Skip to content

Commit 8516494

Browse files
committed
fix root user session creation + styles
1 parent 17cba36 commit 8516494

File tree

10 files changed

+507
-444
lines changed

10 files changed

+507
-444
lines changed

install/index.php

Lines changed: 62 additions & 62 deletions
Large diffs are not rendered by default.

install/install.controller.php

Lines changed: 154 additions & 126 deletions
Large diffs are not rendered by default.

install/install.css

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ label.checkbox, label.radio {cursor:pointer}
4444
.form small {color:#888; font-size:90%}
4545
.form small a {color:#55f}
4646
.form small a:hover {text-decoration:underline; color:#000}
47-
.form small a.external:after {height:8px; margin-left:1.5px}
47+
.form small a.external:after {height:9px; margin-left:2px}
4848

4949
/* Fieldsets */
5050
fieldset {margin:10px 0 10px 0; padding:0 15px 15px; border:1px solid #96b3c9; border:1px solid rgba(50,81,126,0.25); box-shadow:inset 0 1px 0 rgb(255 255 255 / 0.75), 0 1px 0 rgb(255 255 255 / 0.75)}
@@ -88,8 +88,16 @@ hr.separator {color:#bbf; border:dashed #96b3c9; border:dashed rgba(50,81,126,0.
8888

8989
/* Mobile support */
9090
@media only screen and (max-width:800px) {
91-
body {margin:0; background:#ffffff}
92-
#container {width:unset; margin:unset; background:#f5f5ff}
91+
body {margin:0}
92+
#container {width:unset; margin:unset; background:#f5f5ff; border-radius:0; text-shadow:0 1px 0 #ffffff}
93+
h1 img {-webkit-filter:drop-shadow(0 1px 0 #ffffff); filter: drop-shadow(0 1px 0 #ffffff)}
94+
.progress .step {box-shadow:0 1px 0 #ffffff}
95+
#footer input.button {box-shadow:inset 0 1px 0 #eeeeee,0 1px 0 #ffffff}
96+
#footer input.button:hover {box-shadow:inset 0 0 0 2px rgba(255, 255, 255, 0.5),inset 0 1px 0 #eeeeee, 0 1px 0 #ffffff}
97+
#footer input.button:active {box-shadow:inset 0 0 25px 2px rgba(0, 0, 0, 0.25),inset 0 1px 0 #eeeeee, 0 1px 0 #ffffff}
98+
#footer .button del, #footer input.button.disabled, #footer input.button.disabled:hover, #footer input.button.disabled:active {box-shadow:inset 0 1px 0 #eeeeee, 0 1px 0 #ffffff}
99+
fieldset {box-shadow:inset 0 1px 0 #ffffff, 0 1px 0 #ffffff}
100+
fieldset.hidden {box-shadow:box-shadow:inset 0 1px 0 #ffffff}
93101
}
94102

95103
@media only screen and (max-width:650px) {

install/queries.php

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
// Create default conversations.
173173
$time = time();
174174
$forumTitle = $_SESSION["install"]["forumTitle"];
175-
$welcomeTitle = sprintf($language["installerWelcomeTitle"], $forumTitle);
175+
$welcomeTitle = sprintf($language["install"]["defaultWelcomeTitle"], $forumTitle);
176176
$welcomeSlug = slug($welcomeTitle);
177177
// Store first conversation as prepared statement query (user-provided data: forumTitle)
178178
$preparedQueries[] = array(
@@ -181,8 +181,8 @@
181181
"params" => array($welcomeTitle, $welcomeSlug)
182182
);
183183
// 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"];
186186
$queries[] = "INSERT INTO {$config["tablePrefix"]}conversations (conversationId, title, slug, sticky, posts, startMember, startTime, lastActionTime, private) VALUES
187187
(2, '" . mysqli_real_escape_string($db, $howToUseTitle) . "', '" . mysqli_real_escape_string($db, slug($howToUseTitle)) . "', 1, 1, 1, $time, $time, 0),
188188
(3, '" . mysqli_real_escape_string($db, $howToCustomizeTitle) . "', '" . mysqli_real_escape_string($db, slug($howToCustomizeTitle)) . "', 0, 1, 1, $time, $time, 1)";
@@ -191,22 +191,22 @@
191191
$forumTitle = $_SESSION["install"]["forumTitle"];
192192
$adminUser = $_SESSION["install"]["adminUser"];
193193
$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);
196196
// Store post 1 as prepared statement (user-provided data: forumTitle)
197197
$preparedQueries[] = array(
198198
"query" => "INSERT INTO {$config["tablePrefix"]}posts (conversationId, memberId, time, title, content) VALUES (1, 1, $time, ?, ?)",
199199
"types" => "ss",
200200
"params" => array($post1Title, $post1Content)
201201
);
202202
// 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"];
205205
$queries[] = "INSERT INTO {$config["tablePrefix"]}posts (conversationId, memberId, time, title, content) VALUES
206206
(2, 1, $time, '" . mysqli_real_escape_string($db, $post2Title) . "', '" . mysqli_real_escape_string($db, $post2Content) . "')";
207207
// 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);
210210
$preparedQueries[] = array(
211211
"query" => "INSERT INTO {$config["tablePrefix"]}posts (conversationId, memberId, time, title, content) VALUES (3, 1, $time, ?, ?)",
212212
"types" => "ss",
@@ -217,7 +217,7 @@
217217
$queries[] = "INSERT INTO {$config["tablePrefix"]}status (conversationId, memberId, allowed) VALUES (3, 1, 1)";
218218

219219
// Add tags for the default conversations.
220-
$tags = $language["installerDefaultTags"];
220+
$tags = $language["install"]["defaultTags"];
221221
$tagValues = array();
222222
$tagValues[] = "(1, '" . mysqli_real_escape_string($db, $tags["welcome"]) . "')";
223223
$tagValues[] = "(1, '" . mysqli_real_escape_string($db, $tags["introduction"]) . "')";
@@ -231,4 +231,13 @@
231231
$tagValues[] = "(3, '" . mysqli_real_escape_string($db, $tags["administration"]) . "')";
232232
$queries[] = "INSERT INTO {$config["tablePrefix"]}tags (conversationId, tag) VALUES " . implode(", ", $tagValues);
233233

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+
234243
?>

0 commit comments

Comments
 (0)