fix docblocks
[grauphel.git] / controller / guicontroller.php
index f3fce6b64d05e7a167d80b4966e50073f4a0415a..8e260bc0a269795a414bcc2b1e310a3a9912b0c4 100644 (file)
@@ -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;
@@ -48,11 +48,16 @@ class GuiController extends Controller
     /**
      * Main page /
      *
+     * Tomdroid wants this to be a public page. Sync fails otherwise.
+     *
      * @NoAdminRequired
      * @NoCSRFRequired
+     * @PublicPage
      */
     public function index()
     {
+        $this->checkDeps();
+
         $res = new TemplateResponse('grauphel', 'index');
         $res->setParams(
             array(
@@ -64,7 +69,13 @@ class GuiController extends Controller
             )
         );
         return $res;
+    }
 
+    protected function checkDeps()
+    {
+        if (!class_exists('OAuthProvider')) {
+            throw new \Exception('PHP extension "oauth" is required');
+        }
     }
 }
 ?>