function Loadtemplate() { $ou = $_GET["ou"]; $template_name = $_GET["template"]; writequeries(); $ldap = new clladp(); $dn = "cn=artica_quarantine_settings,ou={$ou},dc=organizations,{$ldap->suffix}"; if (isset($_GET["ArticaMaxDayTemplate"])) { $template_data = "<SUBJECT>{$_GET["subject"]}</SUBJECT>\n\t\t<FROM>{$_GET["from"]}</FROM>\n\t\t<TEMPLATE>{$_GET["ArticaMaxDayTemplate"]}</TEMPLATE>"; $upd[$template_name][0] = $template_data; if (!$ldap->Ldap_modify($dn, $upd)) { echo "<H2>{$ldap->ldap_last_error}</H2>"; exit; } } if (!$ldap->ExistsDN($dn)) { $upd["cn"][] = "artica_quarantine_settings"; $upd["objectClass"][] = 'top'; $upd["objectClass"][] = 'ArticaQuarantineTemplates'; $upd["{$template_name}"][] = "DEFAULT"; $ldap->ldap_add($dn, $upd); $template_data = "DEFAULT"; } else { $hash = $ldap->Ldap_read($dn, '(ObjectClass=ArticaQuarantineTemplates)', array(strtolower($template_name))); if (!is_array($hash[0][strtolower($template_name)])) { unset($upd); $upd[$template_name] = "DEFAULT"; $ldap->Ldap_add_mod($dn, $upd); $hash = $ldap->Ldap_read($dn, '(ObjectClass=ArticaQuarantineTemplates)', array(strtolower($template_name))); } $template_data = $hash[0][strtolower($template_name)][0]; } if ($template_data == "DEFAULT") { $template_data = file_get_contents("ressources/databases/{$template_name}.cf"); } if (preg_match('#<SUBJECT>(.+?)</SUBJECT>\\s+<FROM>(.+?)</FROM>\\s+<TEMPLATE>(.+?)</TEMPLATE>#is', $template_data, $reg)) { $subject = $reg[1]; $from = $reg[2]; $template_d = $reg[3]; } $tiny = TinyMce('ArticaMaxDayTemplate', $template_d); $html = "\n\t<html>\n\t<head>\n\t<link href='css/styles_main.css' rel=\"styleSheet\" type='text/css' />\n\t<link href='css/styles_header.css' rel=\"styleSheet\" type='text/css' />\n\t<link href='css/styles_middle.css' rel=\"styleSheet\" type='text/css' />\n\t<link href='css/styles_forms.css' rel=\"styleSheet\" type='text/css' />\n\t<link href='css/styles_tables.css' rel=\"styleSheet\" type='text/css' />\n\t<script type='text/javascript' language='JavaScript' src='mouse.js'></script>\n\t<script type='text/javascript' language='javascript' src='XHRConnection.js'></script>\n\t<script type='text/javascript' language='javascript' src='default.js'></script>\n\t<script type='text/javascript' language='javascript' src='js/quarantine.ou.js'></script>\t\n\t</head>\n\t<body width=100% style='background-color:white'> \n\t\t<H5>{" . "{$template_name}}</H5>\n\t<form name='FFM1'>\n\t<table style='width:100%;margin:10px'>\n\t<tr>\n\t<td align='right'><strong>{from}:</strong></td>\n\t<td><input type='text' name='from' value='{$from}'></td>\n\t</tr>\n\t<tr>\n\t<td align='right'><strong>{subject}:</strong></td>\n\t<td><input type='text' name='subject' value='{$subject}'></td>\n\t</tr>\t\n\t</table>\n\t<div style='width:450px'>{$tiny}</div>\n\t<p class=caption>{template_token}</p>\n\t<input type='hidden' name='ou' value='{$ou}'>\n\t<input type='hidden' name='template' value='{$template_name}'>\n\t</form>\n\t</body>\n\t</html>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
<?php include_once "ressources/class.templates.inc"; include_once "ressources/charts.php"; include_once 'ressources/class.mysql.inc'; writequeries('head', __FILE__); if (isset($_GET["USER_STORAGE_USAGE"])) { pie_single_mailbox_user(); exit; } if (isset($_GET["USER_QUARANTINE"])) { pie_single_quarantine(); exit; } if (isset($_GET["tempsQuarantine"])) { CourbeQuarantine(); exit; } if (isset($_GET["weekMessagesPerDay"])) { weekMessagesPerDay(); exit; } if (isset($_GET["QuarMessagesPerDay"])) { QuarMessagesPerDay(); exit; } if (isset($_GET["domainsByQuarantine"])) { domainsByQuarantine(); exit; } if (isset($_GET["allSpamInfos"])) {
} if (isset($_GET["deleteuserdn"])) { users_delete(); exit; } if (isset($_GET["users_refresh_table"])) { echo users_table($_GET["ou"], $_GET["domain"]); exit; } if (isset($_GET["add_transport"])) { add_transport(); exit; } //if(!isset($_GET["domain"])){header('location:domains.php');exit;} //if(!isset($_GET["ou"])){header('location:domains.php');exit;} writequeries(); PageIndex(); function PageIndex() { $ldap = new clladp(); $ou = $_GET["ou"]; $domain = $_GET["domain"]; $transport = $ldap->GetTransportTable($domain); $bt_add_user = "******"javascript:editmailbox('','{$ou}','{$domain}');\">"; $bt_add_transport = " | <input type='button' value='{transport_add} »' OnClick=\"javascript:add_transport('{$domain}','{$ou}');\">"; $bt_av_settings = " | <input type='button' value='{av_settings} »' OnClick=\"javascript:LoadKasperskySettings('{$domain}','{$ou}');\">"; $bt_add_group = "<input type='button' value='{add_new_group} »' OnClick=\"javascript:GroupADD('{$ou}');\"> | "; if ($transport != null) { $users_table = transport_map($domain, $ou); $bt_add_user = null; $bt_add_transport = null;