1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
<?php
/*
* Copyright 2005-2016 OCSInventory-NG/OCSInventory-ocsreports contributors.
* See the Contributors file for more details about them.
*
* This file is part of OCSInventory-NG/OCSInventory-ocsreports.
*
* OCSInventory-NG/OCSInventory-ocsreports is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the License,
* or (at your option) any later version.
*
* OCSInventory-NG/OCSInventory-ocsreports is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OCSInventory-NG/OCSInventory-ocsreports. if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
//$header_html = 'NO';
$form_name = 'debug';
//liste des modes de fonctionnement
$list_mode[1] = $l->g(1010);
$list_mode[2] = $l->g(1011);
$list_mode[3] = $l->g(1012);
$list_mode[4] = $l->g(1013);
if (isset($_SESSION['OCS']['TRUE_USER'])) {
$list_mode[5] = 'NOFUSER';
} else {
$list_mode[5] = 'FUSER';
}
if ($_SESSION['OCS']["usecache"] == 1) {
$list_mode[6] = 'NOCACHE';
} else {
$list_mode[6] = 'CACHE';
}
$tab_typ_champ[0]['DEFAULT_VALUE'] = $list_mode;
$tab_typ_champ[0]['INPUT_NAME'] = "MODE";
$tab_typ_champ[0]['INPUT_TYPE'] = 2;
$tab_name[0] = $l->g(1014) . ":";
$tab_typ_champ[0]['RELOAD'] = "CHANGE";
if ($protectedPost['MODE'] == 5 && $list_mode[$protectedPost['MODE']] == 'FUSER') {
$tab_typ_champ[1]['DEFAULT_VALUE'] = $protectedPost['FUSER'];
$tab_typ_champ[1]['INPUT_NAME'] = "FUSER";
$tab_typ_champ[1]['INPUT_TYPE'] = 0;
$tab_name[1] = $l->g(926) . " ";
}
modif_values($tab_name, $tab_typ_champ, '', array(
'title' => $l->g(1015)
));
if (isset($protectedPost['Reset_modif'])) {
reloadform_closeme('', true);
}
//passage en mode
if (isset($protectedPost['Valid_modif']) && $protectedPost["MODE"] != "") {
AddLog("MODE", $list_mode[$protectedPost["MODE"]]);
if ($protectedPost["MODE"] == 1) {
unset($_SESSION['OCS']['DEBUG'], $_SESSION['OCS']['MODE_LANGUAGE'], $_SESSION['OCS']["usecache"]);
} elseif ($protectedPost["MODE"] == 2) {
unset($_SESSION['OCS']['MODE_LANGUAGE']);
$_SESSION['OCS']['DEBUG'] = "ON";
} elseif ($protectedPost["MODE"] == 3) {
unset($_SESSION['OCS']['DEBUG']);
$_SESSION['OCS']['MODE_LANGUAGE'] = "ON";
} elseif ($protectedPost["MODE"] == 4) {
$_SESSION['OCS']['MODE_LANGUAGE'] = "ON";
$_SESSION['OCS']['DEBUG'] = "ON";
} elseif ($protectedPost["MODE"] == 5) {
if (!isset($_SESSION['OCS']['TRUE_USER'])) {
$true_user = $_SESSION['OCS']['loggeduser'];
$list_page_profil = $_SESSION['OCS']['profile']->getPages();
$restriction = $_SESSION['OCS']['profile']->getRestriction('GUI');
$loggeduser = $protectedPost["FUSER"];
unset($_SESSION['OCS']);
$_SESSION['OCS']['TRUE_USER'] = $true_user;
$_SESSION['OCS']['TRUE_PAGES'] = $list_page_profil;
$_SESSION['OCS']['TRUE_RESTRICTION'] = $restriction;
$_SESSION['OCS']['loggeduser'] = $loggeduser;
} else {
$loggeduser = $_SESSION['OCS']['TRUE_USER'];
$restriction = $_SESSION['OCS']['TRUE_RESTRICTION'];
unset($_SESSION['OCS']);
$_SESSION['OCS']['loggeduser'] = $loggeduser;
$_SESSION['OCS']['profile']->setRestriction('GUI', $restriction);
}
} elseif ($protectedPost["MODE"] == 6) {
if (isset($_SESSION['OCS']["usecache"])
and $_SESSION['OCS']["usecache"] == 1) {
$_SESSION['OCS']["usecache"] = 0;
} else {
$_SESSION['OCS']["usecache"] = 1;
}
}
reloadform_closeme('log_out', true);
}
?>
|