[Fusionforge-commits] r14024 - in trunk: . src/plugins/mediawiki/include src/plugins/mediawiki/www

Roland Mas lolando at fusionforge.org
Mon Aug 1 15:20:44 CEST 2011


Author: lolando
Date: 2011-08-01 15:20:44 +0200 (Mon, 01 Aug 2011)
New Revision: 14024

Modified:
   trunk/
   trunk/src/plugins/mediawiki/include/mediawikiPlugin.class.php
   trunk/src/plugins/mediawiki/www/LocalSettings.php
Log:
Pruning old RBAC code: src/plugins

Modified: trunk/src/plugins/mediawiki/include/mediawikiPlugin.class.php
===================================================================
--- trunk/src/plugins/mediawiki/include/mediawikiPlugin.class.php	2011-08-01 13:18:58 UTC (rev 14023)
+++ trunk/src/plugins/mediawiki/include/mediawikiPlugin.class.php	2011-08-01 13:20:44 UTC (rev 14024)
@@ -188,19 +188,12 @@
 			$new_sa =& $params['new_sa'] ;
 			$new_pa =& $params['new_pa'] ;
 
-			if (USE_PFO_RBAC) {
-				$projects = $role->getLinkedProjects() ;
-				foreach ($projects as $p) {
-					$role->normalizePermsForSection ($new_pa, 'plugin_mediawiki_read', $p->getID()) ;
-					$role->normalizePermsForSection ($new_pa, 'plugin_mediawiki_edit', $p->getID()) ;
-					$role->normalizePermsForSection ($new_pa, 'plugin_mediawiki_upload', $p->getID()) ;
-					$role->normalizePermsForSection ($new_pa, 'plugin_mediawiki_admin', $p->getID()) ;
-				}
-			} else {
-				$role->normalizeDataForSection ($new_sa, 'plugin_mediawiki_read') ;
-				$role->normalizeDataForSection ($new_sa, 'plugin_mediawiki_edit') ;
-				$role->normalizeDataForSection ($new_sa, 'plugin_mediawiki_upload') ;
-				$role->normalizeDataForSection ($new_sa, 'plugin_mediawiki_admin') ;
+			$projects = $role->getLinkedProjects() ;
+			foreach ($projects as $p) {
+				$role->normalizePermsForSection ($new_pa, 'plugin_mediawiki_read', $p->getID()) ;
+				$role->normalizePermsForSection ($new_pa, 'plugin_mediawiki_edit', $p->getID()) ;
+				$role->normalizePermsForSection ($new_pa, 'plugin_mediawiki_upload', $p->getID()) ;
+				$role->normalizePermsForSection ($new_pa, 'plugin_mediawiki_admin', $p->getID()) ;
 			}
 		} elseif ($hookname == "role_translate_strings") {
 			$right = new PluginSpecificRoleSetting ($role,

Modified: trunk/src/plugins/mediawiki/www/LocalSettings.php
===================================================================
--- trunk/src/plugins/mediawiki/www/LocalSettings.php	2011-08-01 13:18:58 UTC (rev 14023)
+++ trunk/src/plugins/mediawiki/www/LocalSettings.php	2011-08-01 13:20:44 UTC (rev 14024)
@@ -194,24 +194,16 @@
 		$user->loadGroups() ;
 		$current_groups = $user->getGroups() ;
 
-		if (USE_PFO_RBAC) {
-			$available_roles = RBACEngine::getInstance()->getAvailableRoles() ;
-			$rs = array () ;
-			foreach ($available_roles as $r) {
-				$linked_projects = $r->getLinkedProjects () ;
-
-				foreach ($linked_projects as $lp) {
-					if ($lp->getID() == $g->getID()) {
-						$rs[] = $r ;
-					}
+		$available_roles = RBACEngine::getInstance()->getAvailableRoles() ;
+		$rs = array () ;
+		foreach ($available_roles as $r) {
+			$linked_projects = $r->getLinkedProjects () ;
+			
+			foreach ($linked_projects as $lp) {
+				if ($lp->getID() == $g->getID()) {
+					$rs[] = $r ;
 				}
 			}
-		} else {
-			$perm =& $g->getPermission ();
-			$r = $u->getRole($g) ;
-			if (isset ($r) && $r && !$r->isError()) {
-				$rs = array ($r) ;
-			}
 		}
 
 		// Sync MW groups for current user with FF roles




More information about the Fusionforge-commits mailing list