Changeset 1765673
- Timestamp:
- 11/14/2017 06:42:10 AM (8 years ago)
- Location:
- unloq/trunk
- Files:
-
- 5 edited
-
autoloader/admin/class-admin.php (modified) (5 diffs)
-
autoloader/login/class-login.php (modified) (2 diffs)
-
includes/class-activator.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
unloq.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
unloq/trunk/autoloader/admin/class-admin.php
r1751092 r1765673 697 697 'body' => json_encode(array( 698 698 'url' => get_bloginfo('url'), 699 'application_name' => get_bloginfo('name') ,699 'application_name' => get_bloginfo('name') || 'WP Site', 700 700 'site_email' => $c_user->user_email, 701 701 'unloq_email' => $email, … … 754 754 'body' => json_encode(array( 755 755 'url' => get_bloginfo('url'), 756 'application_name' => get_bloginfo('name') ,756 'application_name' => get_bloginfo('name') || 'WP Site', 757 757 'site_email' => $c_user->user_email, 758 758 'unloq_email' => $email, … … 846 846 847 847 $errors = false; 848 $application_name = $this->utility->rgar($_POST, 'application_name') ;848 $application_name = $this->utility->rgar($_POST, 'application_name') || 'WP Site'; 849 849 $push_message = $this->utility->rgar($_POST, 'push_message'); 850 850 $authentication_message = $this->utility->rgar($_POST, 'authentication_message'); … … 855 855 ), 856 856 'body' => json_encode(array( 857 'application_name' => $application_name ,857 'application_name' => $application_name || 'WP Site', 858 858 'push_message' => $push_message, 859 859 'authentication_message' => $authentication_message … … 868 868 } else { 869 869 $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', 871 871 'push_message' => $push_message, 872 872 'authentication_message' => $authentication_message -
unloq/trunk/autoloader/login/class-login.php
r1744417 r1765673 480 480 return $this->start_session($user); 481 481 } 482 if ($userData['authentication_type'] !== 'unloq_only' && $method === 'EMAIL') {482 if ($userData['authentication_type'] !== 'unloq_only' && $method === 'EMAIL') { 483 483 return wp_send_json(array( 484 484 'errors' => 'Authentication method not supported' … … 986 986 $uq_email = $this->utility->rgars($body, 'result/email'); 987 987 $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'); 990 1024 } 991 1025 $this->start_session($user, false); -
unloq/trunk/includes/class-activator.php
r1743724 r1765673 66 66 $newApiKey = $this->util->get_migration_info($oldApiKey, 'POST', 'credentials/regenerate', array( 67 67 'url' => get_bloginfo('url'), 68 'application_name' => get_bloginfo('name') ,68 'application_name' => get_bloginfo('name') || 'WP Site', 69 69 'platform' => 'WORDPRESS' 70 70 )); -
unloq/trunk/readme.txt
r1756420 r1765673 119 119 120 120 == 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 121 124 = 2.1.14 = 122 125 * Fixed wp-login.php alias issue -
unloq/trunk/unloq.php
r1756420 r1765673 3 3 * Plugin Name: UNLOQ Authentication 4 4 * Description: Perform UNLOQ.io authentications with the click of a button 5 * Version: 2.1.1 45 * Version: 2.1.15 6 6 * Author: UNLOQ.io 7 7 * Author URI: https://unloq.io … … 18 18 19 19 define('UQ_PLUGIN', 'unloq'); 20 define('UQ_VERSION', '2.1.1 4');20 define('UQ_VERSION', '2.1.15'); 21 21 define('UQ_VENDORS', plugin_dir_url(__FILE__) . 'vendors'); 22 22 define('UQ_VENDORS_DIR', plugin_dir_path(__FILE__) . 'vendors');
Note: See TracChangeset
for help on using the changeset viewer.