Example #1
0
function backup_index()
{
    $ini = new Bs_IniHandler();
    $computer = new computers($_GET["popup-index"] . '$');
    $ini->loadString($computer->ComputerCryptedInfos);
    $text = "<div><code>{$computer->ComputerIP}</code></div>\n\t<div><code>{$computer->ComputerMacAddress}</code></div>\n\t<div><code>{$computer->ComputerOS}</code></div>\n\t<div><code>{$computer->ComputerMachineType}</code></div>";
    $computer_icon = Paragraphe("64-computer.png", "{$computer->DisplayName}", $text);
    $schedule_icon = Paragraphe("64-planning.png", '{SET_SCHEDULE}', '{SET_SCHEDULE_TEXT}', "javascript:Loadjs('cron.php?function=SaveSchedule&field=schedule')");
    $enable_backup = Paragraphe_switch_img_32('{enable_backup}', '{enable_backup_text}', 'EnableBackupAccount', $computer->EnableBackupAccount, "{enable_disable}", 300);
    $browse = button_browse_computer($_GET["popup-index"], "share_folder");
    $html = "\n<H1>{BACKUP}::&nbsp;{$computer->DisplayName}</H1>\n<input type='hidden' id='schedule' value='{$ini->_params["SCHEDULE"]["cron"]}'>\n<table style='width:100%'>\n<tr>\n\t<td valign='top'>\n\t\t{$computer_icon}\n\t\t{$schedule_icon}\n\t\t\n\t\t<div id='shareslist' style='width:100%;height:120px;overflow:auto'></div>\t\n\t</td>\n\t<td valign='top'>\n\t<div id='backupcomputerform'>\n\t\t{$enable_backup}\n\t\t\n<table style='width:99%' class=form>\n\t\t<tr>\n\t\t\t<tr>\n\t\t\t<td class=legend>{add_share}:</td>\n\t\t\t<td>" . Field_text("share_folder", null, "width:120px") . "&nbsp;{$browse}</td>\n\t\t\t<td><input type='button' OnClick=\"addComputerShareFolder();\" value='{add}&nbsp;&raquo;'></td>\n\t\t</tr>\t\t\n\t\t</table>\t\n\t\t\n\t\t\n\t\t\n\t\t<table style='width:99%' class=form>\n\t\t<tr>\n\t\t\t<td colspan=2><h3>{remote_smb_share}</h3></td>\t\t\t\n\t\t</tr>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{enable}:</td>\n\t\t\t<td>" . Field_checkbox("enable_smb", 1, $ini->_params["BACKUP_PROTO"]["enable_smb"]) . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td class=legend>{username}:</td>\n\t\t\t<td>" . Field_text("username", $ini->_params["ACCOUNT"]["USERNAME"], "width:120px") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{password}:</td>\n\t\t\t<td>" . Field_password("password", $ini->_params["ACCOUNT"]["PASSWORD"], "width:120px") . "</td>\n\t\t</tr>\t\t\n\t\t</table>\n\t\t\n\t<hr>\n\t<div style='width:100%;text-align:right'><input type='button' value='{apply}&nbsp;&raquo;' OnClick=\"javascript:SaveComputerBackupInfo();\"></div>\n\t</div>\n\t</td>\n</tr>\n</table>\n\n";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function smtpd_client_restrictions_popup()
{
    $sock = new sockets();
    $restrictions = get_restrictions_classes();
    $reject_unknown_client_hostname = Paragraphe_switch_img_32('{reject_unknown_client_hostname}', '{reject_unknown_client_hostname_text}', "reject_unknown_client_hostname", $restrictions["reject_unknown_client_hostname"], "{enable_disable}", "100%");
    $reject_unknown_reverse_client_hostname = Paragraphe_switch_img_32('{reject_unknown_reverse_client_hostname}', '{reject_unknown_reverse_client_hostname_text}', "reject_unknown_reverse_client_hostname", $restrictions["reject_unknown_reverse_client_hostname"], "{enable_disable}", "100%");
    $reject_unknown_sender_domain = Paragraphe_switch_img_32('{reject_unknown_sender_domain}', '{reject_unknown_sender_domain_text}', "reject_unknown_sender_domain", $restrictions["reject_unknown_sender_domain"], "{enable_disable}", "100%");
    $reject_invalid_hostname = Paragraphe_switch_img_32('{reject_invalid_hostname}', '{reject_invalid_hostname_text}', "reject_invalid_hostname", $restrictions["reject_invalid_hostname"], "{enable_disable}", "100%");
    $reject_non_fqdn_sender = Paragraphe_switch_img_32('{reject_non_fqdn_sender}', '{reject_non_fqdn_sender_text}', "reject_non_fqdn_sender", $restrictions["reject_non_fqdn_sender"], "{enable_disable}", "100%");
    $EnablePostfixAntispamPack = Paragraphe_switch_img_32('{EnablePostfixAntispamPack}', '{EnablePostfixAntispamPack_text}', "EnablePostfixAntispamPack", $restrictions["EnablePostfixAntispamPack"], "{enable_disable}", "100%");
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%>\n\t<img src='img/96-planetes-free.png'>\n\t</td>\n\t<td valign='top'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>\n\t\t<p class=caption>{smtpd_client_restrictions_text}</p>\n\t</td>\n\t<td valign='top'>\n\t\t{$whitelists}\n\t</td>\n\t</tr>\n\t</table>\n\t<hr>\n\t<div style='width:100%;text-align:right'>\n\t" . button('{apply}', 'smtpd_client_restrictions_save()') . "\n\t</div>\n\t</td>\n\t</tr>\n\t</table>\n\t<div id='smtpd_client_restrictions_div'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>{$reject_unknown_client_hostname}</td>\n\t<td valign='top'>{$reject_unknown_reverse_client_hostname}</td>\n\t</tr>\n\t<tr>\n\t<td valign='top'>{$reject_unknown_sender_domain}</td>\n\t<td valign='top'>{$reject_invalid_hostname}</td>\n\t</tr>\n\t<tr>\n\t<td valign='top'>{$reject_non_fqdn_sender}</td>\n\t<td valign='top'>{$EnablePostfixAntispamPack}</td>\n\t</tr>\t\n\t</table>\n\t</div>";
    //smtpd_client_connection_rate_limit = 100
    //smtpd_client_recipient_rate_limit = 20
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, "postfix.index.php");
}
Example #3
0
function index()
{
    $users = new usersMenus();
    $sock = new sockets();
    $RsyncDaemonEnable = $sock->GET_INFO("RsyncDaemonEnable");
    $RsyncBwlimit = $sock->GET_INFO("RsyncBwlimit");
    $RsyncPort = $sock->GET_INFO("RsyncPort");
    $RsyncMaxConnections = $sock->GET_INFO("RsyncMaxConnections");
    $RsyncStoragePath = $sock->GET_INFO("RsyncStoragePath");
    $RsyncEnableStunnel = $sock->GET_INFO("RsyncEnableStunnel");
    if ($RsyncBwlimit == null) {
        $RsyncBwlimit = "1000";
    }
    if ($RsyncPort == null) {
        $RsyncPort = "873";
    }
    if ($RsyncMaxConnections == null) {
        $RsyncMaxConnections = "4";
    }
    if ($RsyncPort == null) {
        $RsyncPort = "873";
    }
    if ($RsyncStoragePath == null) {
        $RsyncStoragePath = "/var/spool/rsync";
    }
    if ($RsyncEnableStunnel == null) {
        $RsyncEnableStunnel = "0";
    }
    if ($RsyncEnableStunnelPort == null) {
        $RsyncEnableStunnelPort = 8000;
    }
    $enable = Paragraphe_switch_img_32('{ENABLE_RSYNC_SERVER}', '{ENABLE_RSYNC_SERVER_TEXT}', 'RsyncDaemonEnable', $RsyncDaemonEnable, '{enable_disable}', 220);
    if ($users->stunnel4_installed) {
        $stunnel = "\t<tr>\n\t\t<td class=legend nowrap>{RsyncEnableStunnel}:</td>\n\t\t<td>" . Field_numeric_checkbox_img('RsyncEnableStunnel', $RsyncEnableStunnel, "{enable_disable}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap>{RsyncEnableStunnelPort}:</td>\n\t\t<td>" . Field_text("RsyncEnableStunnelPort", $RsyncEnableStunnelPort, "width:60px") . "</td>\n\t</tr>";
    } else {
        $stunnel = null;
    }
    $view_events = Paragraphe("routing-domain-relay-events.png", "{APP_RSYNC_SERVER_LOG}", "{APP_RSYNC_SERVER_LOG_TEXT}", "javascript:Loadjs('rsync.server.php?js-logs=yes')");
    $form = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend nowrap>{RsyncBwlimit}:</td>\n\t\t<td>" . Field_text("RsyncBwlimit", $RsyncBwlimit, "width:60px") . "&nbsp;KBytes</td>\n\t</tr>\n{$stunnel}\t\n\t<tr>\n\t\t<td class=legend nowrap>{listen_port}:</td>\n\t\t<td>" . Field_text("RsyncPort", $RsyncPort, "width:60px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend nowrap>{max_connections}:</td>\n\t\t<td>" . Field_text("RsyncMaxConnections", $RsyncMaxConnections, "width:20px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend nowrap>{storage_path}:</td>\n\t\t<td>" . Field_text("RsyncStoragePath", $RsyncStoragePath, "width:120px") . "&nbsp;" . button_browse("RsyncStoragePath") . "</td>\n\t</tr>\t\t\t\n\t</table>\n";
    $html = "<H1>{APP_RSYNC}</H1>\n\t<div id='rsyncsrver'>\n\t<form name='rsyncsrverForm'>\n\t<p class=caption>{APP_RSYNC_SERVER_TEXT}</p>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>{$enable}</td>\n\t<td valign='top'>{$form}</td>\n\t</tr>\n\t<tr>\n\t<td colspan=2><hr></td></tr>\n\t<tr>\n\t<td valign='top'><div id='rsyncstatus' style='margin:4px'></div></td>\n\t<td valign='top'>{$view_events}</td>\n\t</tr>\t\n\t<tr><td colspan=2 align='right'>\n\t\t<hr>\n\t\t<input type='button' OnClick=\"javascript:SaveRsyncConf();\" value='{apply}&nbsp;&raquo;'>\n\t</td>\n\t</tr>\n\t</table>\n\t\n\t</form>\n\t</div>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}