本文整理汇总了PHP中lms_steam::is_logged_in方法的典型用法代码示例。如果您正苦于以下问题:PHP lms_steam::is_logged_in方法的具体用法?PHP lms_steam::is_logged_in怎么用?PHP lms_steam::is_logged_in使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lms_steam
的用法示例。
在下文中一共展示了lms_steam::is_logged_in方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
public function login($login = "", $password = "")
{
if (empty($login)) {
$login = $this->login;
$password = $this->get_password();
} else {
if (empty($password)) {
throw new Exception("Password not given ({$login}).", E_USER_LOGIN);
}
$this->login = $login;
$this->set_password($password);
}
if (lms_steam::is_connected()) {
lms_steam::disconnect();
}
lms_steam::connect(STEAM_SERVER, STEAM_PORT, $login, $password);
if (!lms_steam::is_logged_in()) {
return FALSE;
}
// ASSIGN COMMON ATTRIBUTES
$this->logged_in = TRUE;
// INITIALIZE ATTRIBUTES
$this->init_attributes();
// INITIALIZE NETWORKING_PROFILE
$steam_user = lms_steam::get_current_user();
if (!$steam_user->get_attribute("LLMS_NETWORKING_PROFILE") instanceof steam_object) {
$profile = new lms_networking_profile($steam_user);
$profile->initialize();
logging::write_log(LOG_MESSAGES, "REGISTRATION\t" . $login);
}
// NEW ENTRY IN LOGFILE
logging::write_log(LOG_MESSAGES, "LOGIN\t\t" . $login);
$_SESSION["last_login"] = $steam_user->get_attribute("LMS_LAST_LOGIN");
$steam_user->set_attribute("LMS_LAST_LOGIN", time());
return TRUE;
}
示例2: get_current_user
public static function get_current_user()
{
if (!lms_steam::is_logged_in()) {
throw new Exception("Not logged in.", E_INVOCATION);
}
return $GLOBALS["STEAM"]->get_current_steam_user();
}