set parameter $plain for exitError() in case of an ajax call

This commit is contained in:
Uwe Steinmann 2016-08-22 17:03:29 +02:00
parent 58e52856b2
commit 8b9d4b98d5
3 changed files with 11 additions and 12 deletions

View File

@ -27,21 +27,22 @@ include("../inc/inc.DBInit.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
$isajax = isset($_GET['action']) && ($_GET['action'] == 'info' || $_GET['action'] == 'form');
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
if (!$accessop->check_view_access($view, $_GET)) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"), false, $isajax);
}
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
if (is_bool($allUsers)) {
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"), false, $isajax);
}
$allGroups = $dms->getAllGroups();
if (is_bool($allGroups)) {
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"), false, $isajax);
}
if(isset($_GET['groupid']) && $_GET['groupid']) {

View File

@ -31,15 +31,12 @@ include("../inc/inc.Authentication.php");
*/
require_once("SeedDMS/Preview.php");
$isajax = isset($_GET['action']) && ($_GET['action'] == 'items' || $_GET['action'] == 'form');
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
if (!$accessop->check_view_access($view, $_GET)) {
UI::exitError(getMLText("my_transmittals"),getMLText("access_denied"));
}
if ($user->isGuest()) {
UI::exitError(getMLText("my_transmittals"),getMLText("access_denied"));
UI::exitError(getMLText("my_transmittals"),getMLText("access_denied"), false, $isajax);
}
if(isset($_GET['transmittalid']) && $_GET['transmittalid']) {

View File

@ -27,26 +27,27 @@ include("../inc/inc.DBInit.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
$isajax = isset($_GET['action']) && ($_GET['action'] == 'info' || $_GET['action'] == 'form');
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
if (!$accessop->check_view_access($view, $_GET)) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"), false, $isajax);
}
$users = $dms->getAllUsers($settings->_sortUsersInList);
if (is_bool($users)) {
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"), false, $isajax);
}
$groups = $dms->getAllGroups();
if (is_bool($groups)) {
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"), false, $isajax);
}
$roles = $dms->getAllRoles();
if (is_bool($roles)) {
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"));
UI::exitError(getMLText("admin_tools"),getMLText("internal_error"), false, $isajax);
}
if(isset($_GET['userid']) && $_GET['userid']) {