role is now an instance of SeedDMD_Core_Role

This commit is contained in:
Uwe Steinmann 2016-02-24 14:35:37 +01:00
parent ee7180ccd3
commit 49be0485c5
2 changed files with 14 additions and 2 deletions

View File

@ -40,6 +40,11 @@ if (is_bool($groups)) {
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
}
$roles = $dms->getAllRoles();
if (is_bool($roles)) {
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
}
if(isset($_GET['userid']) && $_GET['userid']) {
$seluser = $dms->getUser($_GET['userid']);
} else {
@ -47,7 +52,7 @@ if(isset($_GET['userid']) && $_GET['userid']) {
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'seluser'=>$seluser, 'allusers'=>$users, 'allgroups'=>$groups, 'passwordstrength'=>$settings->_passwordStrength, 'passwordexpiration'=>$settings->_passwordExpiration, 'httproot'=>$settings->_httpRoot, 'enableuserimage'=>$settings->_enableUserImage, 'undeluserids'=>explode(',', $settings->_undelUserIds), 'workflowmode'=>$settings->_workflowMode, 'quota'=>$settings->_quota, 'strictformcheck'=>$settings->_strictFormCheck));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'seluser'=>$seluser, 'allusers'=>$users, 'allgroups'=>$groups, 'allroles'=>$roles, 'passwordstrength'=>$settings->_passwordStrength, 'passwordexpiration'=>$settings->_passwordExpiration, 'httproot'=>$settings->_httpRoot, 'enableuserimage'=>$settings->_enableUserImage, 'undeluserids'=>explode(',', $settings->_undelUserIds), 'workflowmode'=>$settings->_workflowMode, 'quota'=>$settings->_quota, 'strictformcheck'=>$settings->_strictFormCheck));
if($view) {
$view($_GET);
}

View File

@ -157,6 +157,7 @@ $(document).ready( function() {
$user = $this->params['user'];
$users = $this->params['allusers'];
$groups = $this->params['allgroups'];
$roles = $this->params['allroles'];
$passwordstrength = $this->params['passwordstrength'];
$passwordexpiration = $this->params['passwordexpiration'];
$httproot = $this->params['httproot'];
@ -240,7 +241,13 @@ $(document).ready( function() {
</tr>
<tr>
<td><?php printMLText("role");?>:</td>
<td><select name="role"><option value="<?php echo SeedDMS_Core_User::role_user ?>"><?php printMLText("role_user"); ?></option><option value="<?php echo SeedDMS_Core_User::role_admin ?>" <?php if($currUser && $currUser->getRole() == SeedDMS_Core_User::role_admin) echo "selected"; ?>><?php printMLText("role_admin"); ?></option><option value="<?php echo SeedDMS_Core_User::role_guest ?>" <?php if($currUser && $currUser->getRole() == SeedDMS_Core_User::role_guest) echo "selected"; ?>><?php printMLText("role_guest"); ?></option></select></td>
<td><select name="role">
<?php
foreach($roles as $role) {
echo '<option value="'.$role->getID().'"'.($currUser && $currUser->getRole()->getID() == $role->getID() ? ' selected' : '').'>'.$role->getName().'</option>';
}
?>
</select></td>
</tr>
<tr>
<td><?php printMLText("groups");?>:</td>