mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
fix import of role
This commit is contained in:
parent
a78800e036
commit
480a130180
|
@ -99,26 +99,21 @@ function renderGroupData($colname, $objdata) { /* {{{ */
|
|||
} /* }}} */
|
||||
|
||||
function getRoleData($colname, $coldata, $objdata) { /* {{{ */
|
||||
switch($coldata) {
|
||||
case 'admin':
|
||||
$role = 1;
|
||||
break;
|
||||
case 'guest':
|
||||
$role = 2;
|
||||
break;
|
||||
case 'user':
|
||||
$role = 0;
|
||||
break;
|
||||
default:
|
||||
$role = 0;
|
||||
global $dms;
|
||||
if($role = $dms->getRoleByName($coldata)) {
|
||||
$objdata['role'] = $role;
|
||||
} else {
|
||||
$objdata['role'] = null;
|
||||
$objdata['__logs__'][] = array('type'=>'error', 'msg'=> "No such role with name '".$coldata."'");
|
||||
}
|
||||
$objdata['role'] = $role;
|
||||
return $objdata;
|
||||
} /* }}} */
|
||||
|
||||
function renderRoleData($colname, $objdata) { /* {{{ */
|
||||
return ($objdata[$colname] == 1 ? 'admin' : ($objdata[$colname] == 2 ? 'guest' : 'user'));
|
||||
$html = '';
|
||||
if($objdata[$colname])
|
||||
$html .= $objdata[$colname]->getName();
|
||||
return $html;
|
||||
} /* }}} */
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user