Thanks pwFoo.
Is there a complete basic working code example anywhere?
This is what I have so far:
<?php
$fu = $modules->get('FrontendUser');
$redirectDestination = htmlentities($_SERVER['REQUEST_URI']);
if ($user->isGuest()) {
$fu->register();
$fu->process($redirectDestination);
echo $fu->render();
echo 'or log in here if you already have an account';
echo $fu->login(null, $redirectDestination); // with default fields
}
if($user->isLoggedin()) {
if (isset($_GET['logout'])) $fu->logout($redirectDestination);
echo "<a href='?logout'>Logout</a>";
}
?>
Login/logout works fine. Registration adds a new user, but the user would never know; I need to figure out how to send him/her an email confirmation, with an activation link maybe (?), log them in automatically, ..., what else?
I also don't want my registration form to ask for a "username"; only real name - firstname, lastname - and email address and then later maybe addition info. I'll probably end up generating a username from the real name in the background, as I've always done in Wordpress.
All these points have probably been discussed somewhere in this long thread, but is there any place where it is all put together into one working example?
The documentation gives the basic functions/usage (?) but not how to put it together, leaving out essential points that may be obvious for regular Processwire users, but not if this is the first PW module you try to implement after years in WP world.
The code snippets/examples then skip ahead to sanitizing and custom fields. I can't find anywhere how to add an activation link email process. Email activation is mentioned here, but mixed in with a lot of other issues. Where should I start?