| @@ -94,8 +94,11 @@ | ||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | update_user_option($user_id, 'default_password_nag', true, true); // This will show alert to user to change the password. |
| 97 | 97 | $user = get_user_by('ID', $user_id); |
| 98 | + | |
| 99 | + // Following the default WordPress registration flow, we will notify user about the creation of new account. | |
| 100 | + do_action('register_new_user', $user_id); | |
| 98 | 101 | |
| 99 | 102 | // Save avatar if possible. |
| 100 | 103 | $tried_to_download = get_user_meta($user->ID, 'loginizer_avatar_download', true); |
| 101 | 104 | if(!empty($data['photoURL']) && !empty($loginizer['social_settings']['general']['save_avatar']) && empty($tried_to_download)){ |
| @@ -121,8 +124,9 @@ | ||
| 121 | 124 | protected static function close_tab(){ |
| 122 | 125 | global $loginizer; |
| 123 | 126 | |
| 124 | 127 | // Check if the URL is safe to use. |
| 128 | + $redirect_to = ''; | |
| 125 | 129 | if(!empty(self::$ref)){ |
| 126 | 130 | $redirect_to = self::handle_redirect(self::$ref); |
| 127 | 131 | } |
| 128 | 132 | |
| @@ -288,11 +292,10 @@ | ||
| 288 | 292 | } |
| 289 | 293 | |
| 290 | 294 | protected static function handle_redirect($url){ |
| 291 | 295 | |
| 292 | - $redirect = ''; | |
| 293 | 296 | if(empty($url)){ |
| 294 | - return $redirect; | |
| 297 | + return ''; | |
| 295 | 298 | } |
| 296 | 299 | |
| 297 | 300 | $url = rawurldecode($url); |
| 298 | 301 | $parsed_url = parse_url($url); |
| @@ -307,13 +310,9 @@ | ||
| 307 | 310 | } |
| 308 | 311 | |
| 309 | 312 | // Reloading the page wont show the admin page so we need to redirect it to the admin page. |
| 310 | 313 | if($parsed_url['scheme'].'://'.$parsed_url['host'] . $parsed_url['path'] == wp_login_url()){ |
| 311 | - return $redirect; | |
| 312 | - } | |
| 313 | - | |
| 314 | - if(strpos(wp_login_url(), $parsed_url['path']) !== FALSE){ | |
| 315 | - return $redirect; | |
| 314 | + return admin_url(); | |
| 316 | 315 | } |
| 317 | 316 | |
| 318 | 317 | // If none of the above happens then we will just make the page reload. |
| 319 | 318 | return $url; |