Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function load($id) {
- if (!is_numeric($id)) throw new AccountNotFoundException();
- //load attributes from database
- $acc = $this->sql->myRetrieve('accounts', array('id' => $id));
- $nicaw_acc = $this->sql->myRetrieve('nicaw_accounts', array('account_id' => $id));
- if ($acc === false) throw new AccountNotFoundException();
- //arranging attributes, ones on the left will be used all over the aac
- $this->attrs['accno'] = (int) $acc['id'];
- $this->attrs['blocked'] = (bool) $acc['blocked'];
- $this->attrs['name'] = (string) $acc['name'];
- $this->attrs['password'] = (string) $acc['password'];
- $this->attrs['email'] = (string) $acc['email'];
- $this->attrs['proxyid'] = (bool) $acc['proxyid'];
- if ($nicaw_acc){
- $this->attrs['rlname'] = $nicaw_acc['rlname'];
- $this->attrs['location'] = $nicaw_acc['location'];
- $this->attrs['comment'] = $nicaw_acc['comment'];
- $this->attrs['recovery_key'] = $nicaw_acc['recovery_key'];
- $this->attrs['reveal_characters'] = (bool) $nicaw_acc['reveal_characters'];
- $this->attrs['show_death'] = (bool) $nicaw_acc['show_death'];
- }
- if (isset($acc['premdays']) && $acc['premdays'] > 0) $this->attrs['premend'] = $acc['premdays']*24*3600 + time();
- elseif (isset($acc['premend']) && $acc['premend'] > 0) $this->attrs['premend'] = $acc['premend'];
- $this->attrs['pointers'] = (double) $acc['account_poin'];
- $this->attrs['create'] = (int) $acc['create'];
- $this->attrs['prem_autoloot'] = (int) $acc['prem_autoloot'];
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement