[evolvis-commits] r18494: skip groups that are templates or not 'A'ctive, for the maven use

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Jul 12 14:55:08 CEST 2012


Author: mirabilos
Date: 2012-07-12 14:55:08 +0200 (Thu, 12 Jul 2012)
New Revision: 18494

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
   trunk/gforge_base/evolvisforge-5.1/src/utils/normalize_roles.php
Log:
skip groups that are templates or not 'A'ctive, for the maven use

XXX what's the sys_state column in the groups table?
XXX AFAICS it's 'N' except for the first four groups… that'd be nice too…

Modified: trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2012-07-12 12:55:03 UTC (rev 18493)
+++ trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2012-07-12 12:55:08 UTC (rev 18494)
@@ -7,8 +7,9 @@
     where MW DB upgrade scripts are run
   * MW plugin: make upgrading spit out less error or warning msgs
   * Drop libjs-yui (unused except in phpwiki plugin and gforge theme)
+  * Add the maven user to only active nōn-template groups
 
- -- Thorsten Glaser <t.glaser at tarent.de>  Thu, 12 Jul 2012 14:28:06 +0200
+ -- Thorsten Glaser <t.glaser at tarent.de>  Thu, 12 Jul 2012 14:51:32 +0200
 
 fusionforge (1:5.1.1+evolvis64) unstable; urgency=low
 

Modified: trunk/gforge_base/evolvisforge-5.1/src/utils/normalize_roles.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/utils/normalize_roles.php	2012-07-12 12:55:03 UTC (rev 18493)
+++ trunk/gforge_base/evolvisforge-5.1/src/utils/normalize_roles.php	2012-07-12 12:55:08 UTC (rev 18494)
@@ -52,8 +52,11 @@
 		INSERT INTO nss_usergroups
 		SELECT DISTINCT u.user_id+20000, g.group_id+10000, u.user_id,
 		    g.group_id, u.user_name, g.unix_group_name
-		FROM users u, groups g WHERE u.user_name=$1',
-	    array($mvn->getUnixName()));
+		FROM users u, groups g
+		WHERE u.user_name=$1
+		    AND g.status=$2
+		    AND g.is_template=0',
+	    array($mvn->getUnixName(), 'A'));
 	if (!$res) {
 		echo "on addition: " . db_error() . "\n";
 		return false;
@@ -62,9 +65,12 @@
 	$res = db_query_params('
 		INSERT INTO nss_usergroups
 		SELECT DISTINCT u.user_id+20000, g.group_id+50000, u.user_id,
-		    g.group_id, u.user_name, $2 || g.unix_group_name
-		FROM users u, groups g WHERE u.user_name=$1',
-	    array($mvn->getUnixName(), 'scm_'));
+		    g.group_id, u.user_name, $3 || g.unix_group_name
+		FROM users u, groups g
+		WHERE u.user_name=$1
+		    AND g.status=$2
+		    AND g.is_template=0',
+	    array($mvn->getUnixName(), 'A', 'scm_'));
 	if (!$res) {
 		echo "on addition (SCM): " . db_error() . "\n";
 		return false;



More information about the evolvis-commits mailing list