Advertisement
poxipox

Untitled

Mar 25th, 2023
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. public function load($id) {
  2. if (!is_numeric($id)) throw new AccountNotFoundException();
  3. //load attributes from database
  4. $acc = $this->sql->myRetrieve('accounts', array('id' => $id));
  5. $nicaw_acc = $this->sql->myRetrieve('nicaw_accounts', array('account_id' => $id));
  6.  
  7. if ($acc === false) throw new AccountNotFoundException();
  8.  
  9. //arranging attributes, ones on the left will be used all over the aac
  10. $this->attrs['accno'] = (int) $acc['id'];
  11. $this->attrs['blocked'] = (bool) $acc['blocked'];
  12. $this->attrs['name'] = (string) $acc['name'];
  13. $this->attrs['password'] = (string) $acc['password'];
  14. $this->attrs['email'] = (string) $acc['email'];
  15. $this->attrs['proxyid'] = (bool) $acc['proxyid'];
  16.  
  17. if ($nicaw_acc){
  18. $this->attrs['rlname'] = $nicaw_acc['rlname'];
  19. $this->attrs['location'] = $nicaw_acc['location'];
  20. $this->attrs['comment'] = $nicaw_acc['comment'];
  21. $this->attrs['recovery_key'] = $nicaw_acc['recovery_key'];
  22. $this->attrs['reveal_characters'] = (bool) $nicaw_acc['reveal_characters'];
  23. $this->attrs['show_death'] = (bool) $nicaw_acc['show_death'];
  24. }
  25.  
  26.  
  27. if (isset($acc['premdays']) && $acc['premdays'] > 0) $this->attrs['premend'] = $acc['premdays']*24*3600 + time();
  28. elseif (isset($acc['premend']) && $acc['premend'] > 0) $this->attrs['premend'] = $acc['premend'];
  29. $this->attrs['pointers'] = (double) $acc['account_poin'];
  30. $this->attrs['create'] = (int) $acc['create'];
  31. $this->attrs['prem_autoloot'] = (int) $acc['prem_autoloot'];
  32.  
  33. return true;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement