$openid->returnUrl = $config['core']['uri'] . '/?return'; header('Location: ' . $openid->authUrl()); } } else { if ($openid->validate()) { $id = $openid->identity; $ptn = "/^http:\\/\\/steamcommunity\\.com\\/openid\\/id\\/(7[0-9]{15,25}+)\$/"; preg_match($ptn, $id, $matches); $_SESSION["steamid"] = $matches[1]; if (isset($_SESSION["persist_login"])) { Application::generateToken($_SESSION["steamid"]); } } } if (isset($_COOKIE['authtoken']) && !isset($_SESSION['steamid'])) { $steamid_login = Application::checkLogin($_COOKIE['authtoken']); if ($steamid_login) { $_SESSION["steamid"] = $steamid_login; } } // check session privileges if (isset($_SESSION['steamid'])) { $_SESSION['admin'] = Admin::checkAdminPrivilege($_SESSION['steamid']); // handle friends list $f = new Friends(); $friends = $f->getFriendsForSteamId($_SESSION['steamid']); } // handle steam oauth return if (isset($_GET['return']) && isset($_SESSION['steamid'])) { header('Location: ' . $config['core']['uri'] . '/player/' . $_SESSION['steamid']); }