Print a nice HTML head with no controls
static public nullHeader ( $title, $url = '' ) | ||
$title | title of the page | |
$url | not used anymore (default '') |
$_SESSION['valid_id'] = session_id(); $_SESSION['glpiactiveentities'] = $form->fields['entities_id']; $subentities = getSonsOf('glpi_entities', $form->fields['entities_id']); $_SESSION['glpiactiveentities_string'] = !empty($subentities) ? "'" . implode("', '", $subentities) . "'" : "'" . $form->fields['entities_id'] . "'"; } } if (isset($_SESSION['glpiactiveprofile']['interface']) && $_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { Html::helpHeader(__('Form list', 'formcreator'), $_SERVER['PHP_SELF']); $form->displayUserForm($form); Html::helpFooter(); } elseif (!empty($_SESSION['glpiactiveprofile'])) { Html::header(__('Form Creator', 'formcreator'), $_SERVER['PHP_SELF'], 'helpdesk', 'PluginFormcreatorFormlist'); $form->displayUserForm($form); Html::footer(); } else { Html::nullHeader(__('Form Creator', 'formcreator'), $_SERVER['PHP_SELF']); Html::displayMessageAfterRedirect(); $form->displayUserForm($form); Html::nullFooter(); } } else { Html::displayNotFoundError(); } // If user was not authenticated, remove temporary user if ($_SESSION['glpiname'] == 'formcreator_temp_user') { unset($_SESSION['glpiname']); } // Or display a "Not found" error } else { Html::displayNotFoundError(); }
/** * Display a common mysql connection error **/ static function displayMySQLError() { if (!isCommandLine()) { Html::nullHeader("Mysql Error", ''); echo "<div class='center'><p class ='b'>\n A link to the Mysql server could not be established. Please check your configuration.\n </p><p class='b'>\n Le serveur Mysql est inaccessible. Vérifiez votre configuration</p>\n </div>"; Html::nullFooter(); } else { echo "A link to the Mysql server could not be established. Please check your configuration.\n"; echo "Le serveur Mysql est inaccessible. Vérifiez votre configuration\n"; } die; }
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 GLPI. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ /** @file * @brief */ include '../inc/includes.php'; $user = new User(); // Manage lost password if (isset($_GET['lostpassword'])) { Html::nullHeader(); if (isset($_GET['password_forget_token'])) { User::showPasswordForgetChangeForm($_GET['password_forget_token']); } else { User::showPasswordForgetRequestForm(); } Html::nullFooter(); exit; } Session::checkLoginUser(); if (isset($_POST["update"]) && $_POST["id"] === Session::getLoginUserID()) { $user->update($_POST); Event::log($_POST["id"], "users", 5, "setup", sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { if ($_SESSION["glpiactiveprofile"]["interface"] == "central") {
echo "<p>" . $CFG_GLPI["maintenance_text"] . "</p>"; } echo "</div>"; Html::nullFooter(); } exit; } } // Check version if ((!isset($CFG_GLPI["version"]) || trim($CFG_GLPI["version"]) != GLPI_VERSION) && !isset($_GET["donotcheckversion"])) { Session::loadLanguage(); if (isCommandLine()) { _e('The version of the database is not compatible with the version of the installed files. An update is necessary.'); echo "\n"; } else { Html::nullHeader("UPDATE NEEDED", $CFG_GLPI["root_doc"]); echo "<div class='center'>"; echo "<table class='tab_cadre'>"; $error = Toolbox::commonCheckForUseGLPI(); echo "</table><br>"; if ($error) { echo "<form action='" . $CFG_GLPI["root_doc"] . "/index.php' method='post'>"; echo "<input type='submit' name='submit' class='submit' value=\"" . __s('Try again') . "\">"; Html::closeForm(); } if ($error < 2) { if (!isset($CFG_GLPI["version"]) || trim($CFG_GLPI["version"]) < GLPI_VERSION) { echo "<form method='post' action='" . $CFG_GLPI["root_doc"] . "/install/update.php'>"; echo "<p class='red'>" . __('The version of the database is not compatible with the version of the installed files. An update is necessary.') . "</p>"; echo "<input type='submit' name='from_update' value=\"" . _sx('button', 'Upgrade') . "\"\n class='submit'>"; Html::closeForm();
// IRMA, Information Resource-Management and Administration // Christian Bauer /** @file * @brief */ include '../inc/includes.php'; if (empty($_POST["_type"]) || $_POST["_type"] != "Helpdesk" || !$CFG_GLPI["use_anonymous_helpdesk"]) { Session::checkRight("ticket", CREATE); } $track = new Ticket(); // Security check if (empty($_POST) || count($_POST) == 0) { Html::redirect($CFG_GLPI["root_doc"] . "/front/helpdesk.public.php"); } if (isset($_POST["_type"]) && $_POST["_type"] == "Helpdesk") { Html::nullHeader(Ticket::getTypeName(Session::getPluralNumber())); } else { if ($_POST["_from_helpdesk"]) { Html::helpHeader(__('Simplified interface'), '', $_SESSION["glpiname"]); } else { Html::header(__('Simplified interface'), '', $_SESSION["glpiname"], "helpdesk", "tracking"); } } if (isset($_POST["my_items"]) && !empty($_POST["my_items"])) { $splitter = explode("_", $_POST["my_items"]); if (count($splitter) == 2) { $_POST["itemtype"] = $splitter[0]; $_POST["items_id"] = $splitter[1]; } } if (!isset($_POST["itemtype"]) || empty($_POST["items_id"]) && $_POST["itemtype"] != 0) {
if (isset($_POST['redirect']) && strlen($_POST['redirect']) > 0) { $REDIRECT = "?redirect=" . rawurlencode($_POST['redirect']); } else { if (isset($_GET['redirect']) && strlen($_GET['redirect']) > 0) { $REDIRECT = "?redirect=" . rawurlencode($_GET['redirect']); } } $auth = new Auth(); // now we can continue with the process... if ($auth->Login($login, $password, isset($_REQUEST["noAUTO"]) ? $_REQUEST["noAUTO"] : false)) { // Redirect to Command Central if not post-only if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { if ($_SESSION['glpiactiveprofile']['create_ticket_on_login'] && empty($REDIRECT)) { Html::redirect($CFG_GLPI['root_doc'] . "/front/helpdesk.public.php?create_ticket=1"); } Html::redirect($CFG_GLPI['root_doc'] . "/front/helpdesk.public.php{$REDIRECT}"); } else { if ($_SESSION['glpiactiveprofile']['create_ticket_on_login'] && empty($REDIRECT)) { Html::redirect($CFG_GLPI['root_doc'] . "/front/ticket.form.php"); } Html::redirect($CFG_GLPI['root_doc'] . "/front/central.php{$REDIRECT}"); } } else { // we have done at least a good login? No, we exit. Html::nullHeader("Login", $CFG_GLPI["root_doc"] . '/index.php'); echo '<div class="center b">' . $auth->getErr() . '<br><br>'; // Logout whit noAUto to manage auto_login with errors echo '<a href="' . $CFG_GLPI["root_doc"] . '/front/logout.php?noAUTO=1' . str_replace("?", "&", $REDIRECT) . '">' . __('Log in again') . '</a></div>'; Html::nullFooter(); exit; }
// IRMA, Information Resource-Management and Administration // Christian Bauer /** @file * @brief */ include '../inc/includes.php'; if (empty($_POST["_type"]) || $_POST["_type"] != "Helpdesk" || !$CFG_GLPI["use_anonymous_helpdesk"]) { Session::checkRight("create_ticket", "1"); } $track = new Ticket(); // Security check if (empty($_POST) || count($_POST) == 0) { Html::redirect($CFG_GLPI["root_doc"] . "/front/helpdesk.public.php"); } if (isset($_POST["_type"]) && $_POST["_type"] == "Helpdesk") { Html::nullHeader(Ticket::getTypeName(2)); } else { if ($_POST["_from_helpdesk"]) { Html::helpHeader(__('Simplified interface'), '', $_SESSION["glpiname"]); } else { Html::header(__('Simplified interface'), '', $_SESSION["glpiname"], "maintain", "tracking"); } } if (isset($_POST["_my_items"]) && !empty($_POST["_my_items"])) { $splitter = explode("_", $_POST["_my_items"]); if (count($splitter) == 2) { $_POST["itemtype"] = $splitter[0]; $_POST["items_id"] = $splitter[1]; } } if (!isset($_POST["itemtype"]) || empty($_POST["items_id"]) && $_POST["itemtype"] != 0) {