Example #1
0
function popup()
{
    $dev = $_GET["dev"];
    $html = "<H1>{$dev}</h1>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t<td valign='top' width=1%><center><img src='img/database-connect-128.png'></center></td>\n\t\t<td valign='top' width=99%>\n\t\t\t<div id='fstab'><p class=caption>{CONNECT_HD_TEXT}</p>\n\t\t\t\t<table style='width:100%' class=table_form>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' class=legend nowrap>{mount_point}:</td>\n\t\t\t\t\t<td nowrap>" . Field_text('mount_point', null, 'width:220px') . "" . button_browse('mount_point') . "</td>\n\t\t\t\t\t<td>" . button("{add}", "fstabAdd()") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t" . RoundedLightWhite("<div id='fslist' style='width:99%;height:220px;overflow:auto'>" . listfstab($dev) . "</div>") . "\n\t\t\t</div>\n\t\t</td>\n\t\t</tr>\n\t</table>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, 'system.internal.disks.php');
}
Example #2
0
function popup()
{
    $dev = $_GET["dev"];
    $sock = new sockets();
    $uuid = base64_decode($sock->getFrameWork("hd.php?uuid-from-dev=" . urlencode($dev)));
    $html = "<div style='font-size:22px;margin-bottom:30px'>{$dev} ( {$uuid} )</div>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t<td valign='top' width=1%><center><img src='img/database-connect-128.png'></center></td>\n\t\t<td valign='top' width=99%>\n\t\t\t<div id='fstab'><div class=text-info style='font-size:16px'>{CONNECT_HD_TEXT}</div>\n\t\t\t\t<div style='width:98%' class=form>\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' class=legend nowrap style='font-size:16px'>{mount_point}:</td>\n\t\t\t\t\t<td nowrap>" . Field_text('mount_point', null, 'width:220px;font-size:16px') . "" . button_browse('mount_point') . "</td>\n\t\t\t\t\t<td>" . button("{add}", "fstabAdd()", 18) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t\t<div id='fslist' style='width:99%;height:220px;overflow:auto'>" . listfstab($dev) . "</div>\n\t\t\t</div>\n\t\t</td>\n\t\t</tr>\n\t</table>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, 'system.internal.disks.php');
}
Example #3
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $t = time();
    $varlog = base64_decode($sock->getFrameWork("squid.php?varlog-location=yes"));
    $t = time();
    $html = "\n\t<div style='font-size:32px;margin-bottom:25px'>{log_location}</div>\n\t<div class=explain style='font-size:22px;margin-bottom:25px'>{squid_log_location_explain}</div>\n\t<div style='width:98%' class=form>\t\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' class=legend style='font-size:28px;vertical-align:middle'>{edit_location}:</td>\n\t\t<td>" . Field_text("location-{$t}", $varlog, "font-size:28px;width:99%") . "</td>\n\t\t<td style='font-size:28px;vertical-align:middle'>" . button_browse("location-{$t}") . "</td>\n\t</tr>\n\t<tr><td colspan=3 align='right'><p>&nbsp;</p><hr>" . button("{apply}", "Save{$t}()", 38) . "</td></tr>\n\t</table>\t\t\n\t</div>\n<script>\n\n\tvar xSave{$t}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){alert(res);}\n\t\tLoadjs('squid.varlog.progress.php');\n\t}\n\nfunction Save{$t}(){\n\tvar pp=encodeURIComponent(document.getElementById('location-{$t}').value);\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('location',pp);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t}); \n}\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #4
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $sock = new sockets();
    $sock->getFrameWork("postgres.php?PostGresSQLDatabaseDirectory=yes");
    $PostGresSQLDatabaseDirectory = $sock->GET_INFO("PostGresSQLDatabaseDirectory");
    $html = "<div style=width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='middle' style='font-size:18px'>{database_storage_path}:</td>\n\t\t<td valign='middle'>" . Field_text("database-dir-{$t}", "{$PostGresSQLDatabaseDirectory}", "font-size:18px;width:98%") . "</td>\n\t\t<td valign='middle'>" . button_browse("database-dir-{$t}", 18) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "Save{$t}()", 32) . "</td>\n\t</tR>\n</table>\n</div>\n<script>\nvar xSave{$t}= function (obj) {\t\n\tvar res=obj.responseText;\n\tif(res.length>3){alert(res);return;}\n\tYahooWin3Hide();\n\tLoadjs('postgres.changedir.progress.php');\n}\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ChangePostGresSQLDir', encodeURIComponent(document.getElementById('database-dir-{$t}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});  \n\n}\n</script>\t\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #5
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $confirm = $tpl->javascript_parse_text("{change_path_services_warn}");
    $sock = new sockets();
    $ARRAY = unserialize(base64_decode($sock->getFrameWork("system.php?critical-paths-locations=yes")));
    $html = "\n<div id='id-final-{$t}'>\n<div id='text-{$t}' style='font-size:18px' class=explain>{change_directories_paths_text}</div>\n<div style='width:98%' class=form>\n\t<table>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>Artica {logs_directory} (" . FormatBytes($ARRAY["/var/log/artica-postfix"]["SIZE"]) . "):</td>\n\t\t<td class=legend style='font-size:16px'>" . Field_text("varlogart-{$t}", $ARRAY["/var/log/artica-postfix"]["PATH"], "font-size:18px;width:95%") . "</td>\n\t\t<td width=1%>" . button_browse("varlogart-{$t}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>Proxy {logs_directory} (" . FormatBytes($ARRAY["/var/log/squid"]["SIZE"]) . "):</td>\n\t\t<td class=legend style='font-size:16px'>" . Field_text("varlog-{$t}", $ARRAY["/var/log/squid"]["PATH"], "font-size:18px;width:95%") . "</td>\n\t\t<td width=1%>" . button_browse("varlog-{$t}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{logs_backup} (" . FormatBytes($ARRAY["/home/logs-backup"]["SIZE"]) . "):</td>\n\t\t<td class=legend style='font-size:16px'>" . Field_text("logsbackup-{$t}", $ARRAY["/home/logs-backup"]["PATH"], "font-size:18px;width:95%") . "</td>\n\t\t<td width=1%>" . button_browse("logsbackup-{$t}") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{categories_databases}: (" . FormatBytes($ARRAY["/home/artica/categories_databases"]["SIZE"]) . ")</td>\n\t\t<td class=legend style='font-size:16px'>" . Field_text("categoriesdb-{$t}", $ARRAY["/home/artica/categories_databases"]["PATH"], "font-size:18px;width:95%") . "</td>\n\t\t<td width=1%>" . button_browse("categoriesdb-{$t}") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{webfiltering_databases} ICAP: (" . FormatBytes($ARRAY["/home/c-icap/blacklists"]["SIZE"]) . ")</td>\n\t\t<td class=legend style='font-size:16px'>" . Field_text("icapdb-{$t}", $ARRAY["/home/c-icap/blacklists"]["PATH"], "font-size:18px;width:95%") . "</td>\n\t\t<td width=1%>" . button_browse("icapdb-{$t}") . "</td>\n\t</tr>\t\n\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}...", "Save{$t}()", "26") . "</td>\n\t</tr>\n</table>\n</div>\n<script>\nvar x_Save{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\tLoadjs('squid.directories.progress.php');\n}\nfunction Save{$t}(){\n\tif(!confirm('{$confirm}')){return;}\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('varlog',document.getElementById('varlog-{$t}').value);\n\tXHR.appendData('logsbackup',document.getElementById('logsbackup-{$t}').value);\n\tXHR.appendData('categoriesdb',document.getElementById('categoriesdb-{$t}').value);\n\tXHR.appendData('icapdb',document.getElementById('icapdb-{$t}').value);\n\tXHR.appendData('varlogart',document.getElementById('varlogart-{$t}').value);\n\t\n\t\n\tXHR.sendAndLoad('{$page}', 'POST',x_Save{$t});\n}\n\n\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #6
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $size = $sock->GET_INFO("SystemTotalSize");
    $DirectoryFSPath = $sock->GET_INFO("DirectoryFSPath");
    $move_fs_to = $tpl->javascript_parse_text("{move_fs_to}");
    $size = FormatBytes($size / 1024);
    $html = "\n\t<div style='width:98%' class=form>\n\t\t<div style='font-size:22px'>{move_filesystem}: {$size}</div>\n\t\t<div class=explain style='font-size:14px'>{move_filesystem_explain}</div>\t\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px'>{directory}:</td>\n\t\t\t<td>" . Field_text("DirectoryFSPath", $DirectoryFSPath, "width:220px;font-size:16px") . "</td>\n\t\t\t<td>" . button_browse("DirectoryFSPath") . "</td>\n\t\t</tr>\n\t\t<tr>\t\t\n\t\t\t<td colspan=3 align='right'><hr>" . button("{move}", "DirectoryFSPathSave()", 18) . "</td>\n\t\t</tr>\n\t\t</table>\n\t</div>\t\t\n<script>\nvar xDirectoryFSPathSave= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);}\n\tYahooWin3Hide();\n\t\n}\nfunction DirectoryFSPathSave(){\n\tvar path=document.getElementById('DirectoryFSPath').value;\n\tif(confirm('{$move_fs_to}:'+path+' ?')){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('DirectoryFSPath',path);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xDirectoryFSPathSave);\n\t}\n}\t\t\t\t\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
function popup()
{
    $sock = new sockets();
    $tpl = new templates();
    $page = CurrentPageName();
    $ArticaDBPath = $sock->GET_INFO("ArticaDBPath");
    if ($ArticaDBPath == null) {
        $ArticaDBPath = "/opt/articatech";
    }
    $t = time();
    $html = "\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{directory}:</td>\n\t\t<td>" . Field_text("ArticaDBPath", $ArticaDBPath, "font-size:16px;width:220px") . "</td>\n\t\t<td width=1%>" . button_browse("ArticaDBPath") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 align='right'>" . button("{apply}", "Save{$t}()", 18) . "</td>\n\t</tr>\n\t</table>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n}\t\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ArticaDBPath',document.getElementById('ArticaDBPath').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n}\n</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
function page()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $q = new mysql();
    $gid = $_GET["gid"];
    $t = time();
    $q = new mysql();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM storage_containers WHERE `groupid`='" . mysql_escape_string2($gid) . "'", "artica_backup"));
    if (!is_numeric($ligne["maxsize"])) {
        $ligne["maxsize"] = "5000";
    }
    $html = "\n\t<div style='font-size:16px' class=explain>{BACKUP_STORAGE_ENDUSERS_CONTAINER_EXPLAIN}</div>\n\t<div id='animate-{$t}'></div>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{enable}:</td>\n\t\t<td>" . Field_checkbox("enable-{$t}", 1, $ligne["enabled"]) . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{max_size}:</td>\t\n\t\t<td style='font-size:16px'>" . Field_text("maxsize-{$t}", $ligne["maxsize"], "font-size:16px;width:120px") . "&nbsp;M</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{directory}:</td>\t\n\t\t<td style='font-size:16px'>" . Field_text("directory-{$t}", $ligne["directory"], "font-size:16px;width:220px") . button_browse("directory-{$t}") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "Save{$t}()", 18) . "</td>\n\t</tr>\n\t</table>\t\n\t<script>\n\tvar xSave{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tdocument.getElementById('animate-{$t}').innerHTML='';\n\t\tif(results.length>0){alert(results);return;}\n\t\t\n\t\tYahooWinHide();\n\t}\n\t\n\tfunction Save{$t}(){\n\t\tvar enabled=0;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('gid','{$_GET["gid"]}');\n\t\n\t\tif(document.getElementById('enable-{$t}').checked){enabled=1;}\n\t\tXHR.appendData('enabled',enabled);\n\t\tXHR.appendData('maxsize',document.getElementById('maxsize-{$t}').value);\n\t\tXHR.appendData('directory',document.getElementById('directory-{$t}').value);\n\t\tAnimateDiv('animate-{$t}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t}\t\n\t\t\t\t\n\t\t\t\t\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
function index()
{
    $ct = new user($_GET["uid"]);
    $sock = new sockets();
    $RsyncStoragePath = $sock->GET_INFO("RsyncStoragePath");
    if ($RsyncStoragePath == null) {
        $RsyncStoragePath = "/var/spool/rsync";
    }
    if ($ct->RsyncBackupTargetPath == null) {
        $ct->RsyncBackupTargetPath = $RsyncStoragePath;
    }
    $RsyncBackupTargetPath = Field_text("RsyncBackupTargetPath", $ct->RsyncBackupTargetPath, "width:220px") . button_browse("RsyncBackupTargetPath");
    $EnableBackupAccount = Field_numeric_checkbox_img("EnableBackupAccount", $ct->EnableBackupAccount);
    $html = "<H1>{backup_parameters}</H1>\n<div id='{$ct->uid}_divid'>\n" . RoundedLightWhite("\n<table style='width:100%'>\n<tr>\n<td valign='top'>\n\t<center><img src='img/bg_backup-org.png'></center><br>\n\t<table style='width:100%' class=table_form>\n\t<tr>\n\t<td class=legend nowrap valign='top'>{ENABLE_RSYNC_ACCOUNT}:</td>\n\t<td>{$EnableBackupAccount}<p class=caption>{ENABLE_RSYNC_ACCOUNT_TEXT}</p></td>\n\t</tr>\n\t<tr>\n\t<td class=legend>{storage_path}:</td>\n\t<td>{$RsyncBackupTargetPath}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td valign='top' align='right' colspan=2><hr>\n\t\t\t<input type='button' OnClick=\"javascript:SaveBackupUserInfos();\" value='&nbsp;&nbsp;{edit}&nbsp;&raquo;&nbsp;&nbsp;'>\n\t\t</td>\n\t</tr>\n</table>\n");
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Example #10
0
function popup()
{
    $sock = new sockets();
    $tpl = new templates();
    $users = new usersMenus();
    $page = CurrentPageName();
    $DisableAnyCache = $sock->GET_INFO("DisableAnyCache");
    if (!is_numeric($DisableAnyCache)) {
        $DisableAnyCache = 0;
    }
    $SquidCacheLevel = $sock->GET_INFO("SquidCacheLevel");
    if (!is_numeric($SquidCacheLevel)) {
        $SquidCacheLevel = 4;
    }
    if ($SquidCacheLevel == 0) {
        $DisableAnyCache = 1;
    }
    if ($DisableAnyCache == 1) {
        $html = FATAL_ERROR_SHOW_128("{all_cache_method_are_globally_disabled}");
        $html = $html . "\n\t\t<div style='width:100%'>\n\t\t\t\t<div style='margin-top:10px;width:99%' class=form>\n\t\t\t\t\t<a href=\"javascript:blur();\" OnClick=\"Loadjs('squid.caches.disable.php')\"\n\t\t\t\t\tstyle='font-size:16px;text-decoration:underline;font-weight:bold'\n\t\t\t\t\t>{access_to_parameters}</a>\n\t\t\t\t</div>\n\t\t</div>";
        echo $tpl->_ENGINE_parse_body($html);
        return;
    }
    $SquidEnableRockStore = $sock->GET_INFO("SquidEnableRockStore");
    $SquidRockStoreSize = $sock->GET_INFO("SquidRockStoreSize");
    $SquidRockStorePath = $sock->GET_INFO("SquidRockStorePath");
    if (!is_numeric($SquidEnableRockStore)) {
        $SquidEnableRockStore = 0;
    }
    if (!is_numeric($SquidRockStoreSize)) {
        $SquidRockStoreSize = 2000;
    }
    if ($SquidRockStorePath == null) {
        $SquidRockStorePath = "/home/squid";
    }
    $t = time();
    $html = "\n\t<div style='font-size:14px' class=explain>{SQUID_ROCK_STORE_EXPLAIN}</div>\n\t<div style='width:98%' class=form>\n\t<div id='waitcache-{$t}'></div>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{enable}:</td>\n\t\t<td>" . Field_checkbox("SquidEnableRockStore", 1, $SquidEnableRockStore) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{size}:</td>\n\t\t<td style='font-size:16px'>" . Field_text("SquidRockStoreSize", $SquidRockStoreSize, "font-size:16px;width:90px") . "&nbsp;MB</td>\n\t</tr>\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{directory}:</td>\n\t\t<td style='font-size:16px'>" . Field_text("SquidRockStorePath", $SquidRockStorePath, "font-size:16px;width:220px") . button_browse("SquidRockStorePath") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", 18) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n<script>\n\tvar x_Save{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tdocument.getElementById('waitcache-{$t}').innerHTML='';\n\t\t\tif(results.length>3){alert(results);return;}\n\t\t\tRefreshTab('squid_main_caches_new');\n\t\t\tRefreshTab('squid_main_svc');\n\t\t\tLoadjs('squid.restart.php?ApplyConfToo=yes&ask=yes');\n\t\t\t\n\t\t}\t\t\t\n\t\t\n\tfunction Save{$t}(){\n\t\t\tvar enabled=1;\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tif(!document.getElementById('SquidEnableRockStore').checked){enabled=0;}\n\t\t\tXHR.appendData('SquidRockStoreSize',document.getElementById('SquidRockStoreSize').value);\n\t\t\tXHR.appendData('SquidRockStorePath',document.getElementById('SquidRockStorePath').value);\n\t\t\tXHR.appendData('SquidEnableRockStore',enabled);\n\t\t\tAnimateDiv('waitcache-{$t}');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_Save{$t});\n\t\t}\n</script>\t\t\t\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #11
0
function popup(){
	$page=CurrentPageName();
	$tpl=new templates();
	$sock=new sockets();
	$t=time();
	$varlog=base64_decode($sock->getFrameWork("squid.php?varlog-location=yes"));
	$t=time();
	$html="
	<div style='width:98%' class=form>		
	<table style='width:100%'>
	<tr>
		<td valign='top' class=legend style='font-size:18px;vertical-align:middle'>{directory}:</td>
		<td>". Field_text("location-$t",$varlog,"font-size:18px;width:99%")."</td>
		<td style='font-size:18px;vertical-align:middle'>". button_browse("location-$t")."</td>
	</tr>
	<tr><td colspan=3 align='right'><p>&nbsp;</p><hr>". button("{apply}","Save$t()",22)."</td></tr>
	</table>		
	</div>
<script>

	var xSave$t= function (obj) {
		var res=obj.responseText;
		if (res.length>3){alert(res);}
		Loadjs('squid.varlog.progress.php');
	}

function Save$t(){
	var pp=encodeURIComponent(document.getElementById('location-$t').value);
	var XHR = new XHRConnection();
	XHR.appendData('location',pp);
	XHR.sendAndLoad('$page', 'POST',xSave$t); 
}
</script>
";
echo $tpl->_ENGINE_parse_body($html);	
	
	
}
Example #12
0
function parameters()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $maillogToMysql = $sock->GET_INFO("maillogToMysql");
    if (!is_numeric($maillogToMysql)) {
        $maillogToMysql = 1;
    }
    $maillogStoragePath = $sock->GET_INFO("maillogStoragePath");
    if ($maillogStoragePath == null) {
        $maillogStoragePath = "/home/postfix/maillog";
    }
    $maillogMaxDays = $sock->GET_INFO("maillogMaxDays");
    if (!is_numeric($maillogMaxDays)) {
        $maillogMaxDays = 7;
    }
    $t = time();
    $html = "<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{store_events_to_mysql}:</td>\n\t\t<td>" . Field_checkbox("maillogToMysql", 1, $maillogToMysql, "Check{$t}()") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{storage_directory}:</td>\n\t\t<td>" . Field_text("maillogStoragePath", $maillogStoragePath, "font-size:16px;width:300px") . "</td>\n\t\t<td width=1% nowrap>" . button_browse("maillogStoragePath") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{max_days}:</td>\n\t\t<td style='font-size:16px'>" . Field_text("maillogMaxDays", $maillogMaxDays, "font-size:16px;width:90px") . "&nbsp;{days}</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\t\t\n\t<tr>\n\t\t<td colspan=3 align='right'>\n\t\t\t\t<hr>" . button("{apply}", "Save{$t}()", 18) . "\n\t\t</td>\n\t</tr>\n\t</table>\n\t</div>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=trim(obj.responseText);\n\tif(results.length>0){alert(results);}\n\tRefreshTab('main_postfix_events');\n\t}\n\t\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('maillogToMysql').checked){\n\t\tXHR.appendData('maillogToMysql',1);\n\t}else{\n\t\tXHR.appendData('maillogToMysql',0);\n\t}\n\tXHR.appendData('maillogStoragePath',document.getElementById('maillogStoragePath').value);\n\tXHR.appendData('maillogMaxDays',document.getElementById('maillogMaxDays').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t},true);\t\t\t\t\n}\t\n\t\nfunction Check{$t}(){\n\tif(document.getElementById('maillogToMysql').checked){\n\t\tdocument.getElementById('maillogStoragePath').disabled=true;\n\t\tdocument.getElementById('maillogMaxDays').disabled=true;\n\t}else{\n\t\tdocument.getElementById('maillogStoragePath').disabled=false;\n\t\tdocument.getElementById('maillogMaxDays').disabled=false;\t\n\t}\n\n}\nCheck{$t}();\t\n</script>\t\t\t\t\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #13
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);
}
Example #14
0
function status()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $users = new usersMenus();
    $sock = new sockets();
    $t = time();
    $WORKDIR = base64_decode($sock->getFrameWork("squid.php?artica-db-path=yes"));
    $html = "\n\t<div id='title-{$t}' style='font-size:16px;font-weight:bold'></div>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t<td valign='top'><div id='squid-db-status'></div></td>\n\t<td valign='top'><div id='squid-db-mysql'>\n\t\t<div class=explain style='font-size:14px'>{squiddb_howitis}</div>\n\t</td>\n\t</tr>\n\t</table>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{database_path}:</td>\n\t\t<td>" . Field_text("SquidStatsDatabasePath", $WORKDIR, "font-size:18px") . "</td>\n\t\t<td>" . button_browse("SquidStatsDatabasePath") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 align='right' style='padding-top:20px'><hr>\n\t\t\t\t" . button("{backup_database}", "Loadjs('squid.articadb.progress.php?backup=yes')", 26) . "&nbsp;&nbsp;&nbsp;" . button("{change_database_path}", "SaveWorkdir{$t}()", 26) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t\n\t\n\t\n\t\n\t\n\t<script>\n\t\tfunction RefreshTableTitle{$t}(){\n\t\t\tLoadAjaxTiny('title-{$t}','squid.artica.statistics.purge.php?title=yes&t={$t}');\n\t\t\tLoadAjaxTiny('squid-db-status','{$page}?squid-db-status=yes&t={$t}');\n\t\t}\n\tvar xSaveWorkdir{$t}= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\tLoadjs('squid.articadb.progress.php');\n\t\tUnlockPage();\n\t}\t\t\n\t\t\n\tfunction SaveWorkdir{$t}(){\n\t\tvar XHR = new XHRConnection();\t\n\t\tXHR.appendData('SquidStatsDatabasePath',document.getElementById('SquidStatsDatabasePath').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSaveWorkdir{$t});\t\t\t\t\n\t}\n\t\n\tfunction SaveWorkdir{$t}(){\n\t\tvar XHR = new XHRConnection();\t\n\t\tXHR.appendData('SquidStatsDatabasePath',document.getElementById('SquidStatsDatabasePath').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSaveWorkdir{$t});\t\t\t\t\n\t}\t\n\t\t\n\tRefreshTableTitle{$t}();\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #15
0
function add_popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $t = time();
    $html = "\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend nowrap style='font-size:18px'>{directory}:</td>\n\t\t\t<td >" . Field_text("directory-{$t}", null, "font-size:18px", false, "SaveCK{$t}(event)") . "</td>\n\t\t\t<td width=1%>" . button_browse("directory-{$t}") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap style='font-size:18px'>{write}:</td>\n\t\t\t<td >" . Field_checkbox_design("write-{$t}", 1, 0) . "</td>\n\t\t\t<td width=1%>&nbsp;</td>\n\t\t</tr>\t\t\t\t\t\n\t\t<td colspan=3 align='right'><hr>" . button("{add}", "Save{$t}()", 22) . "</td>\n\t\t</tr>\n\t</table>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar res=obj.responseText;\n\tif (res.length>3){alert(res);return;}\n\t\$('#ARTICA_WEBDAV_TABLE').flexReload();\n\tYahooWinHide();\n}\nfunction SaveCK{$t}(e){\n\tif(!checkEnter(e)){return;}\n\tSave{$t}();\n}\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('directory',document.getElementById('directory-{$t}').value);\n\tif( document.getElementById('write-{$t}').checked){\n\t\tXHR.appendData('write',1);\n\t}else{\n\t\tXHR.appendData('write',0);\n\t}\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
