From 1ca61e368b65028c218fbb299b3a8614d3ae5634 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 10 Oct 2014 19:46:33 +0200 Subject: [PATCH] Added new user access rank --- src/Entities/User.php | 9 +++++---- src/Upgrades/Upgrade21.php | 12 ++++++++++++ src/di.php | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 src/Upgrades/Upgrade21.php diff --git a/src/Entities/User.php b/src/Entities/User.php index 1979ba20..e0f6fab6 100644 --- a/src/Entities/User.php +++ b/src/Entities/User.php @@ -5,10 +5,11 @@ final class User extends Entity { const ACCESS_RANK_NOBODY = 0; const ACCESS_RANK_ANONYMOUS = 1; - const ACCESS_RANK_REGULAR_USER = 2; - const ACCESS_RANK_POWER_USER = 3; - const ACCESS_RANK_MODERATOR = 4; - const ACCESS_RANK_ADMINISTRATOR = 5; + const ACCESS_RANK_RESTRICTED_USER = 2; + const ACCESS_RANK_REGULAR_USER = 3; + const ACCESS_RANK_POWER_USER = 4; + const ACCESS_RANK_MODERATOR = 5; + const ACCESS_RANK_ADMINISTRATOR = 6; const AVATAR_STYLE_GRAVATAR = 1; const AVATAR_STYLE_MANUAL = 2; diff --git a/src/Upgrades/Upgrade21.php b/src/Upgrades/Upgrade21.php new file mode 100644 index 00000000..b489731c --- /dev/null +++ b/src/Upgrades/Upgrade21.php @@ -0,0 +1,12 @@ +getPDO(); + $pdo->exec('UPDATE users SET accessRank = accessRank + 1 WHERE accessRank > 1'); + } +} diff --git a/src/di.php b/src/di.php index bd80e8a2..29187a74 100644 --- a/src/di.php +++ b/src/di.php @@ -36,6 +36,7 @@ return [ $container->get(\Szurubooru\Upgrades\Upgrade18::class), $container->get(\Szurubooru\Upgrades\Upgrade19::class), $container->get(\Szurubooru\Upgrades\Upgrade20::class), + $container->get(\Szurubooru\Upgrades\Upgrade21::class), ]; }),