コード例 #1
0
/**
 * Simple Error message page
 *
 * @param $message string displayed before dying
 * @param $minimal set to true do not display app menu
 *
 * @return nothing as function kill script
 **/
function displayErrorAndDie($message, $minimal = false)
{
    global $LANG, $CFG_GLPI, $HEADER_LOADED;
    if (!$HEADER_LOADED) {
        if ($minimal || !isset($_SESSION["glpiactiveprofile"]["interface"])) {
            nullHeader($LANG['login'][5], '');
        } else {
            if ($_SESSION["glpiactiveprofile"]["interface"] == "central") {
                commonHeader($LANG['login'][5], '');
            } else {
                if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
                    helpHeader($LANG['login'][5], '');
                }
            }
        }
    }
    echo "<div class='center'><br><br>";
    echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/warning.png' alt='warning'><br><br>";
    echo "<strong>{$message}</strong></div>";
    nullFooter();
    exit;
}
コード例 #2
0
/**
 * Display common message for item not found
 *
 * @return Nothing
**/
function displayNotFoundError()
{
    global $LANG, $CFG_GLPI, $HEADER_LOADED;
    if (!$HEADER_LOADED) {
        if (!isset($_SESSION["glpiactiveprofile"]["interface"])) {
            nullHeader($LANG['login'][5]);
        } else {
            if ($_SESSION["glpiactiveprofile"]["interface"] == "central") {
                commonHeader($LANG['login'][5]);
            } else {
                if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
                    helpHeader($LANG['login'][5]);
                }
            }
        }
    }
    echo "<div class='center'><br><br>";
    echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/warning.png' alt='warning'><br><br>";
    echo "<strong>" . $LANG['common'][54] . "</strong></div>";
    nullFooter();
    exit;
}
コード例 #3
0
ファイル: login.php プロジェクト: ryukansent/Thesis-SideB
    $_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;
}
コード例 #4
0
ファイル: config.php プロジェクト: ryukansent/Thesis-SideB
 }
 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'>";
         $error = commonCheckForUseGLPI();
         echo "</table><br>";
         if (!$error) {
             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'>" . $LANG['update'][88] . "</p>";
                 echo "<input type='submit' name='from_update' value=\"" . $LANG['install'][4] . "\" class='submit'>";
                 echo "</form>";
             } else {
                 if (trim($CFG_GLPI["version"]) > GLPI_VERSION) {
                     echo "<p class='red'>" . $LANG['update'][89] . "</p>";
                 }
             }
コード例 #5
0
// ----------------------------------------------------------------------
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
if (empty($_POST["type"]) || $_POST["type"] != "Helpdesk" || !$CFG_GLPI["use_anonymous_helpdesk"]) {
    checkRight("create_ticket", "1");
}
$track = new Ticket();
// Security check
if (empty($_POST) || count($_POST) == 0) {
    glpi_header($CFG_GLPI["root_doc"] . "/front/helpdesk.public.php");
}
if (!empty($_POST["type"]) && $_POST["type"] == "Helpdesk") {
    nullHeader($LANG['title'][10]);
} else {
    if ($_POST["_from_helpdesk"]) {
        helpHeader($LANG['Menu'][31], '', $_SESSION["glpiname"]);
    } else {
        commonHeader($LANG['Menu'][31], '', $_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) {
コード例 #6
0
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";
$user = new User();
// Manage lost password
if (isset($_GET['lostpassword'])) {
    nullHeader();
    if (isset($_GET['token'])) {
        User::showPasswordForgetChangeForm($_GET['token']);
    } else {
        User::showPasswordForgetRequestForm();
    }
    nullFooter();
    exit;
}
checkLoginUser();
if (isset($_POST["update"]) && $_POST["id"] === getLoginUserID()) {
    $user->update($_POST);
    Event::log(0, "users", 5, "setup", $_SESSION["glpiname"] . "  " . $LANG['log'][21] . "  " . $_SESSION["glpiname"] . ".");
    glpi_header($_SERVER['HTTP_REFERER']);
} else {
    if ($_SESSION["glpiactiveprofile"]["interface"] == "central") {
コード例 #7
0
 /**
  *  Display a common mysql connection error
  **/
 static function displayMySQLError()
 {
     nullHeader("Mysql Error", '');
     if (!isCommandLine()) {
         echo "<div class='center'><p><strong>\n                A link to the Mysql server could not be established. Please check your configuration.\n                </strong></p><p><strong>\n                Le serveur Mysql est inaccessible. V&eacute;rifiez votre configuration</strong></p>\n               </div>";
     } else {
         echo "A link to the Mysql server could not be established. Please check your configuration.\n";
         echo "Le serveur Mysql est inaccessible. V&eacute;rifiez votre configuration\n";
     }
     nullFooter();
     die;
 }