From c9ccdca1ec2f586b8884b41a5319e4a908888df7 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Tue, 14 Mar 2017 16:56:11 +0100 Subject: add verification dialog Signed-off-by: Bjoern Schiessle --- settings/templates/personal.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'settings/templates') diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 24a78b07853..cea03fd1482 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -8,6 +8,18 @@ /** @var \OCP\Defaults $theme */ ?> +
+ + +
+ + How to verify your account details
+ verification code +

It can take up to 24 hours before the account is displayed as verified.

+
+ +
+
    t('Email')); ?> + Verify placeholder="t('Your email address')); ?>" @@ -151,6 +164,7 @@ + Verify @@ -164,6 +178,7 @@ + Verify -- cgit v1.2.3 From 5c202884e9596a47d38f5432b66117bcca373dc6 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 24 Apr 2017 12:20:36 +0200 Subject: pass verified status to template Signed-off-by: Bjoern Schiessle --- settings/personal.php | 4 ++++ settings/templates/personal.php | 44 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 3 deletions(-) (limited to 'settings/templates') diff --git a/settings/personal.php b/settings/personal.php index 6fbe95f9ea7..d81cdd7c2f3 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -185,6 +185,10 @@ $tmpl->assign('websiteScope', $userData[\OC\Accounts\AccountManager::PROPERTY_WE $tmpl->assign('twitterScope', $userData[\OC\Accounts\AccountManager::PROPERTY_TWITTER]['scope']); $tmpl->assign('addressScope', $userData[\OC\Accounts\AccountManager::PROPERTY_ADDRESS]['scope']); +$tmpl->assign('websiteVerification', $userData[\OC\Accounts\AccountManager::PROPERTY_WEBSITE]['verified']); +$tmpl->assign('twitterVerification', $userData[\OC\Accounts\AccountManager::PROPERTY_TWITTER]['verified']); +$tmpl->assign('emailVerification', $userData[\OC\Accounts\AccountManager::PROPERTY_EMAIL]['verified']); + $tmpl->assign('avatarChangeSupported', OC_User::canUserChangeAvatar(OC_User::getUser())); $tmpl->assign('certs', $certificateManager->listCertificates()); $tmpl->assign('showCertificates', $enableCertImport); diff --git a/settings/templates/personal.php b/settings/templates/personal.php index cea03fd1482..fade96f026e 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -111,7 +111,19 @@ - Verify + + placeholder="t('Your email address')); ?>" @@ -164,7 +176,20 @@ - Verify + + + @@ -178,7 +203,20 @@ - Verify + + + -- cgit v1.2.3 From 06265fe77028c9d04f00e411d1a43bf2718052e4 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 26 Apr 2017 10:03:21 +0200 Subject: make use of verification buttons Signed-off-by: Bjoern Schiessle --- lib/private/Accounts/AccountManager.php | 12 ++++++++--- settings/css/settings.css | 2 +- settings/js/personal.js | 11 +++++----- settings/templates/personal.php | 38 ++++++++++++++++----------------- 4 files changed, 35 insertions(+), 28 deletions(-) (limited to 'settings/templates') diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index 3f4b1d9d79a..18c7f90ef54 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -196,15 +196,21 @@ class AccountManager { // keep old verification status if we don't have a new one if(!isset($newData[self::PROPERTY_TWITTER]['verified'])) { - $newData[self::PROPERTY_TWITTER]['verified'] = isset($oldData[self::PROPERTY_TWITTER]['verified']) ? $oldData[self::PROPERTY_TWITTER]['verified'] : self::NOT_VERIFIED; + // keep old verification status if value didn't changed and an old value exists + $keepOldStatus = $newData[self::PROPERTY_TWITTER]['value'] === $oldData[self::PROPERTY_TWITTER]['value'] && isset($oldData[self::PROPERTY_TWITTER]['verified']); + $newData[self::PROPERTY_TWITTER]['verified'] = $keepOldStatus ? $oldData[self::PROPERTY_TWITTER]['verified'] : self::NOT_VERIFIED; } if(!isset($newData[self::PROPERTY_WEBSITE]['verified'])) { - $newData[self::PROPERTY_WEBSITE]['verified'] = isset($oldData[self::PROPERTY_WEBSITE]['verified']) ? $oldData[self::PROPERTY_WEBSITE]['verified'] : self::NOT_VERIFIED; + // keep old verification status if value didn't changed and an old value exists + $keepOldStatus = $newData[self::PROPERTY_WEBSITE]['value'] === $oldData[self::PROPERTY_WEBSITE]['value'] && isset($oldData[self::PROPERTY_WEBSITE]['verified']); + $newData[self::PROPERTY_WEBSITE]['verified'] = $keepOldStatus ? $oldData[self::PROPERTY_WEBSITE]['verified'] : self::NOT_VERIFIED; } if(!isset($newData[self::PROPERTY_EMAIL]['verified'])) { - $newData[self::PROPERTY_EMAIL]['verified'] = isset($oldData[self::PROPERTY_WEBSITE]['verified']) ? $oldData[self::PROPERTY_EMAIL]['verified'] : self::VERIFICATION_IN_PROGRESS; + // keep old verification status if value didn't changed and an old value exists + $keepOldStatus = $newData[self::PROPERTY_EMAIL]['value'] === $oldData[self::PROPERTY_EMAIL]['value'] && isset($oldData[self::PROPERTY_EMAIL]['verified']); + $newData[self::PROPERTY_EMAIL]['verified'] = $keepOldStatus ? $oldData[self::PROPERTY_EMAIL]['verified'] : self::VERIFICATION_IN_PROGRESS; } // reset verification status if a value from a previously verified data was changed diff --git a/settings/css/settings.css b/settings/css/settings.css index 29bcc8a37c3..597b5f4490b 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -144,7 +144,7 @@ input#openid, input#webdav { width:20em; } padding-top: 10px; } -#personal-settings-container .verify:hover { +#personal-settings-container .verify-action { cursor: pointer; } diff --git a/settings/js/personal.js b/settings/js/personal.js index d5b9b7911a0..41051d9e25f 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -208,15 +208,16 @@ $(document).ready(function () { dialog.style.display = "block"; }; - $(".verify").click(function () { - var account = $(this).attr('id'); - - // Add: make call to get content for verify dialog + $(".verify-action").click(function () { + var account = $(this); + var accountId = $(this).attr('id'); $.ajax( - OC.generateUrl('/settings/users/{account}/verify', {account: account}), + OC.generateUrl('/settings/users/{account}/verify', {account: accountId}), {method: 'GET'} ).done(function(data) { + account.attr('title', 'Verifying...'); + account.attr('src', OC.imagePath('core', 'actions/verifying.svg')); showVerifyDialog(data.msg, data.code); }); diff --git a/settings/templates/personal.php b/settings/templates/personal.php index fade96f026e..cc30acfa025 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -111,19 +111,20 @@ - + - + ?>> + placeholder="t('Your email address')); ?>" @@ -176,19 +177,19 @@ - - + + ?>> t('Twitter')); ?> - - + - + ?>> -- cgit v1.2.3 From 08a33cc4751eebc4fc1384187677efac3ac6b1d0 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 26 Apr 2017 13:20:10 +0200 Subject: Fix styling of verification box to popover Signed-off-by: Jan-Christoph Borchardt --- settings/css/settings.css | 39 ++++----------------------------------- settings/js/personal.js | 4 ++-- settings/templates/personal.php | 26 +++++++++++++------------- 3 files changed, 19 insertions(+), 50 deletions(-) (limited to 'settings/templates') diff --git a/settings/css/settings.css b/settings/css/settings.css index 3e5c8d1fcf8..395423c3bce 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -141,10 +141,10 @@ input#openid, input#webdav { width:20em; } #personal-settings-container .verify { float: right; - padding-top: 10px; } #personal-settings-container .verify-action { + padding: 10px; cursor: pointer; } @@ -1030,47 +1030,16 @@ doesnotexist:-o-prefocus, .strengthify-wrapper { /* verify accounts */ #verification-dialog { - display: none; /* Hidden by default */ - position: fixed; /* Stay in place */ - z-index: 1; /* Sit on top */ - left: 0; - top: 0; - width: 100%; /* Full width */ - height: 100%; /* Full height */ - overflow: auto; /* Enable scroll if needed */ - background-color: rgb(0,0,0); /* Fallback color */ - background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ -} - -.verification-dialog-content { - background-color: #fefefe; - margin: 15% auto; /* 15% from the top and centered */ - padding: 20px; - border: 1px solid #888; - width: 60%; /* Could be more or less, depending on screen size */ -} - -#verify-dialog-close { - float: right; - width: 34px; - border: none; - background-color: transparent; - margin: 0 !important; - border-radius: 0; right: 0; - opacity: 0.3; + top: 0; } -#verify-dialog-close:hover { - cursor: pointer; - opacity: 1; +#verification-dialog p { + padding: 10px; } #verification-dialog .verificationCode { font-family: monospace; white-space: nowrap; display: block; - overflow-y: scroll; - padding: 10px; - margin: 20px 20px 20px 0; } diff --git a/settings/js/personal.js b/settings/js/personal.js index ad0ccaec13d..b67211b274a 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -203,8 +203,8 @@ $(document).ready(function () { var showVerifyDialog = function(howToVerify, verificationCode) { var dialog = document.getElementById('verification-dialog'); - $(".verification-dialog-content span.explainVerification").text(howToVerify); - $(".verification-dialog-content span.verificationCode").text(verificationCode); + $(".verification-dialog-content .explainVerification").text(howToVerify); + $(".verification-dialog-content .verificationCode").text(verificationCode); dialog.style.display = "block"; }; diff --git a/settings/templates/personal.php b/settings/templates/personal.php index cc30acfa025..919fd13efe6 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -8,13 +8,12 @@ /** @var \OCP\Defaults $theme */ ?> -
    + placeholder="t('Your email address')); ?>" @@ -177,11 +176,11 @@ - +
    > - +
    @@ -204,11 +203,11 @@ - +
    > +
    -- cgit v1.2.3 From 9a366dbe2e84bad7d6c40f284794aa6f34c2b0f5 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 26 Apr 2017 13:19:15 +0200 Subject: add missing translation and other small fixes Signed-off-by: Bjoern Schiessle --- .../lib/Controller/ShareesAPIController.php | 1 + lib/private/Accounts/AccountManager.php | 2 +- settings/BackgroundJobs/VerifyUserData.php | 36 ++++++++++------------ settings/js/federationsettingsview.js | 4 +-- settings/js/personal.js | 3 +- settings/templates/personal.php | 24 +++++++-------- 6 files changed, 34 insertions(+), 36 deletions(-) (limited to 'settings/templates') diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php index ace413a51a8..7d345efb3eb 100644 --- a/apps/files_sharing/lib/Controller/ShareesAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php @@ -655,6 +655,7 @@ class ShareesAPIController extends OCSController { protected function getLookup($search) { $isEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'no'); $lookupServerUrl = $this->config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com'); + $lookupServerUrl = rtrim($lookupServerUrl, '/'); $result = []; if($isEnabled === 'yes') { diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index 18c7f90ef54..bd23f6289c0 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -284,7 +284,7 @@ class AccountManager { [ 'value' => $user->getDisplayName(), 'scope' => self::VISIBILITY_CONTACTS_ONLY, - 'verified' => '0', + 'verified' => self::NOT_VERIFIED, ], self::PROPERTY_ADDRESS => [ diff --git a/settings/BackgroundJobs/VerifyUserData.php b/settings/BackgroundJobs/VerifyUserData.php index 2ec0ce2ea13..f044c9f31fb 100644 --- a/settings/BackgroundJobs/VerifyUserData.php +++ b/settings/BackgroundJobs/VerifyUserData.php @@ -62,27 +62,25 @@ class VerifyUserData extends Job { /** * VerifyUserData constructor. * - * @param AccountManager|null $accountManager - * @param IUserManager|null $userManager - * @param IClientService|null $clientService - * @param IConfig|null $config + * @param AccountManager $accountManager + * @param IUserManager $userManager + * @param IClientService $clientService + * @param ILogger $logger + * @param IConfig $config */ - public function __construct(AccountManager $accountManager = null, - IUserManager $userManager = null, - IClientService $clientService = null, - ILogger $logger = null, - IConfig $config = null + public function __construct(AccountManager $accountManager, + IUserManager $userManager, + IClientService $clientService, + ILogger $logger, + IConfig $config ) { - $this->accountManager = $accountManager !== null ? $accountManager : \OC::$server->query(AccountManager::class); - $this->userManager = $userManager !== null ? $userManager : \OC::$server->getUserManager(); - $this->httpClientService = $clientService !== null ? $clientService : \OC::$server->getHTTPClientService(); - $this->logger = $logger !== null ? $logger : \OC::$server->getLogger(); - - if ($config !== null) { - $this->lookupServerUrl = $config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com'); - } else { - $this->lookupServerUrl = \OC::$server->getConfig()->getSystemValue('lookup_server', 'https://lookup.nextcloud.com'); - } + $this->accountManager = $accountManager; + $this->userManager = $userManager; + $this->httpClientService = $clientService; + $this->logger = $logger; + + $lookupServerUrl = $config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com'); + $this->lookupServerUrl = rtrim($lookupServerUrl, '/'); } /** diff --git a/settings/js/federationsettingsview.js b/settings/js/federationsettingsview.js index 4a502544e8d..2b41f49b322 100644 --- a/settings/js/federationsettingsview.js +++ b/settings/js/federationsettingsview.js @@ -142,12 +142,12 @@ if (field === 'twitter' || field === 'webpage') { var verifyStatus = this.$('#' + field + 'form > .verify > #verify-' + field); - verifyStatus.attr('title', 'Verify'); + verifyStatus.attr('title', t('core', 'Verify')); verifyStatus.attr('src', OC.imagePath('core', 'actions/verify.svg')); verifyStatus.addClass('verify-action'); } else if (field === 'email') { var verifyStatus = this.$('#' + field + 'form > .verify > #verify-' + field); - verifyStatus.attr('title', 'Verifying...'); + verifyStatus.attr('title', t('core', 'Verifying …')); verifyStatus.attr('src', OC.imagePath('core', 'actions/verifying.svg')); } }, diff --git a/settings/js/personal.js b/settings/js/personal.js index b67211b274a..094fc36ceaf 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -211,13 +211,12 @@ $(document).ready(function () { $(".verify-action").click(function () { var account = $(this); var accountId = $(this).attr('id'); - $.ajax( OC.generateUrl('/settings/users/{account}/verify', {account: accountId}), {method: 'GET'} ).done(function(data) { showVerifyDialog(data.msg, data.code); - account.attr('title', 'Verifying...'); + account.attr('title', t('core', 'Verifying …')); account.attr('src', OC.imagePath('core', 'actions/verifying.svg')); account.removeClass('verify-action'); }); diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 919fd13efe6..1d77bd805b9 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -12,9 +12,9 @@
    -

    How to verify your account details

    -

    Verification code

    -

    It can take up to 24 hours before the account is displayed as verified.

    +

    +

    +

    getL10N('settings')->t('It can take up to 24 hours before the account is displayed as verified.'));?>

    @@ -114,13 +114,13 @@ getL10N()->t('Verified') . '"'); break; default: - print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="Verify"'); + print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '"'); } ?>>
