aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Accounts
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-04-21 16:36:52 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-04-28 23:41:36 -0300
commit86701dce7b041f9ef9d5802475c360f3e0a0ca6a (patch)
tree97bc137446a6fb8fc62bf91f9271ef13ce56978c /lib/private/Accounts
parent94df091ee4ba8b9e497bbbb6ecbd189617f9b060 (diff)
downloadnextcloud-server-86701dce7b041f9ef9d5802475c360f3e0a0ca6a.tar.gz
nextcloud-server-86701dce7b041f9ef9d5802475c360f3e0a0ca6a.zip
make sure that we don't lose previous verification status
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib/private/Accounts')
-rw-r--r--lib/private/Accounts/AccountManager.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php
index 91be4be4ab7..0c175795541 100644
--- a/lib/private/Accounts/AccountManager.php
+++ b/lib/private/Accounts/AccountManager.php
@@ -137,10 +137,25 @@ class AccountManager {
*/
protected function updateVerifyStatus($oldData, $newData) {
+ // which account was already verified successfully?
$twitterVerified = isset($oldData[self::PROPERTY_TWITTER]['verified']) && $oldData[self::PROPERTY_TWITTER]['verified'] === self::VERIFIED;
$websiteVerified = isset($oldData[self::PROPERTY_WEBSITE]['verified']) && $oldData[self::PROPERTY_WEBSITE]['verified'] === self::VERIFIED;
$emailVerified = isset($oldData[self::PROPERTY_EMAIL]['verified']) && $oldData[self::PROPERTY_EMAIL]['verified'] === self::VERIFIED;
+ // 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;
+ }
+
+ 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;
+ }
+
+ if(!isset($newData[self::PROPERTY_EMAIL]['verified'])) {
+ $newData[self::PROPERTY_EMAIL]['verified'] = isset($oldData[self::PROPERTY_WEBSITE]['verified']) ? $oldData[self::PROPERTY_EMAIL]['verified'] : self::NOT_VERIFIED;
+ }
+
+ // reset verification status if a value from a previously verified data was changed
if($twitterVerified &&
$oldData[self::PROPERTY_TWITTER]['value'] !== $newData[self::PROPERTY_TWITTER]['value']
) {