mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
manage access restrictions
This commit is contained in:
parent
6278dd8df3
commit
795eb1e028
|
@ -116,11 +116,13 @@ else if ($action == "editrole") {
|
|||
|
||||
$name = $_POST["name"];
|
||||
$role = preg_replace('/[^0-2]+/', '', $_POST["role"]);
|
||||
$noaccess = isset($_POST['noaccess']) ? $_POST['noaccess'] : null;
|
||||
|
||||
if ($editedRole->getName() != $name)
|
||||
$editedRole->setName($name);
|
||||
if ($editedRole->getRole() != $role)
|
||||
$editedRole->setRole($role);
|
||||
$editedRole->setNoAccess($noaccess);
|
||||
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_edit_role')));
|
||||
add_log_line(".php&action=editrole&roleid=".$roleid);
|
||||
|
|
|
@ -149,6 +149,18 @@ $(document).ready( function() {
|
|||
<td><?php printMLText("role_type");?>:</td>
|
||||
<td><select name="role"><option value="<?php echo SeedDMS_Core_Role::role_user ?>"><?php printMLText("role_user"); ?></option><option value="<?php echo SeedDMS_Core_Role::role_admin ?>" <?php if($currRole && $currRole->getRole() == SeedDMS_Core_Role::role_admin) echo "selected"; ?>><?php printMLText("role_admin"); ?></option><option value="<?php echo SeedDMS_Core_Role::role_guest ?>" <?php if($currRole && $currRole->getRole() == SeedDMS_Core_Role::role_guest) echo "selected"; ?>><?php printMLText("role_guest"); ?></option></select></td>
|
||||
</tr>
|
||||
<?php
|
||||
if($currRole && $currRole->getRole() == SeedDMS_Core_Role::role_user) {
|
||||
echo "<tr>";
|
||||
echo "<td>".getMLText('restrict_access')."</td>";
|
||||
echo "<td>";
|
||||
foreach(array(S_DRAFT_REV, S_DRAFT_APP, S_IN_WORKFLOW, S_REJECTED, S_RELEASED, S_IN_REVISION, S_DRAFT, S_OBSOLETE) as $status) {
|
||||
echo "<input type=\"checkbox\" name=\"noaccess[]\" value=\"".$status."\" ".(in_array($status, $currRole->getNoAccess()) ? "checked" : "")."> ".getOverallStatusText($status)."<br />";
|
||||
}
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><button type="submit" class="btn"><i class="icon-save"></i> <?php printMLText($currRole ? "save" : "add_role")?></button></td>
|
||||
|
|
Loading…
Reference in New Issue
Block a user