Plugin Directory

Changeset 2028444


Ignore:
Timestamp:
02/11/2019 11:54:48 AM (7 years ago)
Author:
yotiwordpress
Message:

Fixed login by email when email is not available

Location:
yoti/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • yoti/trunk/YotiHelper.php

    r2027308 r2028444  
    457457        $username = $this->generateUsername($profile);
    458458        $password = $this->generatePassword();
    459         $userProvidedEmail = $profile->getEmailAddress()->getValue();
     459
     460        // Check that email is available and valid.
     461        $userProvidedEmailCanBeUsed = FALSE;
     462        if ($emailAttr = $profile->getEmailAddress()) {
     463            $userProvidedEmail = $emailAttr->getValue();
     464            $userProvidedEmailCanBeUsed = is_email($userProvidedEmail) && !get_user_by('email', $userProvidedEmail);
     465        }
     466
    460467        // If user has provided an email address and it's not in use then use it,
    461468        // otherwise use Yoti generic email
    462         $userProvidedEmailCanBeUsed = is_email($userProvidedEmail) && !get_user_by('email', $userProvidedEmail);
    463469        $email = $userProvidedEmailCanBeUsed ? $userProvidedEmail : $this->generateEmail();
    464470
     
    649655    {
    650656        $wpYotiUid = NULL;
    651         $email = $activityDetails->getProfile()->getEmailAddress()->getValue();
     657        $email = NULL;
     658
     659        if ($emailAttr = $activityDetails->getProfile()->getEmailAddress()) {
     660            $email = $emailAttr->getValue();
     661        }
    652662
    653663        if ($email && !empty($emailConfig)) {
  • yoti/trunk/readme.txt

    r2027334 r2028444  
    66Tested up to: 5.0
    77Requires PHP: 5.6
    8 Stable tag: 1.2.1
     8Stable tag: 1.2.2
    99License: GNU v3
    1010License URI: https://www.gnu.org/licenses/gpl.txt
     
    7575
    7676Here you can find the changes for each version:
     77
     781.2.2
     79
     80Release Date - 11 February 2019
     81
     82* Fixed login by email when email is not available
    7783
    78841.2.1
  • yoti/trunk/yoti.php

    r2027308 r2028444  
    55Plugin URI: https://wordpress.org/plugins/yoti/
    66Description: Let Yoti users quickly register on your site.
    7 Version: 1.2.1
     7Version: 1.2.2
    88Author: Yoti SDK.
    99Author URI: https://yoti.com
Note: See TracChangeset for help on using the changeset viewer.