[evolvis-commits] r6558: merge bm:taramir/patches/permissions-for-new-trackers

Thorsten Glaser t.glaser at tarent.de
Wed Apr 21 11:59:20 CEST 2010


Author: Thorsten Glaser <t.glaser at tarent.de>
Date: 2010-04-21 11:59:19 +0200 (Wed, 21 Apr 2010)
New Revision: 6558

Modified:
   trunk/gforge_base/evolvisforge/gforge/common/include/session.php
   trunk/gforge_base/evolvisforge/gforge/debian/README.Debian
   trunk/gforge_base/evolvisforge/gforge/debian/changelog
   trunk/gforge_base/evolvisforge/gforge/utils/fixscripts/normalize_roles.php
Log:
merge bm:taramir/patches/permissions-for-new-trackers

Modified: trunk/gforge_base/evolvisforge/gforge/common/include/session.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/include/session.php	2010-04-21 09:59:16 UTC (rev 6557)
+++ trunk/gforge_base/evolvisforge/gforge/common/include/session.php	2010-04-21 09:59:19 UTC (rev 6558)
@@ -484,7 +484,30 @@
 
 }
 
+
 /**
+ *	session_set_admin() - Setup session for the admin user
+ *
+ *	This function sets up a session for the administrator
+ *
+ *	@return none
+ */
+function session_set_admin() {
+	$res = db_query_params ('SELECT user_id FROM user_group WHERE admin_flags=$1 AND group_id=1',
+				array ('A'));
+	if (!$res) {
+		echo db_error();
+		exit (1);
+	}
+	if (db_numrows($res) == 0) {
+		echo "No admin users?\n" ;
+		exit (1);
+	}
+	$id = db_result ($res, 0, 0);
+	session_set_new ($id);
+}
+
+/**
  *	Private optimization function for logins - fetches user data, language, and session
  *	with one query
  *

Modified: trunk/gforge_base/evolvisforge/gforge/debian/README.Debian
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/debian/README.Debian	2010-04-21 09:59:16 UTC (rev 6557)
+++ trunk/gforge_base/evolvisforge/gforge/debian/README.Debian	2010-04-21 09:59:19 UTC (rev 6558)
@@ -1,3 +1,10 @@
+Evolvis notes
+=============
+
+To update permissions for roles in RBAC for existing projects,
+run /usr/share/gforge/bin/normalize_roles.php as root.
+
+
 GForge for Debian
 =================
 
@@ -129,4 +136,3 @@
 # Local Variables:
 # mode: text
 # End:
-

Modified: trunk/gforge_base/evolvisforge/gforge/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/debian/changelog	2010-04-21 09:59:16 UTC (rev 6557)
+++ trunk/gforge_base/evolvisforge/gforge/debian/changelog	2010-04-21 09:59:19 UTC (rev 6558)
@@ -1,9 +1,15 @@
-gforge (4.8.3+evolvis7) UNRELEASED; urgency=low
+gforge (4.8.3+evolvis7) unstable; urgency=low
 
-  * Suppress "A session had already been started" PHP notices in Mediawiki plugin.
+  [ Roland Mas ]
+  * Suppress "A session had already been started" PHP notices in
+    Mediawiki plugin.
+  * Normalizing the roles needs to happen as admin
 
- -- Roland Mas <roland at gnurandal.com>  Wed, 21 Apr 2010 10:58:30 +0200
+  [ Thorsten Glaser ]
+  * debian/README.Debian: mention need-to-do-on-upgrade stuff
 
+ -- Thorsten Glaser <t.glaser at tarent.de>  Wed, 21 Apr 2010 11:57:57 +0200
+
 gforge (4.8.3+evolvis6) unstable; urgency=low
 
   [ Roland Mas ]

Modified: trunk/gforge_base/evolvisforge/gforge/utils/fixscripts/normalize_roles.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/utils/fixscripts/normalize_roles.php	2010-04-21 09:59:16 UTC (rev 6557)
+++ trunk/gforge_base/evolvisforge/gforge/utils/fixscripts/normalize_roles.php	2010-04-21 09:59:19 UTC (rev 6558)
@@ -30,6 +30,7 @@
 require_once('common/include/PluginManager.class.php') ;
 
 setup_plugin_manager () ;
+session_set_admin () ;
 
 $res=db_query("SELECT group_id, group_name FROM groups");
 




More information about the evolvis-commits mailing list