[Fusionforge-commits] r11189 - trunk/src

Roland Mas lolando at libremir.placard.fr.eu.org
Tue Oct 26 10:51:18 CEST 2010


Author: lolando
Date: 2010-10-26 10:51:18 +0200 (Tue, 26 Oct 2010)
New Revision: 11189

Modified:
   trunk/src/fusionforge-install-3-db.php
Log:
Setting admin's global role can't happen before the DB has been upgraded, the bug must be elsewhere

Modified: trunk/src/fusionforge-install-3-db.php
===================================================================
--- trunk/src/fusionforge-install-3-db.php	2010-10-26 08:30:33 UTC (rev 11188)
+++ trunk/src/fusionforge-install-3-db.php	2010-10-26 08:51:18 UTC (rev 11189)
@@ -294,7 +294,11 @@
 //$t = trim(fgets($STDIN));
 
 //	run("su - postgres -c \"psql $gforge_db -c \\\"INSERT INTO users (user_name, user_pw, unix_pw) VALUES ('$admin_user', '$pw_md5', '$pw_crypt')\\\"\"");
-		run("su - postgres -c \"psql $gforge_db -c \\\"INSERT INTO users (user_name, email, user_pw, unix_pw, status, theme_id) VALUES ('$admin_user', 'root at localhost.localdomain', '$pw_md5', '$pw_crypt', 'A', 1); INSERT INTO user_group (user_id, group_id, admin_flags) VALUES (currval('users_pk_seq'), 1, 'A'); INSERT INTO pfo_user_role (user_id, role_id) VALUES (currval('users_pk_seq'), 3)\\\"\"");
+		if (file_exists ('/tmp/fusionforge-use-pfo-rbac')) { // USE_PFO_RBAC
+			run("su - postgres -c \"psql $gforge_db -c \\\"INSERT INTO users (user_name, email, user_pw, unix_pw, status, theme_id) VALUES ('$admin_user', 'root at localhost.localdomain', '$pw_md5', '$pw_crypt', 'A', 1); INSERT INTO user_group (user_id, group_id, admin_flags) VALUES (currval('users_pk_seq'), 1, 'A'); INSERT INTO pfo_user_role (user_id, role_id) VALUES (currval('users_pk_seq'), 3)\\\"\"");
+		} else {
+			run("su - postgres -c \"psql $gforge_db -c \\\"INSERT INTO users (user_name, email, user_pw, unix_pw, status, theme_id) VALUES ('$admin_user', 'root at localhost.localdomain', '$pw_md5', '$pw_crypt', 'A', 1); INSERT INTO user_group (user_id, group_id, admin_flags) VALUES (currval('users_pk_seq'), 1, 'A')\\\"\"");
+		}
 
 //echo "BREAKPOINT 2\n";
 //$t = trim(fgets($STDIN));




More information about the Fusionforge-commits mailing list