aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.32_restricted_user_management.php
blob: c7a2ef6439e7dd68c07c2bbf579d398b80fe9dcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?
class RestrictedUserManagement extends Migration
{
    function description ()
    {
        return 'add config option for restricting user management to root';
    }

    function up ()
    {
        $db = DBManager::get();

        $name = 'RESTRICTED_USER_MANAGEMENT';
        $description = 'Schränkt Zugriff auf die globale Nutzerverwaltung auf root ein';
        $time = time();

        $db->exec("
            INSERT INTO config
                (config_id, field, value, is_default, type, mkdate, chdate, description)
            VALUES
                (MD5('$name'), '$name', '0', 1, 'boolean', $time, $time, '$description')
        ");
    }

    function down ()
    {
        $db = DBManager::get();

        $db->exec("DELETE FROM config WHERE field = 'RESTRICTED_USER_MANAGEMENT'");
    }
}
?>