added additional params for the activate method, allowing to validate against password if needed.
Showing
1 changed file
with
10 additions
and
1 deletions
| ... | @@ -163,7 +163,7 @@ function register($username, $email, $password, $meta = Array()) { | ... | @@ -163,7 +163,7 @@ function register($username, $email, $password, $meta = Array()) { |
| 163 | * @global $wpdb | 163 | * @global $wpdb |
| 164 | * @see wpmu_activate_signup | 164 | * @see wpmu_activate_signup |
| 165 | */ | 165 | */ |
| 166 | function activate($key) { | 166 | function activate($key, $validate_against_password = false, $pass = '') { |
| 167 | global $wpdb, $current_blog; | 167 | global $wpdb, $current_blog; |
| 168 | $signup = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->signups} WHERE activation_key = %s", $key)); | 168 | $signup = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->signups} WHERE activation_key = %s", $key)); |
| 169 | 169 | ||
| ... | @@ -179,6 +179,15 @@ function activate($key) { | ... | @@ -179,6 +179,15 @@ function activate($key) { |
| 179 | 179 | ||
| 180 | // Do I need to re-sanatize this? | 180 | // Do I need to re-sanatize this? |
| 181 | $meta = unserialize($signup->meta); | 181 | $meta = unserialize($signup->meta); |
| 182 | |||
| 183 | |||
| 184 | if ($validate_against_password) { | ||
| 185 | if ($meta['password'] != $pass) { | ||
| 186 | throw new Exception('Bad password match'); | ||
| 187 | } | ||
| 188 | } | ||
| 189 | |||
| 190 | |||
| 182 | $id = _create_user($signup->user_login, $meta['password'], $signup->user_email); | 191 | $id = _create_user($signup->user_login, $meta['password'], $signup->user_email); |
| 183 | unset($meta['password']); | 192 | unset($meta['password']); |
| 184 | 193 | ... | ... |
-
Please register or sign in to post a comment