[Fusionforge-commits] r15550 - branches/Branch_5_1/src/common/include

Roland Mas lolando at fusionforge.org
Wed May 23 11:52:33 CEST 2012


Author: lolando
Date: 2012-05-23 11:52:32 +0200 (Wed, 23 May 2012)
New Revision: 15550

Modified:
   branches/Branch_5_1/src/common/include/RBAC.php
Log:
RBAC bugfix for scm_* groups and external (including global) roles

Modified: branches/Branch_5_1/src/common/include/RBAC.php
===================================================================
--- branches/Branch_5_1/src/common/include/RBAC.php	2012-05-23 08:13:12 UTC (rev 15549)
+++ branches/Branch_5_1/src/common/include/RBAC.php	2012-05-23 09:52:32 UTC (rev 15550)
@@ -266,6 +266,7 @@
 	}
 
 	function linkProject ($project) { // From the PFO spec
+		global $SYS;
 		$hp = $this->getHomeProject () ;
 		if ($hp != NULL && $hp->getID() == $project->getID()) {
 			$this->setError ("Can't link to home project") ;
@@ -289,10 +290,18 @@
 
 		$this->normalizeData();
 
+		foreach ($this->getUsers() as $u) {
+			if (!$SYS->sysCheckCreateUser($u->getID())) {
+				$this->setError($SYS->getErrorMessage());
+				return false;
+			}
+		}
+
 		return true ;
 	}
 
 	function unlinkProject ($project) { // From the PFO spec
+		global $SYS;
 		$hp = $this->getHomeProject () ;
 		if ($hp != NULL && $hp->getID() == $project->getID()) {
 			$this->setError ("Can't unlink from home project") ;
@@ -309,6 +318,13 @@
 
 		$this->removeObsoleteSettings () ;
 
+		foreach ($this->getUsers() as $u) {
+			if (!$SYS->sysCheckCreateUser($u->getID())) {
+				$this->setError($SYS->getErrorMessage());
+				return false;
+			}
+		}
+
 		return true ;
 	}
 
@@ -956,15 +972,6 @@
 			foreach ($data as $sect => $refs) {
 				foreach ($refs as $refid => $value) {
 					$this->setSetting ($sect, $refid, $value) ;
-					if ($sect == 'scm') {
-						foreach ($this->getUsers() as $u) {
-							if (!$SYS->sysGroupCheckUser($refid,$u->getID())) {
-								$this->setError($SYS->getErrorMessage());
-								db_rollback();
-								return false;
-							}
-						}
-					}
 				}
 			}
 		} else {
@@ -989,16 +996,7 @@
 				 array ($this->getID(),
 					'pm',
 					db_int_array_to_any_clause (array_keys ($data['pm'])))) ;
-		
 
-
-
-
-
-
-
-
-
 ////$data['section_name']['ref_id']=$val
 		$arr1 = array_keys($data);
 		for ($i=0; $i<count($arr1); $i++) {	
@@ -1152,6 +1150,14 @@
 
 		db_commit();
 		$this->fetchData($this->getID());
+
+		foreach ($this->getUsers() as $u) {
+			if (!$SYS->sysCheckCreateUser($u->getID())) {
+				$this->setError($SYS->getErrorMessage());
+				return false;
+			}
+		}
+
 		return true;
 	}
 
@@ -1191,6 +1197,7 @@
 					'forum')) ;
 
 		db_commit () ;
+		$this->fetchData($this->getID());
 		return true ;
 	}
 




More information about the Fusionforge-commits mailing list