Skip to content

Instantly share code, notes, and snippets.

@somatonic
Created June 8, 2015 08:11
Show Gist options
  • Save somatonic/06499aeb20e613c4cf0e to your computer and use it in GitHub Desktop.
Save somatonic/06499aeb20e613c4cf0e to your computer and use it in GitHub Desktop.
processwire login
/**
* Custom login
* ==============================================================================
*/
wire()->addHookBefore("ProcessLogin::execute", function($event){
if(wire("user")->isLoggedin() && wire("input")->get("login")) {
wire("session")->redirect("/");
}
});
try {
$loginForm = $modules->ProcessLogin->execute();
if(!$user->isLoggedin()) $sidebar .= $loginForm;
} catch(WireException $e){
$error = $e->getMessage();
$sidebar .= $error;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment