/** * **/ public function authorize_action() { global $user, $auth; $auth->login_if($user->id == 'nobody'); $user_id = OAuthUser::getMappedId($user->id); // Fetch the oauth store and the oauth server. $store = OAuthStore::instance(); $server = new OAuthServer(); try { // Check if there is a valid request token in the current request // Returns an array with the consumer key, consumer secret, token, token secret and token type. $rs = $server->authorizeVerify(); if (isset($_POST['allow'])) { // See if the user clicked the 'allow' submit button (or whatever you choose) $authorized = array_key_exists('allow', $_POST); // Set the request token to be authorized or not authorized // When there was a oauth_callback then this will redirect to the consumer $server->authorizeFinish($authorized, $user_id); // No oauth_callback, show the user the result of the authorization // ** your code here ** PageLayout::postMessage(Messagebox::success(_('Sie haben der Applikation Zugriff auf Ihre Daten gewährt.'))); $this->redirect('user#' . $rs['consumer_key']); } } catch (OAuthException $e) { // No token to be verified in the request, show a page where the user can enter the token to be verified // **your code here** die('invalid'); } PageLayout::disableHeader(); $this->set_layout($GLOBALS['template_factory']->open('layouts/base_without_infobox')); $this->rs = $rs; }