From 5de69128fbece5d49893648d5855905a21576d01 Mon Sep 17 00:00:00 2001 From: Jay Trees Date: Tue, 18 Jan 2022 12:52:21 +0100 Subject: [PATCH] Replace isAdministrator with power --- includes/pages/register.php | 4 ++-- includes/pages/update.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/pages/register.php b/includes/pages/register.php index 15d1667f..4429322f 100644 --- a/includes/pages/register.php +++ b/includes/pages/register.php @@ -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) ;'); } diff --git a/includes/pages/update.php b/includes/pages/update.php index 2c7761ec..4f63a532 100644 --- a/includes/pages/update.php +++ b/includes/pages/update.php @@ -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`);');