Replace isAdministrator with power
This commit is contained in:
parent
3dd6c276b4
commit
5de69128fb
2 changed files with 5 additions and 5 deletions
|
@ -20,8 +20,8 @@ if (isset($_POST['email'], $_POST['password'])) {
|
|||
;');
|
||||
} else {
|
||||
$database->query('INSERT INTO `users`
|
||||
(`email`, `password`, `isAdministrator`) VALUES
|
||||
("' . $_POST['email'] . '", "' . sha1($_POST['password']) . '", ' . true . ')
|
||||
(`email`, `password`, `power`) VALUES
|
||||
("' . $_POST['email'] . '", "' . sha1($_POST['password']) . '", 100)
|
||||
;');
|
||||
}
|
||||
|
||||
|
|
|
@ -21,11 +21,11 @@ if ('POST' === $_SERVER['REQUEST_METHOD']) {
|
|||
/** Current version is below 0.2.0 */
|
||||
if (-1 === version_compare($options->version, '0.2.0')) {
|
||||
$database->query('ALTER TABLE `users`
|
||||
ADD `last_login` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `password`,
|
||||
ADD `isAdministrator` BOOLEAN NOT NULL AFTER `last_login`
|
||||
ADD `last_login` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `password`,
|
||||
ADD `power` BOOLEAN NOT NULL DEFAULT 0 AFTER `last_login`
|
||||
;');
|
||||
$database->query('UPDATE `users`
|
||||
SET `isAdministrator` = ' . true . '
|
||||
SET `power` = 100
|
||||
WHERE `id` = ' . $user->id .
|
||||
';');
|
||||
$database->query('ALTER TABLE `users` ADD INDEX(`password`);');
|
||||
|
|
Loading…
Reference in a new issue