GI-229 Modificar drive para que lea la información del archivo json y no del p12

This commit is contained in:
Dante
2016-01-02 12:02:11 -04:00
parent b043a770a5
commit 9d068bfbba
2 changed files with 6 additions and 3 deletions

View File

@@ -227,11 +227,13 @@ class PMGoogleApi
throw new Exception(G::LoadTranslation('ID_GOOGLE_FILE_P12_ERROR')); throw new Exception(G::LoadTranslation('ID_GOOGLE_FILE_P12_ERROR'));
} }
$data = json_decode($key);
$assertionCredentials = new Google_Auth_AssertionCredentials( $assertionCredentials = new Google_Auth_AssertionCredentials(
$this->serviceAccountEmail, $this->serviceAccountEmail,
$this->scope, $this->scope,
$key $data->private_key
); );
$assertionCredentials->sub = $this->user; $assertionCredentials->sub = $this->user;
$client = new Google_Client(); $client = new Google_Client();

View File

@@ -23,7 +23,8 @@ class Authentication
// define options // define options
$optArray = array( $optArray = array(
CURLOPT_URL => $url, CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false
); );
// apply those options // apply those options
curl_setopt_array($ch, $optArray); curl_setopt_array($ch, $optArray);
@@ -33,7 +34,7 @@ class Authentication
// Check if any error occurred // Check if any error occurred
if(curl_errno($ch)) if(curl_errno($ch))
{ {
throw (new \Exception(\G::LoadTranslation( 'ID_TO_URL' ))); throw (new \Exception(curl_error($ch)));
} }
$info = curl_getinfo($ch); $info = curl_getinfo($ch);
curl_close($ch); curl_close($ch);