Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class steam {
- function __construct(){
- $this->OnLoginCallback = function(){};
- }
- function Init(){
- if($this->IsUserLoggedIn()){
- $this->SteamID = $_SESSION['steamid'];
- return;
- }
- if($this->OpenID->mode){
- if($this->OpenID->validate()){
- $this->SteamID = basename($this->OpenID->identity);
- if($this->OnLoginCallback($this->SteamID)){
- $_SESSION['steamid'] = $this->SteamID;
- }
- }
- }
- }
- function SetOnLoginCallback($callback){
- $this->OnLoginCallback = $callback;
- }
- }
- $steam->SetOnLoginCallback(function($steamid64){
- return true;
- });
- $steam->Init();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement