aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-10-14 18:23:36 +0200
committerChristian Weiske <cweiske@cweiske.de>2014-10-14 18:23:36 +0200
commit2cb2fae10d986db73bb0ad517df8c5334cab713c (patch)
tree570f0e30ee9b249d677264f01e4482749ea4ee54
parent62340c61f3ab49aa405c549b43e2cd910ab4d834 (diff)
downloadgrauphel-2cb2fae10d986db73bb0ad517df8c5334cab713c.tar.gz
grauphel-2cb2fae10d986db73bb0ad517df8c5334cab713c.zip
Add computer name input field on oauth authorization page
-rw-r--r--controller/oauthcontroller.php9
-rw-r--r--templates/oauthAuthorize.php9
2 files changed, 13 insertions, 5 deletions
diff --git a/controller/oauthcontroller.php b/controller/oauthcontroller.php
index bc66de4..dfb02c5 100644
--- a/controller/oauthcontroller.php
+++ b/controller/oauthcontroller.php
@@ -132,10 +132,11 @@ class OauthController extends Controller
$res->setParams(
array(
'oauth_token' => $token->tokenKey,
- 'client' => $clientTitle,
+ 'clientTitle' => $clientTitle,
+ 'clientAgent' => $clientAgent,
'formaction' => $this->deps->urlGen->linkToRoute(
'grauphel.oauth.confirm'
- ) . '?client=' . urlencode($clientAgent),
+ ),
)
);
return $res;
@@ -178,8 +179,8 @@ class OauthController extends Controller
}
$clientAgent = '';
- if (isset($_GET['client'])) {
- $clientAgent = $_GET['client'];
+ if (isset($_POST['client'])) {
+ $clientAgent = $_POST['client'];
}
//the user is logged in and authorized
diff --git a/templates/oauthAuthorize.php b/templates/oauthAuthorize.php
index cab58ab..46a1918 100644
--- a/templates/oauthAuthorize.php
+++ b/templates/oauthAuthorize.php
@@ -4,9 +4,16 @@
<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>
+ <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>