Changeset 1833
- Timestamp:
- 12/08/2008 11:49:44 PM (18 years ago)
- File:
-
- 1 edited
-
branches/0.9/profile-edit.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.9/profile-edit.php
r1622 r1833 27 27 $assignable_caps = get_assignable_caps(); 28 28 } 29 $updated = false;30 $user_email = true;31 29 32 30 $errors = new WP_Error; … … 49 47 } 50 48 49 // Find out if we have a valid email address 50 if ( !$user_email = bb_verify_email( $user_email ) ) { 51 $errors->add( 'user_email', __( 'Invalid email address' ), array( 'data' => $_POST['user_email'] ) ); 52 } 53 51 54 if ( bb_current_user_can('edit_users') ) { 52 55 if ( isset($_POST['delete-user']) && $_POST['delete-user'] && $bb_current_id != $user->ID ) { … … 55 58 exit; 56 59 } 57 58 if ( isset($_POST['user_email']) )59 if ( !$user_email = bb_verify_email( $_POST['user_email'] ) )60 $errors->add( 'user_email', __( 'Invalid email address' ), array( 'data' => $_POST['user_email'] ) );61 60 62 61 $user_obj = new BB_User( $user->ID ); … … 96 95 } 97 96 98 $updated = true; 97 if ( !$errors->get_error_codes() ) { 98 if ( bb_current_user_can( 'edit_user', $user->ID ) ) { 99 bb_update_user( $user->ID, $user_email, $user_url ); 99 100 100 if ( $user_email && !$errors->get_error_codes() ) {101 if ( bb_current_user_can( 'edit_user', $user->ID ) ) {102 if ( is_string($user_email) ) {103 bb_update_user( $user->ID, $user_email, $user_url );104 } else {105 bb_update_user( $user->ID, $user->user_email, $user_url );106 }107 101 foreach( $profile_info_keys as $key => $label ) 108 102 if ( strpos($key, 'user_') !== 0 ) … … 138 132 139 133 wp_redirect( add_query_arg( 'updated', 'true', get_user_profile_link( $user->ID ) ) ); 140 exit; 134 exit; 141 135 } 142 136 } 143 137 144 bb_load_template( 'profile-edit.php', array('profile_info_keys', 'profile_admin_keys', 'assignable_caps', 'u pdated', 'user_email', 'bb_roles', 'errors') );138 bb_load_template( 'profile-edit.php', array('profile_info_keys', 'profile_admin_keys', 'assignable_caps', 'user_email', 'bb_roles', 'errors') ); 145 139 146 140 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)