예제 #1
0
function phplist_shutdown()
{
    #  output( "Script status: ".connection_status(),0); # with PHP 4.2.1 buggy. http://bugs.php.net/bug.php?id=17774
    $status = connection_status();
    if ($GLOBALS['mail_error_count']) {
        $message = "Some errors occurred in the phpList Mailinglist System\n" . 'URL: ' . $GLOBALS['admin_scheme'] . '://' . hostName() . "{$_SERVER['REQUEST_URI']}\n" . "Error message(s):\n\n" . $GLOBALS['mail_error'];
        $message .= "\n==== debugging information\n\nSERVER Vars\n";
        if (is_array($_SERVER)) {
            while (list($key, $val) = each($_SERVER)) {
                if (stripos($key, 'password') === false) {
                    $message .= $key . '=' . serialize($val) . "\n";
                }
            }
        }
        foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
            $plugin->processError($message);
        }
        #   sendMail(getConfig("report_address"),$GLOBALS["installation_name"]." Mail list error",$message);
    }
    #  print "Phplist shutdown $status";
    #  exit;
}
예제 #2
0
 public function add_timestamp()
 {
     #0013076:
     # Add a line like Received: from [10.1.2.3] by website.example.com with HTTP; 01 Jan 2003 12:34:56 -0000
     # more info: http://www.spamcop.net/fom-serve/cache/369.html
     $ip_address = $_SERVER['REMOTE_ADDR'];
     if (!empty($_SERVER['REMOTE_HOST'])) {
         $ip_domain = $_SERVER['REMOTE_HOST'];
     } else {
         $ip_domain = gethostbyaddr($ip_address);
     }
     if ($ip_domain != $ip_address) {
         $from = "{$ip_domain} [{$ip_address}]";
     } else {
         $from = "[{$ip_address}]";
     }
     $hostname = hostName();
     $request_time = date('r', $_SERVER['REQUEST_TIME']);
     $sTimeStamp = "from {$from} by {$hostname} with HTTP; {$request_time}";
     $this->addTimeStamp($sTimeStamp);
 }
예제 #3
0
파일: lib.php 프로젝트: pedru/phplist3
function activateRemoteQueue()
{
    $result = '';
    $activated = file_get_contents(PQAPI_URL . '&cmd=start&key=' . getConfig('PQAPIkey') . '&s=' . urlencode(getConfig('remote_processing_secret')) . '&u=' . base64_encode($GLOBALS['admin_scheme'] . '://' . hostName() . dirname($_SERVER['REQUEST_URI'])));
    if ($activated == 'OK') {
        $result .= '<h3>' . s('Remote queue processing has been activated successfully') . '</h3>';
        $result .= '<p>' . PageLinkButton('messages&tab=active', $GLOBALS['I18N']->get('view progress')) . '</p>';
    } elseif ($activated == 'KEYFAIL' || $activated == 'NAC') {
        $result .= '<h3>' . s('Error activating remote queue processing') . '</h3>';
        if ($activated == 'KEYFAIL') {
            $result .= s('The API key is incorrect');
        } elseif ($activated == 'NAC') {
            $result .= s('The phpList.com server is unable to reach your phpList installation');
        } else {
            $result .= s('Unknown error');
        }
        $result .= '<p><a href="./?page=hostedprocessqueuesetup" class="button">' . s('Change settings') . '</a></p>';
        $result .= '<p><a href="./?page=processqueue&pqchoice=local" class="button">' . s('Run queue locally') . '</a></p>';
    } else {
        $result .= '<h3>' . s('Error activating remote queue processing') . '</h3>';
        $result .= '<p><a href="./?page=processqueue&pqchoice=local" class="button">' . s('Run queue locally') . '</a></p>';
    }
    return $result;
}
예제 #4
0
     if (MANUALLY_PROCESS_QUEUE) {
         # wait a little, otherwise the message won't show
         sleep(10);
     }
     continue;
 }
 if (!empty($getspeedstats)) {
     processQueueOutput('message data loaded ');
 }
 if (VERBOSE) {
     //   processQueueOutput($msgdata);
 }
 if (!empty($msgdata['notify_start']) && !isset($msgdata['start_notified'])) {
     $notifications = explode(',', $msgdata['notify_start']);
     foreach ($notifications as $notification) {
         sendMail($notification, s('Campaign started'), s('phplist has started sending the campaign with subject %s', $msgdata['subject']) . "\n\n" . s('to view the progress of this campaign, go to %s://%s', $GLOBALS['admin_scheme'], hostName() . $GLOBALS['adminpages'] . '/?page=messages&amp;tab=active'));
     }
     Sql_Query(sprintf('insert ignore into %s (name,id,data) values("start_notified",%d,now())', $GLOBALS['tables']['messagedata'], $messageid));
 }
 if (empty($reload)) {
     processQueueOutput($GLOBALS['I18N']->get('Processing message') . ' ' . $messageid);
 }
 flush();
 keepLock($send_process_id);
 $status = Sql_Query(sprintf('update %s set status = "inprocess" where id = %d', $tables['message'], $messageid));
 $sendstart = Sql_Query(sprintf('update %s set sendstart = now() where sendstart is null and id = %d', $tables['message'], $messageid));
 if (empty($reload)) {
     processQueueOutput($GLOBALS['I18N']->get('Looking for users'));
 }
 if (Sql_Has_Error($database_connection)) {
     ProcessError(Sql_Error($database_connection));