Example #1
0
 /**
  * @since version 0.84
  **/
 function getDefaultUserType()
 {
     if (Auth::isAlternateAuth(Auth::checkAlternateAuthSystems())) {
         return self::EXTERNAL_USER;
     }
     return self::GLPI_USER;
 }
// If config_db doesn't exist -> start installation
define('GLPI_ROOT', dirname(__FILE__));
include GLPI_ROOT . "/config/based_config.php";
if (!file_exists(GLPI_CONFIG_DIR . "/config_db.php")) {
    include_once GLPI_ROOT . "/inc/autoload.function.php";
    Html::redirect("install/install.php");
    die;
} else {
    $TRY_OLD_CONFIG_FIRST = true;
    include GLPI_ROOT . "/inc/includes.php";
    $_SESSION["glpicookietest"] = 'testcookie';
    // For compatibility reason
    if (isset($_GET["noCAS"])) {
        $_GET["noAUTO"] = $_GET["noCAS"];
    }
    Auth::checkAlternateAuthSystems(true, isset($_GET["redirect"]) ? $_GET["redirect"] : "");
}
?>
<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php 
echo __('GLPI - Authentication');
?>
</title>

<!-- Bootstrap -->
<link href="css/bootstrap.css" rel="stylesheet">
Example #3
0
function redirectMobile()
{
    if (!isset($_SESSION['glpiactiveprofile']) && strpos($_SERVER['SCRIPT_FILENAME'], 'plugins/mobile') === false && strpos($_SERVER['SCRIPT_FILENAME'], 'login.php') === false) {
        //check if alternate auth is available
        Auth::checkAlternateAuthSystems(true, "plugin_mobile_1");
        //else redirect login page
        //header("location: ".GLPI_ROOT."/plugins/mobile/index.php");
        header("location: " . $CFG_GLPI["root_doc"] . "plugins/mobile/index.php");
    }
}