Beispiel #1
0
 protected function _doCallback($auth_id, $ticket, $target_url, $realm_id_pseudonym)
 {
     if ($this->_callback) {
         $err = '';
         $redirect = QuickBooks_Callbacks::callSAMLCallback($this->_driver, $this->_callback, $auth_id, $ticket, $target_url, $realm_id_pseudonym, $this->_config, $err);
         if ($err) {
             $this->_setError(QuickBooks_IPP_Federator::ERROR_CALLBACK, 'Callback said: ' . $err);
             return false;
         }
     } else {
         // Just set the cookie
         $cookie_expire = (int) $this->_config['cookie_expire'];
         $cookie_path = $this->_config['cookie_path'];
         $cookie_domain = $this->_config['cookie_domain'];
         $cookie_secure = (bool) $this->_config['cookie_secure'];
         $cookie_httponly = (bool) $this->_config['cookie_httponly'];
         //print('setting cookie: ' . print_r($this->_config, true));
         if (QuickBooks_IPP_Federator::setCookie($ticket, $cookie_expire, $cookie_path, $cookie_domain, $cookie_secure, $cookie_httponly)) {
             $redirect = true;
         } else {
             // Cookie failed to set for some reason
             $this->_setError(QuickBooks_IPP_Federator::ERROR_COOKIE, 'Could not set the IPP context cookie (did you make sure *not* to send any output yet?)');
             return false;
         }
     }
     if ($redirect) {
         $this->_doRedirect($target_url);
     }
     return true;
 }