Changeset 29

Show
Ignore:
Timestamp:
10/22/06 04:45:44 (14 years ago)
Author:
andrewgunn
Message:

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

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/post_igb.php

    r24 r29  
    1 <<<<<<< .mine 
    2 <? 
    3   require_once( "class.page.php" ); 
    4   require_once( "class.killboard.php" ); 
    5   require_once( "class.parser.php" ); 
    6   require_once( "class.phpmailer.php" ); 
    7   require_once( "class.kill.php" ); 
    8  
    9   $kb = new Killboard( KB_SITE ); 
    10  
    11   $html = "<html><head><title>".KB_TITLE." Killboard - Post Mail"."</title></head></html><body>"; 
    12  
    13   $config = $kb->getConfig(); 
    14  
    15   if ( isset( $_POST['killmail'] ) ) { 
    16  
    17     if ( $_POST['password'] == $config->getPostPassword() ) { 
    18       $parser = new Parser( $_POST['killmail'] ); 
    19  
    20                 if($config->getConfig("filter_apply") == "1"){ 
    21                         $filterdate = $config->getConfig("filter_date"); 
    22                         $year = substr($_POST['killmail'],0,4); 
    23                         $month = substr($_POST['killmail'],5,2); 
    24                         $day = substr($_POST['killmail'],8,2);           
    25                         $killstamp = mktime(0,0,0,$month,$day,$year); 
    26                         if($killstamp < $filterdate){ 
    27                                 $killid = -3; 
    28                         }else{ 
    29                                 $killid = $parser->parse(true); 
    30                         } 
    31                 }else{ 
    32                         $killid = $parser->parse(true); 
    33                 }       
    34  
    35       if ( $killid == 0 || $killid == -1 || $killid == -2 ) { 
    36         if ( $killid == 0 ) 
    37           $html = "Killmail is malformed."; 
    38         if ( $killid == -1 ) 
    39           $html = "That killmail has already been posted."; 
    40         if ( $killid == -2 ) 
    41           $html = "You are not authorized to post this killmail."; 
    42             
    43         $html .= "<br><br><a href=\"?a=post_igb\">Try again</a>"; 
    44       } 
    45       else { 
    46         if ( $config->getPostMailTo() != "" ) { 
    47           $mailer = new PHPMailer(); 
    48           $kill = new Kill( $killid ); 
    49  
    50           $mailer->From = "mailer@eve-killboard.net"; 
    51           $mailer->FromName = "eve-killboard.net"; 
    52           $mailer->Subject = "Killmail #".$killid; 
    53           $mailer->Host = "localhost"; 
    54           $mailer->Port = 25; 
    55           $mailer->Helo = "localhost"; 
    56           $mailer->Mailer = "smtp"; 
    57           $mailer->AddReplyTo( "no_reply@eve-killboard.net", "No-Reply" ); 
    58           $mailer->Sender = "mailer@eve-killboard.net"; 
    59           $mailer->Body = $kill->getRawMail(); 
    60           $mailer->AddAddress( $config->getPostMailto() ); 
    61           $mailer->Send(); 
    62         } 
    63  
    64         $qry = new DBQuery(); 
    65         $qry->execute( "insert into kb3_log 
    66                                values( ".$killid.", '".KB_SITE."', 
    67                                        '".$_SERVER['REMOTE_ADDR']."', 
    68                                        now() )" ); 
    69  
    70         $html .= "Killmail posted successfully.<br><br>"; 
    71         $html .= "<a href=\"?a=post_igb\">Post another killmail</a>"; 
    72       } 
    73     } 
    74     else { 
    75       $html .= "Invalid password."; 
    76       $html .= "<br><br><a href=\"?a=post_igb\">Try again</a>"; 
    77     } 
    78   } 
    79   else { 
    80     $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."; 
    81     $html .= "<br><br>Remember to post your losses as well.<br><br>"; 
    82     $html .= "<b>Killmail:</b><br>"; 
    83     $html .= "<form name=postform method=\"post\" action=\"?a=post_igb\">"; 
    84     $html .= "<textarea name=killmail id=killmail cols=\"70\" rows=\"24\"></textarea>"; 
    85     $html .= "<br><br><b>Password:</b><br><input name=\"password\" type=\"password\">"; 
    86     $html .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id=submit name=\"submit\" type=\"submit\" value=\"Process !\">"; 
    87     $html .= "</form>"; 
    88  
    89   } 
    90  
    91   $html .= "</body></html>"; 
    92  
    93   echo $html; 
    94 ?>======= 
    951<? 
    962  require_once( "class.page.php" );