Overhaul signout code
This commit is contained in:
parent
e71295d6d1
commit
11c2a6ecf8
@ -974,8 +974,7 @@ sub _generate_passchange_form {
|
||||
## @method private @ generate_loggedin()
|
||||
# Generate the contents of a page telling the user that they have successfully logged in.
|
||||
#
|
||||
# @return An array of three values: the page title string, the 'logged in' message, and
|
||||
# a meta element to insert into the head element to redirect the user.
|
||||
# @return An array of two values: the page title string, and the 'logged in' message.
|
||||
sub _generate_loggedin {
|
||||
my $self = shift;
|
||||
my $content;
|
||||
@ -1017,9 +1016,7 @@ sub _generate_loggedin {
|
||||
## @method private @ generate_signedout()
|
||||
# Generate the contents of a page telling the user that they have successfully logged out.
|
||||
#
|
||||
# @return An array of three values: the page title string, the 'logged out' message, and
|
||||
# a meta element to insert into the head element to redirect the user.
|
||||
# FIXME: OVERHAUL
|
||||
# @return An array of two values: the page title string, and the 'logged out' message
|
||||
sub _generate_signedout {
|
||||
my $self = shift;
|
||||
|
||||
@ -1029,16 +1026,13 @@ sub _generate_signedout {
|
||||
|
||||
# return the title, content, and extraheader
|
||||
return ("{L_LOGOUT_TITLE}",
|
||||
$self -> message_box("{L_LOGOUT_TITLE}",
|
||||
"security",
|
||||
"{L_LOGOUT_SUMMARY}",
|
||||
$self -> {"template"} -> replace_langvar("LOGOUT_MESSAGE", {"%(url)s" => $url}),
|
||||
undef,
|
||||
"logincore",
|
||||
[ {"message" => "{L_SITE_CONTINUE}",
|
||||
"colour" => "blue",
|
||||
"action" => "location.href='$url'"} ]),
|
||||
$self -> {"template"} -> load_template("refreshmeta.tem", {"%(url)s" => $url}));
|
||||
$self -> message_box(title => "{L_LOGOUT_TITLE}",
|
||||
type => "account",
|
||||
summary => "{L_LOGOUT_SUMMARY}",
|
||||
message => $self -> {"template"} -> replace_langvar("LOGOUT_MESSAGE", {"%(url)s" => $url}),
|
||||
buttons => [ {"message" => "{L_SITE_CONTINUE}",
|
||||
"colour" => "standard",
|
||||
"href" => $url } ]));
|
||||
}
|
||||
|
||||
|
||||
@ -1205,7 +1199,7 @@ sub _build_login_response {
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Interface functions
|
||||
# UI handler/dispatcher functions
|
||||
|
||||
## @method private @ _handle_signup()
|
||||
# Handle the process of showing the user the signup form, and processing any
|
||||
@ -1460,12 +1454,16 @@ sub _handle_default {
|
||||
}
|
||||
|
||||
|
||||
# FIXME: OVERHAUL
|
||||
## @method private @ _handle_signout()
|
||||
# Handle signing the user out of the system.
|
||||
#
|
||||
# @return An array containing the page title, content, extra header data, and
|
||||
# extra javascript content.
|
||||
sub _handle_signout {
|
||||
my $self = shift;
|
||||
|
||||
# User must be logged in to log out
|
||||
return $self -> _generate_not_loggedin()
|
||||
return $self -> generate_errorbox(message => "{L_LOGIN_NOTSIGNEDIN}")
|
||||
if($self -> {"session"} -> anonymous_session());
|
||||
|
||||
# User is logged in, do the signout
|
||||
@ -1473,7 +1471,7 @@ sub _handle_signout {
|
||||
if($self -> {"session"} -> delete_session()) {
|
||||
return $self -> _generate_signedout();
|
||||
} else {
|
||||
return $self -> generate_errorbox($SessionHandler::errstr);
|
||||
return $self -> generate_errorbox(message => $SessionHandler::errstr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1508,8 +1506,8 @@ sub _dispatch_ui {
|
||||
when("passchange") { ($title, $body, $extrahead, $extrajs) = $self -> _handle_passchange(); }
|
||||
|
||||
# default handles signin and redirect, paired with signout to log the user out
|
||||
default { ($title, $body, $extrahead, $extrajs) = $self -> _handle_default(); }
|
||||
when("signout") { ($title, $body, $extrahead, $extrajs) = $self -> _handle_signout(); }
|
||||
default { ($title, $body, $extrahead, $extrajs) = $self -> _handle_default(); }
|
||||
}
|
||||
|
||||
# Done generating the page content, return the filled in page template
|
||||
@ -1521,6 +1519,9 @@ sub _dispatch_ui {
|
||||
}
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Module interface functions
|
||||
|
||||
## @method $ page_display()
|
||||
# Generate the page content for this module.
|
||||
sub page_display {
|
||||
|
@ -17,12 +17,13 @@ PERSIST_WARNING = <strong>WARNING</strong>: do not enable the "Remember me" opti
|
||||
|
||||
LOGIN_DONETITLE = Signed in
|
||||
LOGIN_SUMMARY = You have successfully signed into the system.
|
||||
LOGIN_MESSAGE = You have successfully signed in, and you will be redirected shortly. If you do not want to wait, click continue. Alternatively, <a href="{V_[scriptpath]}">Click here</a> to return to the front page.
|
||||
LOGIN_MESSAGE = You have successfully signed in, click continue or <a href="{V_[scriptpath]}">click here</a> to return to the front page.
|
||||
LOGIN_NOREDIRECT = You have successfully signed in, but warnings were encountered during login. Please check the warning messages, and <a href="mailto:%(supportaddr)s">contact support</a> if a serious problem has been encountered, otherwise, click continue. Alternatively, <a href="{V_[scriptpath]}">Click here</a> to return to the front page.
|
||||
|
||||
LOGOUT_TITLE = Signed out
|
||||
LOGOUT_SUMMARY = You have successfully signed out.
|
||||
LOGOUT_MESSAGE = You have successfully signed out, and you will be redirected shortly. If you do not want to wait, click continue. Alternatively, <a href="{V_[scriptpath]}">Click here</a> to return to the front page.
|
||||
LOGOUT_MESSAGE = You have successfully signed out, click continue or <a href="{V_[scriptpath]}">click here</a> to return to the front page.
|
||||
LOGIN_NOTSIGNEDIN = You do not have a signed-in session active. Unable to sign you out!
|
||||
|
||||
LOGIN_ERR_BADUSERCHAR = Illegal character in username. Usernames may only contain alphanumeric characters, underscores, or hyphens.
|
||||
LOGIN_ERR_INVALID = Login failed: unknown username or password provided.
|
||||
|
Loading…
x
Reference in New Issue
Block a user