From: Alexander Ebert Date: Sun, 23 Jun 2013 19:30:07 +0000 (+0200) Subject: Skip authentication for 3rd party login if email address is untouched X-Git-Tag: 2.0.0_Beta_4~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f1639575b52f1b40e0ce0a9ed909bd7db5cf9a1e;p=GitHub%2FWoltLab%2FWCF.git Skip authentication for 3rd party login if email address is untouched --- diff --git a/wcfsetup/install/files/lib/form/RegisterForm.class.php b/wcfsetup/install/files/lib/form/RegisterForm.class.php index 29645cb40d..3c74e982bd 100644 --- a/wcfsetup/install/files/lib/form/RegisterForm.class.php +++ b/wcfsetup/install/files/lib/form/RegisterForm.class.php @@ -303,7 +303,9 @@ class RegisterForm extends UserAddForm { WCF::getSession()->unregister('__githubData'); WCF::getSession()->unregister('__githubToken'); - $registerVia3rdParty = true; + if (WCF::getSession()->getVar('__email') && WCF::getSession()->getVar('__email') == $this->email) { + $registerVia3rdParty = true; + } if (isset($githubData['bio'])) $saveOptions[User::getUserOptionID('aboutMe')] = $githubData['bio']; if (isset($githubData['location'])) $saveOptions[User::getUserOptionID('location')] = $githubData['location']; @@ -316,8 +318,6 @@ class RegisterForm extends UserAddForm { WCF::getSession()->unregister('__twitterData'); - $registerVia3rdParty = true; - if (isset($twitterData['description'])) $saveOptions[User::getUserOptionID('aboutMe')] = $twitterData['description']; if (isset($twitterData['location'])) $saveOptions[User::getUserOptionID('location')] = $twitterData['location']; } @@ -329,7 +329,9 @@ class RegisterForm extends UserAddForm { WCF::getSession()->unregister('__facebookData'); - $registerVia3rdParty = true; + if ($facebookData['email'] == $this->email) { + $registerVia3rdParty = true; + } $saveOptions[User::getUserOptionID('gender')] = ($facebookData['gender'] == 'male' ? UserProfile::GENDER_MALE : UserProfile::GENDER_FEMALE); @@ -360,7 +362,9 @@ class RegisterForm extends UserAddForm { WCF::getSession()->unregister('__googleData'); - $registerVia3rdParty = true; + if (isset($googleData['email']) && $googleData['email'] == $this->email) { + $registerVia3rdParty = true; + } switch ($googleData['gender']) { case 'male':