protected function authenticate() { if (!isset($_GET['code'])) { return false; } require_once 'include/externalAPI/Google/ExtAPIGoogle.php'; $api = new ExtAPIGoogle(); return $api->authenticate($_GET['code']); }
private function revokeAccess($application) { if ($application == 'Google') { require_once 'include/externalAPI/Google/ExtAPIGoogle.php'; $api = new ExtAPIGoogle(); return $api->revokeToken(); } return false; }
/** {@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(); } }
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; }