Пример #1
0
 /**
  * Constructor Class responsible for filling in arrays with the data from a specified user.
  *
  * @param mixed $rebuild If passed it should be the ID of the user to rebuild the data as. If passed as false it will build data as the logged in user.
  */
 public function __construct($rebuild = false)
 {
     parent::__construct();
     if (Authentication::isLoggedIn() && !$rebuild) {
         $this->user = $this->select;
     } else {
         if ($rebuild) {
             $this->user = ORM::forTable('users')->findOne($rebuild);
         } else {
             $this->user = false;
         }
     }
 }
Пример #2
0
 /**
  * Class for building server data.
  *
  * @param string|int $reference This can either be a string (server hash) or a numeric value (server id).
  */
 public function __construct($reference = null)
 {
     Authentication::__construct();
     parent::__construct();
     if (is_null($reference) && !isset($_COOKIE['pp_server_hash'])) {
         $reference = false;
     } else {
         if (is_null($reference)) {
             $reference = $_COOKIE['pp_server_hash'];
         }
     }
     if (is_numeric($reference)) {
         $this->_rebuildData($reference);
     } else {
         $this->_buildData($reference);
     }
 }