зеркало из https://github.com/mozilla/gecko-dev.git
If a user bookmarks or reloads the logout page, we don't want to show an error.
This commit is contained in:
Родитель
d60df2ea1b
Коммит
469080dad5
|
@ -121,11 +121,14 @@ sub cmdLoginLogout {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my($app) = @_;
|
my($app) = @_;
|
||||||
my $user = $app->getObject('user');
|
my $user = $app->getObject('user');
|
||||||
$self->assert(defined($user), 0, 'Not logged in, cannot log out');
|
if (defined($user)) {
|
||||||
$self->assert($app->getSelectingServiceList('user.logout.'.$app->input->defaultOutputProtocol)->logoutUser($app, $user) or
|
$self->assert($app->getSelectingServiceList('user.logout.'.$app->input->defaultOutputProtocol)->logoutUser($app, $user) or
|
||||||
$app->getSelectingServiceList('user.logout.generic')->logoutUser($app, $user),
|
$app->getSelectingServiceList('user.logout.generic')->logoutUser($app, $user),
|
||||||
0, 'Logging out when using the '.($app->input->defaultOutputProtocol).' protocol is not supported');
|
0, 'Logging out when using the '.($app->input->defaultOutputProtocol).' protocol is not supported');
|
||||||
$app->removeObject($user);
|
$app->removeObject($user);
|
||||||
|
} else {
|
||||||
|
$self->warn(4, 'tried to log out but was not logged in');
|
||||||
|
}
|
||||||
$app->noCommand();
|
$app->noCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче