login($username, $password)) { $config = $auth->getAuthConfig(); header('Location: ' . $redirectUrl); die(); } else { $status = "Login failed"; } } } echo renderTemplate( "login", compact( "status", "redirectUrl" ) ); }