// FOR PERMS - SEE THE DATAOBJECT!
- function get()
+ function get($v, $opts = Array())
{
// must recieve a group..
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");
}
$cur[$k] = clone($gr);
}
-
+ $short = explode('.',$k);
$ar[] = array(
'id' => $cur[$k]->id * 1, //
'rightname' => $k,
'descript' => isset($defdata[2]) ? $defdata[2] : '' ,
'accessmask' => $cur[$k]->accessmask,
'FullMask' => $defdata[0],
- 'group_id' => (int)$_GET['group_id']
+ 'group_id' => (int)$_GET['group_id'],
+ 'shortname' => $short[0]
);
}
+
+ if (isset($_GET['_sort'])) {
+ foreach ($ar as $key => $row) {
+ $shortname[$key] = $row['shortname'];
+ $descript[$key] = $row['descript'];
+ }
+
+ array_multisort($shortname, SORT_ASC, $descript, SORT_ASC, $ar);
+ }
+
$this->jdata($ar);
// post..
- function post()
+ function post($v)
{
if (!isset($_POST['group_id']) || (int)$_POST['group_id'] < 0) {
$this->jerr("NO GROUP");
}
- if (!$this->hasPerm( '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) {
}
-
-
-
+ function checkPerm($lvl)
+ {
+ return $this->hasPerm('Core.Groups', $lvl);
+ }
}
\ No newline at end of file