protected function authenticate()
 {
     if (!isset($_GET['code'])) {
         return false;
     }
     require_once 'include/externalAPI/Google/ExtAPIGoogle.php';
     $api = new ExtAPIGoogle();
     return $api->authenticate($_GET['code']);
 }
Exemplo n.º 2
0
 private function revokeAccess($application)
 {
     if ($application == 'Google') {
         require_once 'include/externalAPI/Google/ExtAPIGoogle.php';
         $api = new ExtAPIGoogle();
         return $api->revokeToken();
     }
     return false;
 }
Exemplo n.º 3
0
 /** {@inheritdoc} */
 protected function action_delete()
 {
     if ($this->bean->application == 'Google') {
         require_once 'include/externalAPI/Google/ExtAPIGoogle.php';
         $api = new ExtAPIGoogle();
         $api->revokeToken();
     } else {
         parent::action_delete();
     }
 }
Exemplo n.º 4
0
 protected function getExternalApis()
 {
     $apis = ExternalAPIFactory::listAPI('Import', true);
     foreach ($apis as $name => $_) {
         if ($name == 'Google') {
             require_once 'include/externalAPI/Google/ExtAPIGoogle.php';
             $api = new ExtAPIGoogle();
             $client = $api->getClient();
             $loginUrl = $client->createAuthUrl();
         } else {
             $loginUrl = 'index.php?' . http_build_query(array('module' => 'EAPM', 'action' => 'EditView', 'application' => $name));
         }
         $apis[$name]['loginUrl'] = $loginUrl;
     }
     return $apis;
 }