コード例 #1
0
 public static function addSignatureToken($signature_token)
 {
     if (self::$signature) {
         $signature_token = "-" . $signature_token;
     }
     self::$signature = self::$signature . $signature_token;
 }
コード例 #2
0
 public function login()
 {
     $this->title = "Login";
     $this->requireCss('main');
     $msg = null;
     if (isset($_POST['email']) && $_POST['password']) {
         $response = ApiClient_HasOffers_Request::Execute('Authentication', 'findUserByCredentials', array('type' => 'affiliate_user', 'email' => $_POST['email'], 'password' => $_POST['password']));
         if ($response->isSuccess()) {
             $auth = $response->getValue();
             $response = ApiClient_HasOffers_Request::Execute('AffiliateUser', 'findById', array('id' => $auth['user_id']));
             $user = $response->getValue();
             Session::write('User', $user['AffiliateUser']);
             Session::write('hasAuth', true);
             header('location: /index');
             die;
         } else {
             $msg = "Invalid email / password.";
         }
     }
     $this->display($this->getTpl('login', array('msg' => $msg)));
 }