Exemple #1
0
 function __construct()
 {
     parent::__construct();
     $this->code = hash('sha256', mt_rand() . microtime(true));
     $this->expires = strtotime('now + 10 minutes');
     $this->setTitle($this->code);
     // better stub generation, not that it matters
 }
Exemple #2
0
 function __construct($token_type = 'grant', $expires_in = 2419200)
 {
     parent::__construct();
     $this->access_token = hash('sha256', mt_rand() . microtime(true));
     $this->refresh_token = hash('sha256', mt_rand() . microtime(true));
     $this->expires_in = $expires_in;
     // Default expires is 1 month, like facebook
     $this->token_type = $token_type;
     $this->setTitle($this->access_token);
     // better stub generation, not that it matters
 }
Exemple #3
0
 /**
  * Overloading the constructor for users to make it explicit that
  * they don't have owners
  */
 function __construct()
 {
     parent::__construct();
     $this->owner = false;
     // Hook to add user data to webfinger
     \Idno\Core\site()->addEventHook('webfinger', function (\Idno\Core\Event $event) {
         $user = $event->data()['object'];
         $links = $event->response();
         if (empty($links)) {
             $links = array();
         }
         if ($user instanceof User) {
             $links = array(array('rel' => 'http://webfinger.net/rel/avatar', 'href' => $user->getIcon()), array('rel' => 'http://webfinger.net/rel/profile-page', 'href' => $user->getURL()));
         }
         $event->setResponse($links);
     });
 }
Exemple #4
0
 /**
  * Overloading the constructor for users to make it explicit that
  * they don't have owners
  */
 function __construct()
 {
     parent::__construct();
     $this->owner = false;
 }
Exemple #5
0
 /**
  * On initial creation, make sure access groups have a members property
  * @return mixed
  */
 function __construct()
 {
     $this->members = array('read' => array(\Idno\Core\site()->session()->currentUser()->getUUID()), 'write' => array(\Idno\Core\site()->session()->currentUser()->getUUID()), 'admin' => array(\Idno\Core\site()->session()->currentUser()->getUUID()));
     return parent::__construct();
 }
Exemple #6
0
 function __construct()
 {
     $this->generateCode();
     parent::__construct();
 }