function statusDB_not_installed()
{
    $tpl = new templates();
    $sock = new sockets();
    $t = time();
    $ManualArticaDBPath = $sock->GET_INFO("ManualArticaDBPath");
    if ($ManualArticaDBPath == null) {
        $ManualArticaDBPath = "/home/manualupdate/articadb.tar.gz";
    }
    $ArticaDBPath = $sock->GET_INFO("ArticaDBPath");
    if ($ArticaDBPath == null) {
        $ArticaDBPath = "/opt/articatech";
    }
    $ArticaDBPathenc = urlencode($ArticaDBPath);
    $arrayinfos = unserialize(base64_decode($sock->getFrameWork("services.php?dir-status={$ArticaDBPathenc}")));
    $REQUIRE = round(1753076 / 1024);
    $SIZE = round($arrayinfos["SIZE"] / 1024);
    if ($SIZE < $REQUIRE) {
        $error = "<center style='color:#d32d2d;font-weight:bold;font-size:16px;margin:20px'><span >" . $tpl->_ENGINE_parse_body("{no_enough_free_space_on_target}<br>&laquo;{$ArticaDBPath}&raquo;<br>({$SIZE}MB {require} {$REQUIRE}MB)</center>");
    }
    $page = CurrentPageName();
    $html = FATAL_ERROR_SHOW_128("{ARTICADB_NOT_INSTALLED_EXPLAIN}") . "<center style='margin:80px'>\n\t\t<hr>" . button("{install_now}", "Loadjs('squid.blacklist.upd.php')", 16) . "\n\t\t<hr>" . button("{manual_update}", "Loadjs('squid.catzdb.manual-update.php')", 16) . "\n\t\t<hr>{$error}\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{database_storage_path} ({$SIZE}MB):</td>\n\t\t<td>" . Field_text("ArticaDBPath-{$t}", $ArticaDBPath, "font-size:16px;width:320px") . "</td>\n\t\t<td width=1%>" . button_browse("ArticaDBPath-{$t}") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td colspan=3 align='right'>" . button("{apply}", "Save{$t}()", 18) . "</td>\n\t</tr>\n\t</table>\n\t</center>\t\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\tLoadjs('squid.blacklist.upd.php');\n}\t\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ArticaDBPath',document.getElementById('ArticaDBPath-{$t}').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n}\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #17
0
function add_popup()
{
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $parcourir_domaines = button("{browse}...", "Loadjs('browse.domains.php?field=domainname-{$t}')", 12);
    $administrator = $_SESSION["uid"];
    $password = null;
    $directory_src = null;
    $DUP = 0;
    $RESTORE = 0;
    if ($administrator == -100) {
        $ldap = new clladp();
        $administrator = $ldap->ldap_admin;
        $password = $ldap->ldap_password;
    }
    $bt_title = "{add}";
    if ($password == null) {
        $password = PasswordGenerator();
    }
    if (isset($_GET["duplicate"])) {
        $title = "<div style='font-size:22px'>{duplicate}:{$_GET["duplicate"]}</div>\n\t\t<div style='font-size:18px' class=explain>{wordpress_duplicate_explain}</div>";
        $bt_title = "{duplicate}";
        $DUP = 1;
    }
    if (isset($_GET["restore"])) {
        $title = "<div style='font-size:22px'>{restore_from_website}:{$_GET["duplicate"]}</div>\n\t\t<div style='font-size:18px' class=explain>{restore_from_website_explain}</div>";
        $bt_title = "{restore}";
        $RESTORE = 1;
        $free = new freeweb($_GET["restore"]);
        $directory_src = $free->WORKING_DIRECTORY;
        $q = new mysql();
        $sql = "SELECT servername FROM freeweb WHERE `groupware`='WORDPRESS'";
        $results = $q->QUERY_SQL($sql, "artica_backup");
        $ARRAY_REST[null] = "{select}";
        while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
            $ARRAY_REST[$ligne["servername"]] = $ligne["servername"];
        }
        unset($ARRAY_REST[$_GET["duplicate"]]);
        $restore_tr = "\n\t\t<r>\n\t\t\t<td class=legend style='font-size:22px;vertical-align:middle'>{website_source}:</td>\n\t\t\t<td colspan=2>" . Field_array_Hash($ARRAY_REST, "restore-{$t}", null, "style:font-size:22px", null, null, null, false, null) . "</td>\n\t\t\t\n\t\t</tr>";
    }
    $html = "{$title}\n<div style='width:98%' class=form>\n<div class=explain>{wordpress_form_explain_add}</div>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px;vertical-align:middle'>{webservername}:</td>\n\t\t\t<td colspan=2>" . Field_text("servername-{$t}", null, "font-size:22px;padding:3px;font-weight:bold;width:300px") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px;vertical-align:middle'>{domainname}:</td>\n\t\t\t<td>" . Field_text("domainname-{$t}", null, "font-size:22px;padding:3px;width:400px;", null, null, null, false, "SaveCheck{$t}(event)") . "</td>\n\t\t\t<td>{$parcourir_domaines}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px;vertical-align:middle'>{website_directory}:</td>\n\t\t\t<td>" . Field_text("dirname-{$t}", $directory_src, "font-size:22px;padding:3px;width:400px;", null, null, null, false, "SaveCheck{$t}(event)") . "</td>\n\t\t\t<td>" . button_browse("dirname-{$t}") . "</td>\n\t\t</tr>\n\t\t{$restore_tr}\n\t\t<tr><td colspan=2><div style='margin:20px;font-size:26px'>{wordpress_administrator}</div></td></tr>\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px;vertical-align:middle'>{administrator}:</td>\t\n\t\t\t<td colspan=2>" . Field_text("administrator-{$t}", $administrator, "font-size:22px;padding:3px;width:320px;", null, null, null, false, "SaveCheck{$t}(event)") . "</td>\n\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px;vertical-align:middle'>{password}:</td>\t\n\t\t\t<td colspan=2>" . Field_password("password-{$t}", $password, "font-size:22px;padding:3px;width:320px;font-weight:bold", null, null, null, false, "SaveCheck{$t}(event)") . "</td>\n\t\t\t\n\t\t</tr>\t\t\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td colspan=3 align='right'><hr>" . button($bt_title, "Save{$t}()", "32") . "</td>\n\t\t</tr>\n\t</table>\n</div>\t\n<script>\n\tvar xSave{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\t\n\t\tvar hostname=document.getElementById('servername-{$t}').value+'.'+document.getElementById('domainname-{$t}').value;\n\t\t\n\t\tLoadjs('freeweb.rebuild.progress.php?servername='+hostname)\n\t\tYahooWinHide();\n\t\tif(document.getElementById('freewebs-table-id')){\n\t\t\tvar id=document.getElementById('freewebs-table-id').value;\n\t\t\t\$('#'+id).flexReload();\n\t\t\tUnlockPage();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t\$('#freewebs-table-{$_GET["t"]}').flexReload();\n\t\tUnlockPage();\n\t\t\n\t\t\n\t}\n\t\nfunction SaveCheck{$t}(e){\n\tif(!checkEnter(e)){return;}\n\tSave{$t}();\n\n}\nfunction Save{$t}(){\n\t\tLockPage();\n\t\tvar RESTORE={$RESTORE};\n\t\tvar XHR = new XHRConnection();\n\t\tif(RESTORE==0){\n\t\t\tXHR.appendData('duplicate-from','{$_GET["duplicate"]}');\n\t\t}else{\n\t\t\tXHR.appendData('duplicate-from',document.getElementById('restore-{$t}').value);\n\t\t}\n\t\tXHR.appendData('servername',document.getElementById('servername-{$t}').value);\n\t\tXHR.appendData('domainname',document.getElementById('domainname-{$t}').value);\n\t\tXHR.appendData('directory',encodeURIComponent(document.getElementById('dirname-{$t}').value));\n\t\tXHR.appendData('administrator',encodeURIComponent(document.getElementById('administrator-{$t}').value));\n\t\tXHR.appendData('password',encodeURIComponent(document.getElementById('password-{$t}').value));\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t\t}\n\t\t\nfunction CheckRestore{$t}(){\n\tvar rest={$RESTORE};\n\tif(rest==0){return;}\n\tdocument.getElementById('administrator-{$t}').disabled=true;\n\tdocument.getElementById('password-{$t}').disabled=true;\n\tdocument.getElementById('servername-{$t}').value='{$_GET["restore"]}';\n\tdocument.getElementById('servername-{$t}').disabled=true;\n\tdocument.getElementById('domainname-{$t}').disabled=true;\n\tdocument.getElementById('dirname-{$t}').disabled=true;\n}\n\t\t\nfunction CheckDup{$t}(){\n\tvar DUP={$DUP};\n\tif(DUP==0){return;}\n\tdocument.getElementById('administrator-{$t}').disabled=true;\n\tdocument.getElementById('password-{$t}').disabled=true;\n\n}\nCheckDup{$t}();\n CheckRestore{$t}();\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #18
0
function clamav()
{
    $sock = new sockets();
    $ci = new cicap();
    $page = CurrentPageName();
    $EnableClamavInCiCap = $sock->GET_INFO("EnableClamavInCiCap");
    $EnableClamavInCiCap2 = $sock->GET_INFO("EnableClamavInCiCap2");
    $ClamavTemporaryDirectory = $sock->GET_INFO("ClamavTemporaryDirectory");
    if ($ClamavTemporaryDirectory == null) {
        $ClamavTemporaryDirectory = "/home/clamav";
    }
    if (!is_numeric($EnableClamavInCiCap)) {
        $EnableClamavInCiCap = 1;
    }
    $html = "\n\t<div style='font-size:26px;margin-bottom:20px'>{clamav_settings_text}</div>\n\t\n\t<div id='ffmcc2' style='width:98%' class=form>\n\t<table style='width:99%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{ENABLE_CLAMAV}:</td>\n\t\t<td style=';font-size:14px'>" . Field_checkbox_design('EnableClamavInCiCap', 1, $EnableClamavInCiCap, 'EnableClamavInCiCapCheck()') . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t\n\t\n\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{srv_clamav.SendPercentData}", "{srv_clamav.SendPercentData_text}") . ":</td>\n\t\t<td style=';font-size:22px'>" . Field_text('srv_clamav.SendPercentData', $ci->main_array["CONF"]["srv_clamav.SendPercentData"], 'width:55px;font-size:22px;padding:3px') . "&nbsp;%</td>\n\t</tr>\n\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{srv_clamav.StartSendPercentDataAfter}", "{srv_clamav.StartSendPercentDataAfter_text}") . ":</td>\n\t\t<td style=';font-size:22px'>" . Field_text('srv_clamav.StartSendPercentDataAfter', $ci->main_array["CONF"]["srv_clamav.StartSendPercentDataAfter"], 'width:125px;font-size:22px;padding:3px') . "&nbsp;M</td>\n\t\t<td>" . help_icon() . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{srv_clamav.MaxObjectSize}", "{srv_clamav.MaxObjectSize_text}") . ":</td>\n\t\t<td style=';font-size:22px'>" . Field_text('srv_clamav.MaxObjectSize', $ci->main_array["CONF"]["srv_clamav.MaxObjectSize"], 'width:150px;font-size:22px;padding:3px') . "&nbsp;M</td>\n\t</tr>\n\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{srv_clamav.ClamAvMaxFilesInArchive}", "{srv_clamav.ClamAvMaxFilesInArchive}") . ":</td>\n\t\t<td style=';font-size:22px'>" . Field_text('srv_clamav.ClamAvMaxFilesInArchive', $ci->main_array["CONF"]["srv_clamav.ClamAvMaxFilesInArchive"], 'width:150px;font-size:22px;padding:3px') . "&nbsp;{files}</td>\n\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{srv_clamav.ClamAvMaxFileSizeInArchive}", "{srv_clamav.ClamAvMaxFileSizeInArchive}") . ":</td>\n\t\t<td style=';font-size:22px'>" . Field_text('srv_clamav.ClamAvMaxFileSizeInArchive', $ci->main_array["CONF"]["srv_clamav.ClamAvMaxFileSizeInArchive"], 'width:150px;font-size:22px;padding:3px') . "&nbsp;M</td>\n\t</tr>\n\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{srv_clamav.ClamAvMaxRecLevel}", '{srv_clamav.ClamAvMaxRecLevel}') . ":</td>\n\t\t<td style=';font-size:22px'>" . Field_text('srv_clamav.ClamAvMaxRecLevel', $ci->main_array["CONF"]["srv_clamav.ClamAvMaxRecLevel"], 'width:150px;font-size:22px;padding:3px') . "&nbsp;M</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{temp_dir}", "{temp_dir}") . ":</td>\n\t\t<td style=';font-size:22px;valign:middle'>" . Field_text('ClamavTemporaryDirectory', $ClamavTemporaryDirectory, 'width:450px;font-size:22px;padding:3px') . "&nbsp;" . button_browse("ClamavTemporaryDirectory") . "</td>\n\t</tr>\t\t\t\t\n\t\t\t\t\n\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>\n\t\t" . button("{apply}", "SaveICapCLam()", 28) . "\n\t\t\t\n\t\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t\n\t<script>\n\t\n\t\n\tvar x_SaveICapCLam=function(obj){\n     var tempvalue=obj.responseText;\n\t  if(tempvalue.length>3){alert(tempvalue);}\n\t  RefreshTab('main_config_cicap');\n\t\n\t}\t\n\t\n\tfunction SaveICapCLam(){\n\t\tvar XHR = new XHRConnection();\n\t\t\n\t\t\n\t\tXHR.appendData('ClamavTemporaryDirectory',document.getElementById('ClamavTemporaryDirectory').value);\n\t    XHR.appendData('srv_clamav.SendPercentData',document.getElementById('srv_clamav.SendPercentData').value);\n\t    XHR.appendData('srv_clamav.StartSendPercentDataAfter',document.getElementById('srv_clamav.StartSendPercentDataAfter').value);\n\t    XHR.appendData('srv_clamav.MaxObjectSize',document.getElementById('srv_clamav.MaxObjectSize').value);\n\t    XHR.appendData('srv_clamav.ClamAvMaxFilesInArchive',document.getElementById('srv_clamav.ClamAvMaxFilesInArchive').value);\n\t    XHR.appendData('srv_clamav.ClamAvMaxFileSizeInArchive',document.getElementById('srv_clamav.ClamAvMaxFileSizeInArchive').value);\n\t    XHR.appendData('srv_clamav.ClamAvMaxRecLevel',document.getElementById('srv_clamav.ClamAvMaxRecLevel').value);\n\t    if(document.getElementById('EnableClamavInCiCap').checked){XHR.appendData('EnableClamavInCiCap',1);}else{XHR.appendData('EnableClamavInCiCap',0);}\n\t    \n\t\tAnimateDiv('ffmcc2');\n       \tXHR.sendAndLoad('{$page}', 'POST',x_SaveICapCLam);\n\t}\n\t\n\tfunction EnableClamavInCiCapCheck(){\n\t \tdocument.getElementById('ClamavTemporaryDirectory').disabled=true;\n\t\tdocument.getElementById('srv_clamav.SendPercentData').disabled=true;\n\t\tdocument.getElementById('srv_clamav.StartSendPercentDataAfter').disabled=true;\n\t\tdocument.getElementById('srv_clamav.MaxObjectSize').disabled=true;\n\t\tdocument.getElementById('srv_clamav.ClamAvMaxFilesInArchive').disabled=true;\n\t\tdocument.getElementById('srv_clamav.ClamAvMaxFileSizeInArchive').disabled=true;\n\t\tdocument.getElementById('srv_clamav.ClamAvMaxRecLevel').disabled=true;\n\t\tif(document.getElementById('EnableClamavInCiCap').checked){\n\t\t\tdocument.getElementById('ClamavTemporaryDirectory').disabled=false;\n\t\t\tdocument.getElementById('srv_clamav.SendPercentData').disabled=false;\n\t\t\tdocument.getElementById('srv_clamav.StartSendPercentDataAfter').disabled=false;\n\t\t\tdocument.getElementById('srv_clamav.MaxObjectSize').disabled=false;\n\t\t\tdocument.getElementById('srv_clamav.ClamAvMaxFilesInArchive').disabled=false;\n\t\t\tdocument.getElementById('srv_clamav.ClamAvMaxFileSizeInArchive').disabled=false;\n\t\t\tdocument.getElementById('srv_clamav.ClamAvMaxRecLevel').disabled=false;\t\t\n\t\t}else{\n\t\t\t\n\t\t}\n\t\n\t}\n\t\n\tsetTimeout('EnableClamavInCiCapCheck()',500);\n\t\n</script>\t\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function directory_popup()
{
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $title = $tpl->_ENGINE_parse_body("{new_directory}");
    $directory = $_GET["directory"];
    $q = new mysql();
    $maxtime = 420;
    $enabled = 1;
    $maxtime_array[0] = "{never}";
    $maxtime_array[60] = "1 {hour}";
    $maxtime_array[120] = "2 {hours}";
    $maxtime_array[380] = "3 {hours}";
    $maxtime_array[420] = "4 {hours}";
    $maxtime_array[480] = "8 {hours}";
    $maxtime_array[720] = "12 {hours}";
    $maxtime_array[1440] = "1 {day}";
    $maxtime_array[2880] = "1 {days}";
    $maxtime_array[10080] = "1 {week}";
    $btname = "{add}";
    $directory_field = "<tr>\n\t<td class=legend style='font-size:18px'>{directory}:</td>\n\t\t\t<td>" . Field_text("directory-{$t}", null, "font-size:18px;width:98%'") . "</td>\n\t\t\t<td>" . button_browse("directory-{$t}") . "</td>\n\t\t\t</tr>";
    if ($directory != null) {
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM philesight WHERE directory='{$directory}'", "artica_backup"));
        $directory_field = "<input type='hidden' name='directory-{$t}' id='directory-{$t}' value='{$directory}'>";
        $title = basename($directory);
        $maxtime = $ligne["maxtime"];
        $enabled = $ligne["enabled"];
        $btname = "{apply}";
    }
    $html = "\n\t<div style='font-size:22px;margin-bottom:20px'>{$title}</div>\n\t<div style='width:98%' class=form>\n\n\t<table style='width:100%'>\n\t{$directory_field}\n\t<tr>\n\t<td class=legend style='font-size:18px'>{enabled}:</td>\n\t<td colspan=2>" . Field_checkbox("enabled-{$t}", 1, $enabled) . "</td>\n\t</tr>\n\t<tr>\n\t<td class=legend style='font-size:18px'>{scan_period}:</td>\n\t\t\t<td colspan=2>" . Field_array_Hash($maxtime_array, "maxtime-{$t}", $maxtime, "style:font-size:18px") . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t<td colspan=3 align='right'>" . button($btname, "Save{$t}();", 30) . "</td>\n\t\t</tr>\n\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t\t<script>\n\t\t\t\t\tvar xSave{$t}=function (obj) {\n\t\t\t\t\tvar results=obj.responseText;\n\t\t\t\t\tif(results.length>0){alert(results);return;}\n\t\t\t\t\t\$('#WATCHDOG_FOLDERS_TABLE').flexReload();\n\t}\n\n\n\tfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tvar directory=encodeURIComponent(document.getElementById('directory-{$t}').value);\n\tXHR.appendData('directory',directory);\n\tXHR.appendData('maxtime',document.getElementById('maxtime-{$t}').value);\n\tif(document.getElementById('enabled-{$t}').checked){\n\tXHR.appendData('enabled',1);\n\t}else{\n\tXHR.appendData('enabled',0);\n\t}\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t}\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
