rsstootalizer/RSSTootalizer/Website/Logout.pm

34 lines
701 B
Perl
Raw Normal View History

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;
$self->{"template"} = "Logout";
2017-04-22 20:22:55 +00:00
$self->{"content_type"} = "html";
$self->{"params"}->{"currentmode"} = "Logout";
2017-04-22 20:22:55 +00:00
$self->{"set_cookie"} = ("session_id=");
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;