问题
I have installed the cakeDC Users plugin and extend/override users controller and model as they described in to the Readme. Seems everything working.
But, I want to modify the registration form and plugin to add fields - first_name, company etc. and enable user account activation by admin user.
So, my question is, how do I
- add custom fields in to the registration form
- disable email verification
- disable activating user account by default
I am new to cakePHP and there is not so much documentation for cakeDC as well.
Can anyone help please? Thanks in advance!
回答1:
I'm not going to do your work here and writing all the code for you but let me give you a few directions:
1) Just copy the register view to /app/View/Plugin/Users/register.ctp (or whatever the view file is called) and add the field there following the same pattern for the UserDetail fields. The user details are just a key value store. And were also already removed in the develop branch because peoply usually favor a dedicate profiles table or something similar over the hard to work with key-value store.
2) Did you even spent 5 minutes looking at the code? Extend the UsersController and overload the method and change either the argument to false or overload the whole email sending method and simply don't add any code to it.
3) Simple OOP again - extend the class, overload the method, alter the behaviour of the code.
Another solution is to simply fork the plugin and alter the code directly and keep your changes in a separate branch you can update with the changes from the plugins origin repo.
Alternatively you could simply hire the CakeDC to integrate it. ;)
来源:https://stackoverflow.com/questions/18848943/cakedc-users-plugin-how-to-add-details-fieldi-e-first-name-company-in-to