Changeset 10 for dev/common/post.php
- Timestamp:
- 10/16/06 20:59:42 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/post.php
r2 r10 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");1 <?php 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 7 8 $page = new Page( "Post killmail");9 $kb = new Killboard( KB_SITE);8 $page = new Page("Post killmail"); 9 $kb = new Killboard(KB_SITE); 10 10 11 $config = $kb->getConfig(); 12 if ( isset( $_POST['killmail'] ) ) { 11 $config = $kb->getConfig(); 12 if (isset($_POST['killmail'])) 13 { 14 if ($_POST['password'] == $config->getPostPassword() || $page->isAdmin()) 15 { 16 $parser = new Parser($_POST['killmail']); 13 17 14 if ( $_POST['password'] == $config->getPostPassword() ) { 15 $parser = new Parser( $_POST['killmail'] ); 18 $killid = $parser->parse(true); 16 19 17 $killid = $parser->parse( true ); 20 if ($killid == 0 || $killid == -1 || $killid == -2) 21 { 22 if ($killid == 0) 23 $html = "Killmail is malformed."; 24 if ($killid == -1) 25 { 26 $html = "That killmail has already been posted <a href=\"?a=kill_detail&kll_id=" . $parser->dupeid_ . "\">here</a>."; 27 } 28 if ($killid == -2) 29 $html = "You are not authorized to post this killmail."; 30 } 31 else 32 { 33 if ($config->getPostMailto() != "") 34 { 35 $mailer = new PHPMailer(); 36 $kill = new Kill($killid); 18 37 19 if ( $killid == 0 || $killid == -1 || $killid == -2 ) {20 if ( $killid == 0 )21 $html = "Killmail is malformed.";22 if ( $killid == -1 ) {23 $html = "That killmail has already been posted <a href=\"?a=kill_detail&kll_id=".$parser->dupeid_."\">here</a>.";24 } 25 if ( $killid == -2 ) 26 $html = "You are not authorized to post this killmail.";27 }28 else {29 if ( $config->getPostMailto() != "" ) {30 $mailer = new PHPMailer();31 $kill = new Kill( $killid ); 38 $mailer->From = "mailer@eve-killboard.net"; 39 $mailer->FromName = "eve-killboard.net"; 40 $mailer->Subject = "Killmail #" . $killid; 41 $mailer->Host = "localhost"; 42 $mailer->Port = 25; 43 $mailer->Helo = "localhost"; 44 $mailer->Mailer = "smtp"; 45 $mailer->AddReplyTo("no_reply@eve-killboard.net", "No-Reply"); 46 $mailer->Sender = "mailer@eve-killboard.net"; 47 $mailer->Body = $kill->getRawMail(); 48 $mailer->AddAddress($config->getPostMailto()); 49 $mailer->Send(); 50 } 32 51 33 $mailer->From = "mailer@eve-killboard.net"; 34 $mailer->FromName = "eve-killboard.net"; 35 $mailer->Subject = "Killmail #".$killid; 36 $mailer->Host = "localhost"; 37 $mailer->Port = 25; 38 $mailer->Helo = "localhost"; 39 $mailer->Mailer = "smtp"; 40 $mailer->AddReplyTo( "no_reply@eve-killboard.net", "No-Reply" ); 41 $mailer->Sender = "mailer@eve-killboard.net"; 42 $mailer->Body = $kill->getRawMail(); 43 $mailer->AddAddress( $config->getPostMailto() ); 44 $mailer->Send(); 52 $qry = new DBQuery(); 53 $qry->execute("insert into kb3_log 54 values( " . $killid . ", '" . KB_SITE . "', 55 '" . $_SERVER['REMOTE_ADDR'] . "', 56 now() )"); 57 58 header("Location: ?a=kill_detail&kll_id=" . $killid); 59 exit; 45 60 } 46 47 $qry = new DBQuery();48 $qry->execute( "insert into kb3_log49 values( ".$killid.", '".KB_SITE."',50 '".$_SERVER['REMOTE_ADDR']."',51 now() )" );52 53 Header( "Location: ?a=kill_detail&kll_id=".$killid );54 exit;55 }56 61 } 57 else { 58 $html = "Invalid password."; 62 else 63 { 64 $html = "Invalid password."; 59 65 } 60 } 61 else { 66 } 67 else 68 { 62 69 $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."; 63 70 $html .= "<br><br>Remember to post your losses as well.<br><br>"; … … 65 72 $html .= "<form id=postform name=postform class=f_killmail method=post action=\"?a=post\">"; 66 73 $html .= "<textarea name=killmail id=killmail class=f_killmail cols=\"70\" rows=\"24\"></textarea>"; 67 $html .= "<br><br><b>Password:</b><br><input id=password name=password type=password></input>"; 74 if (!$page->isAdmin()) 75 { 76 $html .= "<br><br><b>Password:</b><br><input id=password name=password type=password></input>"; 77 } 68 78 $html .= " <input id=submit name=submit type=submit value=\"Process !\"></input>"; 69 79 $html .= "</form>"; 80 } 70 81 71 } 72 73 $page->setContent( $html ); 74 $page->generate(); 82 $page->setContent($html); 83 $page->generate(); 75 84 ?>