Beispiel #1
0
 function __construct($data = '')
 {
     $this->user_id = $this->getID();
     if (!Requester::isUser($this->user_id)) {
         Error::http(401, "The requester must be logged in as the requested user.");
     }
     $this->{"@id"} = "/user/{$this->user_id}/apps";
     $this->{'@type'} = "userApps";
     $this->collectionOf = "app";
     $this->table = "consumers";
     $this->init($data);
     $this->okToAdd = array("name", "secret", "type", "redirect_url");
 }
Beispiel #2
0
 function __construct($data = '')
 {
     $this->{"@type"} = 'userMemberships';
     $this->user_id = $this->getID();
     if (!Requester::isUser($this->user_id)) {
         Error::http(401, "The requester must be logged in as the requested user.");
     }
     $this->{"@id"} = "{$this->root}/user/{$this->user_id}/memberships";
     $this->table = "members";
     $this->idkey = 'user_id';
     $this->collectionOf = "memberships";
     $this->init($data);
     $this->okToSet = array("joined", "revoked");
     $this->okToFilterBy = array("member_id");
 }
Beispiel #3
0
 function __construct($data = '')
 {
     $this->{"@type"} = 'userAccounts';
     //print_r($data);
     $this->user_id = Router::$id ? $this->getID() : Requester::$user_id;
     //print_r($this);
     if (!Requester::isUser($this->user_id)) {
         Error::http(401, "The requester must be logged in as the requested user.");
     }
     $this->{"@id"} = "{$this->root}/user/{$this->user_id}/accounts";
     $this->collectionOf = "holding";
     $this->init($data);
     $this->okToSet = array("alias", "limkey");
     $this->okToFilterBy = array("user_id", "holder_id");
 }
Beispiel #4
0
 function __construct($data = '')
 {
     $this->{"@type"} = 'user';
     $this->user_id = $this->getID();
     if (!Requester::isUser($this->user_id)) {
         Error::http(401, "The requester must be logged in as the requested user.");
     }
     $this->{"@id"} = "{$this->root}/user/{$this->user_id}";
     $this->table = 'users';
     $this->idkey = 'user_id';
     $this->init($data);
     $this->name = Requester::$name;
     $this->email = Requester::$email;
     $this->okToSet = array("ended", "email", "name", "password");
     $this->okToFilterBy = array("user_id", "email");
     $this->login_provider = Requester::$login_provider;
 }