root/dev/common/post_igb.php @ 29

Revision 29, 3.0 KB (checked in by andrewgunn, 14 years ago)

Fixed: post_igb.php was an un-merged diff file.

RevLine 
[23]1<?
2  require_once( "class.page.php" );
3  require_once( "class.killboard.php" );
4  require_once( "class.parser.php" );
5  require_once( "class.phpmailer.php" );
6  require_once( "class.kill.php" );
7
8  $kb = new Killboard( KB_SITE );
9
10  $html = "<html><head><title>".KB_TITLE." Killboard - Post Mail"."</title></head></html><body>";
11
12  $config = $kb->getConfig();
13
14  if ( isset( $_POST['killmail'] ) ) {
15
16    if ( $_POST['password'] == $config->getPostPassword() ) {
17      $parser = new Parser( $_POST['killmail'] );
18
19      $killid = $parser->parse( true );
20
21      if ( $killid == 0 || $killid == -1 || $killid == -2 || $killid == -3) {
22        if ( $killid == 0 )
23          $html = "Killmail is malformed.";
24        if ( $killid == -1 )
25          $html = "That killmail has already been posted.";
26        if ( $killid == -2 )
27          $html = "You are not authorized to post this killmail.";
28           
29        if ($killid == -3) {
30        $filterdate = date("j F Y",$config->getConfig("filter_date"));
31          $html = "You are not allowed to post killmails older than $filterdate.";
32        }
33
34        $html .= "<br><br><a href=\"?a=post_igb\">Try again</a>";
35      }
36      else {
37        if ( $config->getPostMailTo() != "" ) {
38          $mailer = new PHPMailer();
39          $kill = new Kill( $killid );
40
41          $mailer->From = "mailer@eve-killboard.net";
42          $mailer->FromName = "eve-killboard.net";
43          $mailer->Subject = "Killmail #".$killid;
44          $mailer->Host = "localhost";
45          $mailer->Port = 25;
46          $mailer->Helo = "localhost";
47          $mailer->Mailer = "smtp";
48          $mailer->AddReplyTo( "no_reply@eve-killboard.net", "No-Reply" );
49          $mailer->Sender = "mailer@eve-killboard.net";
50          $mailer->Body = $kill->getRawMail();
51          $mailer->AddAddress( $config->getPostMailto() );
52          $mailer->Send();
53        }
54
55        $qry = new DBQuery();
56        $qry->execute( "insert into kb3_log
57                               values( ".$killid.", '".KB_SITE."',
58                                       '".$_SERVER['REMOTE_ADDR']."',
59                                       now() )" );
60
61        $html .= "Killmail posted successfully.<br><br>";
62        $html .= "<a href=\"?a=post_igb\">Post another killmail</a>";
63      }
64    }
65    else {
66      $html .= "Invalid password.";
67      $html .= "<br><br><a href=\"?a=post_igb\">Try again</a>";
68    }
69  }
70  else {
71    $html .= "Paste the killmail from your EVEMail inbox into the box below. Make sure you post the <b>ENTIRE</b> mail.<br>Posting fake or otherwise edited mails is not allowed. All posts are logged.";
72    $html .= "<br><br>Remember to post your losses as well.<br><br>";
73    $html .= "<b>Killmail:</b><br>";
74    $html .= "<form name=postform method=\"post\" action=\"?a=post_igb\">";
75    $html .= "<textarea name=killmail id=killmail cols=\"70\" rows=\"24\"></textarea>";
76    $html .= "<br><br><b>Password:</b><br><input name=\"password\" type=\"password\">";
77    $html .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id=submit name=\"submit\" type=\"submit\" value=\"Process !\">";
78    $html .= "</form>";
79
80  }
81
82  $html .= "</body></html>";
83
84  echo $html;
85?>
[24]86>>>>>>> .r23
Note: See TracBrowser for help on using the browser.