If a user bookmarks or reloads the logout page, we don't want to show an error.

This commit is contained in:
ian%hixie.ch 2002-04-21 14:05:15 +00:00
Родитель d60df2ea1b
Коммит 469080dad5
1 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -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();
} }