]> ruin.nu Git - ndwebbie.git/blobdiff - addintel.pl
better intel messages subjects
[ndwebbie.git] / addintel.pl
index fe21d0412b66dfd44aad8d39ef55c0cb8bead29f..b3d5aed99abfdd588fb142a33180f39011792982 100644 (file)
@@ -25,6 +25,7 @@ $ND::TEMPLATE->param(TITLE => 'Add Intel and Scans');
 
 our $BODY;
 our $DBH;
+our $ERROR;
 my $error;
 
 die "You don't have access" unless isMember();
@@ -63,7 +64,14 @@ if (defined param('cmd')){
        }
        if (param('cmd') eq 'submit_message'){
                my $board = {id => 12};
-               if (my $thread = addForumThread $DBH,$board,$ND::UID,param('subject')){
+               my $subject = param('subject');
+               unless ($subject){
+                       if (param('intel') =~ /(.*\w.*)/){
+                               $subject = $1;
+                       }
+                       
+               }
+               if (my $thread = addForumThread $DBH,$board,$ND::UID,$subject){
                        $error .= p 'Intel message added' if addForumPost $DBH,$thread,$ND::UID,param('intel')
                }
        }