Commit 697ff944 authored by Malcolm Blaney's avatar Malcolm Blaney

Bug fix in user.php, move new-login assignment to after the new

session is started. Also a few minor UI improvements.
parent 7008c4a8
Pipeline #8851688 passed with stage
in 3 minutes and 43 seconds
......@@ -396,7 +396,9 @@ class Cart extends Base {
'"","#cart-migs-format","font-style","italic"',
'"","#cart-migs-format","margin-left","13em"',
'"","#eway-form label","width","7em"',
'"","#eway-form button","margin-left","7.3em"'];
'"","#eway-form button","margin-left","7.3em"',
'"",".cart-item .item-quantity","width","25px"',
'"",".cart-item label","margin-right","5px"'];
$this->AddSiteStyle($site_style);
}
......
......@@ -57,12 +57,10 @@ function style_rule($property = 'property', $value = 'value') {
'<button class="remove-style-rule">remove</button>'.
'<span class="ui-widget">'.
'<input class="style-property" '.
'value="'.htmlspecialchars($property).'" size="15" '.
'readonly="true">'.
'value="'.htmlspecialchars($property).'" readonly="true">'.
'</span>'.
'<span class="ui-widget">'.
'<input class="style-value" value="'.htmlspecialchars($value).'" '.
'size="15">'.
'<input class="style-value" value="'.htmlspecialchars($value).'">'.
'</span>'.
'</div>';
}
......
......@@ -66,13 +66,11 @@ class User {
else if (isset($_SESSION['user']) && $_SESSION['user'] === 'admin') {
$this->loggedIn = true;
$this->defaultPage = true;
$_SESSION['new-login'] = true;
}
else if ($this->Valid()) {
$this->loggedIn = true;
// Go to the user's default page when they first log in.
$this->defaultPage = true;
$_SESSION['new-login'] = true;
// Check if the user wants a persistent login.
if (isset($_POST['remember'])) {
$this->RememberLogin();
......@@ -89,6 +87,8 @@ class User {
// Restart the session in case the username has changed.
session_destroy();
session_start();
// new-login is used by init.php to clear local storage.
if ($this->defaultPage) $_SESSION['new-login'] = true;
}
// Check if a session already exists.
else if (isset($_SESSION['user'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment