mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +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"];
|
if (isset($_GET["action"])) $action=$_GET["action"];
|
||||||
else $action=NULL;
|
else $action=NULL;
|
||||||
|
|
||||||
if (isset($_GET["aroid"])) {
|
if($action == 'add_aro') {
|
||||||
if(!($aro = SeedDMS_Aro::getInstance((int) $_GET["aroid"], $dms))) {
|
if (isset($_GET["roleid"])) {
|
||||||
$result = array('type'=>'error', 'msg'=>'1'.getMLText("access_denied"));
|
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);
|
echo json_encode($result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$result = array('type'=>'error', 'msg'=>'2'.getMLText("access_denied"));
|
|
||||||
echo json_encode($result);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET["acoid"])) {
|
} else {
|
||||||
if(!($aco = SeedDMS_Aco::getInstance((int) $_GET["acoid"], $dms))) {
|
if (isset($_GET["aroid"])) {
|
||||||
$result = array('type'=>'error', 'msg'=>'3'.getMLText("access_denied"));
|
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);
|
echo json_encode($result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$result = array('type'=>'error', 'msg'=>'4'.getMLText("access_denied"));
|
|
||||||
echo json_encode($result);
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch($action) {
|
switch($action) {
|
||||||
case "toggle_permission":
|
case "toggle_permission":
|
||||||
$acl = new SeedDMS_Acl($dms);
|
$acl = new SeedDMS_Acl($dms);
|
||||||
if($acl->toggle($aro, $aco))
|
if($acl->toggle($aro, $aco))
|
||||||
$result = array('type'=>'success', 'msg'=>'lasjfl');
|
$result = array('type'=>'success', 'msg'=>getMLText('success_toogle_permission'));
|
||||||
else
|
else
|
||||||
$result = array('type'=>'error', 'msg'=>'lasjfl');
|
$result = array('type'=>'error', 'msg'=>getMLText('error_toogle_permission'));
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode($result);
|
echo json_encode($result);
|
||||||
break;
|
break;
|
||||||
case "add_permission":
|
case "add_permission":
|
||||||
$acl = new SeedDMS_Acl($dms);
|
$acl = new SeedDMS_Acl($dms);
|
||||||
if($acl->add($aro, $aco))
|
if($acl->add($aro, $aco))
|
||||||
$result = array('type'=>'success', 'msg'=>'lasjfl');
|
$result = array('type'=>'success', 'msg'=>getMLText('success_add_permission'));
|
||||||
else
|
else
|
||||||
$result = array('type'=>'error', 'msg'=>'lasjfl');
|
$result = array('type'=>'error', 'msg'=>getMLText('error_add_permission'));
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
$result = array('type'=>'success', 'msg'=>'lasjfl');
|
|
||||||
echo json_encode($result);
|
echo json_encode($result);
|
||||||
break;
|
break;
|
||||||
case "remove_permission":
|
case "remove_permission":
|
||||||
$acl = new SeedDMS_Acl($dms);
|
$acl = new SeedDMS_Acl($dms);
|
||||||
if($acl->remove($aro, $aco))
|
if($acl->remove($aro, $aco))
|
||||||
$result = array('type'=>'success', 'msg'=>'lasjfl');
|
$result = array('type'=>'success', 'msg'=>getMLText('success_remove_permission'));
|
||||||
else
|
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');
|
header('Content-Type: application/json');
|
||||||
$result = array('type'=>'success', 'msg'=>'lasjfl');
|
|
||||||
echo json_encode($result);
|
echo json_encode($result);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user