Im wanting to build a a Login / register / forgot password form / page using ATK4. Can you point me to any documentation or a tutorial on this.
开发者_运维百科Thank You
Documentation
You can see the steps to allow a login using basicauth with agiletoolkit on another question i answered on stackoverflow and on agiletoolkit and there is some documentation on the agiletoolkit tutorial pages
The documentation for sending emails using Tmail.php is also on the agiletoolkit blog
Manual Way
The login form itself doesnt exist as a page but is defined inside /atk4/lib/BasicAuth.php
To change this to use the database, you can use SqlAuth instead of BasicAuth which then stores the users information and passwords in the database.
In versions before 4.0.3 there was another class called atk4/lib/DBAuth.php which had the following in the header comment
- Improved version of BasicAuth.
- Login/password retrieved from DB table
- Functionality of password recovery and new user registration is included.
and there was an lib/Auth directory containing the following php files
Form.php PasswordRecovery.php SignupProcessor.php
The Form.php seems to just create a login page the same as the one in BasicAuth and the passwordRecovery has logic to send an email / provide a link for the user with a timeout to reset their password.
I also need to build registration/forgot password functionality including emailing the user with a one time key to confirm the email address but not at that point yet so cant provide the code to do it.
My approach will be to copy BasicAuth to my webhome/lib directory, modify the login page that is created in BasicAuth to add links for forgot password and register ( I did wonder is there a reason why login is not a real page but is generated on the fly @romans ?). Then create a separte registration page containing an MVCForm of table "user" to store the details and create a couple of templates to send using atk4/lib/TMail.php.
精彩评论