Example #1
0
function showRecord()
{
    $db = new SQLite3(DB_FILENAME);
    $result = $db->query("SELECT * FROM iventory");
    print "<table class=\"bordered\" id=\"main_table\">\n<thead> <th>Number</th> <th>Team</th> <th>Name</th> <th>Place</th> <th>Place Detail</th> <th>Stored Date</th> <th>Checked Date</th>  <th>Confirmor</th></thead>\n";
    while ($record = $result->fetchArray()) {
        print "<tr>";
        print "<td>" . textwrap($record['number']) . "</td>";
        print "<td>" . textwrap($record['team']) . "</td>";
        print "<td>" . textwrap($record['name']) . "</td>";
        print "<td>" . textwrap($record['place']) . "</td>";
        print "<td>" . textwrap($record['place_detail']) . "</td>";
        print "<td>" . textwrap($record['stored_date']) . "</td>";
        $class = $record['checked'] == 1 ? "checked" : "notchecked";
        print "<td class=" . $class . ">" . textwrap($record['date']) . "</td>";
        print "<td class=" . $class . ">" . textwrap($record['check_person']) . "</td>";
        //print("<td class=".$class.">".textwrap($record['checked'])."</td>");
        print "</tr>\n";
    }
    print "</table>\n";
    $db->close();
}
Example #2
0
        if ($reply['replyto']) {
            $message['destination'] = preg_replace('/^.* <(.+@.+)>/', '\\1', $reply['replyto']);
        } else {
            $message['destination'] = preg_replace('/^.* <(.+@.+)>/', '\\1', $reply['mailfrom']);
        }
        if (!$message['destination'] && !$reply['userid']) {
            $message['destination'] = $LMS->GetCustomerEmail($message['customerid']);
            if (!empty($message['destination'])) {
                $message['destination'] = implode(',', $message['destination']);
            }
        }
        $message['subject'] = 'Re: ' . $reply['subject'];
        $message['inreplyto'] = $reply['id'];
        $message['references'] = $reply['messageid'];
        if (ConfigHelper::checkConfig('phpui.helpdesk_reply_body')) {
            $body = explode("\n", textwrap(strip_tags($reply['body']), 74));
            foreach ($body as $line) {
                $message['body'] .= '> ' . $line . "\n";
            }
        }
        if (!preg_match('/\\[RT#[0-9]{6}\\]/i', $message['subject'])) {
            $message['subject'] .= sprintf(' [RT#%06d]', $message['ticketid']);
        }
    }
}
$layout['pagetitle'] = trans('New Message');
$SESSION->save('backto', $_SERVER['QUERY_STRING']);
$SMARTY->assign('message', $message);
$SMARTY->assign('error', $error);
$SMARTY->assign('userlist', $LMS->GetUserNames());
$SMARTY->assign('queuelist', $LMS->GetQueueNames());
Example #3
0
        $subject = stripslashes($subject);
    }
    $body = stripslashes($body);
}
$quote_button = "";
if (initvar("read") != false) {
    $caption = $lReplyMessage;
    if (!eregi("^re:", $qsubject)) {
        $p_subject = "Re: " . $qsubject;
    } else {
        $p_subject = $qsubject;
    }
    $parent = $id;
    if (!${$phflat}) {
        $quote = "{$qauthor} {$lWrote}:\n";
        $quote .= textwrap("\n{$qbody}", 63, "\n", "> ") . "\n";
        $quote = htmlspecialchars($quote);
        $quote_button = "<input type=\"hidden\" name=\"hide\" value=\"" . $quote . "\"><script language=\"JavaScript\"><!--\nthis.document.writeln('<input tabindex=\"100\" type=\"Button\" name=\"quote\" value=\"{$lQuote}\" onClick=\"this.form.body.value=this.form.body.value + this.form.hide.value; this.form.hide.value='+\"''\"+';\">');\n//--></script>";
    }
    $p_body = "";
} else {
    $caption = $lStartTopic;
    $p_subject = initvar("subject");
    $p_body = initvar("body");
}
$p_author = $author;
$p_email = $email;
if (isset($IsError) && $action) {
    echo "<p><strong>{$IsError}</strong>";
}
if ($AllowAttachments && $ForumAllowUploads == 'Y' && $ForumMaxUploads < 4) {
Example #4
0
                 break;
             case 3:
                 $error['file'] = trans('File upload has finished prematurely.');
                 break;
             case 4:
                 $error['file'] = trans('Path to file was not specified.');
                 break;
             default:
                 $error['file'] = trans('Problem during file upload.');
                 break;
         }
     }
 }
 if (!$error) {
     $layout['nomenu'] = TRUE;
     $mailing['body'] = textwrap($mailing['body']);
     $mailing['body'] = str_replace("\r", '', $mailing['body']);
     $SMARTY->assign('mailing', $mailing);
     $SMARTY->display($_LMSDIR . '/modules/core/templates/header.html');
     $emails = GetEmails($mailing['group'], $mailing['network'], $mailing['customergroup']);
     $SMARTY->assign('recipcount', sizeof($emails));
     $SMARTY->display($_LMSDIR . '/modules/mailing/templates/mailingsend.html');
     if (sizeof($emails)) {
         $files = NULL;
         if (isset($file)) {
             $files[0]['content_type'] = $_FILES['file']['type'];
             $files[0]['filename'] = $filename;
             $files[0]['data'] = $file;
         }
         $debug_email = ConfigHelper::getConfig('mail.debug_email');
         if (!empty($debug_email)) {
Example #5
0
function verschicken($subject, $from, $newsgroups, $ref, $body)
{
    global $server, $port, $send_poster_host, $organization, $text_error;
    global $file_footer;
    flush();
    $ns = OpenNNTPconnection($server, $port);
    if ($ns != false) {
        fputs($ns, "post\r\n");
        $weg = lieszeile($ns);
        fputs($ns, 'Subject: ' . quoted_printable_encode($subject) . "\r\n");
        fputs($ns, 'From: ' . $from . "\r\n");
        fputs($ns, 'Newsgroups: ' . $newsgroups . "\r\n");
        fputs($ns, "Mime-Version: 1.0\r\n");
        fputs($ns, "Content-Type: text/plain; charset=ISO-8859-15\r\n");
        fputs($ns, "Content-Transfer-Encoding: 8bit\r\n");
        fputs($ns, "User-Agent: NewsPortal 0.24pre6, http://florian-amrhein.de/newsportal/\r\n");
        if ($send_poster_host) {
            fputs($ns, 'X-HTTP-Posting-Host: ' . gethostbyaddr(getenv("REMOTE_ADDR")) . "\r\n");
        }
        if ($ref != false) {
            fputs($ns, 'References: ' . $ref . "\r\n");
        }
        if (isset($organization)) {
            fputs($ns, 'Organization: ' . quoted_printable_encode($organization) . "\r\n");
        }
        if (isset($file_footer) && $file_footer != "") {
            $footerfile = fopen($file_footer, "r");
            $body .= "\n" . fread($footerfile, filesize($file_footer));
            fclose($footerfile);
        }
        $body = str_replace("\n.\r", "\n..\r", $body);
        $body = str_replace("\r", '', $body);
        $b = split("\n", $body);
        $body = "";
        for ($i = 0; $i < count($b); $i++) {
            if (strpos(substr($b[$i], 0, strpos($b[$i], " ")), ">") != false | strcmp(substr($b[$i], 0, 1), ">") == 0) {
                $body .= textwrap(stripSlashes($b[$i]), 78, "\r\n") . "\r\n";
            } else {
                $body .= textwrap(stripSlashes($b[$i]), 74, "\r\n") . "\r\n";
            }
        }
        fputs($ns, "\r\n" . $body . "\r\n.\r\n");
        $message = lieszeile($ns);
        closeNNTPconnection($ns);
    } else {
        $message = $text_error["post_failed"];
    }
    return $message;
}
Example #6
0
}
ini_set("include_path", $include_path);
include_once "{$config}.inc";
require_once "sql.inc";
require_once "template.inc";
require_once "user.inc";
require_once "textwrap.inc";
require_once "mailfrom.inc";
$tpl = new Template($template_dir, "comment");
$tpl->set_file("mail", "mail/offtopic.tpl");
db_connect();
if (!ini_get('safe_mode')) {
    set_time_limit(0);
}
$sth = db_query("select * from f_forums");
while ($f = $sth->fetch()) {
    $forums[$f['fid']] = $f;
}
$sth->closeCursor();
$sth = db_query("select * from f_offtopic where UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(tstamp) > 10 * 60");
while ($msg = $sth->fetch()) {
    $nuser = new User();
    $nuser->find_by_aid((int) $msg['aid']);
    $tpl->set_var(array("EMAIL" => $nuser->email, "FORUM_SHORTNAME" => $forums[$msg['fid']]['shortname'], "MSG_MID" => $msg['mid'], "PHPVERSION" => phpversion()));
    $e_message = $tpl->parse("MAIL", "mail");
    $e_message = textwrap($e_message, 78, "\n");
    mailfrom("followup-" . $nuser->aid . "@" . $bounce_host, $nuser->email, $e_message);
    unset($nuser);
    db_exec("delete from f_offtopic where fid = ? and mid = ?", array($msg['fid'], $msg['mid']));
}
$sth->closeCursor();
Example #7
0
function post_to_email()
{
    global $q, $DB, $ForumModeration, $ForumModEmail, $ForumEmailReturnList;
    global $ForumEmailList, $ForumTableName, $ForumName, $PhorumMailCode, $PhorumMail;
    global $email, $thread, $parent, $plain_subject, $plain_body, $plain_author;
    global $forum_url, $read_page, $ext, $num, $id, $phorumver, $msgid;
    //FIXME:  Since there is currently no mechanism for holding a post for later
    //        emailing to a list, we must disable this check for active moderation.
    //        But active moderation is of dubious value in a mailing list
    //        environment, because a post via email will go out to all the other
    //        subscribers before getting to Phorum anyway.
    //    if($ForumModeration!="a"){
    if (is_email($email)) {
        $from_email = $email;
    } else {
        $from_email = $ForumModEmail;
    }
    if (is_email($ForumEmailReturnList)) {
        $return = $ForumEmailReturnList;
    } else {
        $return = $from_email;
    }
    $replies = "";
    if ($thread != 0) {
        $sSQL = "Select distinct email from {$ForumTableName} where thread={$thread} and email_reply='Y' and email<>'{$email}'";
        $q->query($DB, $sSQL);
        if ($q->numrows() > 0) {
            while ($row = $q->getrow()) {
                $replies .= trim($row["email"]) . ",";
            }
            $replies = substr($replies, 0, strlen($replies) - 1);
        }
    }
    // If the message is going to a mailing list, it hasn't gone into the
    // database yet, so there is no point in trying to build a link to it.
    // On the other hand, if it is coming from PhorumMail, then PhorumMail
    // has already put it in the database.
    // We can check whether it is in the database by $id.
    $ebody = '';
    if ($id) {
        $ebody .= "This message was sent from: {$ForumName}.\n";
        $ebody .= "<{$forum_url}/{$read_page}.{$ext}?f={$num}&i={$id}&t={$thread}> \n";
        $ebody .= "----------------------------------------------------------------\n\n";
    }
    $ebody .= textwrap($plain_body) . "\n\n";
    $ebody .= "----------------------------------------------------------------\n";
    $ebody .= "Sent using Phorum software version {$phorumver} <http://phorum.org> ";
    $headers = "Message-ID: {$msgid}" . "\nFrom: {$plain_author} <{$from_email}>" . "\nReturn-Path: <{$return}>" . "\nReply-To: {$return}" . "\nX-Phorum-{$PhorumMailCode}-Version: Phorum {$phorumver}" . "\nX-Phorum-{$PhorumMailCode}-Forum: {$ForumName}" . "\nX-Phorum-{$PhorumMailCode}-Thread: {$thread}" . "\nX-Phorum-{$PhorumMailCode}-Parent: {$parent}";
    if (!empty($parent)) {
        $sSQL = "Select msgid from {$ForumTableName} where id='{$parent}'";
        $q->query($DB, $sSQL);
        if ($q->numrows() > 0) {
            $row = $q->getrow();
            if (!empty($row['msgid'])) {
                $headers .= "\nIn-reply-to: " . $row['msgid'];
            }
        }
    }
    // Only send to mailing list if NOT coming from PhorumMail!
    if (!$PhorumMail && is_email($ForumEmailList) && is_email($return)) {
        //        mail("$ForumName <$ForumEmailList>", "$plain_subject [$num:$thread:$id]", $ebody, $headers);
        mail("{$ForumName} <{$ForumEmailList}>", $plain_subject, $ebody, $headers);
    }
    if ($replies) {
        $headers .= "\nBCC: {$replies}";
        mail("", "{$plain_subject} [{$num}:{$thread}:{$id}]", $ebody, $headers);
    }
    //    }
}