diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-27 14:40:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-27 14:40:20 +0300 |
commit | 72a3301ba4449adf87ff9e46b81b62f1dbec20b8 (patch) | |
tree | b35e51b65d69ecaaa7d48de6cff3e760f29b95f4 /settings | |
parent | 5e2a9dac14c5d4bd56fde1ede3ff4868b12d0ee9 (diff) | |
parent | 213d7119f9159d42a3877ed5c2e5a033dfd24979 (diff) |
Merge pull request #25261 from owncloud/app-password-login-name
show which login name to use for the new app password
Diffstat (limited to 'settings')
-rw-r--r-- | settings/Controller/AuthSettingsController.php | 1 | ||||
-rw-r--r-- | settings/css/settings.css | 8 | ||||
-rw-r--r-- | settings/js/authtoken_view.js | 9 | ||||
-rw-r--r-- | settings/templates/personal.php | 12 |
4 files changed, 28 insertions, 2 deletions
diff --git a/settings/Controller/AuthSettingsController.php b/settings/Controller/AuthSettingsController.php index fba663b034d..db2db6e5bfc 100644 --- a/settings/Controller/AuthSettingsController.php +++ b/settings/Controller/AuthSettingsController.php @@ -118,6 +118,7 @@ class AuthSettingsController extends Controller { return [ 'token' => $token, + 'loginName' => $loginName, 'deviceToken' => $deviceToken ]; } diff --git a/settings/css/settings.css b/settings/css/settings.css index 3bb88b46283..3951aa898cf 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -131,11 +131,19 @@ table.nostyle td { padding: 0.2em 0; } opacity: 0.6; } +#new-app-login-name, #new-app-password { width: 186px; font-family: monospace; background-color: lightyellow; } +.app-password-row { + display: table-row; +} +.app-password-label { + display: table-cell; + padding-right: 1em; +} /* USERS */ #newgroup-init a span { margin-left: 20px; } diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js index 8fc23bd490e..01fc1b2ea34 100644 --- a/settings/js/authtoken_view.js +++ b/settings/js/authtoken_view.js @@ -107,6 +107,8 @@ _result: undefined, + _newAppLoginName: undefined, + _newAppPassword: undefined, _hideAppPasswordBtn: undefined, @@ -136,6 +138,8 @@ this._addAppPasswordBtn.click(_.bind(this._addAppPassword, this)); this._result = $('#app-password-result'); + this._newAppLoginName = $('#new-app-login-name'); + this._newAppLoginName.on('focus', _.bind(this._onNewTokenLoginNameFocus, this)); this._newAppPassword = $('#new-app-password'); this._newAppPassword.on('focus', _.bind(this._onNewTokenFocus, this)); this._hideAppPasswordBtn = $('#app-password-hide'); @@ -181,6 +185,7 @@ $.when(creatingToken).done(function(resp) { _this.collection.add(resp.deviceToken); _this.render(); + _this._newAppLoginName.val(resp.loginName); _this._newAppPassword.val(resp.token); _this._toggleFormResult(false); _this._newAppPassword.select(); @@ -194,6 +199,10 @@ }); }, + _onNewTokenLoginNameFocus: function() { + this._newAppLoginName.select(); + }, + _onNewTokenFocus: function() { this._newAppPassword.select(); }, diff --git a/settings/templates/personal.php b/settings/templates/personal.php index e93155f0f39..5056aad4c10 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -203,8 +203,16 @@ if($_['passwordChangeSupported']) { <button id="add-app-password" class="button"><?php p($l->t('Create new app password')); ?></button> </div> <div id="app-password-result" class="hidden"> - <input id="new-app-password" type="text" readonly="readonly"/> - <button id="app-password-hide" class="button"><?php p($l->t('Done')); ?></button> + <span><?php p($l->t('Use the credentials below to configure your app or device.')); ?></span> + <div class="app-password-row"> + <span class="app-password-label"><?php p($l->t('Username')); ?></span> + <input id="new-app-login-name" type="text" readonly="readonly"/> + </div> + <div class="app-password-row"> + <span class="app-password-label"><?php p($l->t('Password')); ?></span> + <input id="new-app-password" type="text" readonly="readonly"/> + <button id="app-password-hide" class="button"><?php p($l->t('Done')); ?></button> + </div> </div> </div> |