Beispiel #1
0
 public function __construct($publicKey, $privateKey)
 {
     $this->models();
     $db = new Store('apistore_user');
     $user = $db->findOneByPublicKey($publicKey);
     if (!empty($user)) {
         if ($user->getPrivateKey() != $privateKey) {
             $this->render('You cannot access to this API.', 500);
         }
     } else {
         $this->render('You cannot access to this API.', 500);
     }
     $this->user = $user;
 }