Membership Plugin :: Create User

6 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: April 2, 2015   (RSS)

Hi I am ditching my wordpress site but I do not want existing people to have to re-register, so when they login I snaffle the WP data and now want to create their cmsb user record, doesn't seem to be an easy way to do this, also I would like to create the user based on a template for section access. I sthis hidden somewhere ;-)

yes I am going totally cmsb for sanity sake.

Cheers,
Larry

---



Peace and Long Life

yeah .. suffering a d'oh from writing the code to access the wp stuff and return a cut down array of the values.

There are 1's & 0's all over the place ;-)

---



Peace and Long Life

By jenolan - April 1, 2015 - edited: April 1, 2015

ok I am a bit further with this .. I have the access to wordpress login available in my process, but I have an issue (yeah only one sure) you are using a password method and a check if already done lookup isPasswordDigest($password) and getPasswordDigest($password, $forceEncode = false) which is not compatible with what Wordpress has built using the generic password hasher library from http://www.openwall.com/phpass/ that's not the issue the problem is that there is no method to override the password functions without hacking (which I don't like doing it make upgrading hell later).

OK so the Wordpress way would be to put

if( ! function_exists( 'getPasswordDigest' ) )
{
    // add standard code here
}

Then I can add my own definition before the code is loaded and shazzam I can run any scheme I like ;-) able to do that for me please?

Thanks,
Larry

PS: Sorry need to include custom.php if it exists in init.php to allow the injection

---



Peace and Long Life

By Dave - April 2, 2015

Hi Larry, 

Are you able to use this plugin filter from /lib/login_functions.php?

// Plugin filters
list($isValidLogin, $user, $updateLastLogin) = applyFilters('login_isValidLogin', array($isValidLogin, $user, $updateLastLogin));

You might be able to just bypass everything.  I could add plugin hooks to the two password functions, but I'm not sure we're not going to change those in the near future.

Let me know if the above will work for you.  Cheers!

Dave Edis - Senior Developer
interactivetools.com

By jenolan - April 2, 2015

In that the $user is not set if the password didn't match in the preceeding code... As mentioned by email some of the code needs work ;-)

---



Peace and Long Life