We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Creating a user via a module in PHP

Development and Programming

pauljessup's avatar
pauljessup
6 posts
17 years ago
pauljessup's avatar pauljessup

Is there a class or function I can use to generate a user in EE from a module? So that I could create my own registration?

       
pauljessup's avatar
pauljessup
6 posts
17 years ago
pauljessup's avatar pauljessup

So- could anyone please tell me if this possible? Can I create a user registration for EE via a module? Or do I need to have to add each user manually in the administration panel?

       
Brian M.'s avatar
Brian M.
529 posts
17 years ago
Brian M.'s avatar Brian M.

I don’t see why you couldn’t - just find the tables that are member related, and use the $DB class to add to those tables?

       
lodonnell's avatar
lodonnell
6 posts
17 years ago
lodonnell's avatar lodonnell

There was a recent post: Preferred method of programatically adding new members that you might find helpful. Presumably, you’d be collecting all of the info you’d need from your own form to load the Post array, then you’d call the existing registration code.

Good Luck! I haven’t tried this, but will have to do something like this in the near future to stitch two systems together.

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
17 years ago
Jamie Poitra's avatar Jamie Poitra

Paul,

Yes, that other post points to the correct function for adding members.

Solspace also has a module “User” that allows you to put the registration form (among other things) into normal templates. Though I can’t warrant it in any way since its not a first party module.

Brian,

Your solution would work in most software. However, by default EE creates a hash for each form that will eventually no longer be valid. So users will start getting “You are not authorized to perform that action!” since the form will then be static and won’t get a new hash on each page load like a normal EE form. You can disable the generation of that hash and not require it. But its obviously not generally advisable to do so.

Jamie

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.