install/database-structure.inc.php
author peter
Mon, 14 Jul 2008 20:17:34 +0000
changeset 189 b918c891f81d
parent 165 cc0763252b89
permissions -rw-r--r--
[feladat @ 298] Bugfix: The GRANT statement for PostgreSQL is not correct. Modified the code to give the correct GRANT statement based on the tables in database-structure.inc.php. Reported by grin. Closes: #78.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
142
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
     1
<?
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
     2
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
     3
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
     4
$def_tables = 
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
     5
	array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
     6
		array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
     7
			'table_name'	=>	'perm_items',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
     8
			'fields'	=>	array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
     9
				    'id' => array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    10
				    	    'type'		=> 'integer',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    11
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    12
					    'length' 		=> 4,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    13
					    'unsigned' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    14
					    'autoincrement'	=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    15
					    'name' 		=> 'id',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    16
					    'table' 		=> 'perm_items',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    17
					    'flags' 		=> 'primary_keynot_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    18
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    19
				    'name' => array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    20
				    	    'type'		=> 'text',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    21
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    22
					    'length' 		=> 64,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    23
					    'fixed' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    24
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    25
					    'name' 		=> 'name',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    26
					    'table' 		=> 'perm_items',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    27
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    28
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    29
				    'descr' => array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    30
				    	    'type'		=> 'text',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    31
					    'length'		=> 1024,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    32
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    33
					    'fixed' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    34
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    35
					    'name' 		=> 'descr',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    36
					    'table' 		=> 'perm_items',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    37
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    38
					)
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    39
				)
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    40
			),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    41
		array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    42
			'table_name'	=>	'perm_templ',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    43
			'fields'	=>	array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    44
				   'id' => array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    45
				    	    'type'		=> 'integer',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    46
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    47
					    'length' 		=> 4,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    48
					    'unsigned' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    49
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    50
					    'autoincrement'	=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    51
					    'name' 		=> 'id',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    52
					    'table' 		=> 'perm_templ',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    53
					    'flags' 		=> 'primary_keynot_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    54
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    55
				    'name' => array(
145
6190c9a5f48b [feladat @ 251]
rejo
parents: 142
diff changeset
    56
				    	    'type'		=> 'text',
142
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    57
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    58
					    'length' 		=> 128,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    59
					    'fixed' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    60
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    61
					    'name' 		=> 'name',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    62
					    'table' 		=> 'perm_templ',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    63
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    64
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    65
				    'descr' => array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    66
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    67
					    'fixed' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    68
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    69
					    'type' 		=> 'text',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    70
					    'length'		=> 1024,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    71
					    'name' 		=> 'descr',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    72
					    'table' 		=> 'perm_templ',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    73
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    74
					)
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    75
				)
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    76
			),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    77
		array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    78
			'table_name'	=>	'perm_templ_items',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    79
			'fields'	=>	array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    80
				   'id' => array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    81
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    82
					    'length' 		=> 4,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    83
					    'unsigned' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    84
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    85
					    'autoincrement'	=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    86
					    'type' 		=> 'integer',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    87
					    'name' 		=> 'id',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    88
					    'table' 		=> 'perm_templ_items',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    89
					    'flags' 		=> 'primary_keynot_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    90
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    91
				    'templ_id' => array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    92
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    93
					    'length' 		=> 4,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    94
					    'unsigned' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    95
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    96
					    'type' 		=> 'integer',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    97
					    'name' 		=> 'templ_id',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    98
					    'table' 		=> 'perm_templ_items',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
    99
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   100
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   101
				    'perm_id' => array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   102
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   103
					    'length' 		=> 4,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   104
					    'unsigned' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   105
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   106
					    'type' 		=> 'integer',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   107
					    'name' 		=> 'perm_id',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   108
					    'table' 		=> 'perm_templ_items',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   109
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   110
					)
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   111
				)
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   112
			),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   113
		array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   114
			'table_name'	=>	'users',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   115
			'fields'	=>	array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   116
				    'id' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   117
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   118
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   119
					    'length' 		=> 4,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   120
					    'unsigned' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   121
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   122
					    'autoincrement'	=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   123
					    'type' 		=> 'integer',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   124
					    'name' 		=> 'id',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   125
					    'table' 		=> 'users',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   126
					    'flags' 		=> 'primary_keynot_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   127
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   128
				    'username' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   129
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   130
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   131
					    'length' 		=> 16,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   132
					    'fixed' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   133
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   134
					    'type' 		=> 'text',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   135
					    'name' 		=> 'username',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   136
					    'table' 		=> 'users',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   137
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   138
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   139
				    'password' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   140
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   141
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   142
					    'length' 		=> 34,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   143
					    'fixed' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   144
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   145
					    'type' 		=> 'text',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   146
					    'name' 		=> 'password',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   147
					    'table' 		=> 'users',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   148
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   149
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   150
				    'fullname' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   151
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   152
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   153
					    'length' 		=> 255,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   154
					    'fixed' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   155
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   156
					    'type' 		=> 'text',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   157
					    'name' 		=> 'fullname',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   158
					    'table' 		=> 'users',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   159
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   160
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   161
				    'email' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   162
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   163
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   164
					    'length' 		=> 255,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   165
					    'fixed' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   166
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   167
					    'type' 		=> 'text',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   168
					    'name' 		=> 'email',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   169
					    'table' 		=> 'users',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   170
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   171
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   172
				    'description' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   173
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   174
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   175
					    'fixed' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   176
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   177
					    'type' 		=> 'text',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   178
					    'length'		=> 1024,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   179
					    'name' 		=> 'description',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   180
					    'table' 		=> 'users',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   181
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   182
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   183
				    'perm_templ' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   184
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   185
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   186
					    'length' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   187
					    'unsigned' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   188
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   189
					    'type' 		=> 'integer',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   190
					    'name' 		=> 'perm_templ',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   191
					    'table' 		=> 'users',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   192
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   193
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   194
				    'active' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   195
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   196
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   197
					    'length' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   198
					    'unsigned' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   199
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   200
					    'type' 		=> 'integer',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   201
					    'name' 		=> 'active',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   202
					    'table' 		=> 'users',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   203
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   204
					)
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   205
				)
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   206
			),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   207
		array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   208
			'table_name'	=>	'zones',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   209
			'fields'	=>	array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   210
				    'id' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   211
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   212
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   213
					    'length' 		=> 4,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   214
					    'unsigned' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   215
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   216
					    'autoincrement'	=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   217
					    'type' 		=> 'integer',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   218
					    'name' 		=> 'id',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   219
					    'table' 		=> 'zones',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   220
					    'flags' 		=> 'primary_keynot_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   221
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   222
				    'domain_id' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   223
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   224
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   225
					    'length' 		=> 4,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   226
					    'unsigned' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   227
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   228
					    'type' 		=> 'integer',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   229
					    'name' 		=> 'domain_id',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   230
					    'table' 		=> 'zones',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   231
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   232
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   233
				    'owner' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   234
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   235
					    'notnull' 		=> 1,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   236
					    'length' 		=> 4,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   237
					    'unsigned' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   238
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   239
					    'type' 		=> 'integer',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   240
					    'name' 		=> 'owner',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   241
					    'table' 		=> 'zones',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   242
					    'flags' 		=> 'not_null'
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   243
					),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   244
				    'comment' => array
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   245
					(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   246
					    'notnull' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   247
					    'length' 		=> 1024,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   248
					    'fixed' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   249
					    'default' 		=> 0,
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   250
					    'type' 		=> 'text',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   251
					    'name' 		=> 'comment',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   252
					    'table' 		=> 'zones',
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   253
					    'flags' 		=> ''
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   254
					)
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   255
				)
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   256
			)
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   257
		);
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   258
189
b918c891f81d [feladat @ 298]
peter
parents: 165
diff changeset
   259
