/** * @throws \Workflow\Exception\PocketException */ public function appAction() { $oauth = UserOauth::find(["user_id = :user_id: and access_token <> ''", 'bind' => ['user_id' => $this->current_user->id]]); $app = []; foreach ($oauth as $item) { $app[$item->app] = 'auth'; } $pushbullet = new Pushbullet(''); $pushbullet->setConfig($this->config); $pock = new Pocket(''); $pock->setConfig($this->config); $request_token = $pock->requestToken(); $this->view->setVar('pushbullet_authorize_uri', $pushbullet->authorizeUrl()); $this->view->setVar('pocket_authorize_uri', $pock->authorizeUrl($request_token)); $this->view->setVar('app', $app); }