upgrade.php:

- upgrade_1284(): migrate the ALL domain to the superadmin column
  Note: The ALL domain is not (yet) deleted to stay backwards-compatible 
  for now (will be done in a later upgrade function)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1284 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 14 years ago
parent 48f2a0a94b
commit 41d8bcaf0a

@ -1308,6 +1308,19 @@ function upgrade_1283() {
_db_add_field('admin', 'superadmin', '{BOOLEAN}', 'password');
}
function upgrade_1284() {
# migrate the ALL domain to the superadmin column
# Note: The ALL domain is not (yet) deleted to stay backwards-compatible for now (will be done in a later upgrade function)
$result = db_query("SELECT username FROM " . table_by_key('domain_admins') . " where domain='ALL'");
if ($result['rows'] > 0) {
while ($row = db_array ($result['result'])) {
printdebug ("Setting superadmin flag for " . $row['username']);
db_update('admin', 'username', $row['username'], array('superadmin' => db_get_boolean(true)) );
}
}
}
# TODO MySQL:

Loading…
Cancel
Save