SF.net SVN: postfixadmin:[1284] trunk/upgrade.php
Brought to you by:
christian_boltz,
gingerdog
|
From: <chr...@us...> - 2011-11-27 21:23:42
|
Revision: 1284
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1284&view=rev
Author: christian_boltz
Date: 2011-11-27 21:23:36 +0000 (Sun, 27 Nov 2011)
Log Message:
-----------
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)
Modified Paths:
--------------
trunk/upgrade.php
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2011-11-27 20:22:31 UTC (rev 1283)
+++ trunk/upgrade.php 2011-11-27 21:23:36 UTC (rev 1284)
@@ -1308,8 +1308,21 @@
_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:
# - various varchar fields do not have a default value
# https://sourceforge.net/projects/postfixadmin/forums/forum/676076/topic/3419725
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|