Пример #1
0
 function check_auth_response($params = array())
 {
     $httpclient = new HTTPRequest($this->check_url);
     // Add Api key to response
     $params['api_key'] = $this->api_key;
     $res = $httpclient->Post($params, true);
     if ($res['http']['code'] == 200 && $res['body'] == $params['verification_code']) {
         return true;
     } else {
         return false;
     }
 }
Пример #2
0
	function Authenticate($username, $password) {
		$params['accountType'] = 'HOSTED_OR_GOOGLE';
		$params['Email'] = $username;
		$params['Passwd'] = $password;
		$params['service'] = 'xapi';
		$params['source'] = 'Zend-ZendFramework';
		$http = new HTTPRequest('https://www.google.com/accounts/ClientLogin');
		$response = $http->Post($params,true);
		$httpdetails = $response['http'];
		$code = $httpdetails['code'];
		if ($code == 200) {
			return true;
		} else {
			return false;
		}
	}