Show client name in oauth authorization (works for tomdroid only)
[grauphel.git] / controller / guicontroller.php
index 1a4d0233cdeb002726b3c391037a29c3585bda7f..3c9c6f1f2a99b5d18d3a430dfbe33beceeaa20a1 100644 (file)
@@ -15,6 +15,7 @@ namespace OCA\Grauphel\Controller;
 
 use \OCP\AppFramework\Controller;
 use \OCP\AppFramework\Http\TemplateResponse;
+use \OCA\Grauphel\Lib\TokenStorage;
 
 /**
  * Owncloud frontend
@@ -93,6 +94,28 @@ class GuiController extends Controller
         return $res;
     }
 
+    /**
+     * Show access tokens
+     *
+     * @NoAdminRequired
+     * @NoCSRFRequired
+     */
+    public function tokens()
+    {
+        $tokens = new TokenStorage();
+        $res = new TemplateResponse('grauphel', 'tokens');
+        $res->setParams(
+            array(
+                'tokens' => $tokens->loadForUser(
+                    $this->user->getUid(), 'access'
+                )
+            )
+        );
+        $this->addNavigation($res, $rawtag);
+
+        return $res;
+    }
+
     protected function addNavigation(TemplateResponse $res, $selectedRawtag = null)
     {
         $nav = new \OCP\Template('grauphel', 'appnavigation', '');