Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. class steam {
  2. function __construct(){
  3. $this->OnLoginCallback = function(){};
  4. }
  5.  
  6. function Init(){
  7. if($this->IsUserLoggedIn()){
  8. $this->SteamID = $_SESSION['steamid'];
  9. return;
  10. }
  11.  
  12. if($this->OpenID->mode){
  13. if($this->OpenID->validate()){
  14. $this->SteamID = basename($this->OpenID->identity);
  15. if($this->OnLoginCallback($this->SteamID)){
  16. $_SESSION['steamid'] = $this->SteamID;
  17. }
  18. }
  19. }
  20. }
  21.  
  22. function SetOnLoginCallback($callback){
  23. $this->OnLoginCallback = $callback;
  24. }
  25. }
  26.  
  27. $steam->SetOnLoginCallback(function($steamid64){
  28. return true;
  29. });
  30.  
  31. $steam->Init();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement