HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to register user programmatically

I need to create another registration page with some additional features in it. Is this possible?

Thanks

Comments

  • KasparKaspar ✭✭

    Not entirely sure what you want to do but check this out

    https://success.vanillaforums.com/kb/articles/300-profile-extender

    rloyola
  • R_JR_J Ex-Fanboy Munich Admin

    If you write a plugin which implements the method "entryController_yourSlug_create($sender, $args)", you would be able to access it under "yourforum.com/entry/yourslug"

    From there it should be quite easy. Take a look at the EntryController->registerBasic() method and you will see what needs to be done. You can also copy the view from applications\dashboard\views\entry\registerbasic.php to your plugin to get a start

    But you should really check if the profile extender isn't an option.

    And if it is not, there might be other things which might make more sense. I personally prefer extending what is already there instead of replacing anything. If you look at the view, you will find the event RegisterFormBeforeTerms gets fired. You can add some of your own fields in there (just like the ProfileExtender does)

    In Vanilla 2.X it was enough to create some rows in the database and if a view contained that new fields, they were automatically saved. Therefore I would try to add what you think needs to be added to the database, hook into the event mentioned before to add a corresponding field to the view and that might be all you need.

    If you have the need to do some extra work, during the registration the events RegisterValidation and RegistrationSuccessful are fired which might be of interest for you.


    rloyola
Sign In or Register to comment.