GroupRights.php
[Pman.Admin] / GroupRights.php
index 8a0126c..b023314 100644 (file)
@@ -34,7 +34,8 @@ class Pman_Admin_GroupRights extends Pman
         if (!isset($_GET['group_id']) || (int)$_GET['group_id'] < 0) {
             $this->jerr("NO GROUP");
         }
-        if (!$this->hasPerm( 'Core.Groups','S')) { // listing groups..
+        
+        if (!$this->checkPerm('E')) { // editing groups..
             $this->jerr("PERMISSION DENIED");
         }
         
@@ -85,6 +86,15 @@ class Pman_Admin_GroupRights extends Pman
             );
                 
         }
+        //print_r($ar);
+        usort($ar, function($a, $b) {
+            $retval = $a['rightname'] - $b['rightname'];
+            if ($retval == 0) {
+                $retval = $a['descript'] - $b['descript'];                
+            }
+            return $retval;
+        });
+        //print_r($ar);exit;
         $this->jdata($ar);
         
          
@@ -98,14 +108,10 @@ class Pman_Admin_GroupRights extends Pman
             $this->jerr("NO GROUP");
         }
         
-        if (!$this->checkPerm('Core.Groups','E')) { // editing groups..
+        if (!$this->checkPerm('E')) { // editing groups..
             $this->jerr("PERMISSION DENIED");
         }
         
-        
-            
-        
-        
         // add or update..
         if (!empty($_POST['dataUpdate'])) {
             foreach($_POST['dataUpdate'] as $id => $ac) {
@@ -138,9 +144,9 @@ class Pman_Admin_GroupRights extends Pman
         
     }
     
-    function checkPerm($perms, $lvl)
+    function checkPerm($lvl)
     {
-        return $this->hasPerm($perms, $lvl);
+        return $this->hasPerm('Core.Groups', $lvl);
     }
     
 }
\ No newline at end of file