So, how complex is it?
It’s around 15 different steps or screens.
Fifteen.
I’ve done it a dozen times, and I think that’s about right.
I’m learning the Slim PHP framework, and needed to do the auth parts. There is some existing middleware to do auth, and even one that uses a db backend (but it brings in ZF2… so I’m not inclined to use it). There doesn’t seem to be a canned solution with all the screens and emailer.
I turned to Django, which has a good user reg system that has password changing and resetting. It’s extended by the django-registration-redux package, which adds email activation.
Here’s a snippet of some work in progress. It’s not functional or even correct, but just look at the URLs:
$app->get('/login', 'RegControllersMain::login' )->name('reg/login'); $app->get('/logout', 'RegControllersMain::logout' ); $app->get('/password/change', 'RegControllersPassword::change'); $app->get('/password/change/done', 'RegControllersPassword::done' ); $app->get('/password/reset', 'RegControllersReset::reset' ); $app->get('/password/reset/:key', 'RegControllersReset::reset' ); $app->get('/password/reset/complete', 'RegControllersReset::complete' ); $app->get('/password/reset/done', 'RegControllersReset::done' ); $app->get('/activate/:key', 'RegControllersReset::done' ); $app->get('/activate/complete', 'RegControllersReset::done' ); $app->get('/register', 'RegControllersReset::done' ); $app->get('/register/complete', 'RegControllersReset::done' ); $app->get('/register/closed', 'RegControllersReset::done' );
Yes, that looks about right.
It’s going to take a couple days to write this.
I’ll use Twig now. This way, I can reuse the Django templates I’ve copied and adapted recently.
I’ll bring in PHPMailer, which is nice.