/** * save log * @param * @return boolean */ function log($arr) { //indexes: //author_id = given author id, if not given, check data array for author id, if not given, check login, if not given, set to 0=system //action = text = new/edit/delete //object = contact/ticket/contact_group/object/contact_type etc //data = array with data, e.g. from $contact array addContact Method etc. $Return = false; //check values //set log date $this->LOG['date'] = date("Y-m-d H:i:s"); //chekc for author id $this->LOG['author_id'] = 0; //default is 0=system if (isset($arr['author_id']) && check_dbid($arr['author_id'])) { //if valid author_id in arr $this->LOG['author_id'] = $arr['author_id']; } else { //else check for author_id in data array if (isset($arr['data']['author_id']) && check_dbid($arr['data']['author_id'])) { $this->LOG['author_id'] = $arr['data']['author_id']; } else { // else, if not set at all get author id from logged in user global $LOGIN; if (isset($LOGIN->USER['id']) && check_dbid($LOGIN->USER['id'])) { $this->LOG['author_id'] = $LOGIN->USER['id']; } } } //action //action should always be set, default is -- $this->LOG['action'] = "--"; if (isset($arr['action']) && !empty($arr['action'])) { //wenn aktion definiert $this->LOG['action'] = $arr['action']; } //object //object should always be set, default is -- $this->LOG['object'] = "--"; if (isset($arr['object']) && !empty($arr['object'])) { //wenn aktion definiert $this->LOG['object'] = $arr['object']; } //edit_id, die id des geaenderten datensatzes! oder neuen datensatzes, defakto muss log() erst am ende einer add methode aufgerufen werden wenn die id bekannt ist! //edit_id should always be set, default is 0 $this->LOG['edit_id'] = 0; if (isset($arr['data']['id']) && !empty($arr['data']['id'])) { //wenn id $this->LOG['edit_id'] = $arr['data']['id']; } $this->LOG['memo'] = ""; if (isset($arr['memo'])) { $this->LOG['memo'] = $arr['memo']; } $this->LOG['s_data'] = serialize($arr['data']); //hmmm, falls loeschung, daten aus altem datensatz anhand id ermitteln.... hmmmm if ($this->LOG['action'] == "delete" && check_dbid($this->LOG['edit_id'])) { switch ($this->LOG['object']) { //default: #no default, default : require_once (TM_INCLUDEPATH."/Welcome.inc.php"); break; case 'usr': $LINK = new tm_CFG(); $DATA = $LINK->getUser("", $this->LOG['edit_id']); $this->LOG['s_data'] = serialize($DATA); break; case 'adr': $LINK = new tm_ADR(); $DATA = $LINK->getAdr($this->LOG['edit_id']); $this->LOG['s_data'] = serialize($DATA[0]); break; case 'adr_grp': $LINK = new tm_ADR(); $DATA = $LINK->getGroup($this->LOG['edit_id']); $this->LOG['s_data'] = serialize($DATA[0]); break; case 'nl': $LINK = new tm_NL(); $DATA = $LINK->getNL($this->LOG['edit_id']); $this->LOG['s_data'] = serialize($DATA[0]); break; case 'nl_grp': $LINK = new tm_NL(); $DATA = $LINK->getGroup($this->LOG['edit_id']); $this->LOG['s_data'] = serialize($DATA[0]); break; case 'bl': $LINK = new tm_BLACKLIST(); $DATA = $LINK->getBL($this->LOG['edit_id']); $this->LOG['s_data'] = serialize($DATA[0]); break; case 'frm': $LINK = new tm_FRM(); $DATA = $LINK->getForm($this->LOG['edit_id']); $this->LOG['s_data'] = serialize($DATA[0]); break; case 'host': $LINK = new tm_HOST(); $DATA = $LINK->getHost($this->LOG['edit_id']); $this->LOG['s_data'] = serialize($DATA[0]); break; case 'q': $LINK = new tm_Q(); $DATA = $LINK->getQ($this->LOG['edit_id']); $this->LOG['s_data'] = serialize($DATA[0]); break; case 'lnk': $LINK = new tm_LNK(); $DATA = $LINK->get($this->LOG['edit_id']); $this->LOG['s_data'] = serialize($DATA[0]); break; case 'lnk_grp': $LINK = new tm_LNK(); $DATA = $LINK->getGroup($this->LOG['edit_id']); $this->LOG['s_data'] = serialize($DATA[0]); break; } //switch } //if action=delete //serialisierte werte speichern, ein eintrag in die db pro aktion! $Query = "INSERT INTO " . TM_TABLE_LOG . " (\n\t\t\t\t\t\tdate,\n\t\t\t\t\t\tauthor_id,\n\t\t\t\t\t\taction,\n\t\t\t\t\t\tobject,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tx_value,\n\t\t\t\t\t\tedit_id,\n\t\t\t\t\t\tdata,\n\t\t\t\t\t\tmemo,\n\t\t\t\t\t\tsiteid\n\t\t\t\t\t\t)\n\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t'" . dbesc($this->LOG["date"]) . "',\n\t\t\t\t\t\t" . checkset_int($this->LOG["author_id"]) . ",\n\t\t\t\t\t\t'" . dbesc($this->LOG["action"]) . "',\n\t\t\t\t\t\t'" . dbesc($this->LOG["object"]) . "',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t" . checkset_int($this->LOG["edit_id"]) . ",\n\t\t\t\t\t\t'" . dbesc($this->LOG['s_data']) . "',\n\t\t\t\t\t\t'" . dbesc($this->LOG['memo']) . "',\n\t\t\t\t\t\t'" . TM_SITEID . "')"; if ($this->DB->Query($Query)) { $Return = true; } else { $Return = FALSE; return $Return; } /* //jeden wert einzeln speichern, ist aber unsinnn!!!! //iterate data array, fetch all indexes and values and save...... yes, it becomes a very very big table!!!!! anders gehts halt nicht! foreach ($arr['data'] as $data_key => $data_val) { if (DEBUG) $_MAIN_MESSAGE.= "$data_key => $data_val\n, "; $Query ="INSERT INTO ".TM_TABLE_LOG." ( date, author_id, action, object, property, x_value, edit_id, siteid ) VALUES ( '".dbesc($this->LOG["date"])."', '".checkset_int($this->LOG["author_id"])."', '".dbesc($this->LOG["action"])."', '".dbesc($this->LOG["object"])."', '".dbesc($data_key)."', '".dbesc($data_val)."', '".checkset_int($this->LOG["edit_id"])."', '".TM_SITEID."')"; if (DEBUG_SQL) $_MAIN_MESSAGE.="\n".$Query."<br>"; if ($this->DB->Query($Query)) { $Return=true; } else { $Return=FALSE; return $Return; } }//foreach */ return $Return; }
} if (!isset($_CONTENT)) { $_CONTENT = ""; } if (!isset($called_via_url)) { if (DEBUG) { $FMESSAGE .= tm_debugmessage("valled_via_url = true"); } $called_via_url = true; } $HOSTS = new tm_HOST(); #$HOST=$HOSTS->getStdSMTPHost(); if (DEBUG) { $FMESSAGE .= tm_debugmessage("select smtp host with id " . $C[0]['unsubscribe_host']); } $HOST = $HOSTS->getHost($C[0]['unsubscribe_host']); $check = true; $InputName_Name = "email"; //email ${$InputName_Name} = getVar($InputName_Name); $InputName_Captcha = "fcpt"; //einbgegebener Captcha Code ${$InputName_Captcha} = getVar($InputName_Captcha); $cpt = getVar("cpt"); //zu pruefender captchacode, hidden field, $captcha_code //if isset $a_id and adr exists and adr code=c, then prefill email! if (check_dbid($a_id)) { $ADR_TMP = $ADDRESS->getAdr($a_id); //found entry? if (count($ADR_TMP) > 0) { if (DEBUG) {
//set new tpl path $_Tpl_FRM->setTemplatePath($tm_formpath); } //get default smtp host, default, as fallback if (DEBUG) { $MESSAGE .= tm_debugmessage("fetch default smtp host"); } $HOST = $HOSTS->getStdSMTPHost(); $use_frm_smtphost = FALSE; //get host form valid form if ($use_form) { // && !$doptin_check //get host if (check_dbid($FRM[0]['host_id'])) { //valid host id found $HOST_FRM = $HOSTS->getHost($FRM[0]['host_id']); if ($HOST_FRM[0]['aktiv'] == 1 && $HOST_FRM[0]['type'] == 'smtp') { $use_frm_smtphost = TRUE; if (DEBUG) { $MESSAGE .= tm_debugmessage("found valid smtp host for this form"); } } else { if (DEBUG) { $MESSAGE .= tm_debugmessage("found no valid smtp host for this form, continue use default host"); } } } } if ($use_frm_smtphost) { //if found a valid host for this form, set new host array..... $HOST = $HOST_FRM;
} $InputName_Action = "val"; ${$InputName_Action} = getVar($InputName_Action); if (empty($val)) { $val = "list"; } $InputName_ActionAdr = "val2"; ${$InputName_ActionAdr} = getVar($InputName_ActionAdr); require_once TM_INCLUDEPATH . "/bounce_host_form.inc.php"; require_once TM_INCLUDEPATH . "/bounce_host_form_show.inc.php"; //server ausgewaehlt, wir connecten if ($set == "connect") { $Mailer = new tm_Mail(); $Bounce = new tm_Bounce(); $ADDRESS = new tm_ADR(); $HOST = $HOSTS->getHost($host); $search_mail = array(); //filter? emails suchen? if ($filter_to == 1) { //nur mails an aktuelle return adesse fuer host $search_mail['to'] = $filter_to_smtp_return_path; $_MAIN_OUTPUT .= "<br>" . sprintf(___("Es werden nur E-Mails an die Adresse %s angezeigt."), $filter_to_smtp_return_path); } $_MAIN_OUTPUT .= "<br>" . sprintf(___("Verbindung zum Server %s wird aufgebaut..."), $HOST[0]['name'] . " (" . $HOST[0]['host'] . ":" . $HOST[0]['port'] . "/" . $HOST[0]['type'] . ")"); $Mailer->Connect($HOST[0]['host'], $HOST[0]['user'], $HOST[0]['pass'], $HOST[0]['type'], $HOST[0]['port'], $HOST[0]['options']); if (!empty($Mailer->Error)) { $_MAIN_MESSAGE .= "<br><b>" . sprintf(___("Servermeldung: %s"), "" . $Mailer->Error . "") . "</b>"; } //Mails auslesen $Mail = $Mailer->getMail(0, $offset, $limit, $search_mail); //typ
$search_log['object'] = "q"; include TM_INCLUDEPATH . "/log_summary_section.inc.php"; $reloadURLPara_ = $reloadURLPara->getAllParams(); //refresh list $_MAIN_OUTPUT .= "<a href=\"" . $tm_URL . "/" . $reloadURLPara_ . "\" title=\"" . ___("Anzeige aktualisieren") . "\">" . tm_icon("arrow_refresh.png", ___("Anzeige aktualisieren")) . " " . ___("Anzeige aktualisieren") . "</a><br><br>"; //show table $_MAIN_OUTPUT .= "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"100%\">"; $_MAIN_OUTPUT .= "<thead>" . "<tr>" . "<td> " . "</td>" . "<td><b>" . ___("Datum") . "</b>" . "</td>" . "<td><b>" . ___("Newsletter") . "</b>" . "</td>" . "<td><b>" . ___("Adressgruppe") . "</b>" . "</td>" . "<td><b>" . ___("Host") . "</b>" . "</td>" . "<td><b>" . ___("Status") . "</b>" . "</td>" . "<td>...</td>" . "</tr>" . "</thead>" . "<tbody>"; for ($qcc = 0; $qcc < $qc; $qcc++) { if ($qcc % 2 == 0) { $bgcolor = $row_bgcolor; } else { $bgcolor = $row_bgcolor2; } $hc_new = 0; $HOST = $HOSTS->getHost($Q[$qcc]['host_id']); if (!isset($HOST[0]) || $HOST[0]['aktiv'] != 1) { $bgcolor = $row_bgcolor_inactive; } $valid_adr_c = $ADDRESS->countValidADR($Q[$qcc]['grp_id']); //wenn q status=2 or 3 // run oder fertig //dann holen wir uns die daten fuer die q eintraege! vorher ist eh null... :) //wenn status > neu, also gestartet, versendet etc, dann summary anzeigen.... $hc = $QUEUE->countH($Q[$qcc]['id']); $hc_new = $QUEUE->countH($Q[$qcc]['id'], 0, 0, 0, 1); //new entry $hc_ok = $QUEUE->countH($Q[$qcc]['id'], 0, 0, 0, 2); //ok, done $hc_view = $QUEUE->countH($Q[$qcc]['id'], 0, 0, 0, 3); //ok,done,viewed $hc_fail = $QUEUE->countH($Q[$qcc]['id'], 0, 0, 0, 4);
$log_q_id = $QP[$qpcc]['id']; $log_nl_id = $QP[$qpcc]['nl_id']; $log_grp_id = $QP[$qpcc]['grp_id']; send_log("Preparing " . ($qpcc + 1) . " of {$qpc} Qs"); send_log("begin"); send_log("QID=" . $QP[$qpcc]['id']); send_log("Status=" . $QP[$qpcc]['status']); send_log("nl_id=" . $QP[$qpcc]['nl_id']); send_log("grp_id=" . $QP[$qpcc]['grp_id']); send_log("host_id=" . $QP[$qpcc]['host_id']); send_log("send_at=" . $QP[$qpcc]['send_at']); send_log("autogen=" . $QP[$qpcc]['autogen']); $ReportMail_HTML = ""; $G = $ADDRESS->getGroup($QP[$qpcc]['grp_id']); $NL = $NEWSLETTER->getNL($QP[$qpcc]['nl_id']); $HOST = $HOSTS->getHost($QP[$qpcc]['host_id'], array("aktiv" => 1, "type" => "smtp")); send_log("q status=1, q autogen =1"); send_log("creating recipients list:"); $h_refresh = $QUEUE->addHQ(array('nl_id' => $QP[$qpcc]['nl_id'], 'q_id' => $QP[$qpcc]['id'], 'grp_id' => $QP[$qpcc]['grp_id'], 'host_id' => $QP[$qpcc]['host_id'], 'status' => 1, 'created' => date("Y-m-d H:i:s"))); #proof?! if ($C[0]['proof'] == 1) { if (DEBUG) { $MESSAGE .= send_log("proofing global enabled"); } if ($QP[$qpcc]['proof'] == 1) { if (DEBUG) { $MESSAGE .= send_log("proofing for this q enabled"); } $ADDRESS->proof(); } else { if (DEBUG) {
/* check Homepage for Updates and more Infos */ /* Besuchen Sie die Homepage fuer Updates und weitere Infos */ /********************************************************************************/ exit; #include config file: edit line if you run this script via cronjob, add full path to tellmatic config file require_once "./tm_config.inc.php"; /********************************************************************************/ if (DEMO) { exit; } $HOSTS = new tm_HOST(); $Mailer = new tm_Mail(); $Bounce = new tm_Bounce(); $ADDRESS = new tm_ADR(); #POP3/IMAP HostID frm global config $HOST = $HOSTS->getHost($C[0]['bounceit_host']); if (!isset($HOST[0])) { exit; } $Mail = array(); $BMail = array(); $Bounces = array(); $bcmatch = 0; $offset = 0; $search_mail = array(); if ($C[0]['bounceit_filter_to'] == 1) { $search_mail['to'] = $C[0]['bounceit_filter_to_email']; echo sprintf(___("Es werden nur E-Mails an die Adresse %s durchsucht."), $C[0]['bounceit_filter_to_email']) . "\n"; } #serververbidung aufbauen echo sprintf(___("Verbindung zum Server %s wird aufgebaut..."), $HOST[0]['name'] . " (" . $HOST[0]['host'] . ":" . $HOST[0]['port'] . "/" . $HOST[0]['type'] . ")") . "\n";
$aktivURLPara = tmObjCopy($mSTDURL); $aktivURLPara->addParam("set", "aktiv"); $stdURLPara = tmObjCopy($mSTDURL); $stdURLPara->addParam("set", "standard"); $delURLPara = tmObjCopy($mSTDURL); $delURLPara->addParam("set", "delete"); $statURLPara = tmObjCopy($mSTDURL); $statURLPara->addParam("act", "statistic"); $statURLPara->addParam("set", "user"); //show log summary //search for logs, only section $search_log['object'] = "host"; include TM_INCLUDEPATH . "/log_summary_section.inc.php"; $_MAIN_OUTPUT .= "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"100%\">"; $_MAIN_OUTPUT .= "<thead>" . "<tr>" . "<td><b> </b>" . "</td>" . "<td><b>" . ___("Name") . "</b>" . "</td>" . "<td><b>" . ___("Host/Port") . "</b>" . "</td>" . "<td><b>" . ___("Type") . "</b>" . "</td>" . "<td><b>" . ___("Options/SMTP-Auth") . "</b>" . "</td>" . "<td><b>" . ___("Benutzer") . "</b>" . "</td>" . "<td><b>" . ___("Aktiv") . "</b>" . "</td>" . "<td>...</td>" . "</tr>" . "</thead>" . "<tbody>"; $HOST = $HOSTS->getHost(); $hc = count($HOST); for ($hcc = 0; $hcc < $hc; $hcc++) { if ($hcc % 2 == 0) { $bgcolor = $row_bgcolor; } else { $bgcolor = $row_bgcolor2; } if ($HOST[$hcc]['aktiv'] != 1) { $bgcolor = $row_bgcolor_inactive; $new_aktiv = 1; } else { $new_aktiv = 0; } $editURLPara->addParam("h_id", $HOST[$hcc]['id']); $editURLPara_ = $editURLPara->getAllParams();
${$InputName_SenderEMail} = getVar($InputName_SenderEMail); $InputName_ReturnMail = "return_mail"; ${$InputName_ReturnMail} = getVar($InputName_ReturnMail); $InputName_ReplyTo = "reply_to"; ${$InputName_ReplyTo} = getVar($InputName_ReplyTo); $InputName_Aktiv = "aktiv"; ${$InputName_Aktiv} = getVar($InputName_Aktiv); $InputName_Delay = "delay"; ${$InputName_Delay} = getVar($InputName_Delay); //delay between messages send to this host in send_it.php! //we MUST remove leading slashes from imap options, if not we get invalid remote specification error. if (strpos($options, "/") == 0) { $options = substr_replace($options, '', 0, 1); } $HOSTS = new tm_HOST(); $HOST = $HOSTS->getHost($h_id); $standard = $HOST[0]['standard']; if ($set == "save") { $check = true; //checkinput if (empty($name)) { $check = false; $_MAIN_MESSAGE .= "<br>" . ___("Der Name darf nicht leer sein."); } if (empty($port)) { $check = false; $_MAIN_MESSAGE .= "<br>" . ___("Der Port muss angegeben werden."); } if (empty($host)) { $check = false; $_MAIN_MESSAGE .= "<br>" . ___("Der Hostname oder IP-Adresse muss angegeben werden.");