aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.38_allow_admin_useraccess.php
blob: 51f5c80e641b0f1ae9138e52b85ca857d74fed96 (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 AllowAdminUseraccess extends Migration
{
    function description ()
    {
        return 'add config option for administrators in order to allows editing of sensible user data like passwords';
    }

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

        $name = 'ALLOW_ADMIN_USERACCESS';
        $description = 'Wenn eingeschaltet, dürfen Administratoren sensible persönliche Angaben wie z.B. Passwörter ändern.';
        $time = time();

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

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

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