Plugin Directory

Changeset 1765673


Ignore:
Timestamp:
11/14/2017 06:42:10 AM (8 years ago)
Author:
unloqer
Message:

2.1.15

  • Fixed setup bug with sites that do not have a name, to use a default site name
  • The Multi-site SSO feature now auto-registers users that are not in the system, when the registration setting is enabled
Location:
unloq/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • unloq/trunk/autoloader/admin/class-admin.php

    r1751092 r1765673  
    697697                'body' => json_encode(array(
    698698                    'url' => get_bloginfo('url'),
    699                     'application_name' => get_bloginfo('name'),
     699                    'application_name' => get_bloginfo('name') || 'WP Site',
    700700                    'site_email' => $c_user->user_email,
    701701                    'unloq_email' => $email,
     
    754754            'body' => json_encode(array(
    755755                'url' => get_bloginfo('url'),
    756                 'application_name' => get_bloginfo('name'),
     756                'application_name' => get_bloginfo('name') || 'WP Site',
    757757                'site_email' => $c_user->user_email,
    758758                'unloq_email' => $email,
     
    846846
    847847        $errors = false;
    848         $application_name = $this->utility->rgar($_POST, 'application_name');
     848        $application_name = $this->utility->rgar($_POST, 'application_name') || 'WP Site';
    849849        $push_message = $this->utility->rgar($_POST, 'push_message');
    850850        $authentication_message = $this->utility->rgar($_POST, 'authentication_message');
     
    855855            ),
    856856            'body' => json_encode(array(
    857                 'application_name' => $application_name,
     857                'application_name' => $application_name || 'WP Site',
    858858                'push_message' => $push_message,
    859859                'authentication_message' => $authentication_message
     
    868868            } else {
    869869                $store_data = $this->utility->wp_option('update', 'unloq_settings', array_merge($this->settings, array(
    870                     'application_name' => $application_name,
     870                    'application_name' => $application_name || 'WP Site',
    871871                    'push_message' => $push_message,
    872872                    'authentication_message' => $authentication_message
  • unloq/trunk/autoloader/login/class-login.php

    r1744417 r1765673  
    480480            return $this->start_session($user);
    481481        }
    482         if($userData['authentication_type'] !== 'unloq_only' && $method === 'EMAIL') {
     482        if ($userData['authentication_type'] !== 'unloq_only' && $method === 'EMAIL') {
    483483            return wp_send_json(array(
    484484                'errors' => 'Authentication method not supported'
     
    986986        $uq_email = $this->utility->rgars($body, 'result/email');
    987987        $user = get_user_by('email', $uq_email);
    988         if (!isset($user) || !$user) {
    989             return __('User does not exist', 'unloq');
     988        // Check if WP registration is enabled. If so, we will create the user.
     989        if (isset($user) && $user) {
     990            $this->start_session($user, false);
     991            return true;
     992        }
     993        // Check if the WP site has registration active.
     994        if (!get_option('users_can_register')) {
     995            return __('Registration is currently disabled.', 'unloq');
     996        }
     997        $username = str_replace("@", ".", $uq_email);
     998        $username = str_replace("_", ".", $username);
     999        $exists = username_exists($username);
     1000        if ($exists) {
     1001            $username .= rand(1000, 9999);
     1002        }
     1003        // We have to generate a 64-random char password.
     1004        $userPass = wp_generate_password(32, false);
     1005        $newUser = new stdClass();
     1006        $newUser->user_email = $uq_email;
     1007        $newUser->user_login = $username;
     1008        $newUser->user_pass = $userPass;
     1009        $firstName = $this->utility->rgars($body, 'result/first_name');
     1010        $lastName = $this->utility->rgars($body, 'result/last_name');
     1011        if (isset($firstName) && $firstName) {
     1012            $newUser->first_name = $firstName;
     1013        }
     1014        if (isset($lastName) && $lastName) {
     1015            $newUser->last_name = $lastName;
     1016        }
     1017        $registered = wp_insert_user($newUser);
     1018        if (is_wp_error($registered)) {
     1019            return __('Could not create new user', 'unloq');
     1020        }
     1021        $user = get_user_by('email', $uq_email);
     1022        if (is_wp_error($user)) {
     1023            return __('Failed to perform registration, could not read user', 'unloq');
    9901024        }
    9911025        $this->start_session($user, false);
  • unloq/trunk/includes/class-activator.php

    r1743724 r1765673  
    6666        $newApiKey = $this->util->get_migration_info($oldApiKey, 'POST', 'credentials/regenerate', array(
    6767            'url' => get_bloginfo('url'),
    68             'application_name' => get_bloginfo('name'),
     68            'application_name' => get_bloginfo('name') || 'WP Site',
    6969            'platform' => 'WORDPRESS'
    7070        ));
  • unloq/trunk/readme.txt

    r1756420 r1765673  
    119119
    120120== Changelog ==
     121= 2.1.15 =
     122* Fixed setup bug with sites that do not have a name, to use a default site name
     123* The Multi-site SSO feature now auto-registers users that are not in the system, when the registration setting is enabled
    121124= 2.1.14 =
    122125* Fixed wp-login.php alias issue
  • unloq/trunk/unloq.php

    r1756420 r1765673  
    33 * Plugin Name:       UNLOQ Authentication
    44 * Description:       Perform UNLOQ.io authentications with the click of a button
    5  * Version:           2.1.14
     5 * Version:           2.1.15
    66 * Author:            UNLOQ.io
    77 * Author URI:        https://unloq.io
     
    1818
    1919define('UQ_PLUGIN', 'unloq');
    20 define('UQ_VERSION', '2.1.14');
     20define('UQ_VERSION', '2.1.15');
    2121define('UQ_VENDORS', plugin_dir_url(__FILE__) . 'vendors');
    2222define('UQ_VENDORS_DIR', plugin_dir_path(__FILE__) . 'vendors');
Note: See TracChangeset for help on using the changeset viewer.