]> ruin.nu Git - ndwebbie.git/blobdiff - lib/NDWeb/Controller/Root.pm
Use default template when smsconfirm is called accidently
[ndwebbie.git] / lib / NDWeb / Controller / Root.pm
index bc422a6fcd6619b331bb206a45e9951624f6efa8..29a0cbcb1a665a029c2709cbc07d84609eedf465 100644 (file)
@@ -95,6 +95,10 @@ sub smsconfirm : Local {
        my ($self, $c) = @_;
        my $dbh = $c->model;
 
+       $c->stash(template => 'default.tt2');
+
+       return unless $c->req->param('apiMsgId');
+
        my $sms = $dbh->prepare(q{
 UPDATE sms SET status = $2, cost = $3
        ,time = TIMESTAMP WITH TIME ZONE 'epoch' + $4 * INTERVAL '1 second'
@@ -106,7 +110,6 @@ WHERE msgid = $1
                ,$c->req->param('charge')
                ,$c->req->param('timestamp'));
 
-       $c->stash(template => 'default.tt2');
 }