Skip to content

Instantly share code, notes, and snippets.

@somatonic
Created June 8, 2015 08:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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