function user_amavis_front() { $tpl = new templates(); if (isset($_GET["userid"])) { $users = new usersMenus(); if (!$users->AllowChangeAntiSpamSettings) { echo $tpl->_ENGINE_parse_body("alert('{ERROR_NO_PRIVS}')"); exit; } $uid = $_GET["userid"]; $button_admin = "<div style='text-align:center'>\n\t\t<input type='button' OnClick=\"javascript:GoBackDefaultAmavis('{$uid}')\" value='{back_to_defaults} »'></div>"; } else { $uid = $_SESSION["uid"]; } $user = new user($uid); $form = "\n<table style='width:100%'>\n<tr>\n\t<td class=legend>{amavisSpamLover}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisSpamLover', $user->amavisSpamLover, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBadHeaderLover}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBadHeaderLover', $user->amavisBadHeaderLover, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBypassVirusChecks}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBypassVirusChecks', $user->amavisBypassVirusChecks, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBypassSpamChecks}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBypassSpamChecks', $user->amavisBypassSpamChecks, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBypassHeaderChecks}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBypassHeaderChecks', $user->amavisBypassHeaderChecks, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisSpamModifiesSubj}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisSpamModifiesSubj', $user->amavisSpamModifiesSubj, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisSpamTagLevel}:</td>\n\t<td>" . Field_text('amavisSpamTagLevel', $user->amavisSpamTagLevel, 'width:90px') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisSpamTag2Level}:</td>\n\t<td>" . Field_text('amavisSpamTag2Level', $user->amavisSpamTag2Level, 'width:90px') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisSpamKillLevel}:</td>\n\t<td>" . Field_text('amavisSpamKillLevel', $user->amavisSpamKillLevel, 'width:90px') . "</td>\n</tR>\n<tr>\n\t<td colspan=2 align='right'><hr><input type='button' OnClick=\"javascript:SaveUserAmavis();\" value='{edit} »'></td>\n</tr>\n</table>\n"; $form = RoundedLightWhite($form); $html = "\n<H1>{spam_rules}</H1>\n\n<table style='width:100%'>\n<td valign='top' width=1%>\n<img src='img/caterpillarkas.png'>\n<p class=caption>{amavis_user_text}</p>\n<hr>\n{$button_admin}\n</td>\n<td><div id='user-amavis'>{$form}</div>\n</td>\n</tr>\n</table>\n\n"; /* amavisSpamLover: FALSE amavisBadHeaderLover: FALSE amavisBypassVirusChecks: FALSE amavisBypassSpamChecks: FALSE amavisBypassHeaderChecks: FALSE amavisSpamTagLevel: -999 amavisSpamTag2Level: 5 amavisSpamKillLevel: 5 amavisSpamModifiesSubj: TRUE */ echo $tpl->_ENGINE_parse_body($html, 'amavis.index.php'); }
function popup() { $ldap = new clladp(); $domain = $_GET["domain"]; $ou = $_GET["ou"]; $dd = new domains_disclaimer($ou, $domain); //DisclaimerContent $edit_disclaimer = Paragraphe("64-templates.png", "{edit_disclaimer}", "{edit_disclaimer_text}", "javascript:OrgLoadDisclaimer()"); $form = "<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend>{enable_disclaimer}:</td>\n\t\t<td>" . Field_TRUEFALSE_checkbox_img("DisclaimerActivate", $dd->DisclaimerActivate, "{enable_disable}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{enable_outbound}:</td>\n\t\t<td>" . Field_TRUEFALSE_checkbox_img("DisclaimerOutbound", $dd->DisclaimerOutbound, "{enable_disable}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{enable_inbound}:</td>\n\t\t<td>" . Field_TRUEFALSE_checkbox_img("DisclaimerInbound", $dd->DisclaimerInbound, "{enable_disable}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{overwritten_by_user}:</td>\n\t\t<td>" . Field_TRUEFALSE_checkbox_img("DisclaimerUserOverwrite", $dd->DisclaimerUserOverwrite, "{enable_disable}") . "</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr><input type='button' OnClick=\"javascript:DisclaimerGlobalConfSave();\" value='{apply} »'></td>\n\t</tr>\n\t</table>"; $form = RoundedLightWhite($form); $html = "<H1>{disclaimer} {parameters}</H1>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>{$edit_disclaimer}</td>\n\t\t<td valign='top'>\n\t\t\t<div id='disclaimerGlobalDiv'>{$form}</div>\n\t\t</td>\n\t</tr>\n\t</table>\n\t\n\t\n\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html, "amavis.index.php"); }
function domain_amavis_front() { $tpl = new templates(); $users = new usersMenus(); if (!$users->AllowChangeAntiSpamSettings) { echo $tpl->_ENGINE_parse_body("alert('{ERROR_NO_PRIVS}')"); exit; } $domain = $_GET["domain"]; $dom = new DomainsTools(); $dom->LoadAmavisDomain($domain); $button_admin = "<div style='text-align:center'>\n\t\t<input type='button' OnClick=\"javascript:GoBackDefaultAmavis()\" value='{back_to_defaults} »'></div>"; $form1 = "\n<table style='width:100%'>\n<tr>\n\t<td class=legend>{amavisSpamLover}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisSpamLover', $dom->amavisSpamLover, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBadHeaderLover}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBadHeaderLover', $dom->amavisBadHeaderLover, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBypassVirusChecks}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBypassVirusChecks', $dom->amavisBypassVirusChecks, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBypassSpamChecks}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBypassSpamChecks', $dom->amavisBypassSpamChecks, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBypassHeaderChecks}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBypassHeaderChecks', $dom->amavisBypassHeaderChecks, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td colspan=2 align='right'><hr><input type='button' OnClick=\"javascript:SaveUserAmavis();\" value='{edit} »'></td>\n</tr>\n</table>"; $sa_quarantine_cutoff_level = $tpl->_ENGINE_parse_body('{sa_quarantine_cutoff_level}', 'amavis.index.php,spamassassin.index.php'); if (strlen($sa_quarantine_cutoff_level) > 50) { $sa_quarantine_cutoff_level = texttooltip(substr($sa_quarantine_cutoff_level, 0, 47) . '...', $sa_quarantine_cutoff_level); } $sa_dsn_cutoff_level = $tpl->_ENGINE_parse_body('{sa_dsn_cutoff_level}', 'amavis.index.php,spamassassin.index.php'); if (strlen($sa_dsn_cutoff_level) > 50) { $sa_dsn_cutoff_level = texttooltip(substr($sa_dsn_cutoff_level, 0, 47) . '...', $sa_dsn_cutoff_level); } $form2 = "\n\n<table style='width:100%'>\t\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{sa_tag2_level_deflt}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamTag2Level', $dom->amavisSpamTag2Level, 'width:90px') . "</td>\n\t\t\t<td> </td>\n\t\t\t\t\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{sa_kill_level_deflt}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamKillLevel', $dom->amavisSpamKillLevel, 'width:90px') . "</td>\n\t\t\t<td> </td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t<td colspan=3 align='right'><input type='button' value='{edit} »' OnClick=\"javascript:SaveUserAmavis();\">\n\t\t</tr>\t\t\n\t\t<tr><td colspan=3><hr></td></tR>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$sa_dsn_cutoff_level}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamDsnCutoffLevel', $dom->amavisSpamDsnCutoffLevel, 'width:90px') . "</td>\n\t\t\t<td> </td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$sa_quarantine_cutoff_level}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamQuarantineCutoffLevel', $dom->amavisSpamQuarantineCutoffLevel, 'width:90px') . "</td>\n\t\t\t<td> </td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'><hr><input type='button' OnClick=\"javascript:SaveUserAmavis();\" value='{edit} »'></td>\n\t\t</tr>\t\n\t</table>\n\n"; $spam_subject_tag2_maps = $tpl->_ENGINE_parse_body('{spam_subject_tag2_maps}', 'amavis.index.php,spamassassin.index.php'); $form3 = "\n<table style='width:100%'>\n<tr>\n\t\n\t\n\t<td class=legend nowrap>{amavisSpamModifiesSubj}:</td>\n\t<td width=1%>" . Field_TRUEFALSE_checkbox_img('amavisSpamModifiesSubj', $dom->amavisSpamModifiesSubj, '{enable_disable}') . "</td>\t\n\t\n</tr>\t\n</table>\n<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{spam_subject_tag_maps}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamSubjectTag', $dom->amavisSpamSubjectTag, 'width:190px') . "</td>\n\t\t\t<td class=legend nowrap>{score}:</td>\n\t\t\t<td>" . Field_text("amavisSpamTagLevel", $dom->amavisSpamTagLevel, 'width:33px') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$spam_subject_tag2_maps}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamSubjectTag2', $dom->amavisSpamSubjectTag2, 'width:190px') . "</td>\n\t\t\t<td> </td>\n\t\t\t<td> </td>\n\t\t</tr>\t\t\n\t<tr>\n\t\t<td colspan=5 align='right'><hr><input type='button' OnClick=\"javascript:SaveUserAmavis();\" value='{edit} »'></td>\n\t</tr>\n</table>\n\n"; $form1 = RoundedLightWhite($form1); $form2 = RoundedLightWhite($form2); $form3 = RoundedLightWhite($form3); $html = "\n<H1>{spam_rules}</H1>\n\n<table style='width:100%'>\n<td valign='top' width=1%>\n<img src='img/caterpillarkas.png'>\n<p class=caption>{amavis_domain_text}</p>\n<hr>\n{$button_admin}\n</td>\n<td><div id='domain-amavis'>{$form1}<br>{$form2}<br>{$form3}</div></td>\n</tr>\n</table>\n\n"; /* amavisSpamLover: FALSE amavisBadHeaderLover: FALSE amavisBypassVirusChecks: FALSE amavisBypassSpamChecks: FALSE amavisBypassHeaderChecks: FALSE amavisSpamTagLevel: -999 amavisSpamTag2Level: 5 amavisSpamKillLevel: 5 amavisSpamModifiesSubj: TRUE */ echo $tpl->_ENGINE_parse_body($html, 'amavis.index.php,spamassassin.index.php'); }
function USER_CHANGE_EMAIL() { $priv = new usersMenus(); $ct = new user($_GET["uid"]); $ldap = new clladp(); $domains = $ldap->hash_get_domains_ou($ct->ou); if (is_array($domains)) { while (list($num, $ligne) = each($domains)) { $fDomains[$ligne] = $ligne; } } if (preg_match('#(.+?)@(.+)#', $ct->mail, $re)) { $domain = $re[2]; $email = $re[1]; } if (!$priv->cyrus_imapd_installed) { $local_mailbox = Field_hidden('MailboxActive', 'FALSE'); } else { $local_mailbox = "<tr>\n\t\t\t<td class=legend nowrap>{MailboxActive}:</td>\n\t\t\t<td>" . Field_TRUEFALSE_checkbox_img('MailboxActive', $ct->MailboxActive) . "</td>\t\n\t\t\t<td width=1%> </td>\n\t\t\t<td width=99%> </td>\n\t\t\t</tr>"; } $user_domain = Field_array_Hash($domains, 'UserChangeEmailDomain', $domain, "style:font-size:16px'"); $form = Field_hidden('UserChangeEmailAddrUID', $ct->uid) . "\n\t<div id='ChangeUserPasswordID' style='width:98%' class=form>\n\t<div style='text-align:left;margin-bottom:8px'><i style='font-size:16px;font-weight:bold;padding-bottom:4px'>{$ct->DisplayName}, {email}:</i></div>\n\t<center>\n\t<table >\n\t<tbody>\n\t<tr>\n\t\t<td>" . Field_text('email', $email, "width:160px;font-size:16px;text-align:right") . "</td>\t\n\t\t<td width=1%><strong style='font-size:16px;font-weight:normal'>@</strong></td>\n\t\t<td width=99%>{$user_domain}</td>\n\t</tr>\n\t{$local_mailbox}\n\t<tr>\n\t\t<td colspan=5 align='right'><hr style='margin-top:8px'>\n\t\t" . button("{apply}", "UserChangeEmailAddrSave();", 16) . "\n\t\t\n\t</tr>\n\t</table>\n\t</div>\n\t</center>\n\t"; if (!$priv->AllowAddUsers) { $form = "<H3>{ERROR_NO_PRIVS}</H3>"; } $html = "{$form}"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function scores_behavior() { $users = new usersMenus(); $spam = new spamassassin(); $page = CurrentPageName(); $sock = new sockets(); if ($users->AMAVIS_INSTALLED) { $EnableAmavisDaemon = $sock->GET_INFO("EnableAmavisDaemon"); $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance"); if ($EnablePostfixMultiInstance == 1) { $EnableAmavisDaemon = 1; } } if ($EnableAmavisDaemon == 1) { $js_load = "SpamAssassinDisableScores()"; $disable_explain_spamassin = "{disabled_amavis_enabled}"; } $html = "\n<div id='SpamassinScoreBehaviorDiv'>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td align='right' nowrap valign='top' class=legend>{report_safe}:</strong></td>\n\t\t\t<td valign='top'>" . Field_TRUEFALSE_checkbox_img('report_safe', $spam->main_array["report_safe"]) . "</td>\n\t\t\t<td valign='top'>" . help_icon("{report_safe_text}") . "</td>\n\t\t\t</tr>\n\t\t\t\n\t\t<tr>\t\n\t\t\t<td align='right' nowrap valign='top' class=legend>{use_bayes}:</strong></td>\n\t\t\t<td valign='top'>" . Field_TRUEFALSE_checkbox_img('use_bayes', $spam->main_array["use_bayes"]) . "</td>\n\t\t\t<td valign='top'> </td>\n\t\t</tr>\t\n\t\t<tr>\t\n\t\t\t<td align='right' nowrap valign='top' class=legend>{auto_learn}:</strong></td>\n\t\t\t<td valign='top'>" . Field_TRUEFALSE_checkbox_img('bayes_auto_learn', $spam->main_array["bayes_auto_learn"]) . "</td>\n\t\t\t<td valign='top'> </td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td align='right' nowrap valign='top' class=legend>{required_score}:</strong></td>\n\t\t\t<td valign='top' colspan=2>" . Field_text('required_score', $spam->main_array["required_score"], 'width:50px', null, null, '{required_score_text}') . "</td>\n\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' nowrap valign='top' class=legend>{block_with_required_score}:</strong></td>\n\t\t\t<td valign='top' colspan=2>" . Field_text('block_with_required_score', $spam->block_with_required_score, 'width:50px', null, null, '{block_with_required_score_text}') . "</td>\n\t\t</tr>\t\n\t\t<tr><td colspan=3 align='right'><i>{$disable_explain_spamassin}</i></td></tr>\n\t\t<tr>\n\t\t\t<td colspan=3 align='right' valign='top'>\n\t\t\t<hr>\n\t\t\t" . button("{save}", "SpamassinScoreBehavior()") . "\n\t\t\t</td>\n\t\t</tr>\n</table>\n</div>\n<script>\n\tfunction SpamAssassinDisableScores(){\n\t\tdocument.getElementById('block_with_required_score').disabled=true;\n\t\tdocument.getElementById('required_score').disabled=true;\n\t\t\n\t\n\t}\n\n{$js_load}\n</script>\n"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function user_amavis_front(){ $tpl=new templates(); $users=new usersMenus(); $sock=new sockets(); if(!$users->AMAVIS_INSTALLED){ echo $tpl->_ENGINE_parse_body("<div class=text-info>{NO_FEATURE_AMAVIS_NOT_INSTALLED}</div>"); return; } $EnableAmavisDaemon=$sock->GET_INFO("EnableAmavisDaemon"); $EnableLDAPAmavis=$sock->GET_INFO("EnableLDAPAmavis"); if(!is_numeric($EnableLDAPAmavis)){$EnableLDAPAmavis=0;} if(!is_numeric($EnableAmavisDaemon)){$EnableAmavisDaemon=0;} if($EnableAmavisDaemon==0){ echo $tpl->_ENGINE_parse_body("<div class=text-info>{NO_FEATURE_AMAVIS_NOT_ENABLED}</div>"); return; } if(isset($_GET["userid"])){ if(!$users->AllowChangeAntiSpamSettings){echo $tpl->_ENGINE_parse_body("alert('{ERROR_NO_PRIVS}')");exit;} $uid=$_GET["userid"]; $button_admin="<div style='text-align:center'> <input type='button' OnClick=\"javascript:GoBackDefaultAmavis('$uid')\" value='{back_to_defaults} »'></div>"; } else{ $uid=$_SESSION["uid"]; } $user=new user($uid); $form=" <table style='width:100%'> <tr> <td class=legend>{amavisSpamLover}:</td> <td>" . Field_TRUEFALSE_checkbox_img('amavisSpamLover',$user->amavisSpamLover,'{enable_disable}')."</td> </tR> <tr> <td class=legend>{amavisBadHeaderLover}:</td> <td>" . Field_TRUEFALSE_checkbox_img('amavisBadHeaderLover',$user->amavisBadHeaderLover,'{enable_disable}')."</td> </tR> <tr> <td class=legend>{amavisBypassVirusChecks}:</td> <td>" . Field_TRUEFALSE_checkbox_img('amavisBypassVirusChecks',$user->amavisBypassVirusChecks,'{enable_disable}')."</td> </tR> <tr> <td class=legend>{amavisBypassSpamChecks}:</td> <td>" . Field_TRUEFALSE_checkbox_img('amavisBypassSpamChecks',$user->amavisBypassSpamChecks,'{enable_disable}')."</td> </tR> <tr> <td class=legend>{amavisBypassHeaderChecks}:</td> <td>" . Field_TRUEFALSE_checkbox_img('amavisBypassHeaderChecks',$user->amavisBypassHeaderChecks,'{enable_disable}')."</td> </tR> <tr> <td class=legend>{amavisSpamModifiesSubj}:</td> <td>" . Field_TRUEFALSE_checkbox_img('amavisSpamModifiesSubj',$user->amavisSpamModifiesSubj,'{enable_disable}')."</td> </tR> <tr> <td class=legend>{amavisSpamTagLevel}:</td> <td>" . Field_text('amavisSpamTagLevel',$user->amavisSpamTagLevel,'width:90px')."</td> </tR> <tr> <td class=legend>{amavisSpamTag2Level}:</td> <td>" . Field_text('amavisSpamTag2Level',$user->amavisSpamTag2Level,'width:90px')."</td> </tR> <tr> <td class=legend>{amavisSpamKillLevel}:</td> <td>" . Field_text('amavisSpamKillLevel',$user->amavisSpamKillLevel,'width:90px')."</td> </tR> <tr> <td colspan=2 align='right'><hr> ". button("{apply}","SaveUserAmavis()")." </td> </tr> </table> "; $html=" <H3>{spam_rules}</H3> <div class=text-info>{amavis_user_text}</div> <hr> $button_admin <div id='user-amavis'>$form</div> "; /* amavisSpamLover: FALSE amavisBadHeaderLover: FALSE amavisBypassVirusChecks: FALSE amavisBypassSpamChecks: FALSE amavisBypassHeaderChecks: FALSE amavisSpamTagLevel: -999 amavisSpamTag2Level: 5 amavisSpamKillLevel: 5 amavisSpamModifiesSubj: TRUE */ echo $tpl->_ENGINE_parse_body($html,'amavis.index.php'); }
function altermime_disclaimer() { $user = new user($_SESSION["uid"]); writelogs("user_disclaimer:: user_disclaimer({$user->ou},{$user->uid})", __FUNCTION__, __FILE__, __LINE__); $dd = new user_disclaimer($user->ou, $user->uid); if (isset($_POST["DisclaimerContent"])) { $dd->DisclaimerActivate = $_POST["DisclaimerActivate"]; $dd->DisclaimerOutbound = $_POST["DisclaimerOutbound"]; $dd->DisclaimerInbound = $_POST["DisclaimerInbound"]; $dd->DisclaimerContent = $_POST["DisclaimerContent"]; $dd->uid = $_SESSION["uid"]; $dd->ou = $user->ou; $dd->SaveDislaimerParameters(); } if ($dd->DisclaimerContent == null) { $dd->DisclaimerContent = $dd->DisclaimerExample; } $tpl = new templates(); $tiny = TinyMce('DisclaimerContent', stripslashes($dd->DisclaimerContent)); $page = CurrentPageName(); $html = "\n\t<H1>{$user->ou}/{$user->DisplayName}</H1>\n\t<p class=caption>{edit_disclaimer_text}</p>\n\t<form name='tinymcedisclaimer' method='post' action=\"{$page}\">\n\t<div style='background-color:white;margin:5px'>\n\t<table style='width:99%' class=form style='background-color:white'>\n\t<tr>\n\t\t<td class=legend>{enable_disclaimer}:</td>\n\t\t<td>" . Field_TRUEFALSE_checkbox_img("DisclaimerActivate", $dd->DisclaimerActivate, "{enable_disable}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{enable_outbound}:</td>\n\t\t<td>" . Field_TRUEFALSE_checkbox_img("DisclaimerOutbound", $dd->DisclaimerOutbound, "{enable_disable}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{enable_inbound}:</td>\n\t\t<td>" . Field_TRUEFALSE_checkbox_img("DisclaimerInbound", $dd->DisclaimerInbound, "{enable_disable}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "document.forms['tinymcedisclaimer'].submit();") . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t{$tiny}\n\t<hr>\n\t<center>" . button("{apply}", "document.forms['tinymcedisclaimer'].submit();") . "</center>\n\t</form>\n\t\n\t\n\t"; $tpl = new templates(); $page = $tpl->_ENGINE_parse_body($html); echo $tpl->PopupPage($page); }
function PageUserMailBoxForm($uid) { include_once dirname(__FILE__) . "/ressources/class.cyrus.inc"; $ldap = new clladp(); $hash = $ldap->UserDatas($uid); if ($hash["MailboxActive"] == 'TRUE') { $cyrus = new cyrus(); $res = $cyrus->get_quota_array($uid); if ($cyrus->connection_off == true or $cyrus->error == true) { return $tpl->_parse_body('{cyrus_connection_error}'); } $free = $cyrus->USER_STORAGE_LIMIT - $cyrus->USER_STORAGE_USAGE; $mailboxInfos = "<tr><td> </td><td style='font-size:9px' align='left'><i>{$cyrus->USER_STORAGE_LIMIT} bytes/{$cyrus->USER_STORAGE_USAGE} bytes ({$free} bytes {free})</i></td></tr>"; } if ($ldap->ldap_last_error != null) { return nl2br($ldap->ldap_last_error); } $html = "<fieldset><legend>{$hash["displayName"]}</legend>\n \t<form name='FFUserMailBox'>\n \t<input type='hidden' name='TreeUserMailBoxEdit' value='{$uid}'>\n \t<table style='width:100%'>\n \t\n \t<tr>\n\t \t\n \t\t<td align='right' width=1%>" . Field_TRUEFALSE_checkbox_img('MailboxActive', $hash["MailboxActive"]) . "</td>\n\t \t<td><strong>{MailboxActive}</strong>\n\t \t\n \t</tr>\n \t<tr>\n\t \t<td align='right' nowrap><strong>{mailbox account}:</strong></td>\n\t \t<td>{$uid}</td>\n \t</tr> \t\n \t<tr>\n\t \t<td align='right' nowrap><strong>{mailbox quota}:</strong></td>\n\t \t<td>" . Field_text('MailBoxMaxSize', $hash["MailBoxMaxSize"], 'width:30%') . " MB</td>\n \t</tr>\n \t\t{$mailboxInfos}\n \t<tr>\n \t\t<td colspan=2 align='right'><input type='button' value='{submit} »' OnClick=\"javascript:ParseForm('FFUserMailBox','domains.php',true);\"></td>\n \t</tr>\n \t<tr>\n \t\t<td colspan=2 align='right'><input type='button' value='« {cyrus_apply_config} »' OnClick=\"javascript:Cyrus_mailbox_apply_settings('{$uid}');\"></td></td>\n \t</tr> \t\n \t</table>\n \t</form>\n \t</fieldset>"; $tpl = new templates(); return DIV_SHADOW($tpl->_ENGINE_parse_body($html), 'windows'); }
function USER_MAILBOX($uid) { $users = new usersMenus(); if ($users->ZARAFA_INSTALLED) { return ZARAFA_MAILBOX($uid); } $page = CurrentPageName(); $RealMailBox = false; $page = CurrentPageName(); $user = new user($uid); $cyr = new cyrus(); $sock = new sockets(); $tpm = $sock->getfile('MbxStat:' . $uid); if (preg_match('#TRUE#', $tpm)) { $RealMailBox = true; } if (!$RealMailBox) { return USER_MAILBOX_NONEXISTENT($uid); $no_mailbox = "<p class=caption style='color:red'>{user_no_mailbox} !!</p>"; } if ($user->MailboxActive == 'TRUE') { $cyrus = new cyrus(); $res = $cyrus->get_quota_array($uid); $size = $cyrus->MailboxInfosSize($uid); $orgfree = $cyrus->USER_STORAGE_LIMIT - $cyrus->USER_STORAGE_USAGE; $free = FormatBytes($orgfree); if ($cyrus->MailBoxExists($uid)) { $graph1 = InsertChart('js/charts.swf', "js/charts_library", "listener.graphs.php?USER_STORAGE_USAGE={$cyrus->USER_STORAGE_USAGE}&STORAGE_LIMIT={$cyrus->USER_STORAGE_LIMIT}&FREE={$orgfree}", 200, 167, "", true, $users->ChartLicence); } else { $graph1 = "<H3>{no_mailbox_user}</H3>"; } $mailboxInfos = "<div>\n\t\t\t<i>" . FormatBytes($cyrus->USER_STORAGE_USAGE) . "/" . FormatBytes($cyrus->USER_STORAGE_LIMIT) . "<br>\n\t\t\t ({$free} {free})</i><br><strong>" . FormatBytes($size) . " used</strong>\n\t\t\t </div>"; } $tpl = new templates(); $export_mailbox = $tpl->_ENGINE_parse_body('{export_mailbox}'); $import_mailbox = $tpl->_ENGINE_parse_body('{import_mailbox}'); if (strlen($import_mailbox) > strlen($export_mailbox)) { $import_mailbox = substr($import_mailbox, 0, strlen($export_mailbox) - 3) . "..."; } //sudo -u cyrusimap /usr/bin/cyrus/bin/reconstruct -r -f user/shortname $repair = "<br>\n <table style='width:100%;border: 1px solid #005447'>\n <tr>\n \t<td coslpan=2><H3 style='color:#005447'>{tools}</H3></td>\n </tr>\n \t<tr " . CellRollOver() . ">\n \t\t\t<td width=99% class=legend nowrap>" . texttooltip('{repair_mailbox}', '{repair_mailbox_text}', "javascript:Loadjs('{$page}?script=repair_mailbox&uid={$uid}');") . "</td>\n\t\t\t\t<td width=1%>" . imgtootltip("icon_roles.gif", '{repair_mailbox_text}', "Loadjs('{$page}?script=repair_mailbox&uid={$uid}');") . "</td> \t\t\t\n \t</tr>\n \t<tr " . CellRollOver() . ">\n \t\t\t<td width=99% class=legend nowrap>" . texttooltip($export_mailbox, '{export_mailbox_text}', "javascript:Loadjs('{$page}?script=export_script&uid={$uid}');") . "</td>\n\t\t\t\t<td width=1%>" . imgtootltip("icon_roles.gif", '{export_mailbox_text}', "Loadjs('{$page}?script=export_script&uid={$uid}');") . "</td> \t\t\t\n \t</tr> \n \t\n\t\t<tr " . CellRollOver() . ">\n \t\t\t<td width=99% class=legend nowrap>" . texttooltip($import_mailbox, '{import_mailbox_text}', "javascript:Loadjs('mailsync.php?uid={$uid}');") . "</td>\n\t\t\t\t<td width=1%>" . imgtootltip("icon_sync.gif", '{export_mailbox_text}', "Loadjs('mailsync.php?uid={$uid}');") . "</td> \t\t\t\n \t</tr> \n \t\n \t<tr " . CellRollOver() . ">\n \t\t\t<td width=99% class=legend nowrap>" . texttooltip('{empty_this_mailbox}', '{empty_this_mailbox_text}', "javascript:Loadjs('domains.edit.user.empty.mailbox.php?&userid={$uid}');") . "</td>\n\t\t\t\t<td width=1%>" . imgtootltip("ed_delete.gif", '{delete_this_mailbox}', "Loadjs('domains.edit.user.empty.mailbox.php?&userid={$uid}');") . "</td> \t\t\t\n \t</tr> \t \t \t\n \t\n \t \t\n \t<tr " . CellRollOver() . ">\n \t\t\t<td width=99% class=legend nowrap>" . texttooltip('{delete_this_mailbox}', '{delete_this_mailbox_text}', "javascript:Loadjs('{$page}?script=delete_mailbox&uid={$uid}');") . "</td>\n\t\t\t\t<td width=1%>" . imgtootltip("ed_delete.gif", '{delete_this_mailbox}', "Loadjs('{$page}?script=delete_mailbox&uid={$uid}');") . "</td> \t\t\t\n \t</tr> \n \t\n \t\n \t\n \t \t\n \t\n \t \t\n </table>"; $img_left_mbx = imgtootltip('folder-mailbox-96.png', "{debug}", "Loadjs('{$page}?debug-mailbox-js={$uid}')"); if (!$RealMailBox) { $repair = null; } $priv = new usersMenus(); $ini = new Bs_IniHandler(); $ini->loadString($user->MailboxSecurityParameters); $button = " \n \t<tr>\n \t\t<td colspan=2 align='right'>\n \t\t<hr>\n \t\t" . button("{change}", "Loadjs('domains.edit.user.create.mbx.php?uid={$uid}')") . "\n \t\t</td>\n \t</tr>\n \t"; if ($priv->AllowAddUsers == false) { $button = null; $img_left_mbx = "<img src='img/folder-mailbox-96.png'>"; } $subtitle = "{user_quota}"; $main_graph = "<div style='border:1px solid #005447;padding:5px;margin:3px'><span id='mailbox_graph'>{$graph1}</span></div>"; if ($user->MailBoxMaxSize == 0) { $subtitle = "{user_has_no_quota}"; $graph1 = null; $mailboxInfos = "<strong>" . FormatBytes($size) . " used</strong>"; $mailboxInfos = null; $main_graph = null; } if ($ldap->ldap_last_error != null) { return nl2br($ldap->ldap_last_error); } $html = "\n \t<table style='width:100%'>\n \t<tr>\n \t<td width=1% valign='top'>{$img_left_mbx}</td>\n \t\t<td>\n\t\t \t<h1>{$user->DisplayName} {mailbox}</h1>\n\t\t \t<form name='FFUserMailBox'>\n\t\t \t<input type='hidden' name='UserMailBoxEdit' value='{$uid}'>\n\t\t \t<table style='width:100%'>\n\t\t \t<tr><td colspan=2>\n\t\t \t\t<H3 style='font-size:18px;color:#005447'>{settings}</h3>\n\t\t \t\t<hr style='border-color:#005447'>\n\t\t \t</td>\n\t\t \t<tr>\n\t\t \t<td valign='top'>\n\t\t \t{$no_mailbox}\n\t\t \t<table style='width:100%'>\n\t\t \t\n\t\t \t<tr>\n\t\t \t\t<td align='right' width=1%>" . Field_TRUEFALSE_checkbox_img('MailboxActive', $user->MailboxActive) . "</td>\n\t\t\t \t<td class=legend style='text-align:left'>{MailboxActive}</td>\t\t\t \t\n\t\t \t</tr>\n\t\t \t<tr>\n\t\t\t \t<td class=legend>{mailbox account}:</td>\n\t\t\t \t<td>{$uid}</td>\n\t\t \t</tr> \t\n\t\t \t<tr>\n\t\t\t \t<td align='right' nowrap class=legend valign='top'>{mailbox quota}:</td>\n\t\t\t \t<td>\n\t\t\t \t\t<table style='width:100%'>\n\t\t\t \t\t\t<tr>\n\t\t\t \t\t\t\t<td width=1% nowrap>" . Field_text('MailBoxMaxSize', $user->MailBoxMaxSize, 'width:45px') . " MB</td>\n\t\t\t \t\t\t\t<td align='left'>" . help_icon($mailboxInfos, true) . "</td>\n\t\t\t \t\t\t</tr>\n\t\t\t \t\t\t<tr>\n\t\t\t \t\t\t<td colspan=2><strong>{$subtitle}</strong></td>\n\t\t\t \t\t\t</tr>\n\t\t\t \t\t\t\n\t\t\t \t\t</table>\n\t\t\t \t</td>\n\t\t \t</tr>\n\t\t \t<tr><td colspan=2><br><H3 style='font-size:18px;color:#005447'>{mailbox_priv}</h3><hr style='border-color:#005447'></td>\n\t\t \t<tr><td colspan=2 align='left'>\n\t\t \t\t\t<table style='width:60%'>\n\t\t \t\t\t\t<tr>\n\t\t\t\t \t\t\t<td class=legend>{mplt}:</td> \n\t\t\t\t \t\t\t<td>" . Field_checkbox('mp_l', 1, $ini->_params["mailbox"]["l"], null, '{mpl}') . "</td>\n\t\t\t \t\t\t</tr> \n\t\t\t \t\t\t<tr>\n\t\t\t\t \t\t\t<td class=legend nowrap>{mprt}:</td>\n\t\t\t\t \t\t\t<td>" . Field_checkbox('mp_r', 1, $ini->_params["mailbox"]["r"], null, '{mpr}') . "</td>\n\t\t\t \t\t\t</tr> \n\t\t\t \t\t\t<tr>\n\t\t\t\t \t\t\t<td class=legend nowrap>{mpst}:</td>\n\t\t\t\t \t\t\t<td>" . Field_checkbox('mp_s', 1, $ini->_params["mailbox"]["s"], null, '{mps}') . "</td>\n\t\t\t \t\t\t</tr> \n\t\t\t \t\t\t<tr>\n\t\t\t\t \t\t\t<td class=legend nowrap>{mpwt}:</td>\n\t\t\t\t \t\t\t<td>" . Field_checkbox('mp_w', 1, $ini->_params["mailbox"]["w"], null, '{mpw}') . "</td>\n\t\t\t \t\t\t</tr> \t\n\t\t\t \t\t\t<tr>\n\t\t\t\t \t\t\t<td class=legend nowrap>{mpit}:</td>\n\t\t\t\t \t\t\t<td>" . Field_checkbox('mp_i', 1, $ini->_params["mailbox"]["i"], null, '{mpi}') . "</td>\n\t\t\t \t\t\t</tr> \t\n\t\t\t \t\t\t<tr>\n\t\t\t\t \t\t\t<td class=legend nowrap>{mppt}:</td>\n\t\t\t\t \t\t\t<td>" . Field_checkbox('mp_p', 1, $ini->_params["mailbox"]["p"], null, '{mpp}') . "</td>\n\t\t\t \t\t\t</tr>\n\t\t\t \t\t\t<tr>\n\t\t\t\t \t\t\t<td class=legend nowrap>{mpct}:</td>\n\t\t\t\t \t\t\t<td>" . Field_checkbox('mp_c', 1, $ini->_params["mailbox"]["c"], null, '{mpc}') . "</td>\n\t\t\t \t\t\t</tr>\t\n\t\t\t \t\t\t<tr>\n\t\t\t\t \t\t\t<td class=legend nowrap>{mpdt}:</td>\n\t\t\t\t \t\t\t<td>" . Field_checkbox('mp_d', 1, $ini->_params["mailbox"]["d"], null, '{mpd}') . "</td>\n\t\t\t \t\t\t</tr>\t\n\t\t\t \t\t\t<tr>\n\t\t\t\t \t\t\t<td class=legend nowrap><strong>{mpat}</strong>:</td>\n\t\t\t\t \t\t\t<td>" . Field_checkbox('mp_a', 1, $ini->_params["mailbox"]["a"], null, '{mpa}') . "</td>\n\t\t\t \t\t\t</tr>\t\t \t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\t\t\t \t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\t\t\n\t\t\t \t\t</table>\n\t\t \t\t</td>\n\t\t \t</tr>\n\t\t \t\n\t\t \t\n\t\t \t\t\t{$button}\n\t\t \t</table>\n\t\t \t</td>\n\t\t \t<td valign='top' class=legend style='border-left:3px solid #005447;padding:5px'>\n\t\t\t\t\t\t{$main_graph}\n \t\t\t\t\t{$mailboxInfos}\n \t\t\t\t\t{$repair}\n \t\t\t</td>\n\t\t \t</table>\n\t\t \t</form></td>\n\t\t </tr>\n\t\t </table>"; $html = "{$html}"; return $tpl->_ENGINE_parse_body($html); }
function domain_amavis_front() { $sock = new sockets(); $users = new usersMenus(); $tpl = new templates(); $domain = $_GET["domain"]; $page = CurrentPageName(); if (!$users->AMAVIS_INSTALLED) { echo $tpl->_ENGINE_parse_body("<div class=explain>{NO_FEATURE_AMAVIS_NOT_INSTALLED}</div>"); return; } $EnableAmavisDaemon = $sock->GET_INFO("EnableAmavisDaemon"); $EnableLDAPAmavis = $sock->GET_INFO("EnableLDAPAmavis"); if (!is_numeric($EnableLDAPAmavis)) { $EnableLDAPAmavis = 0; } if (!is_numeric($EnableAmavisDaemon)) { $EnableAmavisDaemon = 0; } if ($EnableAmavisDaemon == 0) { echo $tpl->_ENGINE_parse_body("<div class=explain>{NO_FEATURE_AMAVIS_NOT_ENABLED}</div>"); return; } $amavis_bypass_rcpt = 0; $sql = "SELECT `pattern` FROM amavis_bypass_rcpt WHERE `pattern`='{$_GET["domain"]}'"; $q = new mysql(); $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); if ($ligne["pattern"] != null) { $amavis_bypass_rcpt = 1; } $amavis_bypass_rcpt_html = "\n\t<table style='width:99%;margin-bottom:5px' class=form>\n\t<tr>\n\t\t<td class=legend>{bypass_content_filter_for_inbound_domain}:</td>\n\t\t<td>" . Field_checkbox("amavis_bypass_rcpt", 1, $amavis_bypass_rcpt, "amavis_bypass_rcpt_domainCheck()") . "</td>\n\t</tr>\n\t</table>\n\t<script>\n\t\n\t\tvar x_amavis_bypass_rcpt_domainCheck= function (obj) {\n\t\t\t\tvar results=obj.responseText;\n\t\t\t\tif(results.length>0){alert(results);}\n\t\t\t}\n\t\n\tfunction amavis_bypass_rcpt_domainCheck(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('amavis_bypass_rcpt')){XHR.appendData('amavis_bypass_rcpt','1');}else{XHR.appendData('amavis_bypass_rcpt','0');}\n\t\tXHR.appendData('domain','{$domain}');\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_amavis_bypass_rcpt_domainCheck);\t\n\t\t}\n\t\t\n\t</script>\n\t"; echo $tpl->_ENGINE_parse_body($amavis_bypass_rcpt_html); if ($EnableLDAPAmavis == 0) { echo $tpl->_ENGINE_parse_body("<div class=explain>{EnableLDAPAmavis_is_disabled_explain}</div>"); return; } if (!$users->AllowChangeAntiSpamSettings) { echo $tpl->_ENGINE_parse_body("alert('{ERROR_NO_PRIVS}')"); exit; } $dom = new DomainsTools(); $dom->LoadAmavisDomain($domain); $button_admin = "<div style='text-align:center'>" . button('{back_to_defaults}', "GoBackDefaultAmavis()") . "</div>"; $button_save = "<div style='text-align:right;width:100%'>" . button('{apply}', "SaveUserAmavis()") . "</div>"; if ($EnableLDAPAmavis == 0) { $button_save = null; $button_admin = null; } $form1 = "\n<table style='width:99%' class=form>\n<tr>\n\t<td class=legend>{amavisSpamLover}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisSpamLover', $dom->amavisSpamLover, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBadHeaderLover}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBadHeaderLover', $dom->amavisBadHeaderLover, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBypassVirusChecks}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBypassVirusChecks', $dom->amavisBypassVirusChecks, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBypassSpamChecks}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBypassSpamChecks', $dom->amavisBypassSpamChecks, '{enable_disable}') . "</td>\n</tR>\n<tr>\n\t<td class=legend>{amavisBypassHeaderChecks}:</td>\n\t<td>" . Field_TRUEFALSE_checkbox_img('amavisBypassHeaderChecks', $dom->amavisBypassHeaderChecks, '{enable_disable}') . "</td>\n</tR>\n</table>\n{$button_save}"; $sa_quarantine_cutoff_level = $tpl->_ENGINE_parse_body('{sa_quarantine_cutoff_level}', 'amavis.index.php,spamassassin.index.php'); if (strlen($sa_quarantine_cutoff_level) > 50) { $sa_quarantine_cutoff_level = texttooltip(substr($sa_quarantine_cutoff_level, 0, 47) . '...', $sa_quarantine_cutoff_level); } $sa_dsn_cutoff_level = $tpl->_ENGINE_parse_body('{sa_dsn_cutoff_level}', 'amavis.index.php,spamassassin.index.php'); if (strlen($sa_dsn_cutoff_level) > 50) { $sa_dsn_cutoff_level = texttooltip(substr($sa_dsn_cutoff_level, 0, 47) . '...', $sa_dsn_cutoff_level); } $form2 = "\n\n<table style='width:99%' class=form>\t\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{sa_tag2_level_deflt}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamTag2Level', $dom->amavisSpamTag2Level, 'width:90px') . "</td>\n\t\t\t<td> </td>\n\t\t\t\t\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{sa_kill_level_deflt}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamKillLevel', $dom->amavisSpamKillLevel, 'width:90px') . "</td>\n\t\t\t<td> </td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$sa_dsn_cutoff_level}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamDsnCutoffLevel', $dom->amavisSpamDsnCutoffLevel, 'width:90px') . "</td>\n\t\t\t<td> </td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$sa_quarantine_cutoff_level}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamQuarantineCutoffLevel', $dom->amavisSpamQuarantineCutoffLevel, 'width:90px') . "</td>\n\t\t\t<td> </td>\n\t\t</tr>\n\t</table>\n\n"; $spam_subject_tag2_maps = $tpl->_ENGINE_parse_body('{spam_subject_tag2_maps}', 'amavis.index.php,spamassassin.index.php'); $form3 = "\n<table style='width:99%' class=form>\n<tr>\n\t\n\t\n\t<td class=legend nowrap>{amavisSpamModifiesSubj}:</td>\n\t<td width=1%>" . Field_TRUEFALSE_checkbox_img('amavisSpamModifiesSubj', $dom->amavisSpamModifiesSubj, '{enable_disable}') . "</td>\t\n\t\n</tr>\t\n</table>\n<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{spam_subject_tag_maps}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamSubjectTag', $dom->amavisSpamSubjectTag, 'width:190px') . "</td>\n\t\t\t<td class=legend nowrap>{score}:</td>\n\t\t\t<td>" . Field_text("amavisSpamTagLevel", $dom->amavisSpamTagLevel, 'width:33px') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$spam_subject_tag2_maps}:</td>\n\t\t\t<td width=1%>" . Field_text('amavisSpamSubjectTag2', $dom->amavisSpamSubjectTag2, 'width:190px') . "</td>\n\t\t\t<td> </td>\n\t\t\t<td> </td>\n\t\t</tr>\t\t\n</table>\n\n"; $html = "\n<div class=explain>{amavis_domain_text}</div>\n<div id='domain-amavis'>{$form1}<br>{$form2}<br>{$form3}</div>{$button_save}\n<div style='text-align:right;width:100%'>{$button_admin}</div>\n\n\n\n\n\n\n"; /* amavisSpamLover: FALSE amavisBadHeaderLover: FALSE amavisBypassVirusChecks: FALSE amavisBypassSpamChecks: FALSE amavisBypassHeaderChecks: FALSE amavisSpamTagLevel: -999 amavisSpamTag2Level: 5 amavisSpamKillLevel: 5 amavisSpamModifiesSubj: TRUE */ echo $tpl->_ENGINE_parse_body($html, 'amavis.index.php,spamassassin.index.php'); }
function page() { $uid = $_GET["uid"]; $uidenc = urlencode($uid); $users = new usersMenus(); $page = CurrentPageName(); $RealMailBox = false; $tpl = new templates(); $page = CurrentPageName(); $user = new user($uid); $t = time(); $cyr = new cyrus(); if ($GLOBALS["VERBOSE"]) { echo "<H1> cyrus ( ) -> IfMailBoxExists({$uid})</H1>\n"; } $RealMailBox = $cyr->IfMailBoxExists($uid); if (!$RealMailBox) { if (preg_match("#Authentication failed#i", $cyr->cyrus_infos)) { echo USER_MAILBOX_AUTHENTICATION_FAILED($uid, nl2br($cyr->cyrus_infos)); return; } echo USER_MAILBOX_NONEXISTENT($uid, nl2br($cyr->cyrus_infos)); $no_mailbox = "<p class=caption style='color:red'>{user_no_mailbox} !!</p>"; return; } if ($user->MailboxActive == 'TRUE') { $cyrus = new cyrus(); $res = $cyrus->get_quota_array($uid); $size = $cyrus->MailboxInfosSize($uid); $orgfree = $cyrus->USER_STORAGE_LIMIT - $cyrus->USER_STORAGE_USAGE; $free = FormatBytes($orgfree); if ($cyrus->MailBoxExists($uid)) { $graph1 = InsertChart('js/charts.swf', "js/charts_library", "listener.graphs.php?USER_STORAGE_USAGE={$cyrus->USER_STORAGE_USAGE}&STORAGE_LIMIT={$cyrus->USER_STORAGE_LIMIT}&FREE={$orgfree}", 200, 167, "", true, $users->ChartLicence); } else { $graph1 = "<H3>{no_mailbox_user}</H3>"; } $mailboxInfos = "<div>\n\t\t\t<i>" . FormatBytes($cyrus->USER_STORAGE_USAGE) . "/" . FormatBytes($cyrus->USER_STORAGE_LIMIT) . "<br>\n\t\t\t({$free} {free})</i><br><strong>" . FormatBytes($size) . " used</strong>\n\t\t\t </div>"; } $export_mailbox = $tpl->_ENGINE_parse_body('{export_mailbox}'); $import_mailbox = $tpl->_ENGINE_parse_body('{import_mailbox}'); if (strlen($import_mailbox) > strlen($export_mailbox)) { $import_mailbox = substr($import_mailbox, 0, strlen($export_mailbox) - 3) . "..."; } //sudo -u cyrusimap /usr/bin/cyrus/bin/reconstruct -r -f user/shortname $tr[] = button("{repair_mailbox}", "Loadjs('domains.edit.user.php?script=repair_mailbox&uid={$uidenc}');"); $tr[] = button("{export_mailbox}", "Loadjs('domains.edit.user.php?script=export_script&uid={$uidenc}');"); $tr[] = button("{empty_this_mailbox}", "Loadjs('domains.edit.user.empty.mailbox.php?&userid={$uidenc}');"); $tr[] = button("{delete_this_mailbox}", "Loadjs('domains.edit.user.php?script=delete_mailbox&uid={$uidenc}');"); $repair = CompileTr3($tr); if (!$RealMailBox) { $repair = null; } $priv = new usersMenus(); $ini = new Bs_IniHandler(); $ini->loadString($user->MailboxSecurityParameters); $button = "\n \t<tr>\n \t\t<td colspan=2 align='right'>\n \t\t<hr>\n \t\t" . button("{apply}", "Save{$t}()", 26) . "\n \t\t</td>\n \t</tr>\n \t"; if ($priv->AllowAddUsers == false) { $button = null; $img_left_mbx = "<img src='img/folder-mailbox-96.png'>"; } $subtitle = "{user_quota}"; $main_graph = "<div style='border:1px solid #005447;padding:5px;margin:3px'><span id='mailbox_graph'>{$graph1}</span></div>"; if ($user->MailBoxMaxSize == 0) { $subtitle = "<i>{user_has_no_quota}</i>"; $graph1 = null; $mailboxInfos = "<strong>" . FormatBytes($size) . " used</strong>"; $mailboxInfos = null; $main_graph = null; } if ($ldap->ldap_last_error != null) { return nl2br($ldap->ldap_last_error); } $ADDisable = 0; if ($priv->EnableManageUsersTroughActiveDirectory) { $ADDisable = 1; $button = null; } if ($subtitle != null) { $subtitle = "<p class=text-info style='font-size:16px'>{$subtitle}</p>"; } $html = "\n<div id='usermailboxformdiv'>\n<table style='width:100%'>\n<form name='FFUserMailBox'>\n<input type='hidden' name='UserMailBoxEdit' value='{$uid}'>\n<table style='width:100%'>\n\t<tr>\n\t\t<td colspan=3>\n\t\t\t<div style='font-size:30px;margin-bottom:20px'>{mailbox} {mailbox account}: {$uid}</div>{$mailboxInfo}\n\t\t</td>\n\t</tr>\n\t\t<td class=legend style='font-size:18px' class=legend>{MailboxActive}</td>\n\t\t<td align='right'>" . Field_TRUEFALSE_checkbox_img('MailboxActive', $user->MailboxActive) . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' nowrap class=legend valign='middle' \n\t\t\tstyle='vertical-align:middle;font-size:18px'>{mailbox quota}:</td>\n\t\t<td style='font-size:18px'>" . Field_text('MailBoxMaxSize', $user->MailBoxMaxSize, 'width:95px;font-size:18px') . " MB</td>\n\t\t<td align='left'>" . help_icon($mailboxInfos, true) . "</td>\n\t</tr>\n\t<tr>\n\t<td colspan=3>{$subtitle}</td>\n\t</tr>\n\t<tr>\n\t<td colspan=3><div style='font-size:30px;margin-bottom:20px'>{mailbox_priv}</div></td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='text-align:rigth;font-size:18px'>{mplt}:</td>\n\t\t<td>" . Field_checkbox('mp_l', 1, $ini->_params["mailbox"]["l"], null, '{mpl}') . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap style='text-align:rigth;font-size:18px'>{mprt}:</td>\n\t\t<td>" . Field_checkbox('mp_r', 1, $ini->_params["mailbox"]["r"], null, '{mpr}') . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap style='text-align:rigth;font-size:18px'>{mpst}:</td>\n\t\t<td>" . Field_checkbox('mp_s', 1, $ini->_params["mailbox"]["s"], null, '{mps}') . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap style='text-align:rigth;font-size:18px'>{mpwt}:</td>\n\t\t<td>" . Field_checkbox('mp_w', 1, $ini->_params["mailbox"]["w"], null, '{mpw}') . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap style='text-align:rigth;font-size:18px'>{mpit}:</td>\n\t\t<td>" . Field_checkbox('mp_i', 1, $ini->_params["mailbox"]["i"], null, '{mpi}') . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap style='text-align:rigth;font-size:18px'>{mppt}:</td>\n\t\t<td>" . Field_checkbox('mp_p', 1, $ini->_params["mailbox"]["p"], null, '{mpp}') . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap style='text-align:rigth;font-size:18px'>{mpct}:</td>\n\t\t<td>" . Field_checkbox('mp_c', 1, $ini->_params["mailbox"]["c"], null, '{mpc}') . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap style='text-align:rigth;font-size:18px'>{mpdt}:</td>\n\t\t<td>" . Field_checkbox('mp_d', 1, $ini->_params["mailbox"]["d"], null, '{mpd}') . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t<td class=legend nowrap style='text-align:rigth;font-size:18px'><strong>{mpat}</strong>:</td>\n\t<td>" . Field_checkbox('mp_a', 1, $ini->_params["mailbox"]["a"], null, '{mpa}') . "</td>\n\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 align='right'>{$button}</td>\n\t</tr>\n\t</table>\n<p> </p>\n{$repair}\n{$main_graph}\n\n<script>\n\tvar xSave{$t}= function (obj) {\n\t\tvar MailBoxMaxSize='0';\n\t\tvar tempvalue=obj.responseText;\n\t\tif(document.getElementById('MailBoxMaxSize')){\n\t\t\tvar MailBoxMaxSize=document.getElementById('MailBoxMaxSize').value;\n\t\t}\n\t\tif(tempvalue.length>3){\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\tLoadjs('domains.edit.user.create.mbx.php?uid={$uidenc}&MailBoxMaxSize='+MailBoxMaxSize);\n\t}\t\t\n\n\tfunction Save{$t}(){\n\t\t\n\t\tvar mp_l=1;\n\t\tvar mp_r=1;\n\t\tvar mp_s=1;\n\t\tvar mp_w=1;\n\t\tvar mp_i=1;\n\t\tvar mp_p=1;\n\t\tvar mp_c=1;\n\t\tvar mp_d=1;\n\t\tvar mp_a=1;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('Save','{$uid}');\n\t\tXHR.appendData('MailboxActive',document.getElementById('MailboxActive').value);\n\t\tXHR.appendData('MailBoxMaxSize',document.getElementById('MailBoxMaxSize').value);\n\t\tif(document.getElementById('mp_l').checked){mp_l=1;}else{mp_l=0;}\n\t\tif(document.getElementById('mp_r').checked){mp_r=1;}else{mp_r=0;}\n\t\tif(document.getElementById('mp_s').checked){mp_s=1;}else{mp_s=0;}\n\t\tif(document.getElementById('mp_w').checked){mp_w=1;}else{mp_w=0;}\n\t\tif(document.getElementById('mp_i').checked){mp_i=1;}else{mp_i=0;}\n\t\tif(document.getElementById('mp_p').checked){mp_p=1;}else{mp_p=0;}\n\t\tif(document.getElementById('mp_c').checked){mp_c=1;}else{mp_c=0;}\n\t\tif(document.getElementById('mp_d').checked){mp_d=1;}else{mp_d=0;}\n\t\tif(document.getElementById('mp_a').checked){mp_a=1;}else{mp_a=0;}\t\n\t\t\n\t\tXHR.appendData('mp_l',mp_l);\n\t\tXHR.appendData('mp_r',mp_r);\n\t\tXHR.appendData('mp_s',mp_s);\n\t\tXHR.appendData('mp_w',mp_w);\n\t\tXHR.appendData('mp_i',mp_i);\n\t\tXHR.appendData('mp_p',mp_p);\n\t\tXHR.appendData('mp_c',mp_c);\n\t\tXHR.appendData('mp_d',mp_d);\n\t\tXHR.appendData('mp_a',mp_a);\n\t\t\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n\t}\n\t\t\t\t\t\t\t\n</script>\n"; echo $tpl->_ENGINE_parse_body($html); }