This should be everything except for Kolab related issues, as I'm not comfortable
touching Kolab code.
// Load FB
$context = array('http_client' => new Horde_Http_Client(),
- 'http_request' => new Horde_Controller_Request_Http());
+ 'http_request' => $GLOBALS['injector']->getInstance('Horde_Controller_Request'));
$facebook = new Horde_Service_Facebook($conf['facebook']['key'],
$conf['facebook']['secret'],
$context);
}
$context = array('http_client' => new Horde_Http_Client(),
- 'http_request' => new Horde_Controller_Request_Http());
+ 'http_request' => $GLOBALS['injector']->getInstance('Horde_Controller_Request'));
$this->_fb = new Horde_Service_Facebook($conf['facebook']['key'],
$conf['facebook']['secret'],
$this->_fb = new Horde_Service_Facebook($GLOBALS['conf']['facebook']['key'],
$GLOBALS['conf']['facebook']['secret'],
array('http_client' => new Horde_Http_Client(),
- 'http_request' => new Horde_Controller_Request_Http()));
+ 'http_request' => $GLOBALS['injector']->getInstance('Horde_Controller_Request')));
// Set Auth user
$this->_fb->auth->setUser($this->_fbp['uid'], $this->_fbp['sid'], 0);
}
$state = $this->_driver->getStateObject();
if (!empty($devId) && !$state->deviceExists($devId, $this->_driver->getUser())) {
- $get = $this->_request->getGetParams();
+ $get = $this->_request->getGetVars();
$device = new StdClass();
$device->userAgent = $this->_request->getHeader('User-Agent');
$device->deviceType = !empty($get['DeviceType']) ? $get['DeviceType'] : '';
$decoder = new Horde_ActiveSync_Wbxml_Decoder(fopen('php://input', 'r'),
Horde_ActiveSync::$zpushdtd);
- $request = new Horde_Controller_Request_Http();
+ $request = $injector->getInstance('Horde_Controller_Request');
$server = new Horde_ActiveSync($driver, $state, $decoder, $encoder, $request);
}
/* Create the Consumer */
$auth = new Horde_Service_Twitter_Auth_Oauth(new Horde_Oauth_Consumer($params));
- $request = new Horde_Service_Twitter_Request_Oauth(new Horde_Controller_Request_Http());
+ $request = new Horde_Service_Twitter_Request_Oauth($injector->getInstance('Horde_Controller_Request'));
$twitter = new Horde_Service_Twitter($auth, $request);
//$twitter->setCache($injector->getInstance('Horde_Cache'));
// @TODO: inject this
$auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getAuth();
-
- if ($this->_request->getServer('PHP_AUTH_USER')) {
- $user = $this->_request->getServer('PHP_AUTH_USER');
- $pass = $this->_request->getServer('PHP_AUTH_PW');
- } elseif ($this->_request->getServer('Authorization')) {
- $hash = str_replace('Basic ', '', $this->_request->getServer('Authorization'));
+ $serverVars = $this->_request->getServerVars();
+ if ($serverVars['PHP_AUTH_USER']) {
+ $user = $serverVars['PHP_AUTH_USER'];
+ $pass = $serverVars['PHP_AUTH_PW'];
+ } elseif ($serverVars['Authorization']) {
+ $hash = str_replace('Basic ', '', $serverVars['Authorization']);
$hash = base64_decode($hash);
if (strpos($hash, ':') !== false) {
list($user, $pass) = explode(':', $hash, 2);
* @param array $config A hash containing any additional configuration or
* connection parameters this class might need.
*/
- public function __construct($request, $params = array())
+ public function __construct(Horde_Controller_Request_Http $request, $params = array())
{
parent::__construct($request, $params);
/* Check for requirements */
- $this->_get = $request->getGetParams();
+ $this->_get = $request->getGetVars();
if ($request->getMethod() == 'POST' &&
(empty($this->_get['Cmd']) || empty($this->_get['User']) || empty($this->_get['DeviceId']) || empty($this->_get['DeviceType']))) {
public function expireSession()
{
if ($this->_expireSession()) {
- if ($this->_request->getCookie($this->_facebook->apiKey . '_user')) {
+ $cookies = $this->_request->getCookieVars();
+ if ($cookies[$this->_facebook->apiKey . '_user']) {
$cookies = array('user', 'session_key', 'expires', 'ss');
foreach ($cookies as $name) {
setcookie($this->_facebook->apiKey . '_' . $name, false, time() - 3600);
{
// Prefer $_POST data - but if absent, try $_GET and $_POST with
// 'fb_post_sig' since that might be returned by FQL queries.
- $post = $this->_request->getPostParams();
- $get = $this->_request->getGetParams();
+ $post = $this->_request->getPostVars();
+ $get = $this->_request->getGetVars();
// Parse the values
$fb_params = $this->_getParams($post, 48 * 3600, 'fb_sig');
$this->setUser($user, $sessionKey, $expires);
} elseif (!$ignore_cookies &&
- $fb_params = $this->_getParams($this->_request->getCookie(), null, $this->_facebook->apiKey)) {
+ $fb_params = $this->_getParams($this->_request->getCookieVars(), null, $this->_facebook->apiKey)) {
+ $cookies = $this->_reqeust->getCookieVars();
// Nothing yet, try cookies...this is where we will get our values
// for an extenral web app accessing FB's API - assuming the session
// has already been retrieved previously.
$base_domain_cookie = 'base_domain_' . $this->_facebook->apiKey;
- if ($this->_request->getCookie($base_domain_cookie)) {
- $this->_base_domain = $this->_request->getCookie($base_domain_cookie);
+ if ($cookies[$base_domain_cookie]) {
+ $this->_base_domain = $cookie[$base_domain_cookie];
}
// use $api_key . '_' as a prefix for the cookies in case there are
// multiple facebook clients on the same domain.
*/
public function setUser($user, $sessionKey, $expires = null, $noCookie = false)
{
- if (!$noCookie && (!$this->_request->getCookie($this->_facebook->apiKey . '_user') ||
- $this->_request->getCookie($this->_facebook->apiKey . '_user') != $user)) {
+ $cookies = $this->_request->getCookieVars();
+ if (!$noCookie && (!$cookie[$this->_facebook->apiKey . '_user'] ||
+ $cookie[$this->_facebook->apiKey . '_user'] != $user)) {
$this->setCookies($user, $sessionKey, $expires);
}
//@TODO: Verify the existence of requestSecret...
- $params = $request->getGetParams();
+ $params = $request->getGetVars();
if (empty($params['oauth_token'])) {
return false;
}
'session_control' => $session_control
));
-$request = new Horde_Controller_Request_Http(array(
- 'session_control' => $session_control
-));
+$request = $GLOBALS['injector']->getInstance('Horde_Controller_Request);
$params['logger'] = $injector->getInstance('Horde_Log_Logger');
} elseif (!empty($_SESSION['twitter_request_secret'])) {
/* No existing auth token, maybe we are in the process of getting it? */
try {
- $auth_token = $twitter->auth->getAccessToken(new Horde_Controller_Request_Http(), $_SESSION['twitter_request_secret']);
+ $auth_token = $twitter->auth->getAccessToken($GLOBALS['injector']->getInstance('Horde_Controller_Request'), $_SESSION['twitter_request_secret']);
} catch (Horde_Service_Twitter_Exception $e) {
echo '<div class="fberrorbox">' . sprintf(_("Error connecting to Twitter: %s Details have been logged for the administrator."), $e->getMessage()) . '</div>';
echo '</form>';
if (empty($this->_facebook)) {
$context = array('http_client' => new Horde_Http_Client(),
- 'http_request' => new Horde_Controller_Request_Http());
+ 'http_request' => $GLOBALS['injector']->getInstance('Horde_Controller_Request'));
$this->_facebook = new Horde_Service_Facebook($conf['facebook']['key'],
$conf['facebook']['secret'],
$context);