Return the GET variables passed from the device, decoding from
base64 if needed.
public getGetVars ( ) : array | ||
return | array | A hash of get variables => values. |
/** * Handle the request. * * @return boolean */ public function handle() { $this->_logger->info(sprintf('[%s] Request being handled for device: %s, Supporting protocol version: %s, Using Horde_ActiveSync v%s', $this->_procid, $this->_device->id, $this->_device->version, Horde_ActiveSync::LIBRARY_VERSION)); $this->_logger->info(sprintf('[%s] GET VARIABLES: %s', $this->_procid, print_r($this->_activeSync->getGetVars(), true))); try { return $this->_handle(); } catch (Exception $e) { $this->_logger->err($e->getMessage()); throw $e; } }
/** * Return the username and password to use for authentication. * * @return array The username in index 0 and password in index 1. */ protected function _getCredentials() { $user = $pass = ''; $serverVars = $this->_server->request->getServerVars(); if (!empty($serverVars['PHP_AUTH_PW'])) { // Standard case, PHP was passed the needed authentication info. $user = $serverVars['PHP_AUTH_USER']; $pass = $serverVars['PHP_AUTH_PW']; } elseif (!empty($serverVars['HTTP_AUTHORIZATION']) || !empty($serverVars['REDIRECT_HTTP_AUTHORIZATION']) || !empty($serverVars['Authorization'])) { $authorization = !empty($serverVars['HTTP_AUTHORIZATION']) ? $serverVars['HTTP_AUTHORIZATION'] : (!empty($serverVars['REDIRECT_HTTP_AUTHORIZATION']) ? $serverVars['REDIRECT_HTTP_AUTHORIZATION'] : $serverVars['Authorization']); $hash = base64_decode(str_replace('Basic ', '', $authorization)); if (strpos($hash, ':') !== false) { list($user, $pass) = explode(':', $hash, 2); } } else { // Might be using X509 certs, so won't have the Auth headers or a // password. $get = $this->_server->getGetVars(); if (!empty($get['User'])) { $user = $get['User']; } } return array($user, $pass); }