]> ruin.nu Git - ndwebbie.git/blobdiff - motd.pl
order by last post
[ndwebbie.git] / motd.pl
diff --git a/motd.pl b/motd.pl
index f69a54a4f1da894581db34285a839f6717d2d7c8..b324cc013c3592ed966f8cd4b29fee61930c099c 100644 (file)
--- a/motd.pl
+++ b/motd.pl
 #**************************************************************************/
 
 use strict;
+use warnings FATAL => 'all';
+use ND::Include;
 
 $ND::TEMPLATE->param(TITLE => 'Edit MOTD');
 
 our $BODY;
 our $DBH;
-our $LOG;
 
 die "You don't have access" unless isHC();
 
-if (param('cmd') eq 'change'){
+if (defined param 'cmd' and param('cmd') eq 'change'){
        $DBH->begin_work;
        my $query = $DBH->prepare(q{UPDATE misc SET value= ? WHERE id='MOTD'});
        my $motd = escapeHTML(param('motd'));
        $query->execute($motd);
-       $LOG->execute($ND::UID,"Updated MOTD");
+       log_message $ND::UID,"Updated MOTD";
        $DBH->commit;
        $BODY->param(MOTD => $motd);
 }else{