@@ -180,13 +180,13 @@ getL10N()->t('Verified') . '"'); break; default: - print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="Verify" class="verify-action"'); + print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '" class="verify-action"'); } ?>> @@ -207,13 +207,13 @@ getL10N()->t('Verified') . '"'); break; default: - print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="Verify" class="verify-action"'); + print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '" class="verify-action"'); } ?>> -- cgit v1.2.3 From 67057f7e71d5a0aeb493651069a7781329c6c475 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 26 Apr 2017 13:46:19 +0200 Subject: minor style fixes; use verify-action class only for verification-status-icons which are interactive Signed-off-by: Bjoern Schiessle --- settings/css/settings.css | 2 +- settings/templates/personal.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'settings/templates') diff --git a/settings/css/settings.css b/settings/css/settings.css index 395423c3bce..6444aae3c65 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -140,11 +140,11 @@ input#openid, input#webdav { width:20em; } } #personal-settings-container .verify { + padding: 10px; float: right; } #personal-settings-container .verify-action { - padding: 10px; cursor: pointer; } diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 1d77bd805b9..46916478ea4 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -111,7 +111,7 @@
- Date: Wed, 26 Apr 2017 14:14:04 +0200 Subject: Use individual verification popover dialogs instead of one Signed-off-by: Jan-Christoph Borchardt --- settings/css/settings.css | 14 ++++++++------ settings/templates/personal.php | 32 +++++++++++++++++++++----------- 2 files changed, 29 insertions(+), 17 deletions(-) (limited to 'settings/templates') diff --git a/settings/css/settings.css b/settings/css/settings.css index 058126dd73c..d7fad7e946f 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -142,21 +142,23 @@ input#openid, input#webdav { width:20em; } /* verify accounts */ #personal-settings-container .verify { position: relative; - padding: 10px; + padding: 12px 6px; float: right; } #personal-settings-container .verify, #personal-settings-container .verify-action { cursor: pointer; } -#verification-dialog { - right: 0; - top: 0; +.verification-dialog { + display: none; + right: -9px; + top: 40px; + width: 200px; } -#verification-dialog p { +.verification-dialog p { padding: 10px; } -#verification-dialog .verificationCode { +.verification-dialog .verificationCode { font-family: monospace; white-space: nowrap; display: block; diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 46916478ea4..86979acdd2f 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -8,17 +8,6 @@ /** @var \OCP\Defaults $theme */ ?> - -
    getL10N()->t('Verify') . '"'); } ?>> +
