]> ruin.nu Git - ndwebbie.git/blobdiff - lib/NDWeb/Controller/Root.pm
Bugfix, redirect to https version after login
[ndwebbie.git] / lib / NDWeb / Controller / Root.pm
index 3eaaf0d009b254d61892ddc9c8b84eb7de0839d5..d337a297ead91a306a7f7acda5a4b138a106b08d 100644 (file)
@@ -60,7 +60,9 @@ sub login : Local {
                $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:/;
+               $c->res->redirect($ref);
                return;
        }
 }
@@ -123,6 +125,11 @@ sub auto : Private {
 
        $c->stash(dbh => $dbh);
 
+       $c->stash(sslurl => sub {
+                       $_[0]->scheme('https') unless $c->debug;
+                       return $_[0];
+               });
+
        $dbh->do(q{SET timezone = 'GMT'});
 
        $c->stash(TICK =>$dbh->selectrow_array('SELECT tick()',undef));