Added new user access rank
This commit is contained in:
parent
f114c65355
commit
1ca61e368b
3 changed files with 18 additions and 4 deletions
|
@ -5,10 +5,11 @@ final class User extends Entity
|
||||||
{
|
{
|
||||||
const ACCESS_RANK_NOBODY = 0;
|
const ACCESS_RANK_NOBODY = 0;
|
||||||
const ACCESS_RANK_ANONYMOUS = 1;
|
const ACCESS_RANK_ANONYMOUS = 1;
|
||||||
const ACCESS_RANK_REGULAR_USER = 2;
|
const ACCESS_RANK_RESTRICTED_USER = 2;
|
||||||
const ACCESS_RANK_POWER_USER = 3;
|
const ACCESS_RANK_REGULAR_USER = 3;
|
||||||
const ACCESS_RANK_MODERATOR = 4;
|
const ACCESS_RANK_POWER_USER = 4;
|
||||||
const ACCESS_RANK_ADMINISTRATOR = 5;
|
const ACCESS_RANK_MODERATOR = 5;
|
||||||
|
const ACCESS_RANK_ADMINISTRATOR = 6;
|
||||||
|
|
||||||
const AVATAR_STYLE_GRAVATAR = 1;
|
const AVATAR_STYLE_GRAVATAR = 1;
|
||||||
const AVATAR_STYLE_MANUAL = 2;
|
const AVATAR_STYLE_MANUAL = 2;
|
||||||
|
|
12
src/Upgrades/Upgrade21.php
Normal file
12
src/Upgrades/Upgrade21.php
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
namespace Szurubooru\Upgrades;
|
||||||
|
use Szurubooru\DatabaseConnection;
|
||||||
|
|
||||||
|
class Upgrade21 implements IUpgrade
|
||||||
|
{
|
||||||
|
public function run(DatabaseConnection $databaseConnection)
|
||||||
|
{
|
||||||
|
$pdo = $databaseConnection->getPDO();
|
||||||
|
$pdo->exec('UPDATE users SET accessRank = accessRank + 1 WHERE accessRank > 1');
|
||||||
|
}
|
||||||
|
}
|
|
@ -36,6 +36,7 @@ return [
|
||||||
$container->get(\Szurubooru\Upgrades\Upgrade18::class),
|
$container->get(\Szurubooru\Upgrades\Upgrade18::class),
|
||||||
$container->get(\Szurubooru\Upgrades\Upgrade19::class),
|
$container->get(\Szurubooru\Upgrades\Upgrade19::class),
|
||||||
$container->get(\Szurubooru\Upgrades\Upgrade20::class),
|
$container->get(\Szurubooru\Upgrades\Upgrade20::class),
|
||||||
|
$container->get(\Szurubooru\Upgrades\Upgrade21::class),
|
||||||
];
|
];
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue