[evolvis-commits] r18475: streamline the maven use integration a bit

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Jul 12 11:13:34 CEST 2012


Author: mirabilos
Date: 2012-07-12 11:13:34 +0200 (Thu, 12 Jul 2012)
New Revision: 18475

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/common/include/system/pgsql.class.php
Log:
streamline the maven use integration a bit

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/include/system/pgsql.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/include/system/pgsql.class.php	2012-07-12 08:28:42 UTC (rev 18474)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/include/system/pgsql.class.php	2012-07-12 09:13:34 UTC (rev 18475)
@@ -269,30 +269,30 @@
 			return false;
 		}
 
-		$res1 = db_query_params ('DELETE FROM nss_usergroups WHERE group_id=$1',
+		$res = db_query_params ('DELETE FROM nss_usergroups WHERE group_id=$1',
 					 array ($group_id));
-		if (!$res1) {
+		if (!$res) {
 			$this->setError('ERROR - Could Not Delete Group Member(s): '.db_error());
 			return false;
 		}
-		$res3 = db_query_params ('DELETE FROM nss_groups WHERE group_id=$1',
+		$res = db_query_params ('DELETE FROM nss_groups WHERE group_id=$1',
 					 array ($group_id)) ;
-		if (!$res3) {
+		if (!$res) {
 			$this->setError('ERROR - Could Not Delete Group GID: '.db_error());
 			return false;
 		}
-		$res4 = db_query_params ('INSERT INTO nss_groups
+		$res = db_query_params ('INSERT INTO nss_groups
 					(user_id, group_id, name, gid)
         				SELECT 0, group_id, unix_group_name, group_id + $1
 					FROM groups
 					WHERE group_id=$2',
 					 array ($this->GID_ADD,
 						$group_id)) ;
-		if (!$res4) {
+		if (!$res) {
 			$this->setError('ERROR - Could Not Insert Group GID: '.db_error());
 			return false;
 		}
-		$res5 = db_query_params ('INSERT INTO nss_groups
+		$res = db_query_params ('INSERT INTO nss_groups
 					(user_id, group_id, name, gid)
         				SELECT 0, group_id, $1 || unix_group_name, group_id + $2
 					FROM groups
@@ -300,25 +300,24 @@
 					 array ('scm_',
 						$this->SCM_UID_ADD,
 						$group_id)) ;
-		
-		if (!$res5) {
+
+		if (!$res) {
 			$this->setError('ERROR - Could Not Insert SCM Group GID: '.db_error());
 			return false;
 		}
-		
+
 		foreach ($group->getUsers(false) as $u) {
 			$this->sysGroupAddUser ($group_id, $u->getID()) ;
 		}
 
 
 		/*
-		 * Add user "maven" to all groups, as
-		 * well as all SCM groups, to make it
-		 * possible for Continuum to checkout
-		 * any source from any project.
+		 * Add user "maven" to all groups as well as all SCM
+		 * groups, to make it possible for Continuum/Jenkins
+		 * to check out the source from any project.
 		 */
 
-		$res5 = db_query_params("INSERT INTO nss_usergroups
+		$res = db_query_params("INSERT INTO nss_usergroups
 					SELECT DISTINCT u.user_id+20000,
 					    g.group_id+10000, u.user_id,
 					    g.group_id, u.user_name,
@@ -326,24 +325,24 @@
 					FROM users u, groups g
 					WHERE u.user_name=$1 AND
 					    g.group_id=$2",
-					array('maven', $group_id));
+		    array('maven', $group_id));
 
-		if (!$res5) {
+		if (!$res) {
 			$this->setError('ERROR - Could Not Insert Maven (GID): '.db_error());
 			return false;
 		}
 
-		$res5 = db_query_params("INSERT INTO nss_usergroups
+		$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,
-					    $1 || g.unix_group_name
+					    $3 || g.unix_group_name
 					FROM users u, groups g
-					WHERE u.user_name=$2 AND
-					    g.group_id=$3",
-					array('scm_', 'maven', $group_id));
+					WHERE u.user_name=$1 AND
+					    g.group_id=$2",
+		    array('maven', $group_id, 'scm_'));
 
-		if (!$res5) {
+		if (!$res) {
 			$this->setError('ERROR - Could Not Insert Maven (SCM): '.db_error());
 			return false;
 		}



More information about the evolvis-commits mailing list