[buddypress-dev] help

Ramakrishna Dommaraju sruthikrishna at yahoo.com
Sat Nov 29 17:27:23 GMT 2008




--- On Mon, 11/8/08, buddypress-dev-request at lists.automattic.com <buddypress-dev-request at lists.automattic.com> wrote:

> From: buddypress-dev-request at lists.automattic.com <buddypress-dev-request at lists.automattic.com>
> Subject: buddypress-dev Digest, Vol 5, Issue 6
> To: buddypress-dev at lists.automattic.com
> Date: Monday, 11 August, 2008, 5:30 PM
> Send buddypress-dev mailing list submissions to
> 	buddypress-dev at lists.automattic.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.automattic.com/mailman/listinfo/buddypress-dev
> or, via email, send a message with subject or body
> 'help' to
> 	buddypress-dev-request at lists.automattic.com
> 
> You can reach the person managing the list at
> 	buddypress-dev-owner at lists.automattic.com
> 
> When replying, please edit your Subject line so it is more
> specific
> than "Re: Contents of buddypress-dev digest..."
> 
> 
> Today's Topics:
> 
>    1. changing your user password via BuddyPress (David J.
> Bisset)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sun, 10 Aug 2008 16:08:00 -0400
> From: "David J. Bisset"
> <dbisset at dimensionmedia.com>
> Subject: [buddypress-dev] changing your user password via
> BuddyPress
> To: buddypress-dev at lists.automattic.com
> Message-ID:
> <20080810160800.j7hohjsio0ssw8sk at www.dimensionmedia.com>
> Content-Type:
> text/plain;	charset=ISO-8859-1;	DelSp="Yes";
> 	format="flowed"
> 
> Hey all,
> 
> I was looking for a way to change your user login password
> WITHOUT  
> going into wp-admin backend in the spirit of the BuddyPress
> template.
> 
> This is a ROUGH way of doing it (editing the core) but it
> seems to  
> work. If anyone has suggestions for how to make this work
> without  
> editting the core i'm all ears. Or maybe this can be a
> future addition.
> 
> What i did was simply create a profile group
> "advanced" with a textbox  
> "desired password". Then I edited bp-xprofile.php
> around line 300  
> after the IF statement (if($post_field_string != null)).
> 
> if ($group->id == 2 and $group->fields[$j]->id ==
> 24) { // this is the  
> password-update box, located in the advanced(2) group
> 									$ID = (int) $userdata->ID;
> 
> 									// First, get all of the original fields
> 									$user = get_userdata($ID);
> 
> 									// Escape data pulled from DB.
> 									$user = add_magic_quotes(get_object_vars($user));
> 
> 									// If password is changing, hash it now.
> 									if ( ! empty($profile_data->value) ) {
> 										$plaintext_pass = $profile_data->value;
> 										$userdata->user_pass =
> wp_hash_password($profile_data->value);
> 									}
> 
> 									// Merge old and new fields with new fields
> overwriting old ones.
> 									$userdata = array_merge($user, $userdata);
> 									$user_id = wp_insert_user($userdata);
> 							}
> 
> The reason why i'm not using wp's own function
> (wp_update_user) to  
> change the data (which is where this code is actually being
> pulled) is  
> because the wp_update_user attempts to clear/reset cookies
> and that  
> causes header redirect errors because this is being doing
> in the  
> middle of rendering the BuddyPress template page.
> 
> Like I said, this is rough but so far works. There are
> better ways and  
> i'm open to hearing them.
> 
> -- 
> David Bisset
> Director of Web Development
> Dimension Media, Inc.
> www.dimensionmedia.com
> http://www.linkedin.com/in/davidbisset
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> buddypress-dev mailing list
> buddypress-dev at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/buddypress-dev
> 
> 
> End of buddypress-dev Digest, Vol 5, Issue 6
> ********************************************


      Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/



More information about the buddypress-dev mailing list