//dublettencheck // function isBlacklisted($str,$type="all") if (!$BLACKLIST->isBlacklisted($ADR_BL[0]['email'], "domain", 0)) { //only_active=0, also alle, nicht nur aktive, was default waere //wenn noch nicht vorhanden einfuegen: $BLACKLIST->addBL(array("siteid" => TM_SITEID, "expr" => $bl_domainname, "aktiv" => 1, "type" => "domain")); $_MAIN_MESSAGE .= "<br>" . sprintf(___("Die Domain %s wurde in die Blacklist eingetragen."), display($bl_domainname)); } else { $_MAIN_MESSAGE .= "<br>" . sprintf(___("Die Domain %s ist bereits in der Blacklist vorhanden."), display($bl_domainname)); } } //blacklist domain single //delete email from blacklist if ($user_is_manager && $set == "blacklist_del") { $ADR_BL = $ADDRESS->getAdr($adr_id); $BL = $BLACKLIST->getBL(0, array("expr" => $ADR_BL[0]['email'], "type" => "email")); $BLACKLIST->delBL($BL[0]['id']); $_MAIN_MESSAGE .= "<br>" . sprintf(___("Die E-Mail-Adresse %s wurde aus der Blacklist gelöscht."), display($ADR_BL[0]['email'])); } //blacklist adr delete //delete domain from adr from blacklist! if ($user_is_manager && $set == "blacklist_domain_del") { $ADR_BL = $ADDRESS->getAdr($adr_id); $bl_domainname = getDomainFromEMail($ADR_BL[0]['email']); $BL = $BLACKLIST->getBL(0, array("expr" => $bl_domainname, "type" => "domain")); $BLACKLIST->delBL($BL[0]['id']); $_MAIN_MESSAGE .= "<br>" . sprintf(___("Die Domain %s wurde aus der Blacklist gelöscht."), display($bl_domainname)); } //blacklist domain delete require_once TM_INCLUDEPATH . "/adr_list_form.inc.php"; $ac_multi = count($adr_id_arr);
/** * 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 ($blacklist_domains == 1) { $bl_domains[$i] = getDomainFromEMail($addr[$i]['email']); } } //isset email } //for //adressen vergessen unset($addr); if ($blacklist_domains == 1) { $bl_domains = array_unique($bl_domains); //unify! foreach ($bl_domains as $bl_domainname) { //dublettencheck! per getBL if (!empty($bl_domainname)) { $BL = $BLACKLIST->getBL(0, array("type" => "domain", "expr" => $bl_domainname)); //wenn nix gefunden, eintragen: if (count($BL) < 1) { $BLACKLIST->addBL(array("siteid" => TM_SITEID, "expr" => $bl_domainname, "aktiv" => 1, "type" => "domain")); $IMPORT_MESSAGE .= "<br>" . sprintf(___("Die Domain %s wurde in die Blacklist eingetragen."), display($bl_domainname)); } else { $IMPORT_MESSAGE .= "<br>" . sprintf(___("Die Domain %s ist bereits in der Blacklist vorhanden."), display($bl_domainname)); } //if count<1 } //!empty } //foreach bl_domains as bl_domain $IMPORT_MESSAGE .= "<br>" . sprintf(___("%s Domains wurden zur Blacklist hinzgefügt."), count($bl_domains)); } if ($blacklist == 1) {
$_MAIN_MESSAGE .= "<br>" . ___("Der Ausdruck darf nicht leer sein."); } //syntaxcheck wenn email if ($type == "email") { $check_mail = checkEmailAdr($expr, $EMailcheck_Intern); if (!$check_mail[0]) { $check = false; $_MAIN_MESSAGE .= "<br>" . sprintf(___("E-Mail %s hat ein falsches Format."), display($expr)) . " " . $check_mail[1]; } } if ($check) { if (!DEMO) { $BLACKLIST = new tm_BLACKLIST(); //dublettencheck, anders als in adr_list, dort ist nur typ domain und email, hier wuerde isBlacklisted bei regexp probleme machen, ganze email erwartet! //eintrag suchen: $BL = $BLACKLIST->getBL(0, array("type" => $type, "expr" => $expr)); //wenn nix gefunden, eintragen: if (count($BL) < 1) { $BLACKLIST->addBL(array("siteid" => TM_SITEID, "expr" => $expr, "aktiv" => $aktiv, "type" => $type)); } else { $_MAIN_MESSAGE .= "<br>" . sprintf(___("Der Eintrag %s ist bereits vorhanden."), "'<b>" . display($expr) . "</b>'"); } //if count } //demo $_MAIN_MESSAGE .= "<br>" . sprintf(___("Neuer Eintrag %s wurde angelegt."), "'<b>" . display($expr) . "</b>'"); $action = "bl_list"; include_once TM_INCLUDEPATH . "/bl_list.inc.php"; } else { //check require_once TM_INCLUDEPATH . "/bl_form.inc.php";
$nextURLPara->addParam("offset", $offset + $limit); $nextURLPara->addParam("limit", $limit); $nextURLPara->addParam("st", $sortType); $nextURLPara->addParam("si", $sortIndex); $nextURLPara_ = $nextURLPara->getAllParams(); $prevURLPara = tmObjCopy($mSTDURL); $prevURLPara->addParam("act", "bl_list"); $prevURLPara->addParam("offset", $offset - $limit); $prevURLPara->addParam("limit", $limit); $prevURLPara->addParam("st", $sortType); $prevURLPara->addParam("si", $sortIndex); $prevURLPara_ = $prevURLPara->getAllParams(); $exportURLPara = tmObjCopy($mSTDURL); $exportURLPara->addParam("set", "export_blacklist"); $exportURLPara_ = $exportURLPara->getAllParams(); $BL = $BLACKLIST->getBL(0, array("type" => $type), $offset, $limit); $BL = sort_array($BL, $sortIndex, $sortType); $bc = count($BL); $entrys = $bc; // fuer pager.inc!!! $pagesURLPara = tmObjCopy($mSTDURL); //will be defined and use in pager.inc.php //show log summary //search for logs, only section $search_log['object'] = "bl"; include TM_INCLUDEPATH . "/log_summary_section.inc.php"; require_once TM_INCLUDEPATH . "/bl_list_form.inc.php"; require_once TM_INCLUDEPATH . "/bl_list_form_show.inc.php"; //pager require TM_INCLUDEPATH . "/pager.inc.php"; //table
/* Besuchen Sie die Homepage fuer Updates und weitere Infos */ /********************************************************************************/ $_MAIN_DESCR = ___("Blacklist bearbeiten"); $_MAIN_MESSAGE .= ""; $set = getVar("set"); $bl_id = getVar("bl_id"); $created = date("Y-m-d H:i:s"); #$author=$LOGIN->USER['name']; $InputName_Expr = "expr"; ${$InputName_Expr} = getVar($InputName_Expr); $InputName_Type = "type"; ${$InputName_Type} = getVar($InputName_Type); $InputName_Aktiv = "aktiv"; ${$InputName_Aktiv} = getVar($InputName_Aktiv); $BLACKLIST = new tm_BLACKLIST(); $BL = $BLACKLIST->getBL($bl_id); if ($set == "save") { $check = true; //checkinput if (empty($expr)) { $check = false; $_MAIN_MESSAGE .= "<br>" . ___("Der Ausdruck darf nicht leer sein."); } //syntaxcheck wenn email $check_mail = checkEmailAdr($expr, $EMailcheck_Intern); if ($type == "email" && !$check_mail[0]) { $check = false; $_MAIN_MESSAGE .= "<br>" . sprintf(___("E-Mail %s hat ein falsches Format."), display($expr)) . " " . $check_mail[1]; } if ($check) { if (!DEMO) {