algo action_allowed
authordj3c1t <dj3c1t@free.fr>
Fri, 9 May 2014 15:28:10 +0000 (17:28 +0200)
committerdj3c1t <dj3c1t@free.fr>
Fri, 9 May 2014 15:28:10 +0000 (17:28 +0200)
mw/env/modules/mw_env_run.php

index f88acd3..10a4022 100644 (file)
                (isset($action_roles[$action][0]) && $action_roles[$action][0])
             || (isset($action_roles[$action][$id_role]) && $action_roles[$action][$id_role]);
         }
-        if(!$OK){
-          $action = $etat["mod"]."/".$etat["controller"];
-          if(isset($action_roles[$action])){
-            $OK =
-                 (isset($action_roles[$action][0]) && $action_roles[$action][0])
-              || (isset($action_roles[$action][$id_role]) && $action_roles[$action][$id_role]);
-          }
+        $action = $etat["mod"]."/".$etat["controller"];
+        if(isset($action_roles[$action])){
+          $OK =
+               (isset($action_roles[$action][0]) && $action_roles[$action][0])
+            || (isset($action_roles[$action][$id_role]) && $action_roles[$action][$id_role]);
         }
-        if(!$OK){
-          $action = $etat["mod"]."/".$etat["controller"]."/".$etat["action"];
-          if(isset($action_roles[$action])){
-            $OK =
-                 (isset($action_roles[$action][0]) && $action_roles[$action][0])
-              || (isset($action_roles[$action][$id_role]) && $action_roles[$action][$id_role]);
-          }
+        $action = $etat["mod"]."/".$etat["controller"]."/".$etat["action"];
+        if(isset($action_roles[$action])){
+          $OK =
+               (isset($action_roles[$action][0]) && $action_roles[$action][0])
+            || (isset($action_roles[$action][$id_role]) && $action_roles[$action][$id_role]);
         }
         if($OK) break;
       }