function popup()
{
    $sock = new sockets();
    $tpl = new templates();
    $page = CurrentPageName();
    $t = time();
    //1753076
    $ManualArticaDBPath = $sock->GET_INFO("ManualArticaDBPath");
    $ManualArticaDBPathNAS = $sock->GET_INFO("ManualArticaDBPathNAS");
    if (!is_numeric($ManualArticaDBPathNAS)) {
        $ManualArticaDBPathNAS = 0;
    }
    if ($ManualArticaDBPath == null) {
        $ManualArticaDBPath = "/home/manualupdate/articadb.tar.gz";
    }
    $ArticaDBPath = $sock->GET_INFO("ArticaDBPath");
    if ($ArticaDBPath == null) {
        $ArticaDBPath = "/opt/articatech";
    }
    $ArticaDBPathenc = urlencode($ArticaDBPath);
    $arrayinfos = unserialize(base64_decode($sock->getFrameWork("services.php?dir-status={$ArticaDBPathenc}")));
    $REQUIRE = round(1753076 / 1024);
    $SIZE = round($arrayinfos["SIZE"] / 1024);
    if ($SIZE < $REQUIRE) {
        $error = "<center style='color:#d32d2d;font-weight:bold;font-size:16px;margin:20px'><span >" . $tpl->_ENGINE_parse_body("{no_enough_free_space_on_target}<br>&laquo;{$ArticaDBPath}&raquo;<br>({$SIZE}MB {require} {$REQUIRE}MB)</center>");
    }
    $t = time();
    $html = "\n\t<div style='width:98%' class=form>\n\t<div class=explain style='font-size:16px'>{squid_catz_dbs_manual_update_explain}</div>\n\t\t\t\n\t<center style='font-size:16px;text-decoration:underline;margin:20px' \n\t\t\tOnClick=\"javascript:s_PopUp('http://www.artica.fr/artica-catzdb.php',800,800);\">{where_to_find_package} ?</center>\t\t\n\t{$error}\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{use_remote_shared_folder}:</td>\n\t\t<td>" . Field_checkbox("ManualArticaDBPathNAS", 1, $ManualArticaDBPathNAS, "ManualArticaDBPathNASCK()") . "</td>\n\t\t<td width=1%>" . button("{settings}", "Loadjs('{$page}?nas-js=yes')") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{source_package_path}:</td>\n\t\t<td>" . Field_text("ManualArticaDBPath", $ManualArticaDBPath, "font-size:14px;width:320px") . "</td>\n\t\t<td width=1%></td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{database_storage_path}:</td>\n\t\t<td>" . Field_text("ArticaDBPath-{$t}", $ArticaDBPath, "font-size:16px;width:320px") . "</td>\n\t\t<td width=1%>" . button_browse("ArticaDBPath-{$t}") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td colspan=3 align='right'>" . button("{apply}", "Save{$t}()", 18) . "</td>\n\t</tr>\n\t</table>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\tLoadjs('squid.blacklist.upd.php');\n}\t\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ManualArticaDBPath',document.getElementById('ManualArticaDBPath').value);\n\tXHR.appendData('ArticaDBPath',document.getElementById('ArticaDBPath-{$t}').value);\n\tif(document.getElementById('ManualArticaDBPathNAS').checked){\n\t\tXHR.appendData('ManualArticaDBPathNAS',1);\n\t}else{\n\t\tXHR.appendData('ManualArticaDBPathNAS',0);\n\t}\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n}\n\nfunction ManualArticaDBPathNASCK(){\n\tif(document.getElementById('ManualArticaDBPathNAS').checked){\n\t\tdocument.getElementById('ManualArticaDBPath').disabled=true;\n\t}else{\n\t\tdocument.getElementById('ManualArticaDBPath').disabled=false;\n\t}\n}\n\n</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #21
0
function remote_nas_popup()
{
    $t = $_GET["t"];
    $tt = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $LogRotatePath = $sock->GET_INFO("LogRotatePath");
    $SystemLogsPath = $sock->GET_INFO("SystemLogsPath");
    $BackupMaxDays = $sock->GET_INFO("BackupMaxDays");
    $BackupMaxDaysDir = $sock->GET_INFO("BackupMaxDaysDir");
    $LogsRotateDeleteSize = $sock->GET_INFO("LogsRotateDeleteSize");
    $LogsRotateDefaultSizeRotation = $sock->GET_INFO("LogsRotateDefaultSizeRotation");
    if (!is_numeric($LogsRotateDefaultSizeRotation)) {
        $LogsRotateDefaultSizeRotation = 100;
    }
    $MySQLSyslogType = $sock->GET_INFO("MySQLSyslogType");
    if (!is_numeric($MySQLSyslogType)) {
        $MySQLSyslogType = 1;
    }
    if ($SystemLogsPath == null) {
        $SystemLogsPath = "/var/log";
    }
    if (!is_numeric($BackupMaxDays)) {
        $BackupMaxDays = 30;
    }
    $BackupSquidLogsUseNas = $sock->GET_INFO("BackupSquidLogsUseNas");
    $BackupSquidLogsNASIpaddr = $sock->GET_INFO("BackupSquidLogsNASIpaddr");
    $BackupSquidLogsNASFolder = $sock->GET_INFO("BackupSquidLogsNASFolder");
    $BackupSquidLogsNASUser = $sock->GET_INFO("BackupSquidLogsNASUser");
    $BackupSquidLogsNASPassword = $sock->GET_INFO("BackupSquidLogsNASPassword");
    if (!is_numeric($BackupSquidLogsUseNas)) {
        $BackupSquidLogsUseNas = 0;
    }
    $BackupSquidLogsNASRetry = $sock->GET_INFO("BackupSquidLogsNASRetry");
    if (!is_numeric($BackupSquidLogsNASRetry)) {
        $BackupSquidLogsNASRetry = 0;
    }
    if ($LogRotatePath == null) {
        $LogRotatePath = "/home/logrotate";
    }
    if ($BackupMaxDaysDir == null) {
        $BackupMaxDaysDir = "/home/logrotate_backup";
    }
    if (!is_numeric($LogsRotateDeleteSize)) {
        $LogsRotateDeleteSize = 5000;
    }
    $html = "<div class=text-info style='font-size:14px'>{MYSQLSYSLOG_TYPE_NAS_EXPLAIN}</div>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:18px'>{delete_if_file_exceed}:</strong></td>\n\t\t\t<td align='left' style='font-size:18px'>" . Field_text("LogsRotateDeleteSize-{$tt}", $LogsRotateDeleteSize, 'width:90px;padding:3px;font-size:18px', null, null, '') . "&nbsp;MB</td>\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:18px'>{default_size_for_rotation}:</strong></td>\n\t\t\t<td align='left' style='font-size:18px'>" . Field_text("LogsRotateDefaultSizeRotation-{$tt}", $LogsRotateDefaultSizeRotation, 'width:90px;padding:3px;font-size:18px', null, null, '') . "&nbsp;MB</td>\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:18px'>{system_logs_path}:</strong></td>\n\t\t\t<td align='left' style='font-size:18px'>" . Field_text("SystemLogsPath-{$tt}", $SystemLogsPath, 'width:200px;padding:3px;font-size:18px', null, null, '') . "</td>\n\t\t\t<td width=1% nowrap>" . button_browse("SystemLogsPath-{$tt}") . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:18px'>{max_day_in_database}:</strong></td>\n\t\t\t<td align='left' style='font-size:18px'>" . Field_text("BackupMaxDays-{$tt}", $BackupMaxDays, 'width:90px;padding:3px;font-size:18px', null, null, '') . "&nbsp;{days}</td>\n\t\t\t<td width=1% nowrap>" . help_icon("{BackupMaxDaysDir_explain}") . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:18px'>{backup_folder}:</strong></td>\n\t\t\t<td align='left' style='font-size:18px'>" . Field_text("BackupMaxDaysDir-{$tt}", $BackupMaxDaysDir, 'width:350px;padding:3px;font-size:18px', null, null, '') . "</td>\n\t\t\t<td width=1% nowrap>" . button_browse("BackupMaxDaysDir-{$tt}") . "</td>\n\t\t</tr>\t\n\n<tr><td colspan=3><div style='font-size:24px;margin-top:20px'>{NAS_storage}</div></td></tr>\t\t\t\t\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:18px'>{use_remote_nas}:</strong></td>\n\t\t\t<td align='left'>" . Field_checkbox("BackupSquidLogsUseNas-{$tt}", 1, $BackupSquidLogsUseNas) . "</td>\n\t\t\t<td>" . help_icon("{BackupSquidLogsUseNas_explain}") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:18px'>{hostname}:</strong></td>\n\t\t\t<td align='left'>" . Field_text("BackupSquidLogsNASIpaddr-{$tt}", $BackupSquidLogsNASIpaddr, 'width:350px;padding:3px;font-size:18px', null, null, '') . "</td>\n\t\t\t\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\t\t\t\t\t\n\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:18px'>{shared_folder}:</strong></td>\n\t\t\t<td align='left'>" . Field_text("BackupSquidLogsNASFolder-{$tt}", $BackupSquidLogsNASFolder, 'width:350px;padding:3px;font-size:18px', null, null, '') . "</td>\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:18px'>{username}:</strong></td>\n\t\t\t<td align='left'>" . Field_text("BackupSquidLogsNASUser-{$tt}", $BackupSquidLogsNASUser, 'width:350px;padding:3px;font-size:18px', null, null, '') . "</td>\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:18px'>{password}:</strong></td>\n\t\t\t<td align='left'>" . Field_password("BackupSquidLogsNASPassword-{$tt}", $BackupSquidLogsNASPassword, 'width:350px;padding:3px;font-size:18px', null, null, '') . "</td>\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t\t<tr><td colspan=3 align='right'><hr>" . button("{apply}", "Next{$tt}()", 24) . "</td></tr>\n\t\t\t<tr><td colspan=3 align='right'><hr>" . button("{test_connection}", "Loadjs('miniadm.system.syslogstore.php?test-nas-js=yes')", 16) . "</td></tr>\n\t\n\t\n\t</table>\n</div>\n<script>\nvar xNext{$tt}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\tLoadAjax('{$t}','{$page}?Next3=yes&t={$t}');\n\t}\n\t\n\tfunction Next{$tt}(){\n\tvar XHR = new XHRConnection();\n\t\n\tXHR.appendData('LogsRotateDeleteSize',document.getElementById('LogsRotateDeleteSize-{$tt}').value);\n\tXHR.appendData('LogsRotateDefaultSizeRotation',document.getElementById('LogsRotateDefaultSizeRotation-{$tt}').value);\n\tXHR.appendData('SystemLogsPath',encodeURIComponent(document.getElementById('SystemLogsPath-{$tt}').value));\n\tXHR.appendData('BackupMaxDays',document.getElementById('BackupMaxDays-{$tt}').value);\n\tXHR.appendData('BackupMaxDaysDir',encodeURIComponent(document.getElementById('BackupMaxDaysDir-{$tt}').value));\n\tif(document.getElementById('BackupSquidLogsUseNas-{$tt}').checked){\n\t\tXHR.appendData('BackupSquidLogsUseNas',1);\n\t}else{\n\t\tXHR.appendData('BackupSquidLogsUseNas',0);\n\t}\n\t\n\t\n\t\n\tXHR.appendData('BackupSquidLogsNASIpaddr',document.getElementById('BackupSquidLogsNASIpaddr-{$tt}').value);\n\tXHR.appendData('BackupSquidLogsNASFolder',encodeURIComponent(document.getElementById('BackupSquidLogsNASFolder-{$tt}').value));\n\tXHR.appendData('BackupSquidLogsNASUser',document.getElementById('BackupSquidLogsNASUser-{$tt}').value);\n\tXHR.appendData('BackupSquidLogsNASPassword',encodeURIComponent(document.getElementById('BackupSquidLogsNASPassword-{$tt}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xNext{$tt});\n\t}\n\t</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #22
