aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.33_lock_rule_admin_perm.php
blob: 00525e9202674879e7d53dd62d453881400ea062 (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
33
34
35
36
37
38
39
40
41
42
43
<?
class LockRuleAdminPerm extends Migration
{
    function description ()
    {
        return 'add config options for restricting aux rules and lock rules';
    }

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

        $name = 'AUX_RULE_ADMIN_PERM';
        $description = 'mit welchem Status dürfen Zusatzangaben definiert werden (admin, root)';
        $time = time();

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

        $name = 'LOCK_RULE_ADMIN_PERM';
        $description = 'mit welchem Status dürfen Sperrebenen angepasst werden (admin, root)';

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

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

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