[Fusionforge-commits] r10625 - in trunk/src: common/include www/admin

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Sep 22 15:04:49 CEST 2010


Author: lolando
Date: 2010-09-22 15:04:49 +0200 (Wed, 22 Sep 2010)
New Revision: 10625

Modified:
   trunk/src/common/include/RBAC.php
   trunk/src/common/include/Role.class.php
   trunk/src/www/admin/globalroleedit.php
   trunk/src/www/admin/index.php
Log:
PFO-RBAC: misc fixes

Modified: trunk/src/common/include/RBAC.php
===================================================================
--- trunk/src/common/include/RBAC.php	2010-09-22 13:00:07 UTC (rev 10624)
+++ trunk/src/common/include/RBAC.php	2010-09-22 13:04:49 UTC (rev 10625)
@@ -887,10 +887,11 @@
 		//	Cannot update role_id=1
 		//
 		if (USE_PFO_RBAC) {
-			if ($this->Group == NULL
-			    && !forge_check_global_perm ('forge_admin')) {
-				$this->setPermissionDeniedError();
-				return false;
+			if ($this->Group == NULL) {
+				if (!forge_check_global_perm ('forge_admin')) {
+					$this->setPermissionDeniedError();
+					return false;
+				}
 			} elseif (!forge_check_perm ('project_admin', $this->Group->getID())) {
 				$this->setPermissionDeniedError();
 				return false;

Modified: trunk/src/common/include/Role.class.php
===================================================================
--- trunk/src/common/include/Role.class.php	2010-09-22 13:00:07 UTC (rev 10624)
+++ trunk/src/common/include/Role.class.php	2010-09-22 13:04:49 UTC (rev 10625)
@@ -496,10 +496,11 @@
 	 */
 	function delete() {
 		if (USE_PFO_RBAC) {
-			if ($this->Group == NULL
-			    && !forge_check_global_perm ('forge_admin')) {
-				$this->setPermissionDeniedError();
-				return false;
+			if ($this->Group == NULL) {
+				if (!forge_check_global_perm ('forge_admin')) {
+					$this->setPermissionDeniedError();
+					return false;
+				}
 			} elseif (!forge_check_perm ('project_admin', $this->Group->getID())) {
 				$this->setPermissionDeniedError();
 				return false;
@@ -588,10 +589,11 @@
 	function setUser($user_id) {
 		global $SYS;
 		if (USE_PFO_RBAC) {
-			if ($this->Group == NULL
-			    && !forge_check_global_perm ('forge_admin')) {
-				$this->setPermissionDeniedError();
-				return false;
+			if ($this->Group == NULL) {
+				if (!forge_check_global_perm ('forge_admin')) {
+					$this->setPermissionDeniedError();
+					return false;
+				}
 			} elseif (!forge_check_perm ('project_admin', $this->Group->getID())) {
 				$this->setPermissionDeniedError();
 				return false;

Modified: trunk/src/www/admin/globalroleedit.php
===================================================================
--- trunk/src/www/admin/globalroleedit.php	2010-09-22 13:00:07 UTC (rev 10624)
+++ trunk/src/www/admin/globalroleedit.php	2010-09-22 13:04:49 UTC (rev 10625)
@@ -29,7 +29,7 @@
 site_admin_header(array('title'=>_('Site Admin')));
 echo '<h1>' . _('Site Admin') . '</h1>';
 
-$role_id = getStringFromRequest('role_id');
+$role_id = getIntFromRequest('role_id');
 $data = getStringFromRequest('data');
 
 if (getStringFromRequest('add')) {

Modified: trunk/src/www/admin/index.php
===================================================================
--- trunk/src/www/admin/index.php	2010-09-22 13:00:07 UTC (rev 10624)
+++ trunk/src/www/admin/index.php	2010-09-22 13:04:49 UTC (rev 10625)
@@ -88,7 +88,7 @@
 
 		echo '<form action="globalroleedit.php" method="post"><p>';
 		echo '<input type="text" name="role_name" size="10" value="" />';
-		echo '&nbsp;<input type="submit" name="add" value="'._("Add Role").'" /></p></form>';
+		echo '&nbsp;<input type="submit" name="add" value="'._("Create Role").'" /></p></form>';
 	?></li>
 </ul>
 <?php } ?>




More information about the Fusionforge-commits mailing list