sub index : Local Path Args(0) {
my ( $self, $c ) = @_;
+
+ $c->res->redirect($c->uri_for('/wiki'));
}
sub default : Path {
my ( $self, $c ) = @_;
- $c->res->body( 'Page not found' );
$c->response->status(404);
}
$log->execute($c->user->id,$c->req->address
,$country,$c->sessionid,$remember);
- $c->res->redirect($c->req->referer);
+ my $ref = $c->req->referer;
+ $ref =~ s/^http:/https:/ unless $c->debug;
+ $c->res->redirect($ref);
return;
}
}
$c->stash(alliances => \@alliances);
}
+sub sslurl {
+ return $_[0];
+}
+
sub auto : Private {
my ($self, $c) = @_;
my $dbh = $c ->model;
$c->stash(dbh => $dbh);
+ $c->stash(sslurl => \&sslurl);
+
$dbh->do(q{SET timezone = 'GMT'});
$c->stash(TICK =>$dbh->selectrow_array('SELECT tick()',undef));
$fleetupdate = 0 unless defined $fleetupdate;
}
- my ($unread,$newposts) = $dbh->selectrow_array(unread_query,undef,$c->user->id) or die $dbh->errstr;
+ my ($unread,$newposts) = $dbh->selectrow_array(q{SELECT * FROM unread_posts($1)}
+ ,undef,$c->user->id);
$c->stash(user => {
id => $c->user->id,
|| $c->check_user_roles(qw/no_fleet_update/)))),
$c->forward('listTargets');
}
+ if ($c->res->status == 200){
+ my $birthdays = $dbh->prepare(q{SELECT username
+ ,date_part('year',age(birthday)) AS age
+ FROM users WHERE birthday IS NOT NULL
+ AND mmdd(birthday) = mmdd(CURRENT_DATE)
+ });
+ $birthdays->execute;
+ $c->stash(birthdays => $birthdays->fetchall_arrayref({}));
+ }
}
=head1 AUTHOR