mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +00:00
set propper messages, add missing commands
This commit is contained in:
parent
bae1386c58
commit
c987412482
|
@ -39,58 +39,80 @@ if (!$user->isAdmin()) {
|
|||
if (isset($_GET["action"])) $action=$_GET["action"];
|
||||
else $action=NULL;
|
||||
|
||||
if (isset($_GET["aroid"])) {
|
||||
if(!($aro = SeedDMS_Aro::getInstance((int) $_GET["aroid"], $dms))) {
|
||||
$result = array('type'=>'error', 'msg'=>'1'.getMLText("access_denied"));
|
||||
if($action == 'add_aro') {
|
||||
if (isset($_GET["roleid"])) {
|
||||
if(!($role = SeedDMS_Core_Role::getInstance((int) $_GET["roleid"], $dms))) {
|
||||
$result = array('type'=>'error', 'msg'=>getMLText("access_denied"));
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$result = array('type'=>'error', 'msg'=>getMLText("access_denied"));
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$result = array('type'=>'error', 'msg'=>'2'.getMLText("access_denied"));
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET["acoid"])) {
|
||||
if(!($aco = SeedDMS_Aco::getInstance((int) $_GET["acoid"], $dms))) {
|
||||
$result = array('type'=>'error', 'msg'=>'3'.getMLText("access_denied"));
|
||||
} else {
|
||||
if (isset($_GET["aroid"])) {
|
||||
if(!($aro = SeedDMS_Aro::getInstance((int) $_GET["aroid"], $dms))) {
|
||||
$result = array('type'=>'error', 'msg'=>getMLText("access_denied"));
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$result = array('type'=>'error', 'msg'=>getMLText("access_denied"));
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET["acoid"])) {
|
||||
if(!($aco = SeedDMS_Aco::getInstance((int) $_GET["acoid"], $dms))) {
|
||||
$result = array('type'=>'error', 'msg'=>getMLText("access_denied"));
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$result = array('type'=>'error', 'msg'=>getMLText("access_denied"));
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$result = array('type'=>'error', 'msg'=>'4'.getMLText("access_denied"));
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
|
||||
switch($action) {
|
||||
case "toggle_permission":
|
||||
$acl = new SeedDMS_Acl($dms);
|
||||
if($acl->toggle($aro, $aco))
|
||||
$result = array('type'=>'success', 'msg'=>'lasjfl');
|
||||
$result = array('type'=>'success', 'msg'=>getMLText('success_toogle_permission'));
|
||||
else
|
||||
$result = array('type'=>'error', 'msg'=>'lasjfl');
|
||||
$result = array('type'=>'error', 'msg'=>getMLText('error_toogle_permission'));
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($result);
|
||||
break;
|
||||
case "add_permission":
|
||||
$acl = new SeedDMS_Acl($dms);
|
||||
if($acl->add($aro, $aco))
|
||||
$result = array('type'=>'success', 'msg'=>'lasjfl');
|
||||
$result = array('type'=>'success', 'msg'=>getMLText('success_add_permission'));
|
||||
else
|
||||
$result = array('type'=>'error', 'msg'=>'lasjfl');
|
||||
$result = array('type'=>'error', 'msg'=>getMLText('error_add_permission'));
|
||||
header('Content-Type: application/json');
|
||||
$result = array('type'=>'success', 'msg'=>'lasjfl');
|
||||
echo json_encode($result);
|
||||
break;
|
||||
case "remove_permission":
|
||||
$acl = new SeedDMS_Acl($dms);
|
||||
if($acl->remove($aro, $aco))
|
||||
$result = array('type'=>'success', 'msg'=>'lasjfl');
|
||||
$result = array('type'=>'success', 'msg'=>getMLText('success_remove_permission'));
|
||||
else
|
||||
$result = array('type'=>'error', 'msg'=>'lasjfl');
|
||||
$result = array('type'=>'error', 'msg'=>getMLText('error_remove_permission'));
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($result);
|
||||
break;
|
||||
case "add_aro":
|
||||
if(SeedDMS_Aro::getInstance($role, $dms)) {
|
||||
$result = array('type'=>'success', 'msg'=>getMLText('success_add_aro'));
|
||||
} else {
|
||||
$result = array('type'=>'error', 'msg'=>getMLText('error_add_aro'));
|
||||
}
|
||||
header('Content-Type: application/json');
|
||||
$result = array('type'=>'success', 'msg'=>'lasjfl');
|
||||
echo json_encode($result);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user