Skip to content
Snippets Groups Projects
Unverified Commit 06265fe7 authored by Bjoern Schiessle's avatar Bjoern Schiessle Committed by Morris Jobke
Browse files

make use of verification buttons

parent 2a07ec8e
No related branches found
No related tags found
No related merge requests found
...@@ -196,15 +196,21 @@ class AccountManager { ...@@ -196,15 +196,21 @@ class AccountManager {
// keep old verification status if we don't have a new one // keep old verification status if we don't have a new one
if(!isset($newData[self::PROPERTY_TWITTER]['verified'])) { 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'])) { 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'])) { 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 // reset verification status if a value from a previously verified data was changed
......
...@@ -144,7 +144,7 @@ input#openid, input#webdav { width:20em; } ...@@ -144,7 +144,7 @@ input#openid, input#webdav { width:20em; }
padding-top: 10px; padding-top: 10px;
} }
#personal-settings-container .verify:hover { #personal-settings-container .verify-action {
cursor: pointer; cursor: pointer;
} }
......
...@@ -208,15 +208,16 @@ $(document).ready(function () { ...@@ -208,15 +208,16 @@ $(document).ready(function () {
dialog.style.display = "block"; dialog.style.display = "block";
}; };
$(".verify").click(function () { $(".verify-action").click(function () {
var account = $(this).attr('id'); var account = $(this);
var accountId = $(this).attr('id');
// Add: make call to get content for verify dialog
$.ajax( $.ajax(
OC.generateUrl('/settings/users/{account}/verify', {account: account}), OC.generateUrl('/settings/users/{account}/verify', {account: accountId}),
{method: 'GET'} {method: 'GET'}
).done(function(data) { ).done(function(data) {
account.attr('title', 'Verifying...');
account.attr('src', OC.imagePath('core', 'actions/verifying.svg'));
showVerifyDialog(data.msg, data.code); showVerifyDialog(data.msg, data.code);
}); });
......
...@@ -111,19 +111,20 @@ ...@@ -111,19 +111,20 @@
<label for="email"><?php p($l->t('Email')); ?></label> <label for="email"><?php p($l->t('Email')); ?></label>
<span class="icon-password"/> <span class="icon-password"/>
</h2> </h2>
<span class="verify" id="verify-email"><?php <span class="verify">
<img id="verify-email" <?php
switch($_['emailVerification']) { switch($_['emailVerification']) {
case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
p('verification in progress'); print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="Verifying..."');
break; break;
case \OC\Accounts\AccountManager::VERIFIED: case \OC\Accounts\AccountManager::VERIFIED:
p('verified'); print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '" title="Verified"');
break; break;
default: 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']); ?>" <input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> <?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
placeholder="<?php p($l->t('Your email address')); ?>" placeholder="<?php p($l->t('Your email address')); ?>"
...@@ -176,19 +177,19 @@ ...@@ -176,19 +177,19 @@
<label for="website"><?php p($l->t('Website')); ?></label> <label for="website"><?php p($l->t('Website')); ?></label>
<span class="icon-password"/> <span class="icon-password"/>
</h2> </h2>
<span class="verify" id="verify-website"> <span class="verify">
<?php <img id="verify-website" <?php
switch($_['websiteVerification']) { switch($_['websiteVerification']) {
case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
p('verification in progress'); print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="Verifying..."');
break; break;
case \OC\Accounts\AccountManager::VERIFIED: case \OC\Accounts\AccountManager::VERIFIED:
p('verified'); print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '" title="Verified"');
break; break;
default: default:
p('click to verify'); print_unescaped('src="' . image_path('core', 'actions/verify.svg') . '" title="Verify" class="verify-action"');
} }
?> ?>>
</span> </span>
<input type="text" name="website" id="website" value="<?php p($_['website']); ?>" <input type="text" name="website" id="website" value="<?php p($_['website']); ?>"
placeholder="<?php p($l->t('Your website')); ?>" placeholder="<?php p($l->t('Your website')); ?>"
...@@ -203,20 +204,19 @@ ...@@ -203,20 +204,19 @@
<label for="twitter"><?php p($l->t('Twitter')); ?></label> <label for="twitter"><?php p($l->t('Twitter')); ?></label>
<span class="icon-password"/> <span class="icon-password"/>
</h2> </h2>
<span class="verify" id="verify-twitter"> <span class="verify">
<?php <img id="verify-twitter" <?php
switch($_['twitterVerification']) { switch($_['twitterVerification']) {
case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
p('verification in progress'); print_unescaped('src="' . image_path('core', 'actions/verifying.svg') . '" title="Verifying..."');
break; break;
case \OC\Accounts\AccountManager::VERIFIED: case \OC\Accounts\AccountManager::VERIFIED:
p('verified'); print_unescaped('src="' . image_path('core', 'actions/verified.svg') . '" title="Verified"');
break; break;
default: 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']); ?>" <input type="text" name="twitter" id="twitter" value="<?php p($_['twitter']); ?>"
placeholder="<?php p($l->t('Your Twitter handle')); ?>" placeholder="<?php p($l->t('Your Twitter handle')); ?>"
autocomplete="on" autocapitalize="none" autocorrect="off" /> autocomplete="on" autocapitalize="none" autocorrect="off" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment