Add computer name input field on oauth authorization page
authorChristian Weiske <cweiske@cweiske.de>
Tue, 14 Oct 2014 16:23:36 +0000 (18:23 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 14 Oct 2014 16:23:36 +0000 (18:23 +0200)
controller/oauthcontroller.php
templates/oauthAuthorize.php

index bc66de4b6c390781f026707ee03998e25d15c789..dfb02c57a7a7661bfe5e46db89956954f8441195 100644 (file)
@@ -132,10 +132,11 @@ class OauthController extends Controller
         $res->setParams(
             array(
                 'oauth_token' => $token->tokenKey,
         $res->setParams(
             array(
                 'oauth_token' => $token->tokenKey,
-                'client'      => $clientTitle,
+                'clientTitle' => $clientTitle,
+                'clientAgent' => $clientAgent,
                 'formaction'  => $this->deps->urlGen->linkToRoute(
                     'grauphel.oauth.confirm'
                 'formaction'  => $this->deps->urlGen->linkToRoute(
                     'grauphel.oauth.confirm'
-                ) . '?client=' . urlencode($clientAgent),
+                ),
             )
         );
         return $res;
             )
         );
         return $res;
@@ -178,8 +179,8 @@ class OauthController extends Controller
         }
 
         $clientAgent = '';
         }
 
         $clientAgent = '';
-        if (isset($_GET['client'])) {
-            $clientAgent = $_GET['client'];
+        if (isset($_POST['client'])) {
+            $clientAgent = $_POST['client'];
         }
 
         //the user is logged in and authorized
         }
 
         //the user is logged in and authorized
index cab58ab6f6a7d3ab0324636c0970aa8de961644b..46a1918dd0903b02ec11a93bc263ad9583bff150 100644 (file)
@@ -4,9 +4,16 @@
  <input type="hidden" value="<?php p($_['oauth_token']); ?>" name="oauth_token" />
  <p class="msg">
   Shall application
  <input type="hidden" value="<?php p($_['oauth_token']); ?>" name="oauth_token" />
  <p class="msg">
   Shall application
-  <strong><?php p($_['client']); ?></strong>
+  <strong><?php p($_['clientTitle']); ?></strong>
   get full access to the notes?
  </p>
   get full access to the notes?
  </p>
+ <p>
+  <label>
+   Application/computer name:
+   <input type="text" name="client" value="<?php p($_['clientAgent']); ?>"/>
+  </label>
+  (e.g. <tt>home pc</tt>)
+ </p>
  <div class="buttons">
   <button type="submit" name="auth" value="ok">Yes, authorize</button>
   <button type="submit" name="auth" value="cancel">No, decline</button>
  <div class="buttons">
   <button type="submit" name="auth" value="ok">Yes, authorize</button>
   <button type="submit" name="auth" value="cancel">No, decline</button>