diff options
-rw-r--r-- | lib/private/Accounts/AccountManager.php | 12 | ||||
-rw-r--r-- | settings/css/settings.css | 2 | ||||
-rw-r--r-- | settings/js/personal.js | 11 | ||||
-rw-r--r-- | settings/templates/personal.php | 38 |
4 files changed, 35 insertions, 28 deletions
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 @@ <label for="email"><?php p($l->t('Email')); ?></label> <span class="icon-password"/> </h2> - <span class="verify" id="verify-email"><?php + <span class="verify"> + <img id="verify-email" <?php switch($_['emailVerification']) { case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: - p('verification in progress'); + print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="Verifying..."'); break; case \OC\Accounts\AccountManager::VERIFIED: - p('verified'); + print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '" title="Verified"'); break; default: - p('click to verify'); + print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="Verify"'); } - ?> - </span> + ?>> + </span> <input type="email" name="email" id="email" value="<?php p($_['email']); ?>" <?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> placeholder="<?php p($l->t('Your email address')); ?>" @@ -176,19 +177,19 @@ <label for="website"><?php p($l->t('Website')); ?></label> <span class="icon-password"/> </h2> - <span class="verify" id="verify-website"> - <?php + <span class="verify"> + <img id="verify-website" <?php switch($_['websiteVerification']) { case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: - p('verification in progress'); + print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="Verifying..."'); break; case \OC\Accounts\AccountManager::VERIFIED: - p('verified'); + print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '" title="Verified"'); break; default: - p('click to verify'); + print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="Verify" class="verify-action"'); } - ?> + ?>> </span> <input type="text" name="website" id="website" value="<?php p($_['website']); ?>" placeholder="<?php p($l->t('Your website')); ?>" @@ -203,20 +204,19 @@ <label for="twitter"><?php p($l->t('Twitter')); ?></label> <span class="icon-password"/> </h2> - <span class="verify" id="verify-twitter"> - <?php + <span class="verify"> + <img id="verify-twitter" <?php switch($_['twitterVerification']) { case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: - p('verification in progress'); + print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="Verifying..."'); break; case \OC\Accounts\AccountManager::VERIFIED: - p('verified'); + print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '" title="Verified"'); break; default: - p('click to verify'); + print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="Verify" class="verify-action"'); } - ?> - </span> + ?>> <input type="text" name="twitter" id="twitter" value="<?php p($_['twitter']); ?>" placeholder="<?php p($l->t('Your Twitter handle')); ?>" autocomplete="on" autocapitalize="none" autocorrect="off" /> |