@@ -189,6 +185,13 @@ print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '" class="verify-action"'); } ?>> +
> + Date: Wed, 26 Apr 2017 14:25:07 +0200 Subject: email doesn't need a verification dialog, verification mail is send automatically by the lookup server Signed-off-by: Bjoern Schiessle --- settings/templates/personal.php | 7 ------- 1 file changed, 7 deletions(-) (limited to 'settings/templates') diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 86979acdd2f..c5e8845b418 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -112,13 +112,6 @@ print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '"'); } ?>> - -- cgit v1.2.3 From 47985a13fd7eb7fb033cc1134a10d5784541f0f2 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 26 Apr 2017 17:55:41 +0200 Subject: only show verification buttons for public fields and field with some actual value Signed-off-by: Bjoern Schiessle --- settings/templates/personal.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'settings/templates') diff --git a/settings/templates/personal.php b/settings/templates/personal.php index c5e8845b418..3ec93474e9b 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -99,7 +99,7 @@ -
+
t('Website')); ?> -
+
t('Twitter')); ?> -
+
Date: Wed, 26 Apr 2017 18:41:44 +0200 Subject: Improve placeholders for website and Twitter handle Signed-off-by: Jan-Christoph Borchardt --- settings/templates/personal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'settings/templates') diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 3ec93474e9b..597f1c40ba2 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -187,7 +187,7 @@
getL10N()->t('Verified') . '"'); + print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '"'); break; default: - print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="' . \OC::$server->getL10N()->t('Verify') . '" class="verify-action"'); + print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" class="verify-action"'); } + print_unescaped(' title="' . $_['websiteMessage'] . '""'); ?>>