コード例 #1
0
		$_SESSION["$user_cookie_site"] = $user;
	} elseif ($prefs['auth_ws_create_tiki'] == 'y') {
		$user = $_SERVER['REMOTE_USER'];
		if ($userlib->add_user($_SERVER['REMOTE_USER'], '', '')) {
			$user = $_SERVER['REMOTE_USER'];
			$_SESSION["$user_cookie_site"] = $user;
		}
	}
	if (!empty($_SESSION["$user_cookie_site"])) {
		$userlib->update_lastlogin($user);
	}
}
// Check for Shibboleth Login
if ($prefs['auth_method'] == 'shib' and isset($_SERVER['REMOTE_USER'])) {
	// Validate the user (if not created create it)
	if ($userlib->validate_user($_SERVER['REMOTE_USER'], "", "", "")) {
		$_SESSION["$user_cookie_site"] = $_SERVER['REMOTE_USER'];
	}
}

$userlib->check_cas_authentication($user_cookie_site);

// if the username is already saved in the session, pull it from there
if (isset($_SESSION["$user_cookie_site"])) {
	$user = $_SESSION["$user_cookie_site"];
	// There could be a case where the session contains a user that doesn't exists in this tiki
	// or that has never used the login step in this tiki.
	// Example : If using the same PHP SESSION cookies for more than one tiki.
	$user_details = $userlib->get_user_details($user);
	if (!is_array($user_details) || !is_array($user_details['info']) || (int)$user_details['info']['lastLogin'] <= 0) {
		global $cachelib;
コード例 #2
0
        $_SESSION["{$user_cookie_site}"] = str_replace("\\\\", "\\", $_SERVER['REMOTE_USER']);
    } elseif ($userlib->user_exists(substr($_SERVER['REMOTE_USER'], strpos($_SERVER['REMOTE_USER'], "\\") + 2))) {
        // Check for the username without the domain name
        $_SESSION["{$user_cookie_site}"] = substr($_SERVER['REMOTE_USER'], strpos($_SERVER['REMOTE_USER'], "\\") + 2);
    }
}
// check if phpCAS mods is installed
if (is_file('lib/phpcas/source/CAS/CAS.php')) {
    $phpcas_enabled = 'y';
} else {
    $phpcas_enabled = 'n';
}
// Check for Shibboleth Login
if ($prefs['auth_method'] == 'shib' and isset($_SERVER['REMOTE_USER'])) {
    // Validate the user (if not created create it)
    if ($userlib->validate_user($_SERVER['REMOTE_USER'], "", "", "")) {
        $_SESSION["{$user_cookie_site}"] = $_SERVER['REMOTE_USER'];
    }
}
// if the username is already saved in the session, pull it from there
if (isset($_SESSION["{$user_cookie_site}"])) {
    $user = $_SESSION["{$user_cookie_site}"];
    // There could be a case where the session contains a user that doesn't exists in this tiki
    // or that has never used the login step in this tiki.
    // Example : If using the same PHP SESSION cookies for more than one tiki.
    $user_details = $userlib->get_user_details($user);
    if (!is_array($user_details) || !is_array($user_details['info']) || (int) $user_details['info']['lastLogin'] <= 0) {
        global $cachelib;
        require_once "lib/cache/cachelib.php";
        $cachelib->invalidate('user_details_' . $user);
        $user_details = $userlib->get_user_details($user);