// Tables from PowerDNS
b918c891f81d [feladat @ 298]
peter
parents: 165
diff changeset
   260
$grantTables = array('supermasters', 'domains', 'records');
b918c891f81d [feladat @ 298]
peter
parents: 165
diff changeset
   261
// Include PowerAdmin tables
b918c891f81d [feladat @ 298]
peter
parents: 165
diff changeset
   262
foreach($def_tables as $table) {
b918c891f81d [feladat @ 298]
peter
parents: 165
diff changeset
   263
	$grantTables[] = $table['table_name'];
b918c891f81d [feladat @ 298]
peter
parents: 165
diff changeset
   264
}
b918c891f81d [feladat @ 298]
peter
parents: 165
diff changeset
   265
142
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   266
$def_permissions = array(
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   267
			array(41,'zone_master_add','User is allowed to add new master zones.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   268
			array(42,'zone_slave_add','User is allowed to add new slave zones.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   269
			array(43,'zone_content_view_own','User is allowed to see the content and meta data of zones he owns.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   270
			array(44,'zone_content_edit_own','User is allowed to edit the content of zones he owns.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   271
			array(45,'zone_meta_edit_own','User is allowed to edit the meta data of zones he owns.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   272
			array(46,'zone_content_view_others','User is allowed to see the content and meta data of zones he does not own.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   273
			array(47,'zone_content_edit_others','User is allowed to edit the content of zones he does not own.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   274
			array(48,'zone_meta_edit_others','User is allowed to edit the meta data of zones he does not own.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   275
			array(49,'search','User is allowed to perform searches.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   276
			array(50,'supermaster_view','User is allowed to view supermasters.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   277
			array(51,'supermaster_add','User is allowed to add new supermasters.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   278
			array(52,'supermaster_edit','User is allowed to edit supermasters.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   279
			array(53,'user_is_ueberuser','User has full access. God-like. Redeemer.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   280
			array(54,'user_view_others','User is allowed to see other users and their details.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   281
			array(55,'user_add_new','User is allowed to add new users.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   282
			array(56,'user_edit_own','User is allowed to edit their own details.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   283
			array(57,'user_edit_others','User is allowed to edit other users.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   284
			array(58,'user_passwd_edit_others','User is allowed to edit the password of other users.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   285
			array(59,'user_edit_templ_perm','User is allowed to change the permission template that is assigned to a user.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   286
			array(60,'templ_perm_add','User is allowed to add new permission templates.'),
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   287
			array(61,'templ_perm_edit','User is allowed to edit existing permission templates.')
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   288
		);
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   289
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   290
$def_remaining_queries = array(
165
cc0763252b89 [feladat @ 271]
rejo
parents: 145
diff changeset
   291
			"INSERT INTO users VALUES (1,'admin'," . $db->quote(md5($pa_pass)) . ",'Administrator','admin@example.net','Administrator with full rights.',1,1)",
142
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   292
			"INSERT INTO perm_templ VALUES (1,'Administrator','Administrator template with full rights.')",
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   293
			"INSERT INTO perm_templ_items VALUES (249,1,53)"
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   294
		);
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   295
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   296
edd0c3ee3e1d [feladat @ 248]
rejo
parents:
diff changeset
   297