Changeset 10901 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php
- Timestamp:
- 04/14/2021 04:49:37 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php
r10900 r10901 63 63 $akismet = Akismet::rest_auto_check_comment( $payload ); 64 64 if ( is_wp_error( $akismet ) ) { 65 return 'OK'; // Assume it's okay in the event of failure / unknown. 66 // return $akismet->get_error_code(); 67 } 68 69 if ( ! empty( $akismet['akismet_pro_tip'] ) ) { 70 return $akismet['akismet_pro_tip']; 65 return $akismet->get_error_code(); 66 } 67 68 if ( ! empty( $akismet['akismet_pro_tip'] ) && 'discard' === $akismet['akismet_pro_tip'] ) { 69 return 'spam'; 71 70 } elseif ( 'true' === $akismet['akismet_result'] ) { 72 71 return 'spam'; … … 74 73 return 'OK'; 75 74 } else { 76 return ' OK'; // Assume it's okay in the event of failure / unknown.75 return 'unknown'; 77 76 } 78 77 } … … 81 80 * Handles creating a "Pending" registration that will later be converted to an actual user account. 82 81 */ 83 function wporg_login_create_pending_user( $user_login, $user_email, $ user_mailinglist = false, $tos_revision = 0) {82 function wporg_login_create_pending_user( $user_login, $user_email, $meta = array() ) { 84 83 global $wpdb, $wp_hasher; 85 84 … … 98 97 $profile_key = wp_generate_password( 24, false, false ); 99 98 $hashed_profile_key = time() . ':' . wp_hash_password( $profile_key ); 100 101 $tos_meta_key = WPOrg_SSO::TOS_USER_META_KEY;102 99 103 100 $pending_user = array( … … 107 104 'user_activation_key' => '', 108 105 'user_profile_key' => $hashed_profile_key, 109 'meta' => array( 110 'user_mailinglist' => $user_mailinglist, 106 'meta' => $meta + array( 111 107 'registration_ip' => $_SERVER['REMOTE_ADDR'], // Spam & fraud control. Will be discarded after the account is created. 112 $tos_meta_key => $tos_revision,113 108 ), 114 109 'scores' => array()
Note: See TracChangeset
for help on using the changeset viewer.