0
function popup()
{
    $t = time();
    $html = "<div id='{$t}'></div>\n\t<script>\n\t\tLoadAjax('{$t}','freeweb.edit.main.php?servername={$_GET["servername"]}&force-groupware={$_GET["force-groupware"]}&t={$_GET["t"]}');\n\t</script>\n\t\n\t\n\t";
    echo $html;
    return;
    $sql = "SELECT * FROM freeweb WHERE servername='{$_GET["servername"]}'";
    $page = CurrentPageName();
    $users = new usersMenus();
    $tpl = new templates();
    $q = new mysql();
    $sock = new sockets();
    $APACHE_PROXY_MODE = 0;
    $DNS_INSTALLED = false;
    $remove_sql = false;
    $OnlyWebSite = false;
    $countloops = countloops();
    $no_usersameftpuser = $tpl->javascript_parse_text("{no_usersameftpuser}");
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    $error_field_max_length = $tpl->javascript_parse_text("{error_field_max_length}");
    $error_please_fill_field = $tpl->javascript_parse_text("{error_please_fill_field}");
    $acl_dstdomain = $tpl->javascript_parse_text("{acl_dstdomain}");
    $mysql_database = $tpl->javascript_parse_text("{mysql_database}");
    $username = $tpl->javascript_parse_text("{username}");
    $password = $tpl->javascript_parse_text("{password}");
    $vgservices = unserialize(base64_decode($sock->GET_INFO("vgservices")));
    $checkboxes = 1;
    $ButtonName = "{apply}";
    if ($ligne["groupware"] == "cachemgr") {
        $checkboxes = 0;
    }
    $users = new usersMenus();
    $PUREFTP_INSTALLED = 1;
    if (!$users->PUREFTP_INSTALLED) {
        $PUREFTP_INSTALLED = 0;
    }
    $ServerIPVAL = trim($ligne["ServerIP"]);
    $ServerPort = trim($ligne["ServerPort"]);
    $UseDefaultPort = 0;
    if ($users->APACHE_PROXY_MODE) {
        $APACHE_PROXY_MODE = 1;
    }
    $parcourir_domaines = "<input type='button' OnClick=\"javascript:Loadjs('browse.domains.php?field=domainname')\" value='{browse}...'>";
    if ($users->dnsmasq_installed) {
        $DNS_INSTALLED = true;
    }
    if ($users->POWER_DNS_INSTALLED) {
        $DNS_INSTALLED = true;
    }
    $FreeWebDisableSSL = trim($sock->GET_INFO("FreeWebDisableSSL"));
    if (!is_numeric($FreeWebDisableSSL)) {
        $FreeWebDisableSSL = 0;
    }
    $check_configuration = $tpl->_ENGINE_parse_body("{check_configuration}");
    $webservice = $tpl->_ENGINE_parse_body("{webservice}");
    $ServerIPVAL = "{$ServerIPVAL}:{$ServerPort}";
    if ($vgservices["freewebs"] != null) {
        if (!is_numeric($ligne["lvm_size"])) {
            $ligne["lvm_size"] = 5000;
        }
        if ($ligne["lvm_vg"] == null) {
            $ligne["lvm_vg"] = $vgservices["freewebs"];
        }
        $sizelimit = "\n\t\t<tr>\n\t\t<td class=legend>{size}:</td>\n\t\t<td style='font-size:13px;'>" . Field_text("vg_size", $ligne["lvm_size"], "font-size:13px;padding:3px;width:60px") . "&nbsp;MB</td>\n\t\t<td>&nbsp;</td>\n\t\t</tr>";
    }
    $freeweb = new freeweb($_GET["servername"]);
    $groupwarelink = $freeweb->groupwares_InstallLink();
    $groupwares_textintro = $freeweb->groupwares_textintro();
    if ($groupwarelink != null) {
        $explain = "\n\t\t<div class=explain>{$groupwares_textintro}:<br><strong style='font-size:14px'>\n\t\t\t<a href=\"javascript:blur()\" OnClick=\"javascript:s_PopUpFull('{$groupwarelink}',1024,768)\" style='text-decoration:underline;font-weight:bold;color:#969696'>{$groupwarelink}</a></strong></div>\t\t\n\t\t";
    }
    $img = "website-64.png";
    if ($_GET["force-groupware"] != null) {
        $vhosts = new vhosts();
        $img = $vhosts->IMG_ARRAY_64[$_GET["force-groupware"]];
        $imgtitle = "<div style='font-size:14px;font-weight:bold'>{" . $vhosts->TEXT_ARRAY[$_GET["force-groupware"]]["TITLE"] . "}</div>";
        if ($_GET["force-groupware"] == "ZARAFA") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($_GET["force-groupware"] == "Z-PUSH") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($_GET["force-groupware"] == "ZARAFA_MOBILE") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($_GET["force-groupware"] == "ROUNDCUBE") {
            $OnlyWebSite = true;
        }
    }
    if ($_GET["servername"] == null) {
        $ButtonName = "{add}";
    }
    $freeweb = new freeweb($_GET["servername"]);
    if ($ligne["domainname"] == null) {
        $dda = explode(".", $ligne["servername"]);
        $hostname = $dda[0];
        unset($dda[0]);
        $domainname = @implode(".", $dda);
    } else {
        $ff = explode(".", $ligne["servername"]);
        if (count($ff) > 2) {
            $hostname = str_replace(".{$ligne["domainname"]}", "", $ligne["servername"]);
        } else {
            $hostname = null;
        }
        $domainname = $ligne["domainname"];
        $parcourir_domaines = null;
    }
    if ($hostname == "_default_") {
        $parcourir_domaines = null;
    }
    if ($DNS_INSTALLED) {
        include_once dirname(__FILE__) . "/ressources/class.system.network.inc";
        include_once dirname(__FILE__) . "/ressources/class.pdns.inc";
        $pdns = new pdns();
        if ($ligne["servername"] == null) {
            $ip = new networking();
            $ips = $ip->ALL_IPS_GET_ARRAY();
            $ips[null] = "{none}";
            $dns_field = "<tr>\n\t\t\t\t<td class=legend nowrap>{dns_entry}:</td>\n\t\t\t\t<td>" . Field_array_Hash($ips, "ADD_DNS_ENTRY", null, "style:font-size:14px") . "</td>\n\t\t\t\t<td>" . help_icon("freeweb_add_dns_entry_explain") . "</td>\n\t\t\t</tr>";
        } else {
            $hostip = $pdns->GetIp($ligne["servername"]);
            if ($hostip != null) {
                $dns_field = "<tr>\n\t\t\t\t<td class=legend nowrap>{dns_entry}:</td>\n\t\t\t\t<td style='font-size:14px'>{$hostip}</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>";
            } else {
                $ip = new networking();
                $ips = $ip->ALL_IPS_GET_ARRAY();
                $ips[null] = "{none}";
                $dns_field = "<tr>\n\t\t\t\t<td class=legend nowrap>{dns_entry}:</td>\n\t\t\t\t<td>" . Field_array_Hash($ips, "ADD_DNS_ENTRY", null, "style:font-size:14px") . "</td>\n\t\t\t\t<td>" . help_icon("freeweb_add_dns_entry_explain") . "</td>\n\t\t\t</tr>";
            }
        }
    }
    $domain = "<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td>" . Field_text("servername", $hostname, "font-size:15px;padding:3px;font-weight:bold;width:90px") . "</td>\n\t\t\t<td style='font-size:14px' align='center' width=1%>&nbsp;.&nbsp;</td>\n\t\t\t<td>" . Field_text("domainname", $domainname, "font-size:15px;padding:3px;width:220px;font-weight:bold") . "</td>\n\t\t\t<td>{$parcourir_domaines}</td>\n\t\t</tr>\n\t\t</table>";
    if (!$users->AsSystemAdministrator) {
        if ($ligne["domainname"] == null) {
            $dd = explode(".", $ligne["servername"]);
            $hostname = $dd[0];
            unset($dd[0]);
            $domainname = @implode(".", $dd);
        } else {
            $ff = explode(".", $ligne["servername"]);
            if (count($ff) > 2) {
                $hostname = str_replace(".{$ligne["domainname"]}", "", $ligne["servername"]);
            } else {
                $hostname = null;
            }
            $domainname = $ligne["domainname"];
        }
        $ldap = new clladp();
        $domains = $ldap->Hash_domains_table($_SESSION["ou"]);
        while (list($a, $b) = each($domains)) {
            $c[$a] = $a;
        }
        $domain = "\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td>" . Field_text("servername", $hostname, "font-size:15px;padding:3px;font-weight:bold;width:90px") . "</td>\n\t\t\t<td style='font-size:14px' align='center' width=1%>&nbsp;.&nbsp;</td>\n\t\t\t<td>" . Field_array_Hash($c, "domainname", $domainname, "style:font-size:15px;padding:3px;font-weight:bold;width:220px;") . "</td>\n\t\t</tr>\n\t\t</table>";
    }
    $NewServer = 0;
    $reconfigure = ParagrapheTEXT("48-settings-refresh.png", "{rebuild}", "{rebuild_apache_text}", "javascript:FreeWebsRebuildvHosts()");
    if (trim($ligne["servername"] == null)) {
        $reconfigure = ParagrapheTEXT_disabled("48-settings-refresh.png", "{rebuild}", "{rebuild_apache_text}");
        $NewServer = 1;
    }
    if ($NewServer == 0) {
        $domain = "<div style='font-size:16px'>{$ligne["servername"]}</div>\n\t\t\t<input type='hidden' value='{$ligne["servername"]}' id='servername'>\n\t\t\t<input type='hidden' value='{$ligne["domainname"]}' id='domainname'>";
    }
    if ($ligne["groupware"] != null) {
        $apache = new vhosts();
        $img = $apache->IMG_ARRAY_64[$ligne["groupware"]];
        $rebuild_groupware = ParagrapheTEXT("setup-icon-48.png", "{software}", "{rebuild_apache_groupware_text}", "javascript:FreeWebsRebuildGroupware()");
        $sql = "SELECT ID FROM drupal_queue_orders WHERE `ORDER`='REBUILD_GROUPWARE' AND `servername`='{$servername}'";
        $ligneDrup = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
        if (!is_numeric($ligneDrup["ID"])) {
            $ligneDrup["ID"] = 0;
        }
        if ($ligneDrup["ID"] > 0) {
            $rebuild_groupware = ParagrapheTEXT_disabled("setup-icon-48.png", "{software}", "{rebuild_apache_groupware_text}");
        }
        if ($ligne["groupware"] == "ZARAFA") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($ligne["groupware"] == "Z-PUSH") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($ligne["groupware"] == "ZARAFA_MOBILE") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($ligne["groupware"] == "ROUNDCUBE") {
            $OnlyWebSite = true;
        }
        if ($ligne["ForceInstanceZarafaID"] > 0) {
            $_GET["ForceInstanceZarafaID"] = $ligne["ForceInstanceZarafaID"];
        }
    }
    $checksDebug = ParagrapheTEXT("setup-check-icon-48.png", "{check_configuration}", "{check_configuration_text}", "javascript:FreeWebsCheckGroupware()");
    if ($remove_sql) {
        $js_removesql = "HideMysql()";
    }
    if ($OnlyWebSite) {
        $js_OnlyWebSite = "OnlyWebsite()";
    }
    $uid_uri = urlencode(base64_encode($ligne["uid"]));
    $nets = unserialize(base64_decode($sock->GET_INFO("FreeWebsApacheListenTable")));
    $znets[null] = "{default}";
    while (list($num, $ip) = each($nets)) {
        $znets[$num] = $num;
    }
    $ServerIP = Field_array_Hash($znets, 'ServerIP', $ServerIPVAL, null, null, 0, 'font-size:14px;');
    $q = new mysql();
    include_once dirname(__FILE__) . "/ressources/class.squid.reverse.inc";
    $squid_reverse = new squid_reverse();
    $sslcertificates = $squid_reverse->ssl_certificates_list();
    $sslcertificate = Field_array_Hash($sslcertificates, $ligne["sslcertificate"], "style:font-size:14px");
    $html = "\n\t<input type='hidden' id='force-groupware' name ='force-groupware' value='{$_GET["force-groupware"]}'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' width=1%>\n\t\t\t<center>\n\t\t\t\t<img src='img/{$img}'>{$imgtitle}\n\t\t\t</center><br>\n\t\t\t<div style='width:190px'>\n\t\t\t{$reconfigure}{$rebuild_groupware}{$checksDebug}{$see_config}\n\t\t\t</div>\n\t\t</td>\n\t\t<td valign='top' width=99%>\n\t{$explain}\n\t<div style='font-size:16px'><a href=\"javascript:blur();\" style='font-size:18px;text-decoration:underline;margin-bottom:5px' \n\tOnClick=\"javascript:document.getElementById('block2').style.display='none';document.getElementById('block1').style.display='block';\">{$webservice}:</a></div>\n\t\n\t<div id='freewebdiv'>\n\t\t<div id='block1' style='display:block;'>\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap>{acl_dstdomain}:</td>\n\t\t\t\t<td colspan=2>{$domain}</td>\n\t\t\t</tr>\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap>{listen_address}:</td>\n\t\t\t\t<td colspan=2>{$ServerIP}</td>\n\t\t\t</tr>\t\t\t\t\t\n\t\t\t{$dns_field}\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap>{www_forward}:</td>\n\t\t\t\t<td width=1%>" . Field_checkbox("Forwarder", 1, $ligne["Forwarder"], "CheckForwarder()") . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\t\t\t\t\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap>{reverse_proxy}:</td>\n\t\t\t\t<td width=1%>" . Field_checkbox("UseReverseProxy", 1, $ligne["UseReverseProxy"], "CheckUseReverseProxy()") . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\t\t\n\t\t\t\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap>{directory}:</td>\n\t\t\t\t<td>" . Field_text("www_dir", $ligne["www_dir"], "font-size:13px;padding:3px;") . "</td>\n\t\t\t\t<td>" . button_browse("www_dir") . "</td>\n\t\t\t</tr>\t\t\t\n\t\t\t\n\t\t\t{$sizelimit}\n\t\t\t<tr>\n\t\t\t\t<td class=legend nowrap>{UseLoopDisk}:</td>\n\t\t\t\t<td>" . Field_checkbox("UseLoopDisk", 1, $ligne["UseLoopDisk"], "CheckLoops()") . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\n\t\t\t<tr style='height:auto'>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td colspan=2 style='height:auto'><span id='loops-list'></span></td></tr>\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{member}:</td>\n\t\t\t\t<td>" . Field_text("www_uid", $ligne["uid"], "font-size:13px;padding:3px;") . "</td>\n\t\t\t\t<td><span id='bb_button'><input type='button' OnClick=\"javascript:Loadjs('user.browse.php?field=www_uid&YahooWin=6')\" value='{browse}...'></span>\n\t\t\t\t<span id='status-uid-www' style='float:right'></span></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{group}:</td>\n\t\t\t\t<td>" . Field_text("www_group", $ligne["gpid"], "font-size:13px;padding:3px;") . "</td>\n\t\t\t\t<td><span id='bb_button1'><input type='button' OnClick=\"javascript:Loadjs('MembersBrowse.php?field-user=www_group&OnlyGroups=1&OnlyGUID=1');\" value='{browse}...'></span>\n\t\t\t\t<span id='status-gpid-www' style='float:right'></span></td>\n\t\t\t</tr>\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{ssl}:</td>\n\t\t\t\t<td>" . Field_checkbox("useSSL", 1, $ligne["useSSL"]) . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{certificate}:</td>\n\t\t\t\t<td>{$sslcertificate}</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\t\t\t\n\t\t\t</table>\n\t</div>\n\n\t<div style='font-size:16px'><a href=\"javascript:blur();\" style='font-size:18px;text-decoration:underline;margin-bottom:5px' OnClick=\"javascript:document.getElementById('block2').style.display='block';document.getElementById('block1').style.display='none';\">{mysql_database}:</a></div>\n\t<div id='block2' style='display:none;'>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<td class=legend>{useMySQL}:</td>\n\t\t<td>" . Field_checkbox("useMysql", 1, $ligne["useMysql"], "useMysqlCheck()") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{mysql_instance}:</td>\n\t\t<td><div id='freeweb-mysql-instances'></div></td>\n\t\t<td align='left'>" . imgtootltip("plus-24.png", "{add}:{mysql_instance}", "Loadjs('mysql.multi.php?mysql-server-js=yes&ID=');") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td class=legend>{mysql_database}:</td>\n\t\t<td>" . Field_text("mysql_database", $ligne["mysql_database"], "width:150px;font-size:13px;padding:3px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{mysql_username}:</td>\n\t\t<td>" . Field_text("mysql_username", $ligne["mysql_username"], "width:120px;font-size:13px;padding:3px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{password}:</td>\n\t\t<td>" . Field_password("mysql_password", $ligne["mysql_password"], "width:90px;font-size:13px;padding:3px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3><span style='font-size:16px'>{ftp_access}<hr style='border-color:005447'></td>\n\t</tr>\t\n\t\n\t\n\t<tr>\n\t\t<td class=legend>{allowftp_access}:</td>\n\t\t<td>" . Field_checkbox("useFTP", 1, $ligne["useFTP"], "useMysqlCheck()") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td class=legend>{ftp_user}:</td>\n\t\t<td>" . Field_text("ftpuser", $ligne["ftpuser"], "width:120px;font-size:13px;padding:3px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{password}:</td>\n\t\t<td>" . Field_password("ftppassword", $ligne["ftppassword"], "width:90px;font-size:13px;padding:3px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t</table>\n\t\n\n\t\n\t<div id='block3' style='display:none'>\n\t\t<table style='width:99%' class=form>\n\t\t<tr>\n\t\t\t<td class=legend>{www_ForwardTo}:</td>\n\t\t\t<td>" . Field_text("ForwardTo", $ligne["ForwardTo"], "width:270px;font-size:14px;padding:3px") . "</td>\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t</table>\t\n\t</div>\t\n\t</div>\n\t\n\t<div style='width:100%;text-align:right'><hr>" . button("{$ButtonName}", "SaveFreeWebMain()", 18) . "</div>\n\n\n\n\t\n\t\n\t</td>\n\t</tr>\n\t</table>\n<script>\n\n\tfunction CheckDatas(){\n\t\tvar APACHE_PROXY_MODE={$APACHE_PROXY_MODE};\n\t\tvar FreeWebDisableSSL={$FreeWebDisableSSL};\n\t\t \n\t\t\n\t\tif(APACHE_PROXY_MODE==0){\n\t\t\tdocument.getElementById('UseReverseProxy').checked=false;\n\t\t\tdocument.getElementById('UseReverseProxy').disabled=true;\n\t\t}\n\t\t\n\t\tvar x=document.getElementById('servername').value;\n\t\tvar z=document.getElementById('domainname').value;\n\t\tvar w=x.length+z.length;\n\t\tif(w>0){\n\t\t\tdocument.getElementById('servername').disabled=true;\n\t\t\tdocument.getElementById('domainname').disabled=true;\n\t\t\t}\n\t\tvar x=document.getElementById('mysql_database').value;\n\t\tif(x.length>0){document.getElementById('mysql_database').disabled=true;}\t\n\n\t\tif(FreeWebDisableSSL==1){\n\t\t\tdocument.getElementById('useSSL').disabled=true;\n\t\t}\n\t\t\n\t}\n\t\n\n\t\n\tfunction useMysqlCheck(){\n\t\tvar mysql_instance_id=0;\n\t\tvar checkboxes={$checkboxes};\n\t\tvar PUREFTP_INSTALLED={$PUREFTP_INSTALLED};\n\t\tif(document.getElementById('mysql_instance_id')){mysql_instance_id=document.getElementById('mysql_instance_id').value;}\n\t\tdocument.getElementById('useFTP').disabled=true;\n\t\tdocument.getElementById('useMysql').disabled=true;\n\t\t\n\t\tif(checkboxes==1){\n\t\t\tif(PUREFTP_INSTALLED==1){document.getElementById('useFTP').disabled=false;}\n\t\t\tif(mysql_instance_id==0){document.getElementById('useMysql').disabled=false;}\t\n\t\t}\n\t\tif(PUREFTP_INSTALLED==1){\n\t\t\tdocument.getElementById('useFTP').disabled=false;\n\t\t}else{\n\t\t\tdocument.getElementById('useFTP').disabled=true;\n\t\t\tdocument.getElementById('useFTP').checked=false;\n\t\t}\n\t\t\n\t\tdocument.getElementById('mysql_database').disabled=true;\n\t\tdocument.getElementById('mysql_username').disabled=true;\n\t\tdocument.getElementById('mysql_password').disabled=true;\n\t\tdocument.getElementById('ftpuser').disabled=true;\n\t\tdocument.getElementById('ftppassword').disabled=true;\n\t\tif(mysql_instance_id==0){\n\t\t\tif(document.getElementById('useMysql').checked){\n\t\t\t\tvar mysql_database=document.getElementById('mysql_database').value;\n\t\t\t\tif(mysql_database.length==0){document.getElementById('mysql_database').disabled=false;}\n\t\t\t\tdocument.getElementById('mysql_username').disabled=false;\n\t\t\t\tdocument.getElementById('mysql_password').disabled=false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(mysql_instance_id==1){\n\t\t\tdocument.getElementById('mysql_database').disabled=false;\n\t\t}\n\t\t\n\t\tif(!document.getElementById('useFTP').checked){return;}\n\t\tdocument.getElementById('ftpuser').disabled=false;\n\t\tdocument.getElementById('ftppassword').disabled=false;\t\t\n\t\t\n\t\t\n\t}\n\t\n\tfunction CheckForwarder(){\n\t\tif(document.getElementById('Forwarder').checked){\n\t\t\tdocument.getElementById('block2').style.display='none';\n\t\t\tdocument.getElementById('block3').style.display='block';\n\t\t\tdocument.getElementById('UseReverseProxy').disabled=true;\n\t\t\tdocument.getElementById('UseLoopDisk').disabled=true;\n\t\t}else{\n//\t\t\tdocument.getElementById('block2').style.display='block';\n\t\t\tdocument.getElementById('block3').style.display='none';\n\t\t\tdocument.getElementById('UseReverseProxy').disabled=false;\n\t\t\tdocument.getElementById('UseLoopDisk').disabled=false;\n\t\t\tCheckLoops();\n\t\t}\n\t\n\t}\n\t\t\n\tfunction FreeWebsRebuildvHosts(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('FreeWebsRebuildvHosts','{$_GET["servername"]}');\n\t\tAnimateDiv('freewebdiv');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveFreeWebMain);\n\t}\n\t\n\tfunction FreeWebsRebuildGroupware(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('FreeWebsRebuildGroupware','{$_GET["servername"]}');\n\t\tAnimateDiv('freewebdiv');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveFreeWebMain);\n\t}\t\t\t\n\n\n\tvar x_SaveFreeWebMain=function (obj) {\n\t\t    var NewServer={$NewServer};\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\t\t\t\n\t\t\tRefreshTab('main_config_freewebedit');\n\t\t\tif(document.getElementById('container-www-tabs')){RefreshTab('container-www-tabs');}\n\t\t\tif(document.getElementById('main_config_freeweb')){RefreshTab('main_config_freeweb');}\n\t\t\tif(document.getElementById('sarg_tabs')){RefreshTab('sarg_tabs');}\n\t\t\t\n\t\t\tif(NewServer==1){YahooWin5Hide();}\n\t\t\t\n\t\t}\t\n\t\t\n\t\tfunction SaveFreeWebMain(){\n\t\t\tvar NewServer={$NewServer};\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tif(NewServer==1){\n\t\t\t\tvar sitename=document.getElementById('servername').value;\n\t\t\t\tvar www_a=document.getElementById('domainname').value;\n\t\t\t\tvar www_b=document.getElementById('servername').value;\n\t\t\t\tvar www_t=www_a.length+www_b.length;\n\t\t\t\tif(www_t<2){\n\t\t\t\t\talert('{$error_please_fill_field}:{$acl_dstdomain}'); \n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif(sitename!=='_default_'){\n\t\t\t\t\tvar x=document.getElementById('domainname').value;\n\t\t\t\t\tif(x.length==0){alert('{$error_please_fill_field}:{$acl_dstdomain}');return;}\n\t\t\t\t}else{\n\t\t\t\t\tdocument.getElementById('domainname').value='';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(document.getElementById('ADD_DNS_ENTRY')){\n\t\t\t\tXHR.appendData('ADD_DNS_ENTRY',document.getElementById('ADD_DNS_ENTRY').value);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(document.getElementById('useMysql').checked){\n\t\t\t\tvar mysql_database=document.getElementById('mysql_database').value;\n\t\t\t\tif(mysql_database.length==0){\n\t\t\t\t\talert('{$error_please_fill_field}:{$mysql_database}');\n\t\t\t\t\treturn;\t\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t\tvar x=document.getElementById('mysql_password').value;\n\t\t\t\tif(x.length==0){\n\t\t\t\t\talert('{$error_please_fill_field}:{$mysql_database}/{$password}');\n\t\t\t\t\treturn;\n\t\t\t\t}\t\n\t\t\t\tvar x=document.getElementById('mysql_username').value;\n\t\t\t\tif(x.length==0){\n\t\t\t\t\talert('{$error_please_fill_field}:{$mysql_database}/{$username}');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(mysql_database.length>16){\n\t\t\t\t\talert('mysql_database:{$error_field_max_length}: 16');\n\t\t\t\t\tdocument.getElementById('mysql_database').disabled=false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(document.getElementById('useSSL').checked){XHR.appendData('useSSL',1);}else{XHR.appendData('useSSL',0);}\n\t\t\tif(document.getElementById('useMysql').checked){XHR.appendData('useMysql',1);}else{XHR.appendData('useMysql',0);}\n\t\t\tif(document.getElementById('useFTP').checked){XHR.appendData('useFTP',1);}else{XHR.appendData('useFTP',0);}\n\t\t\tXHR.appendData('UseDefaultPort',0)\n\t\t\tif(document.getElementById('UseReverseProxy').checked){XHR.appendData('UseReverseProxy',1);}else{XHR.appendData('UseReverseProxy',0);}\n\t\t\tif(document.getElementById('Forwarder').checked){XHR.appendData('Forwarder',1);}else{XHR.appendData('Forwarder',0);}\n\t\t\tXHR.appendData('ForceInstanceZarafaID','{$_GET["ForceInstanceZarafaID"]}');\n\t\t\t\n\t\t\tif(document.getElementById('www_dir')){\n\t\t\t\tXHR.appendData('www_dir',document.getElementById('www_dir').value);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(document.getElementById('LoopMounts')){\n\t\t\t\tvar LoopMounts=document.getElementById('LoopMounts').value;\n\t\t\t\tif(LoopMounts.length>3){\n\t\t\t\t\tif(document.getElementById('UseLoopDisk').checked){XHR.appendData('UseLoopDisk',1);}else{XHR.appendData('UseLoopDisk',0);}\n\t\t\t\t\tXHR.appendData('LoopMounts',LoopMounts);\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tvar ftpuser=trim(document.getElementById('ftpuser').value);\n\t\t\tvar uid=trim(document.getElementById('www_uid').value);\n\t\t\tif(document.getElementById('useFTP').checked){\t\n\t\t\t\tif(uid==ftpuser){\n\t\t\t\t\talert('{$no_usersameftpuser}');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(document.getElementById('vg_size')){XHR.appendData('vg_size',document.getElementById('vg_size').value);}\n\t\t\tXHR.appendData('lvm_vg','{$ligne["lvm_vg"]}');\n\t\t\tif(NewServer==1){\n\t\t\t\tif(sitename!=='_default_'){\n\t\t\t\t\tvar www_b=document.getElementById('domainname').value;\n\t\t\t\t\tvar www_a=document.getElementById('servername').value;\n\t\t\t\t\tif(www_a.length>0){XHR.appendData('servername',www_a+'.'+www_b);}else{XHR.appendData('servername',www_b);}\n    \t\t\t\t}else{\n    \t\t\t\tXHR.appendData('servername','_default_');\n    \t\t\t}\n    \t\t}\n    \t\tif(NewServer==0){XHR.appendData('servername',document.getElementById('servername').value);}\n    \t\tXHR.appendData('domainname',document.getElementById('domainname').value);\n    \t\tXHR.appendData('uid',uid);\n    \t\tXHR.appendData('gpid',document.getElementById('www_group').value);\n    \t\tXHR.appendData('mysql_instance_id',document.getElementById('mysql_instance_id').value);\n    \t\tXHR.appendData('mysql_database',document.getElementById('mysql_database').value);\n    \t\tXHR.appendData('mysql_password',document.getElementById('mysql_password').value);\n    \t\tXHR.appendData('mysql_username',document.getElementById('mysql_username').value);\n    \t\tXHR.appendData('ftpuser',ftpuser);\n    \t\tXHR.appendData('ftppassword',document.getElementById('ftppassword').value);\n    \t\tXHR.appendData('ForwardTo',document.getElementById('ForwardTo').value);\n    \t\tXHR.appendData('force-groupware',document.getElementById('force-groupware').value);\n    \t\tXHR.appendData('mysql_instance_id',document.getElementById('mysql_instance_id').value);\n    \t\tXHR.appendData('ServerIP',document.getElementById('ServerIP').value);\n    \t\tXHR.appendData('sslcertificate',document.getElementById('sslcertificate').value);\n    \t\t\n    \t\t\n    \t\t\n    \t\tAnimateDiv('freewebdiv');\n    \t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveFreeWebMain);\n\t\t\t\n\t\t}\t\n\t\t\n\tfunction CheckLoops(){\n\t\tvar countloops={$countloops};\n\t\tdocument.getElementById('UseLoopDisk').disabled=true;\n\t\tif(countloops>0){\n\t\t\tdocument.getElementById('UseLoopDisk').disabled=false;\n\t\t}\n\t\tdocument.getElementById('loops-list').innerHTML='';\n\t\t\n\t\tif(document.getElementById('UseLoopDisk').checked){\n\t\t\tif(document.getElementById('vg_size')){\n\t\t\t\tdocument.getElementById('vg_size').disabled=true;\n\t\t\t}\n\t\t\tLoadAjax('loops-list','{$page}?loops-list=yes&servername={$ligne["servername"]}');\n\t\t}\n\t}\n\t\n\t\n\tfunction FreeWebsCheckGroupware(){\n\t\tLoadWinORG2('850','{$page}?FreeWebsCheck=yes&servername={$ligne["servername"]}','{$check_configuration}::{$ligne["servername"]}');\n\t\n\t}\n\t\n\t\t\n\tfunction CheckLoops(){\n\t\tvar countloops={$countloops};\n\t\tdocument.getElementById('UseLoopDisk').disabled=true;\n\t\tif(countloops>0){document.getElementById('UseLoopDisk').disabled=false;}\n\t\tdocument.getElementById('loops-list').innerHTML='';\n\t\t\n\t\tif(document.getElementById('UseLoopDisk').checked){\n\t\t\tif(document.getElementById('vg_size')){\n\t\t\t\tdocument.getElementById('vg_size').disabled=true;\n\t\t\t}\n\t\t\tLoadAjax('loops-list','{$page}?loops-list=yes&servername={$ligne["servername"]}');\n\t\t}\n\t}\n\t\n\tfunction CheckUseReverseProxy(){\n\t\tCheckDatas();\n\t\tuseMysqlCheck();\n\t\tCheckLoops();\n\t\t{$js_removesql};\n\t\t{$js_OnlyWebSite};\n\t}\n\t\n\tfunction HideMysql(){\n\t\tdocument.getElementById('useMysql').disabled=true;\n\t}\n\t\n\tfunction OnlyWebsite(){\n\t\tif(document.getElementById('Forwarder')){document.getElementById('Forwarder').disabled=true;}\n\t\tif(document.getElementById('UseReverseProxy')){document.getElementById('UseReverseProxy').disabled=true;}\n\t\tif(document.getElementById('useFTP')){document.getElementById('useFTP').disabled=true;}\n\t}\n\t\n\tfunction CheckUId(){\n\t\tLoadAjaxTiny('status-uid-www','{$page}?uid-check={$uid_uri}');\n\t}\n\n\t\n\tfunction freeweb_mysql_instances(){\n\t\tLoadAjaxTiny('freeweb-mysql-instances','{$page}?freeweb-mysql-instances-field=yes&servername={$ligne["servername"]}');\n\t\n\t}\n\t\n\tfunction mysql_instance_id_check(){\n\t\t\t\n\t\t\tvar mysql_instance_id=document.getElementById('mysql_instance_id').value;\n\t\t\t\n\t\t\tif(mysql_instance_id>0){\n\t\t\t\tdocument.getElementById('useMysql').disabled=true;\n\t\t\t\tuseMysqlCheck();\n\t\t\t}else{\n\t\t\t\tdocument.getElementById('useMysql').disabled=false;\n\t\t\t\tuseMysqlCheck();\n\t\t\t}\n\t\t}\n\t\t\n\n\t\n\tCheckDatas();\n\tuseMysqlCheck();\n\tCheckLoops();\n\tCheckForwarder();\n\tCheckUId();\n\t{$js_removesql};\n\t{$js_OnlyWebSite};\n\t\n\tfreeweb_mysql_instances();\n\t\n\t</script>\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #23
0
function webservice()
{
    $sql = "SELECT * FROM freeweb WHERE servername='{$_GET["servername"]}'";
    $page = CurrentPageName();
    $users = new usersMenus();
    $tpl = new templates();
    $q = new mysql();
    $sock = new sockets();
    $APACHE_PROXY_MODE = 0;
    $DNS_INSTALLED = false;
    $remove_sql = false;
    $OnlyWebSite = false;
    $countloops = countloops();
    $no_usersameftpuser = $tpl->javascript_parse_text("{no_usersameftpuser}");
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    if (!is_numeric($_GET["t"])) {
        $_GET["t"] = 0;
    }
    $error_field_max_length = $tpl->javascript_parse_text("{error_field_max_length}");
    $error_please_fill_field = $tpl->javascript_parse_text("{error_please_fill_field}");
    $acl_dstdomain = $tpl->javascript_parse_text("{acl_dstdomain}");
    $mysql_database = $tpl->javascript_parse_text("{mysql_database}");
    $username = $tpl->javascript_parse_text("{username}");
    $password = $tpl->javascript_parse_text("{password}");
    $vgservices = unserialize(base64_decode($sock->GET_INFO("vgservices")));
    $checkboxes = 1;
    $ButtonName = "{apply}";
    if ($ligne["groupware"] == "cachemgr") {
        $checkboxes = 0;
    }
    $users = new usersMenus();
    $PUREFTP_INSTALLED = 1;
    if (!$users->PUREFTP_INSTALLED) {
        $PUREFTP_INSTALLED = 0;
    }
    $ServerIPVAL = trim($ligne["ServerIP"]);
    $ServerPort = trim($ligne["ServerPort"]);
    $sslcertificate = $ligne["sslcertificate"];
    $UseDefaultPort = 0;
    if ($users->APACHE_PROXY_MODE) {
        $APACHE_PROXY_MODE = 1;
    }
    $parcourir_domaines = button("{browse}...", "Loadjs('browse.domains.php?field=domainname')", 12);
    if ($users->dnsmasq_installed) {
        $DNS_INSTALLED = true;
    }
    if ($users->POWER_DNS_INSTALLED) {
        $DNS_INSTALLED = true;
    }
    $FreeWebDisableSSL = trim($sock->GET_INFO("FreeWebDisableSSL"));
    if (!is_numeric($FreeWebDisableSSL)) {
        $FreeWebDisableSSL = 0;
    }
    $check_configuration = $tpl->_ENGINE_parse_body("{check_configuration}");
    $webservice = $tpl->_ENGINE_parse_body("{webservice}");
    $ServerIPVAL = "{$ServerIPVAL}:{$ServerPort}";
    $freeweb = new freeweb($_GET["servername"]);
    $acl_dstdomain_label = $tpl->_ENGINE_parse_body("{acl_dstdomain}");
    //HTTTRACK ---------------------------------------------------------
    $WebCopyCount = $q->COUNT_ROWS("httrack_sites", "artica_backup");
    if ($WebCopyCount > 0) {
        $sql = "SELECT ID,sitename FROM httrack_sites";
        $results_webcopy = $q->QUERY_SQL($sql, "artica_backup");
        $WebCopyHash[0] = "{none}";
        while ($ligneWebCopy = mysql_fetch_assoc($results_webcopy)) {
            $WebCopyHash[$ligneWebCopy["ID"]] = $ligneWebCopy["sitename"];
        }
        $WebCopyTR = "<tr>\n\t\t\t\t<td class=legend nowrap style='font-size:18px;vertical-align:middle'>WebCopy:</td>\n\t\t\t\t<td>" . Field_array_Hash($WebCopyHash, "WebCopyID", $freeweb->WebCopyID, "style:font-size:18px") . "</td>\n\t\t\t\t<td>" . help_icon("freeweb_WebCopy_explain") . "</td>\n\t\t\t</tr>";
    }
    if ($ligne["groupware"] == "SUGAR") {
        $additional_infos = sugard_additional_infos();
    }
    if ($vgservices["freewebs"] != null) {
        if (!is_numeric($ligne["lvm_size"])) {
            $ligne["lvm_size"] = 5000;
        }
        if ($ligne["lvm_vg"] == null) {
            $ligne["lvm_vg"] = $vgservices["freewebs"];
        }
        $sizelimit = "\n\t\t<tr>\n\t\t<td class=legend style='font-size:18px;vertical-align:middle'>{size}:</td>\n\t\t<td style='font-size:14px;'>" . Field_text("vg_size", $ligne["lvm_size"], "font-size:18px;padding:3px;width:60px") . "&nbsp;MB</td>\n\t\t<td>&nbsp;</td>\n\t\t</tr>";
    }
    $groupwarelink = $freeweb->groupwares_InstallLink();
    $groupwares_textintro = $freeweb->groupwares_textintro();
    if ($groupwarelink != null) {
        $explain = "\n\t\t<div class=explain>{$groupwares_textintro}:<br><strong style='font-size:14px'>\n\t\t\t<a href=\"javascript:blur()\" OnClick=\"javascript:s_PopUpFull('{$groupwarelink}',1024,768)\" style='text-decoration:underline;font-weight:bold;color:#969696'>{$groupwarelink}</a></strong></div>\t\t\n\t\t";
    }
    $img = "website-64.png";
    if ($_GET["force-groupware"] != null) {
        $vhosts = new vhosts();
        $img = $vhosts->IMG_ARRAY_64[$_GET["force-groupware"]];
        $imgtitle = "<div style='font-size:18px;font-weight:bold'>{" . $vhosts->TEXT_ARRAY[$_GET["force-groupware"]]["TITLE"] . "}</div>";
        if ($_GET["force-groupware"] == "ZARAFA") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($_GET["force-groupware"] == "Z-PUSH") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($_GET["force-groupware"] == "ZARAFA_MOBILE") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($_GET["force-groupware"] == "ROUNDCUBE") {
            $OnlyWebSite = true;
        }
        if ($_GET["force-groupware"] == "KLMS") {
            $OnlyWebSite = true;
            $remove_sql = true;
        }
    }
    $servernameenc = urlencode($_GET["servername"]);
    $configure = "&nbsp;|&nbsp;" . button("{reconfigure}", "SaveFreeWebMain();Loadjs('freeweb.rebuild.progress.php?servername={$servernameenc}')", 26);
    if ($_GET["servername"] == null) {
        $ButtonName = "{add}";
        $configure = null;
    }
    if ($ligne["domainname"] == null) {
        $dda = explode(".", $ligne["servername"]);
        $hostname = $dda[0];
        unset($dda[0]);
        $domainname = @implode(".", $dda);
    } else {
        $ff = explode(".", $ligne["servername"]);
        if (count($ff) > 2) {
            $hostname = str_replace(".{$ligne["domainname"]}", "", $ligne["servername"]);
        } else {
            $hostname = null;
        }
        $domainname = $ligne["domainname"];
        $parcourir_domaines = null;
    }
    if ($hostname == "_default_") {
        $parcourir_domaines = null;
    }
    if ($DNS_INSTALLED) {
        include_once dirname(__FILE__) . "/ressources/class.system.network.inc";
        include_once dirname(__FILE__) . "/ressources/class.pdns.inc";
        $pdns = new pdns();
        if ($ligne["servername"] == null) {
            $ip = new networking();
            $ips = $ip->ALL_IPS_GET_ARRAY();
            $ips[null] = "{none}";
            $dns_field = "<tr>\n\t\t\t\t<td class=legend nowrap style='font-size:18px;vertical-align:middle'>{dns_entry}:</td>\n\t\t\t\t<td>" . Field_array_Hash($ips, "ADD_DNS_ENTRY", null, "style:font-size:18px") . "</td>\n\t\t\t\t<td>" . help_icon("freeweb_add_dns_entry_explain") . "</td>\n\t\t\t</tr>";
        } else {
            $hostip = $pdns->GetIp($ligne["servername"]);
            if ($hostip != null) {
                $dns_field = "<tr>\n\t\t\t\t<td class=legend nowrap style='font-size:18px;vertical-align:middle'>{dns_entry}:</td>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'>{$hostip}</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>";
            } else {
                $ip = new networking();
                $ips = $ip->ALL_IPS_GET_ARRAY();
                $ips[null] = "{none}";
                $dns_field = "<tr>\n\t\t\t\t<td class=legend nowrap style='font-size:18px;vertical-align:middle'>{dns_entry}:</td>\n\t\t\t\t<td>" . Field_array_Hash($ips, "ADD_DNS_ENTRY", null, "style:font-size:18px") . "</td>\n\t\t\t\t<td>" . help_icon("freeweb_add_dns_entry_explain") . "</td>\n\t\t\t</tr>";
            }
        }
    }
    $domain = "<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td>" . Field_text("servername", $hostname, "font-size:18px;padding:3px;font-weight:bold;width:90px") . "</td>\n\t\t\t<td style='font-size:18px' align='center' width=1%>&nbsp;.&nbsp;</td>\n\t\t\t<td>" . Field_text("domainname", $domainname, "font-size:18px;padding:3px;width:220px;font-weight:bold") . "</td>\n\t\t\t<td>{$parcourir_domaines}</td>\n\t\t</tr>\n\t\t</table>";
    if (!$users->AsSystemAdministrator) {
        if ($ligne["domainname"] == null) {
            $dd = explode(".", $ligne["servername"]);
            $hostname = $dd[0];
            unset($dd[0]);
            $domainname = @implode(".", $dd);
        } else {
            $ff = explode(".", $ligne["servername"]);
            if (count($ff) > 2) {
                $hostname = str_replace(".{$ligne["domainname"]}", "", $ligne["servername"]);
            } else {
                $hostname = null;
            }
            $domainname = $ligne["domainname"];
        }
        $ldap = new clladp();
        $domains = $ldap->Hash_domains_table($_SESSION["ou"]);
        while (list($a, $b) = each($domains)) {
            $c[$a] = $a;
        }
        $domain = "\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td>" . Field_text("servername", $hostname, "font-size:18px;padding:3px;font-weight:bold;width:90px") . "</td>\n\t\t\t<td style='font-size:18px' align='center' width=1%>&nbsp;.&nbsp;</td>\n\t\t\t<td>" . Field_array_Hash($c, "domainname", $domainname, "style:font-size:18px;padding:3px;font-weight:bold;width:220px;") . "</td>\n\t\t</tr>\n\t\t</table>";
    }
    $NewServer = 0;
    if (trim($ligne["servername"] == null)) {
        $NewServer = 1;
    }
    if ($NewServer == 0) {
        $domain = "<div style='font-size:22px'>{$ligne["servername"]}</div>\n\t\t\t<input type='hidden' value='{$ligne["servername"]}' id='servername'>\n\t\t\t<input type='hidden' value='{$ligne["domainname"]}' id='domainname'>";
    }
    if ($ligne["groupware"] != null) {
        $apache = new vhosts();
        $img = $apache->IMG_ARRAY_64[$ligne["groupware"]];
        if ($ligne["groupware"] == "ROUNDCUBE") {
            $OnlyWebSite = true;
        }
        if ($ligne["ForceInstanceZarafaID"] > 0) {
            $_GET["ForceInstanceZarafaID"] = $ligne["ForceInstanceZarafaID"];
        }
    }
    if ($OnlyWebSite) {
        $js_OnlyWebSite = "OnlyWebsite()";
    }
    $uid_uri = urlencode(base64_encode($ligne["uid"]));
    $nets = unserialize(base64_decode($sock->GET_INFO("FreeWebsApacheListenTable")));
    $znets[null] = "{default}";
    while (list($num, $ip) = each($nets)) {
        $znets[$num] = $num;
    }
    $ServerIP = Field_array_Hash($znets, 'ServerIP', $ServerIPVAL, null, null, 0, 'font-size:18px;');
    $q = new mysql();
    include_once dirname(__FILE__) . "/ressources/class.squid.reverse.inc";
    $squid_reverse = new squid_reverse();
    $sslcertificates = $squid_reverse->ssl_certificates_list();
    $sslcertificateF = Field_array_Hash($sslcertificates, "sslcertificate", $sslcertificate, "style:font-size:18px");
    $t = time();
    $html = "\n\t<div id='freewebdiv-{$t}'></div>\n\t<input type='hidden' id='force-groupware' name ='force-groupware' value='{$_GET["force-groupware"]}'>\n\t<table style='width:100%' class=TableRemove>\n\t<tr>\n\t\t<td valign='top' width=1%>\n\t\t\t<center>\n\t\t\t\t<img src='img/{$img}'>{$imgtitle}\n\t\t\t</center><br>\n\t\t\t<div style='width:190px'>\n\t\t\t\n\t\t\t</div>\n\t\t</td>\n\t\t<td valign='top' width=99%>\n\t{$explain}\n\t<div id='freewebdiv'>\n\t\t<div id='block1' style='display:block;'>\n\t\t\t<div style='width:98%' class=form>\n\t\t\t<table>\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap style='font-size:18px;vertical-align:middle'>{$acl_dstdomain_label}:</td>\n\t\t\t\t<td colspan=2>{$domain}</td>\n\t\t\t</tr>\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap style='font-size:18px;vertical-align:middle'>{listen_address}:</td>\n\t\t\t\t<td colspan=2>{$ServerIP}</td>\n\t\t\t</tr>\t\t\t\t\t\n\t\t\t{$dns_field}\n\t\t\t{$WebCopyTR}\t\n\t\t\t\n\t\t\t\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap style='font-size:18px;vertical-align:middle'>{directory}:</td>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'>" . Field_text("www_dir", $ligne["www_dir"], "font-size:18px;padding:3px;") . "</td>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'>" . button_browse("www_dir") . "</td>\n\t\t\t</tr>\t\t\t\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap style='font-size:18px;vertical-align:middle'>{reverse_proxy}:</td>\n\t\t\t\t<td width=1% style='font-size:18px;vertical-align:middle'>" . Field_checkbox_design("UseReverseProxy", 1, $ligne["UseReverseProxy"], "CheckUseReverseProxy()") . "</td>\n\t\t\t</tr>\t\t\n\t\t\t\n\t\t\t{$sizelimit}\n\t\t\t<tr>\n\t\t\t\t<td class=legend nowrap style='font-size:18px;vertical-align:middle'>{UseLoopDisk}:</td>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'>" . Field_checkbox_design("UseLoopDisk", 1, $ligne["UseLoopDisk"], "CheckLoops()") . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\n\t\t\t<tr style='height:auto'>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'>&nbsp;</td>\n\t\t\t\t<td colspan=2 style='height:auto'><span id='loops-list'></span></td></tr>\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:18px;vertical-align:middle'>{member}:</td>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'>" . Field_text("www_uid", $ligne["uid"], "font-size:18px;padding:3px;") . "</td>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'><span id='bb_button'>" . button("{browse}...", "Loadjs('user.browse.php?field=www_uid&YahooWin=6')", 12) . "</span>\n\t\t\t\t<span id='status-uid-www' style='float:right'></span></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:18px;vertical-align:middle'>{group}:</td>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'>" . Field_text("www_group", $ligne["gpid"], "font-size:18px;padding:3px;") . "</td>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'><span id='bb_button1'>" . button("{browse}...", "Loadjs('MembersBrowse.php?field-user=www_group&OnlyGroups=1&OnlyGUID=1')", 12) . "</span>\n\t\t\t\t\t<span id='status-gpid-www' style='float:right'></span>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:18px;vertical-align:middle'>{ssl}:</td>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'>" . Field_checkbox_design("useSSL", 1, $ligne["useSSL"], "useSSLCheckCOnf()") . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:18px;vertical-align:middle'>{certificate}:</td>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'>{$sslcertificateF}</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\t\t\t\n\t\t\t\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap style='font-size:18px;vertical-align:middle'>{www_forward}:</td>\n\t\t\t\t<td width=1% style='font-size:18px;vertical-align:middle'>" . Field_checkbox_design("Forwarder", 1, $ligne["Forwarder"], "CheckForwarder()") . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:18px;vertical-align:middle'>{www_ForwardTo}:</td>\n\t\t\t\t<td style='font-size:18px;vertical-align:middle'>" . Field_text("ForwardTo", $ligne["ForwardTo"], "width:270px;font-size:18px;padding:3px") . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</div>\n\t\t</div>\t\n\t</div>\t\n\t</div>\n\t\n\t<div style='width:100%;text-align:right;font-size:26px'><hr>" . button("{$ButtonName}", "SaveFreeWebMain()", 30) . "{$configure}</div>\n\n\n\n\t\n\t\n\t</td>\n\t</tr>\n\t</table>\n\t\n\t{$additional_infos}\n<script>\n\n\tfunction CheckDatas(){\n\t\tvar APACHE_PROXY_MODE={$APACHE_PROXY_MODE};\n\t\tvar FreeWebDisableSSL={$FreeWebDisableSSL};\n\t\t \n\t\t\n\t\tif(APACHE_PROXY_MODE==0){\n\t\t\tdocument.getElementById('UseReverseProxy').checked=false;\n\t\t\tdocument.getElementById('UseReverseProxy').disabled=true;\n\t\t}\n\t\t\n\t\tvar x=document.getElementById('servername').value;\n\t\tvar z=document.getElementById('domainname').value;\n\t\tvar w=x.length+z.length;\n\t\tif(w>0){\n\t\t\tdocument.getElementById('servername').disabled=true;\n\t\t\tdocument.getElementById('domainname').disabled=true;\n\t\t\t}\n\t\t\n\t\tif(FreeWebDisableSSL==1){\n\t\t\tdocument.getElementById('useSSL').disabled=true;\n\t\t}\n\t\t\n\t}\n\t\n\n\t\n\n\t\n\tfunction CheckForwarder(){\n\t\tif(document.getElementById('Forwarder').checked){\n\t\t\tdocument.getElementById('UseReverseProxy').disabled=true;\n\t\t\tdocument.getElementById('UseLoopDisk').disabled=true;\n\t\t\tdocument.getElementById('ForwardTo').disabled=false;\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\tdocument.getElementById('UseReverseProxy').disabled=false;\n\t\t\tdocument.getElementById('UseLoopDisk').disabled=false;\n\t\t\tdocument.getElementById('ForwardTo').disabled=true;\n\t\t\tCheckLoops();\n\t\t}\n\t\n\t}\n\t\t\n\tfunction FreeWebsRebuildvHosts(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('FreeWebsRebuildvHosts','{$_GET["servername"]}');\n\t\tAnimateDiv('freewebdiv');\n\t\tXHR.sendAndLoad('freeweb.edit.php', 'POST',x_SaveFreeWebMain{$t});\n\t}\n\t\n\tfunction FreeWebsRebuildGroupware(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('FreeWebsRebuildGroupware','{$_GET["servername"]}');\n\t\tAnimateDiv('freewebdiv');\n\t\tXHR.sendAndLoad('freeweb.edit.php', 'POST',x_SaveFreeWebMain{$t});\n\t}\t\t\t\n\n\n\tvar x_SaveFreeWebMain{$t}=function (obj) {\n\t\t    var NewServer={$NewServer};\n\t\t\tvar results=obj.responseText;\n\t\t\tdocument.getElementById('freewebdiv-{$t}').innerHTML='';\n\t\t\tif(results.length>0){alert(results);return;}\n\t\t\tvar t={$_GET["t"]};\t\n\t\t\tif(t>0){\n\t\t\t\t\$('#freewebs-table-{$_GET["t"]}').flexReload();\n\t\t\t}else{\n\t\t\t\tif(document.getElementById('container-www-tabs')){RefreshTab('container-www-tabs');}\n\t\t\t\tif(document.getElementById('main_config_freeweb')){FreeWebsRefreshWebServersList();}\n\t\t\t}\n\t\t\tif(NewServer==1){\n\t\t\t\tYahooWin5Hide();\n\t\t\t\tExecuteByClassName('SearchFunction');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(document.getElementById('main_config_freewebMains')){RefreshTab('main_config_freewebMains');}\n\t\t\tExecuteByClassName('SearchFunction');\n\t\t}\t\n\t\t\n\t\tfunction SaveFreeWebMain(){\n\t\t\tvar NewServer={$NewServer};\n\t\t\t\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('SAVE_FREEWEB_MAIN','yes');\n\t\t\t\n\t\t\tif(NewServer==1){\n\t\t\t\tvar sitename=document.getElementById('servername').value;\n\t\t\t\tvar www_a=document.getElementById('domainname').value;\n\t\t\t\tvar www_b=document.getElementById('servername').value;\n\t\t\t\tvar www_t=www_a.length+www_b.length;\n\t\t\t\tif(www_t<2){\n\t\t\t\t\talert('{$error_please_fill_field}:{$acl_dstdomain}'); \n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif(sitename!=='_default_'){\n\t\t\t\t\tvar x=document.getElementById('domainname').value;\n\t\t\t\t\tif(x.length==0){alert('{$error_please_fill_field}:{$acl_dstdomain}');return;}\n\t\t\t\t}else{\n\t\t\t\t\tdocument.getElementById('domainname').value='';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(document.getElementById('ADD_DNS_ENTRY')){\n\t\t\t\tXHR.appendData('ADD_DNS_ENTRY',document.getElementById('ADD_DNS_ENTRY').value);\n\t\t\t}\n\t\t\t\n\t\t\tif(document.getElementById('useSSL').checked){XHR.appendData('useSSL',1);}else{XHR.appendData('useSSL',0);}\n\t\t\t\n\t\t\tif(document.getElementById('WebCopyID')){\n\t\t\t\tXHR.appendData('WebCopyID',document.getElementById('WebCopyID').value);\n\t\t\t}\n\t\t\tif(document.getElementById('www_dir')){\n\t\t\t\tXHR.appendData('www_dir',document.getElementById('www_dir').value);\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tXHR.appendData('UseDefaultPort',0)\n\t\t\tif(document.getElementById('UseReverseProxy').checked){XHR.appendData('UseReverseProxy',1);}else{XHR.appendData('UseReverseProxy',0);}\n\t\t\tif(document.getElementById('Forwarder').checked){XHR.appendData('Forwarder',1);}else{XHR.appendData('Forwarder',0);}\n\t\t\tXHR.appendData('ForceInstanceZarafaID','{$_GET["ForceInstanceZarafaID"]}');\n\t\t\t\n\t\t\t\n\t\t\tif(document.getElementById('LoopMounts')){\n\t\t\t\tvar LoopMounts=document.getElementById('LoopMounts').value;\n\t\t\t\tif(LoopMounts.length>3){\n\t\t\t\t\tif(document.getElementById('UseLoopDisk').checked){XHR.appendData('UseLoopDisk',1);}else{XHR.appendData('UseLoopDisk',0);}\n\t\t\t\t\tXHR.appendData('LoopMounts',LoopMounts);\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tvar uid=trim(document.getElementById('www_uid').value);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(document.getElementById('vg_size')){XHR.appendData('vg_size',document.getElementById('vg_size').value);}\n\t\t\tXHR.appendData('lvm_vg','{$ligne["lvm_vg"]}');\n\t\t\tif(NewServer==1){\n\t\t\t\tif(sitename!=='_default_'){\n\t\t\t\t\tvar www_b=document.getElementById('domainname').value;\n\t\t\t\t\tvar www_a=document.getElementById('servername').value;\n\t\t\t\t\tif(www_a.length>0){XHR.appendData('servername',www_a+'.'+www_b);}else{XHR.appendData('servername',www_b);}\n    \t\t\t\t}else{\n    \t\t\t\tXHR.appendData('servername','_default_');\n    \t\t\t}\n    \t\t}\n    \t\tif(NewServer==0){XHR.appendData('servername',document.getElementById('servername').value);}\n    \t\tXHR.appendData('domainname',document.getElementById('domainname').value);\n    \t\tXHR.appendData('uid',uid);\n    \t\tXHR.appendData('gpid',document.getElementById('www_group').value);\n    \t\tXHR.appendData('ForwardTo',document.getElementById('ForwardTo').value);\n    \t\tXHR.appendData('force-groupware',document.getElementById('force-groupware').value);\n    \t\tXHR.appendData('ServerIP',document.getElementById('ServerIP').value);\n    \t\tXHR.appendData('sslcertificate',document.getElementById('sslcertificate').value);\n    \t\t\n    \t\t\n    \t\t\n    \t\tAnimateDiv('freewebdiv-{$t}');\n    \t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveFreeWebMain{$t});\n\t\t\t\n\t\t}\t\n\t\t\n\tfunction CheckLoops(){\n\t\tvar countloops={$countloops};\n\t\tdocument.getElementById('UseLoopDisk').disabled=true;\n\t\tif(countloops>0){\n\t\t\tdocument.getElementById('UseLoopDisk').disabled=false;\n\t\t}\n\t\tdocument.getElementById('loops-list').innerHTML='';\n\t\t\n\t\tif(document.getElementById('UseLoopDisk').checked){\n\t\t\tif(document.getElementById('vg_size')){\n\t\t\t\tdocument.getElementById('vg_size').disabled=true;\n\t\t\t}\n\t\t\tLoadAjax('loops-list','{$page}?loops-list=yes&servername={$ligne["servername"]}');\n\t\t}\n\t}\n\t\n\t\n\n\t\n\t\t\n\tfunction CheckLoops(){\n\t\tvar countloops={$countloops};\n\t\tdocument.getElementById('UseLoopDisk').disabled=true;\n\t\tif(countloops>0){document.getElementById('UseLoopDisk').disabled=false;}\n\t\tdocument.getElementById('loops-list').innerHTML='';\n\t\t\n\t\tif(document.getElementById('UseLoopDisk').checked){\n\t\t\tif(document.getElementById('vg_size')){\n\t\t\t\tdocument.getElementById('vg_size').disabled=true;\n\t\t\t}\n\t\t\tLoadAjax('loops-list','{$page}?loops-list=yes&servername={$ligne["servername"]}');\n\t\t}\n\t}\n\t\n\tfunction CheckUseReverseProxy(){\n\t\tCheckDatas();\n\t\tuseMysqlCheck();\n\t\tCheckLoops();\n\t\t{$js_removesql};\n\t\t{$js_OnlyWebSite};\n\t}\n\t\n\n\t\n\tfunction OnlyWebsite(){\n\t\tif(document.getElementById('Forwarder')){document.getElementById('Forwarder').disabled=true;}\n\t\tif(document.getElementById('UseReverseProxy')){document.getElementById('UseReverseProxy').disabled=true;}\n\t\tif(document.getElementById('useFTP')){document.getElementById('useFTP').disabled=true;}\n\t}\n\t\n\tfunction CheckUId(){\n\t\tLoadAjaxTiny('status-uid-www','freeweb.edit.php?uid-check={$uid_uri}');\n\t}\n\t\n\n\t\n\tfunction useSSLCheckCOnf(){\n\t\tdocument.getElementById('sslcertificate').disabled=true;\n\t\t\tif(document.getElementById('useSSL').checked){\n\t\t\t\tdocument.getElementById('sslcertificate').disabled=false;\n\t\t\t}\n\t}\n\t\n\tCheckDatas();\n\tCheckLoops();\n\tCheckForwarder();\n\tCheckUId();\n\t{$js_removesql};\n\t{$js_OnlyWebSite};\n\tuseSSLCheckCOnf();\n\t\n\t</script>\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #24
0
function SyslogServerLocalxPopup()
{
    $t = time();
    $page = CurrentPageName();
    $sock = new sockets();
    $tpl = new templates();
    for ($i = 0; $i < 8; $i++) {
        $hash["local{$i}"] = "local{$i}";
    }
    $tt = $_GET["t"];
    $array = unserialize(base64_decode($sock->GET_INFO("SyslogLocals")));
    $bt = "{apply}";
    if (!is_numeric($_GET["local"])) {
        $bt = "{add}";
    }
    $html = "\n\t<div id='{$t}' style=width:98%' class=form>\n\t<table style='width:99%' >\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>local:</td>\n\t\t<td>" . Field_array_Hash($hash, "local-{$t}", $_GET["local"], 'style:font-size:22px') . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{path}:</td>\n\t\t<td>" . Field_text("path-{$t}", $array[$_GET["local"]], "font-size:22px;width:435px") . "</td>\n\t\t<td>" . button_browse("path-{$t}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 align='right' style='padding-top:40px'><hr>" . button($bt, "SaveLocalxA{$t}()", 32) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t<script>\n\t\tvar x_SaveLocalxA{$t} = function (obj) {\n\t\t\tdocument.getElementById('{$t}').innerHTML='';\n\t\t\t\$('#flexRT{$tt}').flexReload();\n\t\t\tYahooWin2Hide();\n\t\t}\n\t\n\t\n\tfunction SaveLocalxA{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('local',document.getElementById('local-{$t}').value);\n\t\tXHR.appendData('path',document.getElementById('path-{$t}').value);\n\t\tAnimateDiv('{$t}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveLocalxA{$t});\n\t}\n\t</script>\n\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #25
0
function parameters(){
	$tpl=new templates();
	$page=CurrentPageName();
	$t=time();
	$sock=new sockets();


	
	$StreamCacheCache=$sock->GET_INFO("StreamCacheCache");
	if($StreamCacheCache==null){$StreamCacheCache="/home/squid/videocache";}
	$StreamCacheMainCache=$sock->GET_INFO("StreamCacheMainCache");
	if($StreamCacheMainCache==null){$StreamCacheMainCache="/home/squid/streamcache";}
	$StreamCacheBindHTTP=$sock->GET_INFO("StreamCacheBindHTTP");
	$StreamCacheBindProxy=$sock->GET_INFO("StreamCacheBindProxy");
	
	
	$ip=new networking();
	$ips=$ip->ALL_IPS_GET_ARRAY();
	unset($ips["127.0.0.1"]);
	unset($ips["0.0.0.0"]);
	$ips2=$ip->ALL_IPS_GET_ARRAY();
	unset($ips2["0.0.0.0"]);
	
	$ips3[null]="{none}";
	$ips3=$ip->ALL_IPS_GET_ARRAY();
	unset($ips3["0.0.0.0"]);
	unset($ips3["127.0.0.1"]);
	

$html="<div style=width:98% class=form>
	<table style='width:100%'>
	<tr>
		<td colspan=3 style='font-size:32px'>{APP_VIDEOCACHE}<hr></td>
	</tr>
	
	<tr>
		<td class=legend style='font-size:22px'>{webserver} ({listen_address}):</td>
		<td style='font-size:18px'>". Field_array_Hash($ips,"StreamCacheBindHTTP",$StreamCacheBindHTTP,"style:font-size:22px")."<td>
		<td style='font-size:18px' width=1%><td>
	</tr>				
	
	<tr>
		<td colspan=3 style='font-size:22px'>{caches}<hr></td>
	</tr>	
	<tr>
		<td class=legend style='font-size:22px'>{videos_storage}:</td>
		<td style='font-size:22px'>". Field_text("StreamCacheCache",$StreamCacheCache,"font-size:18px;width:350px")."</td>
		<td>". button_browse("StreamCacheCache")."</td>
	</tr>	
	<tr>
	<td colspan=3 align='right' style='padding-top:20px'><hr>". button("{apply}", "Save$t()",32)."</td>
	</tr>
	
	</table>
<script>
var xSave$t= function (obj) {
	var results=obj.responseText;
	if(results.length>3){alert(results);return;}
	Loadjs('squid.reconfigure.php?ask=yes');
	
}
function Save$t(){
	var XHR = new XHRConnection();
	XHR.appendData('StreamCacheCache', document.getElementById('StreamCacheCache').value);
	XHR.appendData('StreamCacheBindHTTP', document.getElementById('StreamCacheBindHTTP').value);
	XHR.sendAndLoad('$page', 'POST',xSave$t);		
}
</script>";	
	echo $tpl->_ENGINE_parse_body($html);
	
}
Example #26
0
function iscsi_disk()
{
    $sql = "SELECT * FROM iscsi_params WHERE ID='{$_GET["ID"]}'";
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql();
    $t = time();
    $button_text = "{apply}";
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    include_once 'ressources/usb.scan.inc';
    while (list($num, $line) = each($_GLOBAL["disks_list"])) {
        if ($num == "size (logical/physical)") {
            continue;
        }
        $ID_MODEL_2 = $line["ID_MODEL_2"];
        $PARTITIONS = $line["PARTITIONS"];
        //print_r($line);
        if (is_array($PARTITIONS)) {
            while (list($dev, $part) = each($PARTITIONS)) {
                $MOUNTED = $part["MOUNTED"];
                if (strlen($MOUNTED) > 20) {
                    $MOUNTED = substr($MOUNTED, 0, 17) . "...";
                }
                $SIZE = $part["SIZE"];
                $TYPE = $part["TYPE"];
                if ($TYPE == 82) {
                    continue;
                }
                if ($TYPE == 5) {
                    continue;
                }
                $devname = basename($dev);
                $devs[$dev] = "({$devname}) {$MOUNTED} {$SIZE}";
            }
        }
    }
    $iscsar = array("disk" => "{disk}", "file" => "{file}");
    $iscsarF = Field_array_Hash($iscsar, "iscsi-type", $ligne["type"], "ChangeIscsiType()", null, 0, "font-size:32px;padding:10px");
    $devsF = Field_array_Hash($devs, "iscsi-part", $ligne["dev"], "style:font-size:22px;padding:3px");
    if ($ligne["hostname"] == null) {
        $users = new usersMenus();
        $ligne["hostname"] = $users->fqdn;
    }
    if ($_GET["ID"] == 0) {
        $button_text = "{add}";
    }
    if (!is_numeric($ligne["file_size"])) {
        $ligne["file_size"] = 5;
    }
    $html = "\n<div styl='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{type}:</td>\n\t\t<td style='font-size:22px'>{$iscsarF}</td>\n\t\t<td width=1% style='font-size:22px'>" . help_icon("{iscsi_type_edit_explain}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{path}:</td>\n\t\t<td style='font-size:22px'>" . Field_text("iscsi-path", $ligne["dev"], "font-size:22px;padding:3px;width:390px") . "</td>\n\t\t<td width=1% style='font-size:22px'>" . button_browse("iscsi-path") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{size}:</td>\n\t\t<td style='font-size:22px;'>" . Field_text("iscsi-size", $ligne["file_size"], "font-size:22px;padding:3px;width:90px") . "&nbsp;G</td>\n\t\t<td width=1%>&nbsp;</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{partition}:</td>\n\t\t<td>{$devsF}</td>\n\t\t<td width=1%>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{hostname}:</td>\n\t\t<td colspan=2>" . Field_text("iscsi-hostname", $ligne["hostname"], "font-size:22px;padding:3px;width:490px") . "</td>\n\t\t\n\t</tr>\n\t<tr>\n\t\t<td class=legend align='left' style='font-size:22px'>{shared_folder}:</td>\n\t\t<td colspan=2>" . Field_text("iscsi-folder", $ligne["shared_folder"], "font-size:22px;padding:3px;width:490px") . "</td>\n</tr>\t\t\t\n<tr>\n\t<td colspan=3 align='right'><hr>\n\t" . button("{$button_text}", "SaveIscsi{$t}()", 40) . "</td>\n</tr>\t\n</table>\n</div>\n\t<script>\n\t\tfunction ChangeIscsiType(){\n\t\t\tdocument.getElementById('iscsi-path').disabled=true;\n\t\t\tdocument.getElementById('iscsi-part').disabled=true;\n\t\t\tdocument.getElementById('iscsi-size').disabled=true;\n\t\t\tvar type=document.getElementById('iscsi-type').value;\n\t\t\tif(type=='disk'){\n\t\t\t\tdocument.getElementById('iscsi-part').disabled=false;\n\t\t\t}\n\t\t\tif(type=='file'){\n\t\t\t\tdocument.getElementById('iscsi-path').disabled=false;\n\t\t\t\tdocument.getElementById('iscsi-size').disabled=false;\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\tvar x_SaveIscsi{$t}=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\t\$('#ISCSI_TABLE1').flexReload();\n\t\t\tif(results.length>0){alert(results);return;}\n\t\t\tvar ID={$_GET["ID"]};\n\t\t\tif(ID>0){\t\n\t\t\t\tRefreshTab('iscsid{$_GET["ID"]}');\n\t\t\t}else{\n\t\t\t\tYahooWin3Hide();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\t\t\n\t\t\n\t\tfunction SaveIscsi{$t}(){\n\t\t\tvar ID={$_GET["ID"]};\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('ID',{$_GET["ID"]});\n\t\t\tXHR.appendData('hostname',document.getElementById('iscsi-hostname').value);\n\t\t\tXHR.appendData('path',document.getElementById('iscsi-path').value);\n\t\t\tXHR.appendData('type',document.getElementById('iscsi-type').value);\n\t\t\tXHR.appendData('partition',document.getElementById('iscsi-part').value);\n\t\t\tXHR.appendData('file_size',document.getElementById('iscsi-size').value);\n\t\t\tXHR.appendData('shared_folder',document.getElementById('iscsi-folder').value);\n    \t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveIscsi{$t});\t\t\n\t\t\n\t\t}\n\t\t\n\t\tfunction lock{$t}(){\n\t\t\tvar ID={$_GET["ID"]};\n\t\t\tif(ID>0){ document.getElementById('iscsi-size').disabled=true;}\n\t\t}\n\t\t\n\t\t\n\tChangeIscsiType();\n\tlock{$t}();\n\t</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
function settings()
{
    $tpl = new templates();
    $sock = new sockets();
    $page = CurrentPageName();
    $users = new usersMenus();
    $influx = new influx();
    $t = time();
    $ERROR_PERF = null;
    $InfluxAdminDisabled = intval($sock->GET_INFO("InfluxAdminDisabled"));
    $InfluxAdminPort = intval($sock->GET_INFO("InfluxAdminPort"));
    if ($InfluxAdminPort == 0) {
        $InfluxAdminPort = 8083;
    }
    $InfluxAdminEnabled = 1;
    if ($InfluxAdminDisabled == 1) {
        $InfluxAdminEnabled = 0;
    }
    $InfluxAdminRetentionTime = intval($sock->GET_INFO("InfluxAdminRetentionTime"));
    $UserAgentsStatistics = intval($sock->GET_INFO("UserAgentsStatistics"));
    $ResolvIPStatistics = intval($sock->GET_INFO("ResolvIPStatistics"));
    $EnableQuotasStatistics = intval($sock->GET_INFO("EnableQuotasStatistics"));
    $QuotasStatisticsInterval = intval($sock->GET_INFO("QuotasStatisticsInterval"));
    $InfluxListenInterface = intval($sock->GET_INFO("InfluxListenInterface"));
    if ($InfluxListenInterface == null) {
        $InfluxListenInterface = "lo";
    }
    $EnableInfluxDB = intval($sock->GET_INFO("EnableInfluxDB"));
    $SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
    $MySQLStatisticsRetentionDays = intval($sock->GET_INFO("MySQLStatisticsRetentionDays"));
    if ($MySQLStatisticsRetentionDays == 0) {
        $MySQLStatisticsRetentionDays = 5;
    }
    $bt_disconnect = null;
    $STATS_APPLIANCE = 0;
    $sys = new networking();
    $influxstop = null;
    $Local_interfaces = $sys->Local_interfaces();
    if (!$users->STATS_APPLIANCE) {
        $Local_interfaces["lo"] = "loopback";
    } else {
        $STATS_APPLIANCE = 1;
    }
    $Local_interfaces["ALL"] = "{all}";
    if ($InfluxAdminRetentionTime == 0) {
        $InfluxAdminRetentionTime = 365;
    }
    $users = new usersMenus();
    $InfluxAdminRetention[7] = "7 {days}";
    $InfluxAdminRetention[15] = "15 {days}";
    $InfluxAdminRetention[30] = "1 {month}";
    $InfluxAdminRetention[90] = "3 {months}";
    $InfluxAdminRetention[180] = "6 {months}";
    $InfluxAdminRetention[365] = "1 {year}";
    $InfluxAdminRetention[730] = "2 {years}";
    $InfluxAdminRetention[1095] = "3 {years}";
    $MySQLStatisticsRetention[1] = "1 {day}";
    $MySQLStatisticsRetention[2] = "2 {days}";
    $MySQLStatisticsRetention[3] = "3 {days}";
    $MySQLStatisticsRetention[4] = "4 {days}";
    $MySQLStatisticsRetention[5] = "5 {days}";
    $MySQLStatisticsRetention[6] = "6 {days}";
    $MySQLStatisticsRetention[7] = "7 {days}";
    $MySQLStatisticsRetention[8] = "8 {days}";
    $MySQLStatisticsRetention[9] = "9 {days}";
    $MySQLStatisticsRetention[10] = "10 {days}";
    $QuotasStatisticsIntervalA[5] = "5 {minutes}";
    $QuotasStatisticsIntervalA[10] = "10 {minutes}";
    $QuotasStatisticsIntervalA[15] = "15 {minutes}";
    $QuotasStatisticsIntervalA[30] = "30 {minutes}";
    if ($QuotasStatisticsInterval == 0) {
        $QuotasStatisticsInterval = 15;
    }
    $CORP_LICENSE = 1;
    $explain_retention = "&nbsp;";
    $field_ret = Field_array_Hash($InfluxAdminRetention, "InfluxAdminRetentionTime", "{$InfluxAdminRetentionTime}", "blur()", null, 0, "font-size:22px");
    if (!$users->CORP_LICENSE) {
        $InfluxAdminRetentionTime = 7;
        $CORP_LICENSE = 0;
        $field_ret = Field_hidden("InfluxAdminRetentionTime", 5) . "5 {days}<div><i style='font-size:16px'>{retention_time_limited_license}</i></div>";
    }
    if ($EnableInfluxDB == 0) {
        $influxstop = "<div class=explain style='font-size:18px'>{influxdb_is_disabled}</div>";
    }
    $InFluxBackupDatabaseDir = $sock->GET_INFO("InFluxBackupDatabaseDir");
    if ($InFluxBackupDatabaseDir == null) {
        $InFluxBackupDatabaseDir = "/home/artica/influx/backup";
    }
    $InFluxBackupDatabaseMaxContainers = intval("InFluxBackupDatabaseMaxContainers");
    if ($InFluxBackupDatabaseMaxContainers == 0) {
        $InFluxBackupDatabaseMaxContainers = 5;
    }
    $InFluxBackupDatabaseInterval = intval("InFluxBackupDatabaseInterval");
    if ($InFluxBackupDatabaseInterval == 0) {
        $InFluxBackupDatabaseInterval = 10080;
    }
    if ($InFluxBackupDatabaseInterval < 1440) {
        $InFluxBackupDatabaseInterval = 1440;
    }
    $influxdb_snapshotsize = @file_get_contents("{$GLOBALS["BASEDIR"]}/influxdb_snapshotsize");
    $InfluxDBAllowBrowse = intval($sock->GET_INFO("InfluxDBAllowBrowse"));
    $InfluxUseRemote = intval($sock->GET_INFO("InfluxUseRemote"));
    $InfluxUseRemoteIpaddr = $sock->GET_INFO("InfluxUseRemoteIpaddr");
    $InfluxRemoteDB = $sock->GET_INFO("InfluxRemoteDB");
    $InfluxUseRemotePort = intval($sock->GET_INFO("InfluxUseRemotePort"));
    $InfluxUseRemoteArticaPort = intval($sock->GET_INFO("InfluxUseRemoteArticaPort"));
    if ($InfluxRemoteDB == null) {
        $InfluxRemoteDB = $influx->db;
    }
    if ($InfluxUseRemotePort == 0) {
        $InfluxUseRemotePort = 8086;
    }
    if ($InfluxUseRemoteArticaPort == 0) {
        $InfluxUseRemoteArticaPort = 9000;
    }
    $InfluxDBPassword = $sock->GET_INFO("InfluxDBPassword");
    $ArticaInfluxUsername = $sock->GET_INFO("ArticaInfluxUsername");
    if ($ArticaInfluxUsername == null) {
        $ArticaInfluxUsername = "******";
    }
    $InfluxSyslogRemote = intval($sock->GET_INFO("InfluxSyslogRemote"));
    $NoCompressStatisticsByHour = intval($sock->GET_INFO("NoCompressStatisticsByHour"));
    $ArticaInfluxPassword = $sock->GET_INFO("ArticaInfluxPassword");
    if ($SquidPerformance > 2) {
        $ERROR_PERF = "<p class=text-error style='font-size:16px'>{INFLUX_DISABLED_PROXY_PERFORMANCE}</p>\n\t\t<div style='margin-top:10px;text-align:right'>" . button("{performance}", "GotoSquidPerformances()", 16) . "</div>";
    }
    if ($InfluxUseRemote == 1) {
        if ($InfluxUseRemoteIpaddr != null) {
            $bt_disconnect = "\n\t\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px;text-align:right' colspan=2><p>&nbsp;</p></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px;text-align:right' colspan=2>" . button("{disconnect}", "Loadjs('influxdb.disconnect.progress.php');", 22) . "</td>\n\t\t\t</tr>";
        }
    }
    $Intervals[1440] = "1 {day}";
    $Intervals[2880] = "1 {days}";
    $Intervals[7200] = "5 {days}";
    $Intervals[10080] = "1 {week}";
    $Intervals[20160] = "2 {weeks}";
    $password = "******" . Field_password("InfluxDBPassword", $InfluxDBPassword, "font-size:22px;width:310px") . "</td>\n\t\t<td style='font-size:22px;text-decoration:underline'>{username}: &laquo;root&raquo;</td>\n\t</tr>";
    $date_start = $tpl->time_to_date(intval(@file_get_contents("{$GLOBALS["BASEDIR"]}/DATE_START")), true);
    $date_end = $tpl->time_to_date(intval(@file_get_contents("{$GLOBALS["BASEDIR"]}/DATE_END")), true);
    $html = "\n\t{$ERROR_PERF}\t\t\n\t<div style='width:98%;margin-top:20px' class=form>\n\t{$influxstop}\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{date_start}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>{$date_start}</td>\n\t\t\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{last_date}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>{$date_end}</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'>" . button("{refresh}", "Loadjs('influxdb.refresh.progress.php')") . "</td>\n\t</tr>\n\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>" . texttooltip("{no_hourly_compression}", "{no_hourly_compression_explain}") . ":</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_checkbox_design("NoCompressStatisticsByHour", 1, $NoCompressStatisticsByHour, "") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>" . texttooltip("{ResolvIPStatistics}", "{ResolvIPStatistics_explain}") . ":</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_checkbox_design("ResolvIPStatistics", 1, $ResolvIPStatistics, "") . "</td>\n\t</tr>\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>" . texttooltip("{MySQLStatisticsRetentionDays}", "{MySQLStatisticsRetentionDays_explain}") . ":</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_array_Hash($MySQLStatisticsRetention, "MySQLStatisticsRetentionDays", "{$MySQLStatisticsRetentionDays}", "blur()", null, 0, "font-size:22px") . "</td>\n\t</tr>\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{useragents_statistics}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_checkbox_design("UserAgentsStatistics", 1, $UserAgentsStatistics, "") . "</td>\n\t\t\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{quota_statistics}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_checkbox_design("EnableQuotasStatistics", 1, $EnableQuotasStatistics, "EnableQuotasStatisticsCheck()") . "</td>\n\t\t\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{interval}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_array_Hash($QuotasStatisticsIntervalA, "QuotasStatisticsInterval", "{$QuotasStatisticsInterval}", "blur()", null, 0, "font-size:22px") . "</td>\n\t</tr>\t\n\t</table>\n\t<div id='influx-local-service-id'>\n\t<table style='width:100%'>\n\t<tr style='height:80px;'>\n\t\t<td colspan=3 style='font-size:30px'>{service_parameters}:</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{query_interface}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold'>" . Field_checkbox_design("InfluxAdminEnabled", 1, $InfluxAdminEnabled, "InfluxAdminEnabledCheck()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{listen_interface}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_array_Hash($Local_interfaces, "InfluxListenInterface", "{$InfluxListenInterface}", "blur()", null, 0, "font-size:22px") . "</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$InfluxListenInterface}:8086</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{listen_port}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold'>" . Field_text("InfluxAdminPort", $InfluxAdminPort, "font-size:22px;width:120px") . "</td>\n\t\t<td style='font-size:22px;text-decoration:underline'><a href=\"http://{$_SERVER["SERVER_ADDR"]}:{$InfluxAdminPort}\" target=_new>{browse}</a></td>\n\t</tr>\t\n\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{retention_time}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>{$field_ret}{$explain_retention}</td>\n\t</tr>\n\t<tr style='height:80px;'>\n\t\t<td colspan=3 align='right' style='padding-top:30px'><hr>" . button("{apply}", "Save{$t}()", 40) . "</td>\n\t</tr>\t\n\t</table>\n\t</div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t<div id='influx-remote-service-id'>\n\t\t<table style='width:100%'>\n\t\t<tr style='height:80px;'>\n\t\t\t<td colspan=3 style='font-size:30px'>{remote_server}:</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px' nowrap>{use_remote_server}:</td>\t\t\n\t\t\t<td style='font-size:22px;font-weight:bold'>" . Field_checkbox_design("InfluxUseRemote", 1, $InfluxUseRemote, "InfluxUseRemoteCheck()") . "</td>\n\t\t</tr>\t\n\t\t</table>\n\t\t<div id='influx-remote-service-options'>\n\t\t\t<table style='width:100%'>\n{$bt_disconnect}\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px' nowrap>" . texttooltip("{send_syslog_logs}", "{send_syslog_explain}") . ":</td>\t\t\n\t\t\t<td style='font-size:22px;font-weight:bold'>" . Field_checkbox_design("InfluxSyslogRemote", 1, $InfluxSyslogRemote) . "</td>\n\t\t</tr>\t\t\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:22px' nowrap>{remote_server_address}:</td>\t\t\n\t\t\t\t<td style='font-size:22px;font-weight:bold'>" . Field_text("InfluxUseRemoteIpaddr", $InfluxUseRemoteIpaddr, "font-size:22px;width:291px") . "</td>\n\t\t\t\t\n\t\t\t</tr>\n\t\t\t\t\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:22px'>{remote_port}:</td>\t\t\n\t\t\t\t<td style='font-size:22px;font-weight:bold'>" . Field_text("InfluxUseRemotePort", $InfluxUseRemotePort, "font-size:22px;width:120px") . "</td>\n\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:22px'>{artica_username}:</td>\n\t\t\t\t\t<td style='font-size:18px'>" . Field_text("ArticaInfluxUsername", $ArticaInfluxUsername, "font-size:22px;width:240px") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:22px'>{artica_password}:</td>\n\t\t\t\t\t<td style='font-size:18px'>" . Field_password("ArticaInfluxPassword", $ArticaInfluxPassword, "font-size:22px;width:240px") . "</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:22px'>{remote_artica_port}:</td>\t\t\n\t\t\t\t<td style='font-size:22px;font-weight:bold'>" . Field_text("InfluxUseRemoteArticaPort", $InfluxUseRemoteArticaPort, "font-size:22px;width:120px") . "</td>\n\t\t\t</tr>\t\t\t\t\n\t\t\t<tr style='height:80px;'>\n\t\t\t\t<td colspan=2 align='right' style='padding-top:30px'>\n\t\t\t\t\t\t\t<hr>" . button("{apply}", "SaveRemote{$t}()", 40) . "</td>\n\t\t\t</tr>\n\t\t\t\t\t\t\n\t\t\t</table>\n\t\t</div>\n\t</div>\t\t\t\n\t\t\t\t\n\t<div id='influx-backup-service-id'>\n\t<table style='width:100%'>\n\t<tr style='height:80px;'>\n\t\t<td colspan=3 style='font-size:26px'>{backup}:</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{backup_each}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_array_Hash($Intervals, "InFluxBackupDatabaseInterval", "{$InFluxBackupDatabaseInterval}", "blur()", null, 0, "font-size:22px") . "</td>\n\t\t\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{backup_directory}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold'>" . Field_text("InFluxBackupDatabaseDir", $InFluxBackupDatabaseDir, "font-size:22px;width:291px") . "</td>\n\t\t<td>" . button_browse("InFluxBackupDatabaseDir") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap colspan=2 align='right'>\n\t\t\t\t<a href=\"/backup-influx/\" style='text-decoration:underline'>{backup_directory} " . FormatBytes($influxdb_snapshotsize / 1024) . "</a>\n\t\t</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>" . texttooltip("{allow_browse_directory}", "{allow_browse_directory_web_explain}") . ":</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_checkbox_design("InfluxDBAllowBrowse", 1, $InfluxDBAllowBrowse, "") . "</td>\n\t\t\t\t\n\t</tr>\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td colspan=3 align='right' style='font-size:18px'>\n\t\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:GotoSquidNasStorage()\" \n\t\t\t\tstyle='text-decoration:underline;font-size:18px'>{also_see_backup_to_nas}</a>\n\t\t</td>\n\t</tr>\n\t<tr style='height:80px;'>\n\t\t<td colspan=3 align='right' style='padding-top:30px'><hr>" . button("{apply}", "Save{$t}()", 40) . "</td>\n\t</tr>\t\t\t\n\t</table>\n\t</div>\n\t</div>\n<script>\nvar xSave{$t}= function (obj) {\t\n\tvar res=obj.responseText;\n\tif(res.length>3){alert(res);return;}\n\tLoadjs('influxdb.restart.progress.php');\n}\t\nvar xSaveRemote{$t}= function (obj) {\t\n\tvar res=obj.responseText;\n\tif(res.length>3){alert(res);return;}\n\tLoadjs('influxdb.remote.progress.php');\n}\n\nfunction SaveRemote{$t}(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('InfluxUseRemote').checked){XHR.appendData('InfluxUseRemote', 1);}else{XHR.appendData('InfluxUseRemote', 0);}\n\tif(document.getElementById('InfluxSyslogRemote').checked){XHR.appendData('InfluxSyslogRemote', 1);}else{XHR.appendData('InfluxSyslogRemote', 0);}\n\tXHR.appendData('InfluxUseRemoteIpaddr', document.getElementById('InfluxUseRemoteIpaddr').value);\n\tXHR.appendData('InfluxUseRemotePort', document.getElementById('InfluxUseRemotePort').value);\n\tXHR.appendData('InfluxUseRemoteArticaPort', document.getElementById('InfluxUseRemoteArticaPort').value);\n\tXHR.appendData('ArticaInfluxPassword', encodeURIComponent(document.getElementById('ArticaInfluxPassword').value));\n\tXHR.appendData('ArticaInfluxUsername', document.getElementById('ArticaInfluxUsername').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSaveRemote{$t});  \n\n}\n\t\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\t\n\tif(document.getElementById('NoCompressStatisticsByHour').checked){XHR.appendData('NoCompressStatisticsByHour', 1);\t}else{XHR.appendData('NoCompressStatisticsByHour', 0);}\n\tif(document.getElementById('ResolvIPStatistics').checked){XHR.appendData('ResolvIPStatistics', 1);\t}else{XHR.appendData('ResolvIPStatistics', 0);}\n\tif(document.getElementById('InfluxAdminEnabled').checked){XHR.appendData('InfluxAdminEnabled', 1);\t}else{XHR.appendData('InfluxAdminEnabled', 0);}\n\tif(document.getElementById('EnableQuotasStatistics').checked){XHR.appendData('EnableQuotasStatistics', 1);\t}else{XHR.appendData('EnableQuotasStatistics', 0);}\n\tif(document.getElementById('UserAgentsStatistics').checked){XHR.appendData('UserAgentsStatistics', 1);\t}else{XHR.appendData('UserAgentsStatistics', 0);}\n\tif(document.getElementById('InfluxDBAllowBrowse').checked){XHR.appendData('InfluxDBAllowBrowse', 1);\t}else{XHR.appendData('InfluxDBAllowBrowse', 0);}\n  \t//XHR.appendData('InfluxDBPassword', encodeURIComponent(document.getElementById('InfluxDBPassword').value));\n\t\n\t\n\tXHR.appendData('MySQLStatisticsRetentionDays', document.getElementById('MySQLStatisticsRetentionDays').value);\n\tXHR.appendData('InfluxAdminPort', document.getElementById('InfluxAdminPort').value);\n\tXHR.appendData('InfluxAdminRetentionTime', document.getElementById('InfluxAdminRetentionTime').value);\t\t\n\tXHR.appendData('QuotasStatisticsInterval', document.getElementById('QuotasStatisticsInterval').value);\n\tXHR.appendData('InfluxListenInterface', document.getElementById('InfluxListenInterface').value);\n\tXHR.appendData('InFluxBackupDatabaseInterval', document.getElementById('InFluxBackupDatabaseInterval').value);\n\tXHR.appendData('InFluxBackupDatabaseDir', document.getElementById('InFluxBackupDatabaseDir').value);\n\t\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});  \t\t\t\n}\n\nfunction EnableQuotasStatisticsCheck(){\n\tdocument.getElementById('QuotasStatisticsInterval').disabled=true;\n\tif(document.getElementById('EnableQuotasStatistics').checked){\n\t\tdocument.getElementById('QuotasStatisticsInterval').disabled=false;\n\t}\n}\n\nfunction InfluxUseRemoteCheck(){\n\tif(document.getElementById('InfluxUseRemote').checked){\n\t\tdocument.getElementById('influx-local-service-id').style.display='none';\n\t\tdocument.getElementById('influx-backup-service-id').style.display='none';\n\t\tdocument.getElementById('influx-remote-service-options').style.display='';\n\t\t\n\t}else{\n\t\tdocument.getElementById('influx-local-service-id').style.display='';\n\t\tdocument.getElementById('influx-backup-service-id').style.display='';\n\t\tdocument.getElementById('influx-remote-service-options').style.display='none';\n\t\n\t}\n\t\n\tvar STATS_APPLIANCE={$STATS_APPLIANCE};\n\tif(STATS_APPLIANCE==1){\n\t\tdocument.getElementById('influx-remote-service-id').style.display='none';\n\t}\n}\n\n\nfunction checkt{$t}(){\n\tvar CORP_LICENSE={$CORP_LICENSE};\n\tdocument.getElementById('InfluxAdminRetentionTime').disabled=true;\n\tif(CORP_LICENSE==1){document.getElementById('InfluxAdminRetentionTime').disabled=false;}\n}\n\nEnableQuotasStatisticsCheck();\ncheckt{$t}();\nInfluxUseRemoteCheck();\nLoadAjaxRound('influx-db-status','{$page}?service-status=yes');\t\t\t\t\n</script>\n\t\t\t\t\n\t\t\t\t\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #28
0
function parameters(){
	$sock=new sockets();
	$tpl=new templates();
	$EnableSargGenerator=$sock->GET_INFO("EnableSargGenerator");
	$SargOutputDir=$sock->GET_INFO("SargOutputDir");
	if($SargOutputDir==null){$SargOutputDir="/var/www/html/squid-reports";}
	$DisableArticaProxyStatistics=$sock->GET_INFO("DisableArticaProxyStatistics");
	$SargConfig=unserialize(base64_decode($sock->GET_INFO("SargConfig")));
	$SargConfig=SargDefault($SargConfig);
	if(!is_numeric($EnableSargGenerator)){$EnableSargGenerator=0;}
	$warn_squid_restart=$tpl->javascript_parse_text("{warn_squid_restart}");
	$page=CurrentPageName();
	$array[]="Bulgarian_windows1251";
	$array[]="Catalan";
	$array[]="Czech";
	$array[]="Dutch";
	$array[]="English";
	$array[]="French";
	$array[]="German";
	$array[]="Greek";
	$array[]="Hungarian";
	$array[]="Indonesian";
	$array[]="Italian";
	$array[]="Japanese";
	$array[]="Latvian";
	$array[]="Polish";
	$array[]="Portuguese";
	$array[]="Romanian";
	$array[]="Russian_koi8";
	$array[]="Russian_UFT-8";
	$array[]="Russian_windows1251";
	$array[]="Serbian";
	$array[]="Slovak";
	$array[]="Spanish";
	$array[]="Turkish";
while (list ($key, $line) = each ($array) ){$langs[$line]=$line;}

$overwrite_report=array("ignore"=>"{sarg_ignore}","ip"=>"{sarg_ip}","everybody"=>"{sarg_everybody}");
$sort_order=array("A"=>"{ascendent}","D"=>"{descendent}");

$sarg_date_format=array(
"e"=>"European=dd/mm/yy",
"u"=>"American=mm/dd/yy",
"w"=>"Weekly=yy.ww"
);

//topusers topsites sites_users users_sites date_time denied auth_failures site_user_time_date downloads

$LASTLOGS[30]="1 {month}";
$LASTLOGS[60]="2 {months}";
$LASTLOGS[90]="3 {months}";
$LASTLOGS[120]="4 {months}";
$LASTLOGS[150]="5 {months}";
$LASTLOGS[360]="1 {year}";

if(!is_numeric($SargConfig["lastlog"])){$SargConfig["lastlog"]=90;}
if(!is_numeric($SargConfig["topuser_num"])){$SargConfig["topuser_num"]=10;}
if($SargConfig["topuser_num"]==0){$SargConfig["topuser_num"]=10;}

if($SargConfig["lastlog"]<1){$SargConfig["lastlog"]=90;}

$html="
<div id='sarg-config-form' style='width:98%' class=form>
<table style='width:100%'>
<tr>
	<td class=legend style='font-size:18px'>{enable}:</td>
	<td>". Field_checkbox("EnableSargGenerator",1,$EnableSargGenerator,"CheckSargFormSave()")."</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td class=legend style='font-size:18px'>{DisableArticaProxyStatistics}:</td>
	<td>". Field_checkbox("DisableArticaProxyStatistics",1,$DisableArticaProxyStatistics)."</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td class=legend style='font-size:18px'>{directory}:</td>
	<td>". Field_text("SargOutputDir",$SargOutputDir,"font-size:18px;padding:3px;width:320px")."</td>
	<td>". button_browse("SargOutputDir")."</td>
</tr>			
<tr>
	<td class=legend style='font-size:18px'>{language}:</td>
	<td>". Field_array_Hash($langs,"language",$SargConfig["language"],"style:font-size:18px;padding;3px")."</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td class=legend style='font-size:18px'>{sarg_title}:</td>
	<td>". Field_text("title",$SargConfig["title"],"font-size:18px;padding:3px;width:320px")."</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td class=legend style='font-size:18px'>{enable_graphs}:</td>
	<td>". Field_checkbox("graphs",1,$SargConfig["graphs"])."</td>
	<td>&nbsp;</td>
</tr>

<tr>
	<td class=legend style='font-size:18px'>{sarg_user_ip}:</td>
	<td>". Field_checkbox("user_ip",1,$SargConfig["user_ip"])."</td>
	<td>&nbsp;</td>
</tr>

<tr>
	<td class=legend style='font-size:18px'>{sarg_resolve_ip}:</td>
	<td>". Field_checkbox("resolve_ip",1,$SargConfig["resolve_ip"])."</td>
	<td>&nbsp;</td>
</tr>

<tr>
	<td class=legend style='font-size:18px'>{sarg_records_without_userid}:</td>
	<td>". Field_array_Hash($overwrite_report,"records_without_userid",$SargConfig["records_without_userid"],"style:font-size:18px;padding;3px")."</td>
	<td>&nbsp;</td>
</tr>

<tr>
	<td class=legend style='font-size:18px'>{sarg_long_url}:</td>
	<td>". Field_checkbox("long_url",1,$SargConfig["long_url"])."</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td class=legend style='font-size:18px'>{sarg_topsites_num}:</td>
	<td>". Field_text("topsites_num",$SargConfig["topsites_num"],"font-size:18px;padding:3px;width:90px")."</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td class=legend style='font-size:18px'>{sarg_topuser_num}:</td>
	<td>". Field_text("topuser_num",$SargConfig["topuser_num"],"font-size:18px;padding:3px;width:90px")."</td>
	<td>". help_icon("{sarg_topuser_exp}")."</td>
</tr>


<tr>
	<td class=legend style='font-size:18px'>{topsites_sort_order}:</td>
	<td>". Field_array_Hash($sort_order,"topsites_sort_order",$SargConfig["topsites_sort_order"],"style:font-size:18px;padding;3px")."</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td class=legend style='font-size:18px'>{index_sort_order}:</td>
	<td>". Field_array_Hash($sort_order,"index_sort_order",$SargConfig["index_sort_order"],"style:font-size:18px;padding;3px")."</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td class=legend style='font-size:18px'>{sarg_date_format}:</td>
	<td>". Field_array_Hash($sarg_date_format,"date_format",$SargConfig["date_format"],"style:font-size:18px;padding;3px")."</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td class=legend style='font-size:18px'>{sarg_lastlog}:</td>
	<td>". Field_array_Hash($LASTLOGS,"lastlog",$SargConfig["lastlog"],"style:font-size:18px;padding;3px")."</td>
	<td>&nbsp;</td>
</tr>

<tr>
	<td colspan=3 align='right'>". button("{apply}","SargSaveConf()",26)."</td>
</tr>
</table>
</div>
<script>

		var x_SargSaveConf= function (obj) {
			var tempvalue=obj.responseText;
			if(tempvalue.length>3){alert(tempvalue)};
			RefreshTab('sarg_tabs');
		}
		
	function CheckSargForm(){
		
		document.getElementById('language').disabled=true;
		document.getElementById('title').disabled=true;
		document.getElementById('topsites_num').disabled=true;
		document.getElementById('topuser_num').disabled=true;
		document.getElementById('topsites_sort_order').disabled=true;
		document.getElementById('index_sort_order').disabled=true;
		document.getElementById('date_format').disabled=true;
		document.getElementById('lastlog').disabled=true;
		document.getElementById('graphs').disabled=true;
		document.getElementById('user_ip').disabled=true;
		document.getElementById('long_url').disabled=true;
		document.getElementById('resolve_ip').disabled=true;
		document.getElementById('records_without_userid').disabled=true;
		document.getElementById('DisableArticaProxyStatistics').disabled=true;
		document.getElementById('SargOutputDir').disabled=true;
		
		
		
		if(!document.getElementById('EnableSargGenerator').checked){return;}
		document.getElementById('language').disabled=false;
		document.getElementById('title').disabled=false;
		document.getElementById('topsites_num').disabled=false;
		document.getElementById('topuser_num').disabled=false;
		document.getElementById('topsites_sort_order').disabled=false;
		document.getElementById('index_sort_order').disabled=false;
		document.getElementById('date_format').disabled=false;
		document.getElementById('lastlog').disabled=false;
		document.getElementById('graphs').disabled=false;
		document.getElementById('user_ip').disabled=false;
		document.getElementById('long_url').disabled=false;
		document.getElementById('resolve_ip').disabled=false;	
		document.getElementById('records_without_userid').disabled=false;
		document.getElementById('DisableArticaProxyStatistics').disabled=false;	
		document.getElementById('SargOutputDir').disabled=false;
	
	}
	
	
	var x_none= function (obj) {
		var tempvalue=obj.responseText;
		if(tempvalue.length>3){alert(tempvalue)};
		CheckSargForm();
		}	
	
	function CheckSargFormSave(){
		var XHR = new XHRConnection();
		var EnableSargGenerator=0;
		if(document.getElementById('EnableSargGenerator').checked){EnableSargGenerator=1;}
		XHR.appendData('EnableSargGenerator',EnableSargGenerator);	
		XHR.sendAndLoad('$page', 'POST',x_none);
	}
		
		
	function SargSaveConf(){
			var EnableSargGenerator=$EnableSargGenerator; 
			var EnableSargGeneratorCK=0;
			if(document.getElementById('EnableSargGenerator').checked){EnableSargGeneratorCK=1;}
			var XHR = new XHRConnection();
			XHR.appendData('uuid','{$_REQUEST["uuid"]}');
			XHR.appendData('group_id','{$_REQUEST["group_id"]}');		
			XHR.appendData('language',document.getElementById('language').value);
			XHR.appendData('title',document.getElementById('title').value);
			XHR.appendData('topsites_num',document.getElementById('topsites_num').value);
			XHR.appendData('topuser_num',document.getElementById('topuser_num').value);
			XHR.appendData('topsites_sort_order',document.getElementById('topsites_sort_order').value);
			XHR.appendData('index_sort_order',document.getElementById('index_sort_order').value);
			XHR.appendData('date_format',document.getElementById('date_format').value);
			XHR.appendData('lastlog',document.getElementById('lastlog').value);
			XHR.appendData('records_without_userid',document.getElementById('records_without_userid').value);
			XHR.appendData('SargOutputDir',document.getElementById('SargOutputDir').value);
			
			if(EnableSargGeneratorCK!=EnableSargGenerator){
				if(confirm('$warn_squid_restart')){
					XHR.appendData('RESTART_SQUID','yes');
				}
			}
			
			
			if(document.getElementById('graphs').checked){XHR.appendData('graphs',1);}else{XHR.appendData('graphs',0);}
			if(document.getElementById('user_ip').checked){XHR.appendData('user_ip',1);}else{XHR.appendData('user_ip',0);}
			if(document.getElementById('long_url').checked){XHR.appendData('long_url',1);}else{XHR.appendData('long_url',0);}
			if(document.getElementById('resolve_ip').checked){XHR.appendData('resolve_ip',1);}else{XHR.appendData('resolve_ip',0);}
			if(document.getElementById('EnableSargGenerator').checked){XHR.appendData('EnableSargGenerator',1);}else{XHR.appendData('EnableSargGenerator',0);}
			if(document.getElementById('DisableArticaProxyStatistics').checked){XHR.appendData('DisableArticaProxyStatistics',1);}else{XHR.appendData('DisableArticaProxyStatistics',0);}
			AnimateDiv('sarg-config-form');
			XHR.sendAndLoad('$page', 'GET',x_SargSaveConf);
			}
			
	CheckSargForm();
</script>


";

$tpl=new templates();
echo $tpl->_ENGINE_parse_body($html);
	
	
}
Example #29
0
function user_defined(){
	
$tpl=new templates();
	$page=CurrentPageName();	
	$dar=new dar_back();
	$list=user_defined_list();
	
$html="<p class=caption>{user_defined_text}</p>
<table style='width:100%' class=table_form>
<tr>
	<td class=legend>{folder}:</td>
	<td>" . Field_text('dar_perso_folder',null,'width:255px')."&nbsp;". button_browse("dar_perso_folder")."</td>
	<td width=1%><input type='button' OnClick=\"javascript:AddDarPersoFolder();\" value='{add}&nbsp;&raquo;'></td>
</tr>
</table>

<table style='width:100%' class=table_form>
<tr>
	<td valign='top'>$list</td>
	<td valign='top' width=1%>" .Paragraphe('64-new-folder.png',"{add_new_directory}","{add_backup_folder}",
	"javascript:Loadjs('SambaBrowse.php?no-shares=yes&field=dar_perso_folder');")."</td>
</tr>
</table>

";	
	

return  $tpl->_ENGINE_parse_body($html);
	
}
Example #30
0
function page(){
	
	$sock=new sockets();
	$tpl=new templates();
	$users=new usersMenus();
	$memdispo=$users->MEM_TOTAL_INSTALLEE*1024;
	$page=CurrentPageName();
	
	$convert_current_attachments_text=$tpl->javascript_parse_text("{convert_current_attachments}");
	$ZarafaCacheCellSize=$sock->GET_INFO("ZarafaCacheCellSize");
	$ZarafaCacheObjectSize=$sock->GET_INFO("ZarafaCacheObjectSize");
	$ZarafaCacheIndexedObjectSize=$sock->GET_INFO("ZarafaCacheIndexedObjectSize");
	$ZarafaCacheQuotaSize=$sock->GET_INFO("ZarafaCacheQuotaSize");
	$ZarafaCacheQuotaLifeTime=$sock->GET_INFO("ZarafaCacheQuotaLifeTime");
	$ZarafaCacheAclSize=$sock->GET_INFO("ZarafaCacheAclSize");
	$ZarafaCacheUserSize=$sock->GET_INFO("ZarafaCacheUserSize");
	$ZarafaCacheUserDetailsSize=$sock->GET_INFO("ZarafaCacheUserDetailsSize");
	$ZarafaCacheUserDetailsLifeTime=$sock->GET_INFO("ZarafaCacheUserDetailsLifeTime");
	$ZarafaThreadStackSize=$sock->GET_INFO("ZarafaThreadStackSize");
	$ZarafaCacheServerSize=$sock->GET_INFO("ZarafaCacheServerSize");
	
	
	if(!is_numeric($ZarafaCacheCellSize)){$ZarafaCacheCellSize=round($memdispo/2);}
	if(!is_numeric($ZarafaCacheQuotaLifeTime)){$ZarafaCacheQuotaLifeTime=1;}
	if(!is_numeric($ZarafaCacheUserDetailsLifeTime)){$ZarafaCacheUserDetailsLifeTime=5;}
	if(!is_numeric($ZarafaThreadStackSize)){$ZarafaThreadStackSize=512;}
	
	if(!is_numeric($ZarafaCacheUserDetailsSize)){$ZarafaCacheUserDetailsSize=1048576;}
	$ZarafaCacheUserDetailsSize=$ZarafaCacheUserDetailsSize/1024;
	$ZarafaCacheUserDetailsSize=$ZarafaCacheUserDetailsSize/1024;
	$ZarafaCacheUserDetailsSize=round($ZarafaCacheUserDetailsSize);		
	
	if(!is_numeric($ZarafaCacheAclSize)){$ZarafaCacheAclSize=1048576;}
	$ZarafaCacheAclSize=$ZarafaCacheAclSize/1024;
	$ZarafaCacheAclSize=$ZarafaCacheAclSize/1024;
	$ZarafaCacheAclSize=round($ZarafaCacheAclSize);	
	
	
	if(!is_numeric($ZarafaCacheServerSize)){$ZarafaCacheServerSize=1048576;}
	$ZarafaCacheServerSize=$ZarafaCacheServerSize/1024;
	$ZarafaCacheServerSize=$ZarafaCacheServerSize/1024;
	$ZarafaCacheServerSize=round($ZarafaCacheServerSize);		
	
	
	if(!is_numeric($ZarafaCacheUserSize)){$ZarafaCacheUserSize=1048576;}
	$ZarafaCacheUserSize=$ZarafaCacheUserSize/1024;
	$ZarafaCacheUserSize=$ZarafaCacheUserSize/1024;
	$ZarafaCacheUserSize=round($ZarafaCacheUserSize);		
	
	
	if(!is_numeric($ZarafaCacheQuotaSize)){$ZarafaCacheQuotaSize=16777216;}
	$ZarafaCacheQuotaSize=$ZarafaCacheQuotaSize/1024;
	$ZarafaCacheQuotaSize=$ZarafaCacheQuotaSize/1024;
	$ZarafaCacheQuotaSize=round($ZarafaCacheQuotaSize);
	
	$ZarafaCacheCellSize=$ZarafaCacheCellSize/1024;
	$ZarafaCacheCellSize=$ZarafaCacheCellSize/1024;
	$ZarafaCacheCellSize=round($ZarafaCacheCellSize);
	
	
	if(!is_numeric($ZarafaCacheObjectSize)){$ZarafaCacheObjectSize=16777216;}
	$ZarafaCacheObjectSize=$ZarafaCacheObjectSize/1024;
	$ZarafaCacheObjectSize=$ZarafaCacheObjectSize/1024;
	$ZarafaCacheObjectSize=round($ZarafaCacheObjectSize);	
	
	if(!is_numeric($ZarafaCacheIndexedObjectSize)){$ZarafaCacheIndexedObjectSize=16777216;}
	$ZarafaCacheIndexedObjectSize=$ZarafaCacheIndexedObjectSize/1024;
	$ZarafaCacheIndexedObjectSize=$ZarafaCacheIndexedObjectSize/1024;
	$ZarafaCacheIndexedObjectSize=round($ZarafaCacheIndexedObjectSize);	
	$t=time();
	
	
	$ZARAFA_LANG=$sock->GET_INFO("ZARAFA_LANG");
	if($ZARAFA_LANG==null){$ZARAFA_LANG="en_US";}
	$languages=unserialize(base64_decode($sock->getFrameWork("zarafa.php?locales=yes")));
	while (list ($index, $data) = each ($languages) ){
		if(preg_match("#cannot set#i", $data)){continue;}
		$langbox[$data]=$data;
	}
	
$ZarafaUserSafeMode=$sock->GET_INFO("ZarafaUserSafeMode");
$ZarafaServerListenIP=$sock->GET_INFO("ZarafaServerListenIP");
$ZarafaServerListenPort=$sock->GET_INFO("ZarafaServerListenPort");


$ZarafaServerSMTPIP=$sock->GET_INFO("ZarafaServerSMTPIP");
$ZarafaServerSMTPPORT=$sock->GET_INFO("ZarafaServerSMTPPORT");
if($ZarafaServerSMTPIP==null){$ZarafaServerSMTPIP="127.0.0.1";}
if($ZarafaServerListenIP==null){$ZarafaServerListenIP="127.0.0.1";}
$ZarafaMAPISSLEnabled=$sock->GET_INFO("ZarafaMAPISSLEnabled");
$ZarafaMAPISSLPort=$sock->GET_INFO("ZarafaMAPISSLPort");
$ZarafaStoreOutside=$sock->GET_INFO("ZarafaStoreOutside");
$ZarafaStoreCompressionLevel=$sock->GET_INFO("ZarafaStoreCompressionLevel");
$ZarafaStoreOutsidePath=$sock->GET_INFO("ZarafaStoreOutsidePath");

if(!is_numeric($ZarafaServerSMTPPORT)){$ZarafaServerSMTPPORT=25;}
if(!is_numeric($ZarafaServerListenPort)){$ZarafaServerListenPort=236;}
if(!is_numeric($ZarafaMAPISSLPort)){$ZarafaMAPISSLPort=237;}


if(!is_numeric($ZarafaStoreOutside)){$ZarafaStoreOutside=0;}
if(!is_numeric($ZarafaStoreCompressionLevel)){$ZarafaStoreCompressionLevel=6;}
if($ZarafaStoreOutsidePath==null){$ZarafaStoreOutsidePath="/var/lib/zarafa";}

for($i=0;$i<10;$i++){
	$ZarafaStoreCompressionLevelAr[$i]=$i;
}
	
	$net=new networking();
	
	$nets=$net->ALL_IPS_GET_ARRAY();
	$nets["0.0.0.0"]="{all}";
	
	$netsSMTP=$nets;
	
	unset($netsSMTP["0.0.0.0"]);
	$SMTPfield=Field_array_Hash($netsSMTP,"ZarafaServerSMTPIP",$ZarafaServerSMTPIP,"font-size:18px;padding:3px");
	
	$ZarafaServerListenIP=Field_array_Hash($nets,"ZarafaServerListenIP",$ZarafaServerListenIP,"style:font-size:18px;padding:3px");
	
		
	$langbox[null]="C";
	
	$mailbox_language=Field_array_Hash($langbox,"ZARAFA_LANG",$ZARAFA_LANG,"style:font-size:18px;padding:3px");
	$build_locales_explain=$tpl->javascript_parse_text("{build_locales_explain}");
	$zarafa_must_restarted=$tpl->javascript_parse_text("{zarafa_must_restarted}");
	
	$html="
	<div id='$t'>
	<div class=text-info style='font-size:16px'>{zarafa_tune_explain}</div>
	
<div style='width:98%' class=form>	
	<div id='locales-gen-running-$t'></div>
	<table style='width:99%'>	
	<tr>
		<td class=legend style='font-size:18px'>{zarafaMbxLang}:</td>
		<td style='font-size:13px'>$mailbox_language</td>
	</tr>
	
	<tr>
		<td colspan=2 align='right'><hr>". button("{build_languages}","BuildLocales()",26)."&nbsp;|&nbsp;". button("{apply}","SaveZarafLang()",26)."</td>
	</tr>	
</table>
</div>	
<div style='width:98%' class=form>	
	<table style='width:99%'>				
	<tr>
		<td colspan=3 style='font-size:28px'>{listen_addresses}</td>
	</tr>	
	<tr>
		<td class=legend style='font-size:18px'>{outgoing_smtp_server}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaServerSMTPIP",$ZarafaServerSMTPIP,"font-size:18px;width:200px")."</td>
		<td></td>
	</tr>
	<tr>
		<td class=legend style='font-size:18px'>{outgoing_smtp_server_port}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaServerSMTPPORT",$ZarafaServerSMTPPORT,"font-size:18px;width:100px")."</td>
		<td></td>
	</tr>	
	<tr>
		<td class=legend style='font-size:18px'>{mapi_address}:</td>
		<td style='font-size:18px'>$ZarafaServerListenIP</td>
		<td></td>
	</tr>				
	<tr>
		<td class=legend style='font-size:18px'>{mapi_port}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaServerListenPort",$ZarafaServerListenPort,"font-size:18px;width:100px")."</td>
		<td></td>
	</tr>	
	<tr>
		<td class=legend style='font-size:18px'>MAPI SSL:</td>
		<td style='font-size:18px'>". Field_checkbox("ZarafaMAPISSLEnabled",1,$ZarafaMAPISSLEnabled,"ZarafaMAPISSLEnabledCheck()")."</td>
		<td></td>
	</tr>	
	<tr>
		<td class=legend style='font-size:18px'>MAPI {ssl_port}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaMAPISSLPort",$ZarafaMAPISSLPort,"font-size:18px;width:100px")."</td>
		<td></td>
	</tr>					
				
	<tr>
		<td colspan=3 align='right'><hr>". button("{apply}","SaveZarafaNet()",26)."</td>
	</tr>				
</table>
</div>	
<br>
<div style='width:98%' class=form>	
	<table style='width:99%'>				
	<tr>
		<td colspan=3 style='font-size:28px'>{attachments}</td>
	</tr>	
			<tr>
				<td class=legend style='font-size:18px'>{ZarafaStoreOutside}:</td>
				<td>". Field_checkbox("ZarafaStoreOutside",1,$ZarafaStoreOutside,"CheckZarafaATTCH()")."</td>
				<td></td>
			</tr>	
			<tr>
				<td class=legend style='font-size:18px'>{attachments_path}:</td>
				<td>". Field_text("ZarafaStoreOutsidePath",$ZarafaStoreOutsidePath,"width:320px;font-size:18px;padding:3px")."</td>
				<td>". button_browse("ZarafaStoreOutsidePath")."</td>
			</tr>
			<tr>
				<td class=legend style='font-size:18px'>{attachments_compression_level}:</td>
				<td>". Field_array_Hash($ZarafaStoreCompressionLevelAr,"ZarafaStoreCompressionLevel",$ZarafaStoreCompressionLevel,"style:font-size:18px;padding:3px")."</td>
				<td></td>
			</tr>	
			<tr>
				<td colspan=3 align='right'><a href=\"javascript:blur();\" OnClick=\"DbAttachConverter()\" 
				style='font-size:18px;text-decoration:underline'>{convert_current_attachments}</a></td>
			</tr>
			<tr><td colspan=3 align='right'><hr>". button("{apply}","SaveZarafaAttch()",26)."</td></tr>																	
		</table>					
</div>				
<br>
<div style='width:98%' class=form>	
	<table style='width:99%'>
	<tr>
		<td colspan=3 style='font-size:28px'>{performance}</td>
	</tr>	
	
	<tr>
		<td class=legend style='font-size:18px'>{ZarafaThreadStackSize}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaThreadStackSize",$ZarafaThreadStackSize,"font-size:18px;width:100px")."&nbsp;KB</td>
		<td>". help_icon("{ZarafaThreadStackSize_explain}")."</td>
	</tr>	
	
	
	<tr>
		<td class=legend style='font-size:18px'>{ZarafaCacheServerSize}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaCacheServerSize",$ZarafaCacheServerSize,"font-size:18px;width:100px")."&nbsp;MB</td>
		<tD>". help_icon("{ZarafaCacheServerSize_explain}")."</td>
	</tr>	
	<tr>
		<td class=legend style='font-size:18px'>{cache_cell_size}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaCacheCellSize",$ZarafaCacheCellSize,"font-size:18px;width:100px")."&nbsp;MB</td>
		<tD>". help_icon("{zcache_cell_size_explain}")."</td>
	</tr>
	<tr>
		<td class=legend style='font-size:18px'>{cache_object_size}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaCacheObjectSize",$ZarafaCacheObjectSize,"font-size:18px;width:100px")."&nbsp;MB</td>
		<tD>". help_icon("{cache_object_size_explain}")."</td>
	</tr>	
	<tr>
		<td class=legend style='font-size:18px'>{cache_indexedobject_size}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaCacheIndexedObjectSize",$ZarafaCacheIndexedObjectSize,"font-size:18px;width:100px")."&nbsp;MB</td>
		<tD>". help_icon("{cache_indexedobject_size_explain}")."</td>
	</tr>
	
	
	<tr>
		<td class=legend style='font-size:18px'>{ZarafaCacheUserSize}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaCacheUserSize",$ZarafaCacheUserSize,"font-size:18px;width:100px")."&nbsp;MB</td>
		<tD>". help_icon("{ZarafaCacheUserSize_explain}")."</td>
	</tr>	
	<tr>
		<td class=legend style='font-size:18px'>{ZarafaCacheUserDetailsSize}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaCacheUserDetailsSize",$ZarafaCacheUserDetailsSize,"font-size:18px;width:100px")."&nbsp;MB</td>
		<tD>". help_icon("{ZarafaCacheUserDetailsSize_explain}")."</td>
	</tr>
	
	
	<tr>
		<td class=legend style='font-size:18px'>{ZarafaCacheAclSize}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaCacheAclSize",$ZarafaCacheAclSize,"font-size:18px;width:100px")."&nbsp;MB</td>
		<tD>". help_icon("{ZarafaCacheAclSize_explain}")."</td>
	</tr>	
	<tr>
		<td class=legend style='font-size:18px'>{ZarafaCacheQuotaSize}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaCacheQuotaSize",$ZarafaCacheQuotaSize,"font-size:18px;width:100px")."&nbsp;MB</td>
		<td>". help_icon("{ZarafaCacheQuotaSize_explain}")."</td>
	</tr>	
	<tr>
		<td class=legend style='font-size:18px'>{ZarafaCacheQuotaLifeTime}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaCacheQuotaLifeTime",$ZarafaCacheQuotaLifeTime,"font-size:18px;width:90px")."&nbsp;{minutes}</td>
		<td>". help_icon("{ZarafaCacheQuotaLifeTime_explain}")."</td>
	</tr>	
	<tr>
		<td class=legend style='font-size:18px'>{ZarafaCacheUserDetailsLifeTime}:</td>
		<td style='font-size:18px'>". Field_text("ZarafaCacheUserDetailsLifeTime",$ZarafaCacheUserDetailsLifeTime,"font-size:18px;width:90px")."&nbsp;{minutes}</td>
		<td>". help_icon("{ZarafaCacheUserDetailsLifeTime_explain}")."</td>
	</tr>
	
	<tr>
		<td colspan=3 align='right'><hr>". button("{apply}","SaveZarafTuning()",26)."</td>
	</tr>
	
	</tbody>
	</table>
</div>
	</div>
	<script>
var X_SaveZarafTuning= function (obj) {
	var results=obj.responseText;
	if(results.length>0){alert(results);}
	RefreshTab('main_config_zarafa2');
	}
var XSaveZarafaAttch= function (obj) {
	var results=obj.responseText;
	if(results.length>0){alert(results);return;}
	RefreshTab('main_config_zarafa2');
	if(!confirm('$zarafa_must_restarted')){return;}
	Loadjs('system.services.cmd.php?APPNAME=APP_ZARAFA&action=restart&cmd=%2Fetc%2Finit.d%2Fzarafa-server&appcode=APP_ZARAFA');
	}		
	
function SaveZarafLang(){
	var XHR = new XHRConnection();
	XHR.appendData('ZARAFA_LANG',document.getElementById('ZARAFA_LANG').value);
	XHR.sendAndLoad('$page', 'POST',X_SaveZarafTuning);	
}
function CheckZarafaATTCH(){
	document.getElementById('ZarafaStoreOutsidePath').disabled=true;
	document.getElementById('ZarafaStoreCompressionLevel').disabled=true;
	if(document.getElementById('ZarafaStoreOutside').checked){
		document.getElementById('ZarafaStoreOutsidePath').disabled=false;
		document.getElementById('ZarafaStoreCompressionLevel').disabled=false;			
	}
}

function BuildLocales(){
	var XHR = new XHRConnection();
	if(!confirm('$build_locales_explain')){return;}
	XHR.appendData('build-locales','yes');
	XHR.sendAndLoad('$page', 'POST',X_SaveZarafTuning);	
}

function SaveZarafaAttch(){
	var XHR = new XHRConnection();
	if(document.getElementById('ZarafaStoreOutside').checked){XHR.appendData('ZarafaStoreOutside',1);}else{XHR.appendData('ZarafaStoreOutside',0);}
	XHR.appendData('ZarafaStoreOutsidePath',document.getElementById('ZarafaStoreOutsidePath').value);
	XHR.appendData('ZarafaStoreCompressionLevel',document.getElementById('ZarafaStoreCompressionLevel').value);
	XHR.sendAndLoad('$page', 'POST',XSaveZarafaAttch);	
}
function DbAttachConverter(){
	YahooWin('550','zarafa.web.php?DbAttachConverter-popup=yes','$convert_current_attachments_text');
}

function SaveZarafaNet(){

	var XHR = new XHRConnection();
	XHR.appendData('ZarafaServerSMTPIP',document.getElementById('ZarafaServerSMTPIP').value);
	XHR.appendData('ZarafaServerSMTPPORT',document.getElementById('ZarafaServerSMTPPORT').value);
	XHR.appendData('ZarafaServerListenIP',document.getElementById('ZarafaServerListenIP').value);
	XHR.appendData('ZarafaServerListenPort',document.getElementById('ZarafaServerListenPort').value);
	XHR.appendData('ZarafaMAPISSLPort',document.getElementById('ZarafaMAPISSLPort').value);
	if( document.getElementById('ZarafaMAPISSLEnabled').checked){
		XHR.appendData('ZarafaMAPISSLEnabled',1);
	}else{
		XHR.appendData('ZarafaMAPISSLEnabled',0);
	}
	 
	
	XHR.sendAndLoad('$page', 'POST',X_SaveZarafTuning);	
	
}

		function IsLocalgenRunninZarafa(){
			if(!document.getElementById('locales-gen-running-$t')){return;}
			LoadAjaxVerySilent('locales-gen-running','$page?locales-gen-running=yes');
		
		}

function ZarafaMAPISSLEnabledCheck(){
	document.getElementById('ZarafaMAPISSLPort').disabled=true;
	if( document.getElementById('ZarafaMAPISSLEnabled').checked){
		document.getElementById('ZarafaMAPISSLPort').disabled=false;
	}
}

	
function SaveZarafTuning(){
	var XHR = new XHRConnection();
	XHR.appendData('ZarafaCacheCellSize',document.getElementById('ZarafaCacheCellSize').value);
	XHR.appendData('ZarafaCacheObjectSize',document.getElementById('ZarafaCacheObjectSize').value);
	XHR.appendData('ZarafaCacheIndexedObjectSize',document.getElementById('ZarafaCacheIndexedObjectSize').value);
	
	XHR.appendData('ZarafaCacheUserSize',document.getElementById('ZarafaCacheUserSize').value);
	XHR.appendData('ZarafaCacheUserDetailsSize',document.getElementById('ZarafaCacheUserDetailsSize').value);
	XHR.appendData('ZarafaCacheAclSize',document.getElementById('ZarafaCacheAclSize').value);
	XHR.appendData('ZarafaCacheQuotaSize',document.getElementById('ZarafaCacheQuotaSize').value);
	XHR.appendData('ZarafaCacheQuotaLifeTime',document.getElementById('ZarafaCacheQuotaLifeTime').value);
	
	
	XHR.appendData('ZarafaCacheUserDetailsLifeTime',document.getElementById('ZarafaCacheUserDetailsLifeTime').value);
	XHR.appendData('ZarafaThreadStackSize',document.getElementById('ZarafaThreadStackSize').value);
	XHR.appendData('ZarafaCacheServerSize',document.getElementById('ZarafaCacheServerSize').value);
	XHR.sendAndLoad('$page', 'POST',X_SaveZarafTuning);	
}
ZarafaMAPISSLEnabledCheck();
CheckZarafaATTCH();
IsLocalgenRunninZarafa();
</script>
	";
	echo $tpl->_ENGINE_parse_body($html);
	
}