本文整理汇总了PHP中glpi_header函数的典型用法代码示例。如果您正苦于以下问题:PHP glpi_header函数的具体用法?PHP glpi_header怎么用?PHP glpi_header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了glpi_header函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkRight
static function checkRight($module, $right)
{
global $CFG_GLPI;
if (!PluginFusioninventory::haveRight($module, $right)) {
// Gestion timeout session
if (!isset($_SESSION["glpiID"])) {
glpi_header($CFG_GLPI["root_doc"] . "/index.php");
exit;
}
displayRightError();
}
}
示例2: manageRedirect
/**
* Manage login redirection
*
* @param $where string: where to redirect ?
**/
function manageRedirect($where)
{
global $CFG_GLPI, $PLUGIN_HOOKS;
if (!empty($where)) {
$data = explode("_", $where);
if (count($data) >= 2 && isset($_SESSION["glpiactiveprofile"]["interface"]) && !empty($_SESSION["glpiactiveprofile"]["interface"])) {
$forcetab = '';
if (isset($data[2])) {
$forcetab = 'forcetab=' . $data[2];
}
// Plugin tab
if (isset($data[3])) {
$forcetab .= '_' . $data[3];
}
switch ($_SESSION["glpiactiveprofile"]["interface"]) {
case "helpdesk":
switch ($data[0]) {
case "plugin":
$plugin = $data[1];
$valid = false;
if (isset($PLUGIN_HOOKS['redirect_page'][$plugin]) && !empty($PLUGIN_HOOKS['redirect_page'][$plugin])) {
// Simple redirect
if (!is_array($PLUGIN_HOOKS['redirect_page'][$plugin])) {
if (isset($data[2]) && $data[2] > 0) {
$valid = true;
$id = $data[2];
$page = $PLUGIN_HOOKS['redirect_page'][$plugin];
}
$forcetabnum = 3;
} else {
// Complex redirect
if (isset($data[2]) && !empty($data[2]) && isset($data[3]) && $data[3] > 0 && isset($PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]]) && !empty($PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]])) {
$valid = true;
$id = $data[3];
$page = $PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]];
}
$forcetabnum = 4;
}
}
if (isset($data[$forcetabnum])) {
$forcetab = 'forcetab=' . $data[$forcetabnum];
}
if ($valid) {
glpi_header($CFG_GLPI["root_doc"] . "/plugins/{$plugin}/{$page}?id={$id}&{$forcetab}");
} else {
glpi_header($CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?{$forcetab}");
}
break;
// Use for compatibility with old name
// Use for compatibility with old name
case "tracking":
case "ticket":
glpi_header($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $data[1] . "&{$forcetab}");
break;
case "preference":
glpi_header($CFG_GLPI["root_doc"] . "/front/preference.php?{$forcetab}");
break;
default:
glpi_header($CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?{$forcetab}");
break;
}
break;
case "central":
switch ($data[0]) {
case "plugin":
$plugin = $data[1];
$valid = false;
if (isset($PLUGIN_HOOKS['redirect_page'][$plugin]) && !empty($PLUGIN_HOOKS['redirect_page'][$plugin])) {
// Simple redirect
if (!is_array($PLUGIN_HOOKS['redirect_page'][$plugin])) {
if (isset($data[2]) && $data[2] > 0) {
$valid = true;
$id = $data[2];
$page = $PLUGIN_HOOKS['redirect_page'][$plugin];
}
$forcetabnum = 3;
} else {
// Complex redirect
if (isset($data[2]) && !empty($data[2]) && isset($data[3]) && $data[3] > 0 && isset($PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]]) && !empty($PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]])) {
$valid = true;
$id = $data[3];
$page = $PLUGIN_HOOKS['redirect_page'][$plugin][$data[2]];
}
$forcetabnum = 4;
}
}
if (isset($data[$forcetabnum])) {
$forcetab = 'forcetab=' . $data[$forcetabnum];
}
if ($valid) {
glpi_header($CFG_GLPI["root_doc"] . "/plugins/{$plugin}/{$page}?id={$id}&{$forcetab}");
} else {
glpi_header($CFG_GLPI["root_doc"] . "/front/central.php?{$forcetab}");
}
break;
//.........这里部分代码省略.........
示例3: Copyright
(at your option) any later version.
Plugin Monitoring for GLPI 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Behaviors. If not, see <http://www.gnu.org/licenses/>.
------------------------------------------------------------------------
@package Plugin Monitoring for GLPI
@author David Durieux
@co-author
@comment
@copyright Copyright (c) 2011-2012 Plugin Monitoring for GLPI team
@license AGPL License 3.0 or (at your option) any later version
http://www.gnu.org/licenses/agpl-3.0-standalone.html
@link https://forge.indepnet.net/projects/monitoring/
@since 2011
------------------------------------------------------------------------
*/
if (!defined('GLPI_ROOT')) {
define('GLPI_ROOT', '../..');
}
include GLPI_ROOT . "/inc/includes.php";
commonHeader($LANG['plugin_monitoring']['title'][0], $_SERVER["PHP_SELF"], "plugins", "monitoring");
glpi_header(GLPI_ROOT . "/plugins/monitoring/front/menu.php");
commonFooter();
示例4: define
(at your option) any later version.
GLPI 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 GLPI; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
checkRight("config", "w");
$config = new Config();
//Update CAS configuration
if (isset($_POST["update"])) {
$config->update($_POST);
glpi_header($CFG_GLPI["root_doc"] . "/front/auth.others.php");
}
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
commonHeader($LANG['title'][14], $_SERVER['PHP_SELF'], "config", "extauth", "others");
showOtherAuthList($_SERVER['PHP_SELF']);
commonFooter();
示例5: ldapChooseDirectory
/** Form to choose a ldap server
*
* @param $target target page for the form
*
* @return nothing
**/
static function ldapChooseDirectory($target)
{
global $DB, $LANG;
$query = "SELECT *\n FROM `glpi_authldaps`\n ORDER BY `name` ASC";
$result = $DB->query($query);
if ($DB->numrows($result) == 1) {
//If only one server, do not show the choose ldap server window
$ldap = $DB->fetch_array($result);
$_SESSION["ldap_server"] = $ldap["id"];
glpi_header($_SERVER['PHP_SELF']);
}
echo "<form action='{$target}' method=\"post\">";
echo "<div class='center'>";
echo "<p >" . $LANG['ldap'][5] . "</p>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_2'><th colspan='2'>" . $LANG['ldap'][4] . "</th></tr>";
//If more than one ldap server
if ($DB->numrows($result) > 1) {
echo "<tr class='tab_bg_2'><td class='center'>" . $LANG['common'][16] . "</td>";
echo "<td class='center'>";
Dropdown::show('AuthLDAP', array('name' => 'ldap_server', 'display_emptychoice' => false, 'comment' => true));
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td class='center' colspan='2'>";
echo "<input class='submit' type='submit' name='ldap_showusers' value=\"" . $LANG['buttons'][2] . "\"></td></tr>";
} else {
//No ldap server
echo "<tr class='tab_bg_2'><td class='center' colspan='2'>" . $LANG['ldap'][7] . "</td></tr>";
}
echo "</table></div></form>";
}
示例6: unclean_cross_side_scripting_deep
$_POST['login_password'] = unclean_cross_side_scripting_deep($_POST['login_password']);
} else {
$_POST['login_password'] = '';
}
// Redirect management
$REDIRECT = "";
if (isset($_POST['redirect']) && strlen($_POST['redirect']) > 0) {
$REDIRECT = "?redirect=" . $_POST['redirect'];
} else {
if (isset($_GET['redirect']) && strlen($_GET['redirect']) > 0) {
$REDIRECT = "?redirect=" . $_GET['redirect'];
}
}
$auth = new Auth();
// now we can continue with the process...
if ($auth->Login($_POST['login_name'], $_POST['login_password'], isset($_REQUEST["noAUTO"]) ? $_REQUEST["noAUTO"] : false)) {
// Redirect to Command Central if not post-only
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
glpi_header($CFG_GLPI['root_doc'] . "/front/helpdesk.public.php{$REDIRECT}");
} else {
glpi_header($CFG_GLPI['root_doc'] . "/front/central.php{$REDIRECT}");
}
} else {
// we have done at least a good login? No, we exit.
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"] . '/logout.php?noAUTO=1' . str_replace("?", "&", $REDIRECT) . '">' . $LANG['login'][1] . '</a></div>';
nullFooter();
exit;
}
示例7: ini_set
}
// If debug mode activated : display some informations
if ($_SESSION['glpi_use_mode'] == DEBUG_MODE) {
// display_errors only need for for E_ERROR, E_PARSE, ... which cannot be catched
ini_set('display_errors', 'On');
// Recommended development settings
error_reporting(E_ALL | E_STRICT);
set_error_handler('userErrorHandlerDebug');
} else {
// Recommended production settings
ini_set('display_errors', 'Off');
error_reporting(E_ALL);
set_error_handler('userErrorHandlerNormal');
}
if (isset($_SESSION["glpiroot"]) && $CFG_GLPI["root_doc"] != $_SESSION["glpiroot"]) {
glpi_header($_SESSION["glpiroot"]);
}
// Override cfg_features by session value
foreach ($CFG_GLPI['user_pref_field'] as $field) {
if (!isset($_SESSION["glpi{$field}"]) && isset($CFG_GLPI[$field])) {
$_SESSION["glpi{$field}"] = $CFG_GLPI[$field];
}
}
if ((!isset($CFG_GLPI["version"]) || trim($CFG_GLPI["version"]) != GLPI_VERSION) && !isset($_GET["donotcheckversion"])) {
loadLanguage();
if (isCommandLine()) {
echo $LANG['update'][88] . "\n";
} else {
nullHeader("UPDATE NEEDED", $CFG_GLPI["root_doc"]);
echo "<div class='center'>";
echo "<table class='tab_check'>";
示例8: commonHeader
commonHeader($LANG['setup'][704], $_SERVER['PHP_SELF'], "config", "mailing", -1);
if (isset($_GET['activate'])) {
$config = new Config();
$tmp['id'] = $CFG_GLPI['id'];
$tmp['use_mailing'] = 1;
$config->update($tmp);
glpi_header($_SERVER['HTTP_REFERER']);
}
if (!$CFG_GLPI['use_mailing']) {
echo "<div align='center'<p>";
if (haveRight("config", "w")) {
echo "<a href='setup.notification.php?activate=1' class='icon_consol b'>" . $LANG['setup'][202] . "</a></p></div>";
}
} else {
if (!haveRight("config", "r") && haveRight("notification", "r") && $CFG_GLPI['use_mailing']) {
glpi_header($CFG_GLPI["root_doc"] . '/front/notification.php');
} else {
echo "<table class='tab_cadre'>";
echo "<tr><th> " . $LANG['setup'][704] . " </th></tr>";
if (haveRight("config", "r")) {
echo "<tr class='tab_bg_1'><td class='center'><a href='notificationmailsetting.form.php'>" . $LANG['setup'][201] . "</a></td></tr>";
echo "<tr class='tab_bg_1'><td class='center'><a href='notificationtemplate.php'>" . $LANG['mailing'][113] . "</a></td> </tr>";
}
if (haveRight("notification", "r") && $CFG_GLPI['use_mailing']) {
echo "<tr class='tab_bg_1'><td class='center'><a href='notification.php'>" . $LANG['setup'][704] . "</a></td></tr>";
} else {
echo "<tr class='tab_bg_1'><td class='center'>" . $LANG['setup'][661] . "</td></tr>";
}
echo "</table>";
}
}
示例9: define
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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
checkRight("config", "w");
$config = new Config();
if (!empty($_POST["update_auth"])) {
$config->update($_POST);
glpi_header($_SERVER['HTTP_REFERER']);
}
if (!empty($_POST["update"])) {
$config->update($_POST);
if (isset($_POST["use_ocs_mode"]) && $_POST["use_ocs_mode"] && !$CFG_GLPI["use_ocs_mode"]) {
glpi_header(getItemTypeSearchURL('OcsServer'));
} else {
glpi_header(getItemTypeFormURL('Config'));
}
}
commonHeader($LANG['common'][12], $_SERVER['PHP_SELF'], "config", "config");
$config->showForm(1);
commonFooter();
示例10: define
LICENSE
This file is part of GLPI.
GLPI 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.
GLPI 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 GLPI; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file: David DURIEUX
// Purpose of file:
// ----------------------------------------------------------------------
if (!defined('GLPI_ROOT')) {
define('GLPI_ROOT', '../..');
}
include GLPI_ROOT . "/inc/includes.php";
commonHeader($LANG['plugin_fusioninventory']["title"][0], $_SERVER["PHP_SELF"], "plugins", "fusioninventory");
glpi_header(GLPI_ROOT . "/plugins/fusioninventory/front/menu.php");
commonFooter();
示例11: checkRight
exit;
}
checkRight("user", "r");
$user = new User();
if (!isset($_POST["start"])) {
$_POST["start"] = 0;
}
if (!isset($_POST["sort"])) {
$_POST["sort"] = "";
}
if (!isset($_POST["order"])) {
$_POST["order"] = "";
}
if (empty($_POST["id"]) && isset($_POST["name"])) {
$user->getFromDBbyName($_POST["name"]);
glpi_header($CFG_GLPI["root_doc"] . "/front/user.form.php?id=" . $user->fields['id']);
}
if (empty($_POST["name"])) {
$_POST["name"] = "";
}
if ($_POST["id"] > 0 && $user->can($_POST["id"], 'r')) {
switch ($_REQUEST['glpi_tab']) {
case -1:
Profile_User::showForUser($user);
Group_User::showForUser($user);
$config = new Config();
$user->computePreferences();
$config->showFormUserPrefs($user->fields);
$user->showItems();
Reservation::showForUser($_POST["id"]);
Ticket::showListForUser($_POST["id"]);
示例12: glpi_header
$kb->redirectToList();
} else {
if (isset($_GET["id"]) && strcmp($_GET["addtofaq"], "yes") == 0) {
// ajouter un item dans la faq
$kb->check($_GET["id"], 'w');
$kb->addToFaq();
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (isset($_GET["id"]) && strcmp($_GET["removefromfaq"], "yes") == 0) {
// retirer un item de la faq
$kb->check($_GET["id"], 'w');
$kb->removeFromFaq($_GET["id"]);
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (empty($_GET["id"])) {
// No id or no tickets id to create from solution
glpi_header($CFG_GLPI["root_doc"] . "/front/knowbaseitem.php");
} else {
// Affiche un item de la base de connaissances
$kb->check($_GET["id"], 'r');
commonHeader($LANG['title'][5], $_SERVER['PHP_SELF'], "utils", "knowbase");
$kb->showFull(true);
commonFooter();
}
}
}
}
}
}
}
}
示例13: define
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
checkSeveralRightsOr(array('knowbase' => 'r', 'faq' => 'r'));
if (isset($_GET["id"])) {
glpi_header($CFG_GLPI["root_doc"] . "/front/knowbaseitem.form.php?id=" . $_GET["id"]);
}
commonHeader($LANG['title'][5], $_SERVER['PHP_SELF'], "utils", "knowbase");
// Search a solution
if (!isset($_GET["contains"]) && isset($_GET["tickets_id"])) {
$ticket = new Ticket();
if ($ticket->getFromDB($_GET["tickets_id"])) {
$_GET["contains"] = $ticket->getField('name');
}
}
if (!isset($_GET["contains"])) {
$_GET["contains"] = "";
}
if (!isset($_GET["knowbaseitemcategories_id"])) {
$_GET["knowbaseitemcategories_id"] = "0";
}
示例14: glpi_header
$ruleaction->add($_POST);
// Can't do this in RuleCriteria, so do it here
$rule->update(array('id' => $_POST['rules_id'], 'date_mod' => $_SESSION['glpi_currenttime']));
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (isset($_POST["update"])) {
$rulecollection->checkGlobal('w');
$rule->update($_POST);
Event::log($_POST['id'], "rules", 4, "setup", $_SESSION["glpiname"] . " " . $LANG['log'][21]);
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (isset($_POST["add"])) {
$rulecollection->checkGlobal('w');
$newID = $rule->add($_POST);
Event::log($newID, "rules", 4, "setup", $_SESSION["glpiname"] . " " . $LANG['log'][20]);
glpi_header($_SERVER['HTTP_REFERER'] . "?id={$newID}");
} else {
if (isset($_POST["delete"])) {
$rulecollection->checkGlobal('w');
$rulecollection->deleteRuleOrder($_POST["ranking"]);
$rule->delete($_POST);
Event::log($_POST["id"], "rules", 4, "setup", $_SESSION["glpiname"] . " " . $LANG['log'][22]);
$rule->redirectToList();
}
}
}
}
}
}
}
commonHeader($LANG['common'][12], $_SERVER['PHP_SELF'], "admin", $rulecollection->menu_type, $rulecollection->menu_option);
示例15: checkCentralAccess
checkCentralAccess();
// Change profile system
if (isset($_POST['newprofile'])) {
if (isset($_SESSION["glpiprofiles"][$_POST['newprofile']])) {
changeProfile($_POST['newprofile']);
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
glpi_header($CFG_GLPI['root_doc'] . "/front/helpdesk.public.php");
}
glpi_header($_SERVER['PHP_SELF']);
}
glpi_header(preg_replace("/entities_id.*/", "", $_SERVER['HTTP_REFERER']));
}
// Manage entity change
if (isset($_GET["active_entity"])) {
if (!isset($_GET["is_recursive"])) {
$_GET["is_recursive"] = 0;
}
if (changeActiveEntities($_GET["active_entity"], $_GET["is_recursive"])) {
if ($_GET["active_entity"] == $_SESSION["glpiactive_entity"] && isset($_SERVER['HTTP_REFERER'])) {
glpi_header(preg_replace("/entities_id.*/", "", $_SERVER['HTTP_REFERER']));
}
}
}
commonHeader($LANG['common'][56], $_SERVER['PHP_SELF']);
// Redirect management
if (isset($_GET["redirect"])) {
manageRedirect($_GET["redirect"]);
}
$central = new Central();
$central->show();
commonFooter();