summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-04-26 10:03:21 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-04-28 23:41:36 -0300
commit06265fe77028c9d04f00e411d1a43bf2718052e4 (patch)
tree754dbe633f5657d8d322fce1da7876dad720b991 /lib
parent2a07ec8e2198985f25641289f0b4d8b2bb76ed28 (diff)
downloadnextcloud-server-06265fe77028c9d04f00e411d1a43bf2718052e4.tar.gz
nextcloud-server-06265fe77028c9d04f00e411d1a43bf2718052e4.zip
make use of verification buttons
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Accounts/AccountManager.php12
1 files changed, 9 insertions, 3 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