Changeset 181 for dev/common/post.php

Show
Ignore:
Timestamp:
01/28/07 16:04:10 (16 years ago)
Author:
exi
Message:

Changed admin/options to show the actual page as page title.
admin_menu.php now also loads settings from mods.
Added event manager and the first 2 events (comment/killmail added).
Changed config to be in a separate file and modified it to be called static with config::get().
http_request now stores the socket status in $this->status.
Changed MapView? to store pictures based on KB_SITE so it doesnt show a map with wrong colors for the current killboard on a multi-site installation.
Changed options to handle element options (like 'edit:size:40').
Changed options to use the static calls to config.
Changed Page to use the static calls to config.
Changed Session to use session_name() to determine if it should start a session.
index.php now loads module-init-scripts.
Changed post.php to use config and it should now also use the mailserver configuration directive to send emails.
Added a mail_forward-mod to show how easy it can be to develop mods once there are enough events listed.
Fixed 2 typos in battle_overview.tpl.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/post.php

    r157 r181  
    1111if (isset($_POST['killmail'])) 
    1212{ 
    13     if ($_POST['password'] == $config->getPostPassword() || $page->isAdmin()) 
     13    if ($_POST['password'] == config::get('post_password') || $page->isAdmin()) 
    1414    { 
    1515        $parser = new Parser($_POST['killmail']); 
    1616 
    1717        // Filtering 
    18         if ($config->getConfig("filter_apply")) 
     18        if (config::get("filter_apply")) 
    1919        { 
    20             $filterdate = $config->getConfig("filter_date"); 
     20            $filterdate = config::get("filter_date"); 
    2121            $year = substr($_POST['killmail'], 0, 4); 
    2222            $month = substr($_POST['killmail'], 5, 2); 
     
    6565            elseif ($killid == -3) 
    6666            { 
    67                 $filterdate = date("j F Y", $config->getConfig("filter_date")); 
     67                $filterdate = date("j F Y", config::get("filter_date")); 
    6868                $html = "You are not allowed to post killmails older than $filterdate."; 
    6969            } 
     
    7676                $kill = new Kill($killid); 
    7777 
    78                 $mailer->From = "mailer@".$config->getConfig('mail_host'); 
    79                 $mailer->FromName = $config->getConfig('mail_host'); 
     78                if (!$server = config::get('post_mailserver')) 
     79                { 
     80                    $server = 'localhost'; 
     81                } 
     82                $mailer->From = "mailer@".config::get('post_mailhost'); 
     83                $mailer->FromName = config::get('post_mailhost'); 
    8084                $mailer->Subject = "Killmail #" . $killid; 
    81                 $mailer->Host = "localhost"; 
     85                $mailer->Host = $server; 
    8286                $mailer->Port = 25; 
    83                 $mailer->Helo = "localhost"; 
     87                $mailer->Helo = $server; 
    8488                $mailer->Mailer = "smtp"; 
    85                 $mailer->AddReplyTo("no_reply@".$config->getConfig('mail_host'), "No-Reply"); 
    86                 $mailer->Sender = "mailer@".$config->getConfig('mail_host'); 
     89                $mailer->AddReplyTo("no_reply@".config::get('post_mailhost'), "No-Reply"); 
     90                $mailer->Sender = "mailer@".config::get('post_mailhost'); 
    8791                $mailer->Body = $kill->getRawMail(); 
    88                 $mailer->AddAddress($config->getPostMailto()); 
     92                $mailer->AddAddress(config::get('post_mailhost')); 
    8993                $mailer->Send(); 
    9094            } 
    9195 
    9296            $qry = new DBQuery(); 
    93             $qry->execute("insert into kb3_log 
    94                                values(".$killid.",'".KB_SITE."','".$_SERVER['REMOTE_ADDR']."', now())"); 
     97            $qry->execute("insert into kb3_log values(".$killid.",'".KB_SITE."','".$_SERVER['REMOTE_ADDR']."', now())"); 
    9598 
    9699            header("Location: ?a=kill_detail&kll_id=".$killid); 
     
    103106    } 
    104107} 
    105 elseif (!$config->getConfig('post_forbid')) 
     108elseif (!config::get('post_forbid')) 
    106109{ 
    107110    $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.";