X-Git-Url: https://git.cweiske.de/grauphel.git/blobdiff_plain/9150b1d1f25a5f278ed44e4d3afe32de5ef8ccc3..07c432f5552f975cfe19846bbd499ed5a7d8d7d6:/controller/guicontroller.php diff --git a/controller/guicontroller.php b/controller/guicontroller.php index e3753d7..8e260bc 100644 --- a/controller/guicontroller.php +++ b/controller/guicontroller.php @@ -29,13 +29,13 @@ use \OCP\AppFramework\Http\TemplateResponse; */ class GuiController extends Controller { - /** - * constructor of the controller + /** + * constructor of the controller * - * @param string $appName Name of the app - * @param IRequest $request Instance of the request - */ - public function __construct($appName, \OCP\IRequest $request, $user, $urlGen) + * @param string $appName Name of the app + * @param IRequest $request Instance of the request + */ + public function __construct($appName, \OCP\IRequest $request, $user, $urlGen) { parent::__construct($appName, $request); $this->user = $user; @@ -56,6 +56,8 @@ class GuiController extends Controller */ public function index() { + $this->checkDeps(); + $res = new TemplateResponse('grauphel', 'index'); $res->setParams( array( @@ -67,7 +69,13 @@ class GuiController extends Controller ) ); return $res; + } + protected function checkDeps() + { + if (!class_exists('OAuthProvider')) { + throw new \Exception('PHP extension "oauth" is required'); + } } } ?>