|
172 | 172 | // Create default conversations. |
173 | 173 | $time = time(); |
174 | 174 | $forumTitle = $_SESSION["install"]["forumTitle"]; |
175 | | -$welcomeTitle = sprintf($language["installerWelcomeTitle"], $forumTitle); |
| 175 | +$welcomeTitle = sprintf($language["install"]["defaultWelcomeTitle"], $forumTitle); |
176 | 176 | $welcomeSlug = slug($welcomeTitle); |
177 | 177 | // Store first conversation as prepared statement query (user-provided data: forumTitle) |
178 | 178 | $preparedQueries[] = array( |
|
181 | 181 | "params" => array($welcomeTitle, $welcomeSlug) |
182 | 182 | ); |
183 | 183 | // Other conversations don't contain user data, use regular query |
184 | | -$howToUseTitle = $language["installerConversationHowToUse"]; |
185 | | -$howToCustomizeTitle = $language["installerConversationHowToCustomize"]; |
| 184 | +$howToUseTitle = $language["install"]["conversationHowToUse"]; |
| 185 | +$howToCustomizeTitle = $language["install"]["conversationHowToCustomize"]; |
186 | 186 | $queries[] = "INSERT INTO {$config["tablePrefix"]}conversations (conversationId, title, slug, sticky, posts, startMember, startTime, lastActionTime, private) VALUES |
187 | 187 | (2, '" . mysqli_real_escape_string($db, $howToUseTitle) . "', '" . mysqli_real_escape_string($db, slug($howToUseTitle)) . "', 1, 1, 1, $time, $time, 0), |
188 | 188 | (3, '" . mysqli_real_escape_string($db, $howToCustomizeTitle) . "', '" . mysqli_real_escape_string($db, slug($howToCustomizeTitle)) . "', 0, 1, 1, $time, $time, 1)"; |
|
191 | 191 | $forumTitle = $_SESSION["install"]["forumTitle"]; |
192 | 192 | $adminUser = $_SESSION["install"]["adminUser"]; |
193 | 193 | $time = time(); |
194 | | -$post1Title = sprintf($language["installerWelcomeTitle"], $forumTitle); |
195 | | -$post1Content = sprintf($language["installerPostWelcomeContent"], $forumTitle, $forumTitle, makeLink(2), $forumTitle); |
| 194 | +$post1Title = sprintf($language["install"]["defaultWelcomeTitle"], $forumTitle); |
| 195 | +$post1Content = sprintf($language["install"]["postWelcomeContent"], $forumTitle, $forumTitle, makeLink(2), $forumTitle); |
196 | 196 | // Store post 1 as prepared statement (user-provided data: forumTitle) |
197 | 197 | $preparedQueries[] = array( |
198 | 198 | "query" => "INSERT INTO {$config["tablePrefix"]}posts (conversationId, memberId, time, title, content) VALUES (1, 1, $time, ?, ?)", |
199 | 199 | "types" => "ss", |
200 | 200 | "params" => array($post1Title, $post1Content) |
201 | 201 | ); |
202 | 202 | // Post 2 has no user data, use regular query |
203 | | -$post2Title = $language["installerConversationHowToUse"]; |
204 | | -$post2Content = $language["installerPostHowToUseContent"]; |
| 203 | +$post2Title = $language["install"]["conversationHowToUse"]; |
| 204 | +$post2Content = $language["install"]["postHowToUseContent"]; |
205 | 205 | $queries[] = "INSERT INTO {$config["tablePrefix"]}posts (conversationId, memberId, time, title, content) VALUES |
206 | 206 | (2, 1, $time, '" . mysqli_real_escape_string($db, $post2Title) . "', '" . mysqli_real_escape_string($db, $post2Content) . "')"; |
207 | 207 | // Store post 3 as prepared statement (user-provided data: adminUser) |
208 | | -$post3Title = $language["installerConversationHowToCustomize"]; |
209 | | -$post3Content = sprintf($language["installerPostHowToCustomizeContent"], $adminUser, $adminUser); |
| 208 | +$post3Title = $language["install"]["conversationHowToCustomize"]; |
| 209 | +$post3Content = sprintf($language["install"]["postHowToCustomizeContent"], $adminUser, $adminUser); |
210 | 210 | $preparedQueries[] = array( |
211 | 211 | "query" => "INSERT INTO {$config["tablePrefix"]}posts (conversationId, memberId, time, title, content) VALUES (3, 1, $time, ?, ?)", |
212 | 212 | "types" => "ss", |
|
217 | 217 | $queries[] = "INSERT INTO {$config["tablePrefix"]}status (conversationId, memberId, allowed) VALUES (3, 1, 1)"; |
218 | 218 |
|
219 | 219 | // Add tags for the default conversations. |
220 | | -$tags = $language["installerDefaultTags"]; |
| 220 | +$tags = $language["install"]["defaultTags"]; |
221 | 221 | $tagValues = array(); |
222 | 222 | $tagValues[] = "(1, '" . mysqli_real_escape_string($db, $tags["welcome"]) . "')"; |
223 | 223 | $tagValues[] = "(1, '" . mysqli_real_escape_string($db, $tags["introduction"]) . "')"; |
|
231 | 231 | $tagValues[] = "(3, '" . mysqli_real_escape_string($db, $tags["administration"]) . "')"; |
232 | 232 | $queries[] = "INSERT INTO {$config["tablePrefix"]}tags (conversationId, tag) VALUES " . implode(", ", $tagValues); |
233 | 233 |
|
| 234 | +// Create login record for root user. |
| 235 | +$ip = cookieIp(); |
| 236 | +$userAgent = md5($_SERVER["HTTP_USER_AGENT"]); |
| 237 | +$preparedQueries[] = array( |
| 238 | + "query" => "INSERT INTO {$config["tablePrefix"]}logins (cookie, ip, userAgent, memberId, firstTime, lastTime) VALUES (NULL, ?, ?, 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())", |
| 239 | + "types" => "is", |
| 240 | + "params" => array($ip, $userAgent) |
| 241 | +); |
| 242 | + |
234 | 243 | ?> |
0 commit comments