public function view_app() { $this->assertLoggedIn(); try { $app = new OAuthConsumer($this->args('app_id')); if (!$app->isHydrated()) { throw new Exception("This app does not exist."); } if (!User::$me->isAdmin() && $app->get('user_id') != User::$me->id) { throw new Exception("You are not authorized to view this app."); } $this->setTitle("View App - " . $app->getName()); $this->set('app', $app); } catch (Exception $e) { $this->setTitle('View App - Error'); $this->set('megaerror', $e->getMessage()); } }
public function view_app() { $this->assertLoggedIn(); $this->set('area', 'app'); try { $app = new OAuthConsumer($this->args('app_id')); if (!$app->isHydrated()) { throw new Exception("This app does not exist."); } $this->setTitle("View App - " . $app->getName()); $this->set('app', $app); } catch (Exception $e) { $this->setTitle('View App - Error'); $this->set('megaerror', $e->getMessage()); } }