本文整理汇总了PHP中Guardian::GetUsername方法的典型用法代码示例。如果您正苦于以下问题:PHP Guardian::GetUsername方法的具体用法?PHP Guardian::GetUsername怎么用?PHP Guardian::GetUsername使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guardian
的用法示例。
在下文中一共展示了Guardian::GetUsername方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Session
if (isset($_COOKIE["cookie_username"]) && isset($_COOKIE["cookie_password"]) && isset($_COOKIE["cookie_userid"])) {
$guardian->SetId($_COOKIE["cookie_userid"]);
$guardian->SetUsername($_COOKIE["cookie_username"]);
$guardian->SetEncryptedPassword($_COOKIE["cookie_password"]);
} else {
$guardian->SetUsername("guest");
$guardian->SetPassword("guest");
}
}
$guardian->SetModuleName($module_name);
if ($module_name != "error") {
if (!$guardian->CheckPermission()) {
echo "<script language='Javascript'>window.location = \"/" . $WEB_SITE . "pages/pgError.php\";</script>";
} else {
$session = new Session();
$session->SetDatabase($database);
if ($guardian->GetId() != "") {
$session_id = $session->Login($guardian->GetId(), $guardian->GetUsername(), $guardian->GetEncryptedPassword());
} else {
$session_id = $session->Login($guardian->GetId(), $guardian->GetUsername(), $guardian->GetPassword());
}
$guardian->SetId($session_id);
$guardian->SetLoggedIn($session->logged_in);
}
}
/*
echo $_SERVER['QUERY_STRING']."<br>";
echo $_SERVER['SCRIPT_NAME']."<br>";
echo $_SERVER['HTTP_HOST']."<br>";
echo $_SERVER['REQUEST_URI']."<br>";
*/