fix import of role

This commit is contained in:
Uwe Steinmann 2020-09-03 14:22:11 +02:00
parent a78800e036
commit 480a130180

View File

@ -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()) {