2017-04-22 20:22:55 +00:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use HTML::Template;
|
2017-04-23 18:51:48 +00:00
|
|
|
use RSSTootalizer::Website;
|
2017-04-22 20:22:55 +00:00
|
|
|
|
2017-04-23 18:51:48 +00:00
|
|
|
package RSSTootalizer::Website::Logout;
|
|
|
|
@RSSTootalizer::Website::Logout::ISA = qw(RSSTootalizer::Website);
|
2017-04-22 20:22:55 +00:00
|
|
|
|
|
|
|
sub requires_authentication {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub fill_content {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub prerender {
|
|
|
|
my $self = shift;
|
2017-04-26 06:44:34 +00:00
|
|
|
$self->{"template"} = "Logout";
|
2017-04-22 20:22:55 +00:00
|
|
|
$self->{"content_type"} = "html";
|
2017-04-26 06:44:34 +00:00
|
|
|
$self->{"params"}->{"currentmode"} = "Logout";
|
2017-04-22 20:22:55 +00:00
|
|
|
|
|
|
|
$self->{"set_cookie"} = ("session_id=");
|
2017-04-26 06:44:34 +00:00
|
|
|
my $user = RSSTootalizer::User->authenticate();
|
|
|
|
if ($user){
|
|
|
|
# RSSTootalizer::DB->doUPDATE("UPDATE users SET session_id = 'invalid' WHERE ID = ?", $user->{data}->{ID});
|
|
|
|
$user->{data}->{session_id} = "invalid";
|
|
|
|
$user->save();
|
|
|
|
}
|
2017-04-22 20:22:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|