Ejemplo n.º 1
0
 /**
  * Выполнение входа
  * @return <type>
  */
 private function login()
 {
     $postUrl = $this->server . '/accounts/ClientLogin';
     $postVars = array('accountType' => $this->accountType, 'Email' => $this->email, 'Passwd' => $this->password, 'service' => $this->service, 'source' => $this->source, 'logintoken' => $this->captchaToken, 'logincaptcha' => $this->captchaResponse);
     $curl = new CurlWrapper();
     try {
         $response = $curl->post($postUrl, $postVars);
         $httpCode = $curl->httpCode();
         if ($httpCode != 200 && $httpCode != 403) {
             throw new AuthTokenException($httpCode);
         }
     } catch (CurlWrapperException $exc) {
         throw new AuthTokenException($exc->getMessage());
     }
     return $response;
 }
Ejemplo n.º 2
0
 protected function setRequestOptions($url, $vars)
 {
     parent::setRequestOptions($url, $vars);
     curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($this->ch, CURLOPT_SSLCERT, $this->options['local_cert']);
 }