function page() { $explorer = iconTable('explorer-64.png', '{explorer}', '{explorer_browse_yours_files}', "Loadjs('tree.php')", null, 210, null, 0, true); $users = new usersMenus(); if ($users->SAMBA_INSTALLED) { $shareAfolder = iconTable('folder-granted-64.png', '{SHARE_FOLDER}', '{SHARE_A_FOLDER_USER_TEXT}', "Loadjs('share-a-folder.php')", null, 210, null, 0, true); } if ($users->MLDONKEY_INSTALLED) { $ml = new EmuleTelnet(); if ($ml->UserIsActivated($_SESSION["uid"])) { $mldonkey = iconTable('64-emule.png', '{PEER_TO_PEER_NETWORKS}', '{PEER_TO_PEER_NETWORKS_TEXT}', "Loadjs('donkey.php')", null, 210, null, 0, true); } } else { writelogs("MLDONKEY_INSTALLED return false", __FUNCTION__, __FILE__, __LINE__); } $ct = new user($_SESSION["uid"]); writelogs("WebDavUser={$ct->WebDavUser}", __FUNCTION__, __FILE__, __LINE__); if ($ct->WebDavUser == 1) { $apache = new vhosts(); print_r($hash); $hash = $apache->LoadVhostsType($ct->ou); if ($hash["WEBDAV"]) { $webdav = iconTable('webdav-64.png', '{WEBDAV_HOWTO}', '{WEBDAV_HOWTO_TEXT}', "Loadjs('webdav.php')", null, 210, null, 0, true); } } $html = "<H1>{storage}:{$_SESSION["ou"]}</H1>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>{$explorer}{$shareAfolder}" . storage_icon() . "</td>\n\t\t<td valign='top'>" . Xapian() . "{$mldonkey}{$webdav}</td>\n\t</tr>\n\t</table>\n\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function page() { $page = CurrentPageName(); $tpl = new templates(); $rebuild_groupware_warning = $tpl->javascript_parse_text("{rebuild_groupware_warning}"); $h = new vhosts(); $hash = $h->listOfAvailableServices(true); $sql = "SELECT groupware FROM freeweb WHERE servername='{$_GET["servername"]}'"; $page = CurrentPageName(); $tpl = new templates(); $q = new mysql(); $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup')); if ($ligne["groupware"] != null) { $groupware_text = "\n\t\t<table style='width:100%' class=form>\n\t\t<tr>\n\t\t\t<td width=1% valign='top'><img src='img/{$h->IMG_ARRAY_64[$ligne["groupware"]]}'></td>\n\t\t\t<td valign='top' width=99%>\n\t\t\t\t<div style='font-size:16px'>{current}: <strong>« {$hash[$ligne["groupware"]]} »</strong><hr>\n\t\t\t\t\t<i style='font-size:13px'>{{$h->TEXT_ARRAY[$ligne["groupware"]]["TEXT"]}}</i>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>"; } $sql = "SELECT ID FROM drupal_queue_orders WHERE `ORDER`='REBUILD_GROUPWARE' AND `servername`='{$_GET["servername"]}'"; if ($ligne["ID"] > 0) { $rebuild_groupware = Paragraphe("64-install-soft-grey.png", "{rebuild_groupoffice}", "{scheduled}"); } else { $rebuild_groupware = Paragraphe("64-install-soft.png", "{rebuild_groupoffice}", "{rebuild_groupoffice_text}", "javascript:RebuildGroupOffice()"); } $tr[] = $tpl->_ENGINE_parse_body($rebuild_groupware); $tables[] = "<table style='width:100%'><tr>"; $t = 0; while (list($key, $line) = each($tr)) { $line = trim($line); if ($line == null) { continue; } $t = $t + 1; $tables[] = "<td valign='top'>{$line}</td>"; if ($t == 2) { $t = 0; $tables[] = "</tr><tr>"; } } if ($t < 2) { for ($i = 0; $i <= $t; $i++) { $tables[] = "<td valign='top'> </td>"; } } $html = "<div style='width:100%' id='groupofficediv'>{$groupware_text}\n<table style='width:100%'>\n<tr>\n<td valign='top'><div id='mysql-status'></div></td>\n<td valign='top'>\n\t" . implode("\n", $tables) . "\n\t</td>\n\t</tr>\n</table>\n\t\n\t</div>\n\t<script>\n\tvar x_RebuildGroupOffice= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);}\n\t\tif(document.getElementById('main_config_freewebedit')){RefreshTab('main_config_freewebedit');}\n\t}\t\t\n\t\n\tfunction RebuildGroupOffice(){\n\t\tif(confirm('{$rebuild_groupware_warning}')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('rebuild-groupoffice','yes');\n\t\t\tXHR.appendData('servername','{$_GET["servername"]}');\n\t\t\tAnimateDiv('groupofficediv');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_RebuildGroupOffice);\n\t\t\t}\n\t}\t\n\t\n\t\n\t\n\t</script>\n\t\n\t"; $tpl = new templates(); $datas = $tpl->_ENGINE_parse_body($html); echo $datas; }
function page() { $page = CurrentPageName(); $tpl = new templates(); $rebuild_groupware_warning = $tpl->javascript_parse_text("{rebuild_groupware_warning}"); $t = time(); $h = new vhosts(); $hash = $h->listOfAvailableServices(true); $sql = "SELECT groupware FROM freeweb WHERE servername='{$_GET["servername"]}'"; $page = CurrentPageName(); $tpl = new templates(); $q = new mysql(); $sock = new sockets(); $ldap = new clladp(); $users = new usersMenus(); if ($users->AsSystemAdministrator) { $ous = $ldap->hash_get_ou(true); $OUFIELD = Field_array_Hash($ous, "NAB-OU-{$t}", $free->Params["ROUNDCUBE"]["NAB-OU"], "style:font-size:14px"); } else { $OUFIELD = "<span style='font-size:14px;font-weight:bold'>{$_SESSION["ou"]}<input type='hidden' id='NAB-OU-{$t}' value='{$_SESSION["ou"]}'></span>"; } $EnableVirtualDomainsInMailBoxes = $sock->GET_INFO("EnableVirtualDomainsInMailBoxes"); if (!is_numeric($EnableVirtualDomainsInMailBoxes)) { $EnableVirtualDomainsInMailBoxes = 0; } $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup')); if ($ligne["groupware"] != null) { $groupware_text = "\n\t\t<table style='width:99%' class=form>\n\t\t<tr>\n\t\t\t<td width=1% valign='top'><img src='img/{$h->IMG_ARRAY_64[$ligne["groupware"]]}'></td>\n\t\t\t<td valign='top' width=99%>\n\t\t\t\t<div style='font-size:16px'>{current}: <strong>« {$hash[$ligne["groupware"]]} »</strong><hr>\n\t\t\t\t\t<i style='font-size:13px'>{{$h->TEXT_ARRAY[$ligne["groupware"]]["TEXT"]}}</i>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>"; } $free = new freeweb($_GET["servername"]); $js = "YahooWin4('650','mysql.browse.php?database={$free->mysql_database}&instance-id={$free->mysql_instance_id}','»{$free->mysql_database}');"; // javascript:LoadMysqlTables('rdcbe05261831'); $SMTP_SERVER = $free->Params["ROUNDCUBE"]["SMTP_SERVER"]; if ($SMTP_SERVER == null) { $SMTP_SERVER = "127.0.0.1"; } if (!isset($free->Params["ROUNDCUBE"]["SIEVE_SERVER"])) { $free->Params["ROUNDCUBE"]["SIEVE_SERVER"] = "127.0.0.1:2000"; } $html = "<div style='width:100%' id='roundcubediv'>{$groupware_text}\n\n<table style='width:99%' class=form>\n<tbody>\n<tr>\n\t<td class=legend style='font-size:14px'>MySQL {database}:</td>\n\t<td style='font-size:14px'>Instance {$free->mysql_instance_id} / <a href=\"javascript:blur();\" OnClick=\"javascript:{$js}\" style='text-decoration:underline'>{$free->mysql_database}</a>\n\t <a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('{$page}?replic-js=yes&servername={$_GET["servername"]}')\" style='text-decoration:underline'>{replication}</a>\n\t\n\t</td>\n</tr>\n<tr>\n\t<td class=legend style='font-size:14px'>{smtp_server}:</td>\n\t<td style='font-size:14px'>" . Field_text("RDCUBE_SMTP_SERVER-{$t}", $SMTP_SERVER, "font-size:14px;width:220px") . "</td>\n</tr>\n<tr>\n\t<td class=legend style='font-size:14px'>{imap_server}:</td>\n\t<td style='font-size:14px'>" . Field_text("RDCUBE_IMAP_SERVER-{$t}", $free->Params["ROUNDCUBE"]["IMAP_SERVER"], "font-size:14px;width:220px") . "</td>\n</tr>\n<tr>\n\t<td class=legend style='font-size:14px'>Sieve:</td>\n\t<td style='font-size:14px'>" . Field_text("RDCUBE_SIEVE_SERVER-{$t}", $free->Params["ROUNDCUBE"]["SIEVE_SERVER"], "font-size:14px;width:220px") . "</td>\n</tr>\t\t\t\n<tr>\n\t<td class=legend style='font-size:14px'>{login_domain}:</td>\n\t<td style='font-size:14px'>" . Field_text("username_domain-{$t}", $free->Params["ROUNDCUBE"]["username_domain"], "font-size:14px;width:220px") . "</td>\n</tr>\n<tr>\n\t<td class=legend style='font-size:14px'>{default_domain}:</td>\n\t<td style='font-size:14px'>" . Field_text("mail_domain-{$t}", $free->Params["ROUNDCUBE"]["mail_domain"], "font-size:14px;width:220px") . "</td>\n</tr>\n<tr>\n\t<td class=legend style='font-size:14px'>{product_name}:</td>\n\t<td style='font-size:14px'>" . Field_text("product_name-{$t}", $free->Params["ROUNDCUBE"]["product_name"], "font-size:14px;width:220px") . "</td>\n</tr>\n<tr>\n\t<td class=legend style='font-size:14px'>{global_addressbook}:</td>\n\t<td style='font-size:14px'>" . Field_checkbox("ENABLE_NAB-{$t}", 1, $free->Params["ROUNDCUBE"]["ENABLE_NAB"], "ENABLE_NAB_CHECK{$t}()") . "</td>\n</tr>\n<tr>\n\t<td class=legend style='font-size:14px'>{organization}:</td>\n\t<td style='font-size:14px'>{$OUFIELD}</td>\n</tr>\n<tr>\n\t<td class=legend style='font-size:14px'>{writeable}:</td>\n\t<td style='font-size:14px'>" . Field_checkbox("WRITE_NAB-{$t}", 1, $free->Params["ROUNDCUBE"]["WRITE_NAB"]) . "</td>\n</tr>\n\n\n<tr>\n<td colspan=2><div style='text-align:right'><hr>" . button("{apply}", "SaveRDCUBESETTS()", 16) . "</div></td>\n</tr>\n\n</table>\n<table class='table-{$t}' style='display: none' id='table-{$t}' style='width:100%;margin:-10px'></table>\n</div>\n\n\n\n\n</div>\n\t<script>\nFreeWebIDMEM='';\n\$(document).ready(function(){\n\$('#table-{$t}').flexigrid({\n\turl: '{$page}?plugin-list=yes&servername={$_GET["servername"]}&force-groupware={$_GET["force-groupware"]}&ForceInstanceZarafaID={$_GET["ForceInstanceZarafaID"]}&t={$t}&tabzarafa={$_GET["tabzarafa"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: ' ', name : 'icon', width : 31, sortable : false, align: 'center'},\n\t\t{display: 'Plugins', name : 'Plugins', width :652, sortable : true, align: 'left'},\n\t\t{display: ' ', name : 'none1', width : 31, sortable : false, align: 'left'},\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t\t{display: 'Plugins', name : 'Plugins'},\n\t\t],\n\tsortname: 'servername',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: 'Plugins',\n\tuseRp: false,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: 874,\n\theight: 200,\n\tsingleSelect: true\n\t\n\t}); \n});\t\n\t\n\t\n\t\n\t\tvar x_SaveRDCUBESETTS=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>3){alert(results);}\n\n\t\t\tif(document.getElementById('main_config_freewebedit')){\n\t\t\t\tRefreshTab('main_config_freewebedit');\n\t\t\t}\n\t\t\t\n\t\t}\t\n\t\t\n\t\tvar x_SaveRDCUBESETTSILENT=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>3){alert(results);}\n\n\t\t\t\n\t\t\t\n\t\t}\t\t\t\n\n\t\t\n\t\tfunction PluginEnable(plug){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('servername','{$_GET["servername"]}');\n\t\t\tXHR.appendData('PLUGS',plug);\n\t\t\tif(document.getElementById('plugin_'+plug).checked){XHR.appendData('plugin_'+plug,1);}else{XHR.appendData('plugin_'+plug,0);}\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveRDCUBESETTSILENT);\n\t\t}\n\t\n\t\n\t\tfunction SaveRDCUBESETTS(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('servername','{$_GET["servername"]}');\n\t\t\tXHR.appendData('SMTP_SERVER',document.getElementById('RDCUBE_SMTP_SERVER-{$t}').value);\n\t\t\tXHR.appendData('IMAP_SERVER',document.getElementById('RDCUBE_IMAP_SERVER-{$t}').value);\n\t\t\tXHR.appendData('SIEVE_SERVER',document.getElementById('RDCUBE_SIEVE_SERVER-{$t}').value);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tXHR.appendData('username_domain',document.getElementById('username_domain-{$t}').value);\n\t\t\tXHR.appendData('mail_domain',document.getElementById('mail_domain-{$t}').value);\n\t\t\tXHR.appendData('product_name',document.getElementById('product_name-{$t}').value);\n\t\t\tif(document.getElementById('ENABLE_NAB-{$t}').checked){XHR.appendData('ENABLE_NAB',1);}else{XHR.appendData('ENABLE_NAB',0);}\n\t\t\tif(document.getElementById('WRITE_NAB-{$t}').checked){XHR.appendData('WRITE_NAB',1);}else{XHR.appendData('WRITE_NAB',0);}\n\t\t\tXHR.appendData('NAB-OU',document.getElementById('NAB-OU-{$t}').value);\n\t\t\t\n\t\t\t\n\t\t\tAnimateDiv('roundcubediv');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveRDCUBESETTS);\n\t\t}\n\t\n\t\tfunction EnableVirtualDomainsInMailBoxesCheck(){\n\t\t\tvar EnableVirtualDomainsInMailBoxes={$EnableVirtualDomainsInMailBoxes};\n\t\t\tdocument.getElementById('username_domain-{$t}').disabled=true;\n\t\t\tif(EnableVirtualDomainsInMailBoxes==1){\n\t\t\t\tdocument.getElementById('username_domain-{$t}').disabled=false;\n\t\t\t\tdocument.getElementById('username_domain-{$t}').value='';\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction ENABLE_NAB_CHECK{$t}(){\n\t\t\tdocument.getElementById('NAB-OU-{$t}').disabled=true;\n\t\t\tdocument.getElementById('WRITE_NAB-{$t}').disabled=true;\n\t\t\tif(document.getElementById('ENABLE_NAB-{$t}').checked){\n\t\t\t\tdocument.getElementById('NAB-OU-{$t}').disabled=false;\n\t\t\t\tdocument.getElementById('WRITE_NAB-{$t}').disabled=false;\n\n\t\t\t}\n\t\t}\n\t\t\n\t\tEnableVirtualDomainsInMailBoxesCheck();\n\t\tENABLE_NAB_CHECK{$t}();\n\t</script>\n\t\n\t"; $tpl = new templates(); $datas = $tpl->_ENGINE_parse_body($html); echo $datas; }
function Websites() { if (is_object($GLOBALS["CLASS_USER"])) { $usr = $GLOBALS["CLASS_USER"]; } else { $usr = new user($_SESSION["uid"]); } $sock = new sockets(); $ApacheGroupWarePort = $sock->GET_INFO("ApacheGroupWarePort"); include_once dirname(__FILE__) . '/ressources/class.apache.inc'; $h = new vhosts($usr->ou); $array = $h->LoadVhosts($usr->ou); $tpl = new templates(); if (count($array) == 0) { return null; } //s_PopUp $html = "<H3>{available_websites}</h3>"; while (list($www, $type) = each($array)) { if ($www == null) { continue; } if ($type == null) { continue; } if ($type == "ARTICA_USR") { continue; } $js = "s_PopUp('http://{$www}:{$ApacheGroupWarePort}',800,800)"; $text = $tpl->_ENGINE_parse_body("{{$h->TEXT_ARRAY[$type]["TEXT"]}}"); if (strlen($text) > 90) { $text = substr($text, 0, 87) . "..."; } $html = $html . iconTable("", "{{$h->TEXT_ARRAY[$type]["TITLE"]}}", "{$text}", $js); } return $html; }
function export_all_groupwares() { include_once 'ressources/class.apache.inc'; $apache = new vhosts(); events("find installed groupwares", __FUNCTION__, __FILE__, __LINE__); $array_final = $apache->AllVhosts(); if (count($array_final) == 0) { events("No groupwares to export ask meta console to stop notify...", __FUNCTION__, __FILE__, __LINE__); NotifyConsoleNoDatas("groupwares"); return; } $datas = base64_encode(serialize($array_final)); @file_put_contents("/etc/artica-postfix/groupwares.cache", $datas); $http = new httpget(); $sock = new sockets(); $meta = new artica_meta(); $http->uploads["ALL_GROUPWARES"] = "/etc/artica-postfix/groupwares.cache"; $body = $http->send("{$meta->ArticaMetaHostname}/lic.users.import.php", "post", array("DATAS" => base64_encode(serialize($meta->GLOBAL_ARRAY)))); events(count($array_final) . " groupwares exported to global Management console", __FUNCTION__, __FILE__, __LINE__); send_email_events(count($array_final) . " groupwares exported to global Management console", $body, "CLOUD"); echo $body; }
function ADD_GROUPWARE($value) { $array = unserialize(base64_decode($value)); $EXEC_NICE = EXEC_NICE(); if (is_file("/usr/bin/nohup")) { $nohup = "/usr/bin/nohup "; } include_once 'ressources/class.apache.inc'; $reload_datas = $nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-all-groupwares >/dev/null 2>&1 &"; $vhosts = new vhosts(); $hostname = $array["apacheservername"]; /* $pdns=new pdns($domain); $pdns->EditIPName($servername,$IP,"A",null); }else{ $hostname=$_GET["host"]; }*/ $vhosts = new vhosts(); $vhosts->ou = $array["ou"]; $vhosts->apachedomainname = $array["apachedomainname"]; $vhosts->apacheIPAddress = $array["apacheIPAddress"]; $vhosts->BuildRoot(); $vhosts->WWWAppliPassword = $array["WWWAppliPassword"]; $vhosts->WWWAppliUser = $array["wwwappliuser"]; $vhosts->WWWMysqlUser = $array["wwwmysqluser"]; $vhosts->WWWMysqlPassword = $array["wwwmysqlpassword"]; $vhosts->WWWSSLMode = $array["wwwsslmode"]; if (isset($array["WWWEnableAddressBook"])) { $vhosts->WWWEnableAddressBook = $array["WWWEnableAddressBook"]; } $vhosts->WWWMultiSMTPSender = $array["WWWMultiSMTPSender"]; if ($vhosts->Addhost($array["apacheservername"], $array["wwwservertype"])) { send_email_events("Success Adding/editing {$array["apacheservername"]} groupware service", null, "CLOUD"); events("Success Adding/editing {$array["apacheservername"]} groupware service", __FUNCTION__, __FILE__, __LINE__); return true; } else { send_email_events("Failed Adding/editing {$array["apacheservername"]} groupware service", null, "CLOUD"); events("Failed Adding/editing {$array["apacheservername"]} groupware service", __FUNCTION__, __FILE__, __LINE__); } }
function add_web_service() { $ou = $_GET["ou"]; $ServerWWWType = $_GET['ServerWWWType']; $servername = $_GET["servername"]; $domain = $_GET["domain"]; $IP = $_GET["IP"]; $tpl = new templates(); $noneed_mysql = false; $noneed_appliPass = false; if ($_GET["host"] == null) { if ($servername == null) { echo $tpl->_ENGINE_parse_body("{server_name}=null"); exit; } if ($IP == null) { echo $tpl->_ENGINE_parse_body("{address}=null"); exit; } if ($domain == null) { echo $tpl->_ENGINE_parse_body("{domain}=null"); exit; } if ($ServerWWWType == null) { echo $tpl->_ENGINE_parse_body("{service_type}=null"); exit; } } $noneed_mysql = false; if ($ou == null) { echo $tpl->_ENGINE_parse_body("{organization}=null"); exit; } $vhosts = new vhosts($_GET["ou"]); $vvhosts = new vhosts(); $noneeduser = $vvhosts->noneeduser; $noneeduser_mysql = $vvhosts->noneeduser_mysql; if ($noneeduser[$ServerWWWType]) { $noneed_appliPass = true; } if ($noneeduser_mysql[$ServerWWWType]) { $noneed_mysql = true; } if (!$noneed_mysql) { if ($_GET["WWWMysqlUser"] == null) { echo $tpl->_ENGINE_parse_body("\"{$ServerWWWType}\":\n{WWWMysqlUser}=null\n{$noneed_mysql}\nL." . __LINE__); exit; } if ($_GET["WWWMysqlPassword"] == null) { echo $tpl->_ENGINE_parse_body("{$ServerWWWType}:{WWWMysqlPassword}=null"); exit; } } if (!$noneeduser["{$ServerWWWType}"]) { if ($_GET["WWWAppliUser"] == null) { echo $tpl->_ENGINE_parse_body("{$ServerWWWType}:\n{WWWAppliUser}=null\n{$vhosts->noneeduser["{$ServerWWWType}"]}"); exit; } } if (!$noneed_appliPass) { if ($_GET["WWWAppliPassword"] == null) { echo $tpl->_ENGINE_parse_body("{WWWAppliPassword}=null"); exit; } } if ($_GET["host"] == null) { $hostname = $servername . "." . $domain; $pdns = new pdns($domain); $pdns->EditIPName($servername, $IP, "A", null); } else { $hostname = $_GET["host"]; } $hostname = str_replace(" ", "_", $hostname); $database = str_replace("-", "_", $database); $database = str_replace(".", "_", $database); $vhosts->ou = $ou; $vhosts->BuildRoot(); $vhosts->WWWAppliPassword = $_GET["WWWAppliPassword"]; $vhosts->WWWAppliUser = $_GET["WWWAppliUser"]; $vhosts->WWWMysqlUser = $_GET["WWWMysqlUser"]; $vhosts->WWWMysqlPassword = $_GET["WWWMysqlPassword"]; $vhosts->WWWSSLMode = $_GET["WWWSSLMode"]; if (isset($_GET["WWWEnableAddressBook"])) { $vhosts->WWWEnableAddressBook = $_GET["WWWEnableAddressBook"]; } writelogs("WWWMultiSMTPSender={$_GET["WWWMultiSMTPSender"]}", __FUNCTION__, __FILE__, __LINE__); $vhosts->WWWMultiSMTPSender = $_GET["WWWMultiSMTPSender"]; $vhosts->Addhost($hostname, $ServerWWWType); $sock = new sockets(); writelogs("Scheduling =>cmd.php?install-web-services=yes", __FUNCTION__, __FILE__, __LINE__); $sock->getFrameWork("cmd.php?install-web-services=yes"); }
function remove($servername) { $apache = new vhosts(); $GLOBALS["ADDLOG"] = "{$GLOBALS["ARTICALOGDIR"]}/{$servername}.log"; $confs = $apache->SearchHosts($servername); events(__FUNCTION__ . ":: Check {$servername}"); events(__FUNCTION__ . ":: remove files and directories"); if (is_dir("/usr/share/artica-groupware/domains/{$servername}")) { shell_exec("/bin/rm -rf /usr/share/artica-groupware/domains/{$servername}"); } $server_database = str_replace(" ", "_", $servername); $server_database = str_replace(".", "_", $servername); $server_database = str_replace("-", "_", $server_database); $q = new mysql(); if ($q->DATABASE_EXISTS($server_database)) { $q->DELETE_DATABASE($server_database); } $flaseuser["root"] = true; $flaseuser["admin"] = true; $flaseuser["manager"] = true; $sql = "DELETE FROM `mysql`.`db` WHERE `db`.`Db` = '{$server_database}'"; $q->QUERY_SQL($sql, "mysql"); events(__FUNCTION__ . ":: removing ldap branch {$confs["dn"]}"); $ldap = new clladp(); if ($ldap->ExistsDN($confs["dn"])) { $ldap->ldap_delete($confs["dn"]); } events(__FUNCTION__ . ":: restarting HTTP service..."); shell_exec("/etc/init.d/artica-postfix restart apache-groupware &"); }
function organization_vhostslist($ou) { $sock = new sockets(); $usersmenus = new usersMenus(); if ($usersmenus->AsOrgAdmin) { $tr[] = Paragraphe('www-add-64.png', '{ADD_WEB_SERVICE}', '{ADD_WEB_SERVICE_TEXT}', "javascript:Loadjs('domains.www.php?ou={$ou}&add=yes')", null, 210, 0, 0, true); } $ApacheGroupWarePort = $sock->GET_INFO("ApacheGroupWarePort"); $apache = new vhosts(); $hash = $apache->LoadVhosts($ou); $html = "<table style='width:98%' class=form>"; $server = $_SERVER['SERVER_NAME']; if (preg_match("#(.+?):#", $server, $re)) { $server = $re[1]; } while (list($host, $wwwservertype) = each($hash)) { $img = null; $suffix = null; $URI = "http://{$host}:{$ApacheGroupWarePort}{$suffix}"; $array = $apache->SearchHosts($host); if ($array["wwwsslmode"] == "TRUE") { $URI = "https://{$host}{$suffix}"; } switch ($wwwservertype) { case "JOOMLA": $suffix = "/administrator"; break; case "DRUPAL": $img = "drupal-logo-32.png"; $suffix = "/install.php"; break; } $img = $apache->IMG_ARRAY_64[$wwwservertype]; $warn = null; $ip = gethostbyname($host); if ($ip == $host) { $warn = imgtootltip("status_warning.png", "{could_not_find_iphost}:{$host}"); } $link = imgtootltip("alias-32.gif", "<b><u>{$host}</u></b><br>{$URI}", "s_PopUpFull('{$URI}',800,800)"); $js = "Loadjs('domains.www.php?ou={$ou}&add=yes&host={$host}')"; $tr[] = Paragraphe(array($img, $warn, $link), $host, '{' . $apache->TEXT_ARRAY[$wwwservertype]["TITLE"] . '}<br>{' . $apache->TEXT_ARRAY[$wwwservertype]["TEXT"] . '}', "javascript:{$js}"); } return $tr; }
function listOfAvailableServices() { $vhost = new vhosts(); $tpl = new templates(); $user = new usersMenus(); $array = $vhost->listOfAvailableServices(); return $tpl->_ENGINE_parse_body(Field_array_Hash($array, 'ServerWWWType', null, "AddWWWServiceChange()")); }
function list_users() { $query = $_GET["SearchPattern"]; $ldap = new clladp(); $page = CurrentPageName(); $www = base64_decode($_GET["www"]); if ($www == "MAIN_INSTANCE") { $dn = "dc=organizations,{$ldap->suffix}"; } else { $w = new vhosts(); $array = $w->SearchHosts($www); $ou = $array["OU"]; $dn = "ou={$ou},dc=organizations,{$ldap->suffix}"; } $html = "\n<table cellspacing='0' cellpadding='0' border='0' class='tableView'>\n<thead class='thead'>\n\t<tr>\n\t<th colspan=4>{$ou}- {members} {$query}</th>\n\t</tr>\n</thead>\t\n\t\n\t"; $sr = @ldap_search($ldap->ldap_connection, $dn, "(&(objectClass=posixAccount)(|(uid={$query}*)(cn={$query}*)(displayName={$query}*)))", array("displayname", "uid"), 0, 10); if ($sr) { $result = ldap_get_entries($ldap->ldap_connection, $sr); for ($i = 0; $i < $result["count"]; $i++) { $displayname = $result[$i]["displayname"][0]; $uid = $result[$i]["uid"][0]; if (substr($uid, strlen($uid) - 1, 1) == '$') { continue; } if ($displayname == null) { $displayname = $uid; } $res[$uid] = $displayname; } } if (!is_array($res)) { return null; } krsort($res); while (list($num, $ligne) = each($res)) { if ($num == null) { continue; } if (is_numeric($num)) { continue; } $Displayname = $ligne; $uid = $num; $js = "AddGADBUser('" . base64_encode($uid) . "');"; if (strlen($Displayname) > 30) { $Displayname = substr($Displayname, 0, 27) . "..."; } $img = "user-18.png"; if ($classtr == "oddRow") { $classtr = null; } else { $classtr = "oddRow"; } $html = $html . "\n\t\t\t\t<tr class={$classtr}>\n\t\t\t\t<td width=1%><img src='img/{$img}'></td>\n\t\t\t\t<td><strong style='font-size:13px' >{$Displayname} ({$uid})</td>\n\t\t\t\t<td width=1%>" . imgtootltip("add-18.png", "{add}", $js) . "</td>\n\t\t\t\t</tr>"; } $html = $html . "</table>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body("{$html}"); }
function groupwares_index() { $h = new vhosts(); $hash = $h->listOfAvailableServices(true); $sql = "SELECT groupware FROM freeweb WHERE servername='{$_GET["servername"]}'"; $page = CurrentPageName(); $tpl = new templates(); $q = new mysql(); $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup')); if ($ligne["groupware"] != null) { echo $tpl->_ENGINE_parse_body("\n\t\t<div style='width:98%' class=form>\n\t\t<table>\n\t\t<tr>\n\t\t\t<td width=1% valign='top'><img src='img/{$h->IMG_ARRAY_64[$ligne["groupware"]]}'></td>\n\t\t\t<td valign='top' width=99%>\n\t\t\t\t<div style='font-size:16px'>{current}: <strong>« {$hash[$ligne["groupware"]]} »</strong><hr>\n\t\t\t\t\t<i style='font-size:13px'>{{$h->TEXT_ARRAY[$ligne["groupware"]]["TEXT"]}}</i>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table></div>"); return; } $page = CurrentPageName(); while (list($key, $title) = each($hash)) { if ($h->IMG_ARRAY_64[$key] == null) { continue; } $js = "javascript:FreeWebToGroupWare('{$key}');"; $tr[] = $tpl->_ENGINE_parse_body(Paragraphe($h->IMG_ARRAY_64[$key], $title, "{{$h->TEXT_ARRAY[$key]["TEXT"]}}", $js)); } $final = CompileTr4($tr); $groupware_text = $tpl->_ENGINE_parse_body($groupware_text); $freeweb_groupware_explain = $tpl->_ENGINE_parse_body("{freeweb_groupware_explain}"); $html = "\n<div class=explain style='font-size:18px'>{$freeweb_groupware_explain}</div>\n{$groupware_text}\n<center>\n{$final}\n</center>\n<script>\n\t\tvar x_FreeWebToGroupWare=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);return;}\n\t\t\t\$('#freewebs-table-{$_GET["t"]}').flexReload();\t\n\t\t\tRefreshTab('main_config_freewebedit');\n\t\t\tExecuteByClassName('SearchFunction');\n\t\t}\n\t\n\t\n\t\tfunction FreeWebToGroupWare(key){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('FreeWebToGroupWare',key);\n\t\t\tXHR.appendData('servername','{$_GET["servername"]}');\n \t\tXHR.sendAndLoad('{$page}', 'POST',x_FreeWebToGroupWare);\n\t\t}\n</script>\n\n\n"; echo $html; }
function list_save() { $listname = $_GET["listname"]; $admin_email = $_GET["admin_email"]; $tpl = new templates(); if ($_SESSION["uid"] == -100) { echo "ok\n"; $ou_q = base64_decode($_GET["ou"]); } else { $ct = new user($_SESSION["uid"]); $ou_q = $ct->ou; } $ldap = new clladp(); $uid = $ldap->uid_from_email($admin_email); if ($uid == null) { echo $tpl->_ENGINE_parse_body("{$admin_email}:{mailman_admin_not_exists}"); exit; } $ct = new user($uid); $listuid = $ldap->uid_from_email("{$listname}@{$domain}"); if ($listuid != null) { echo $tpl->_ENGINE_parse_body("{account_already_exists}:{$listname}@{$domain}"); exit; } if ($_GET["webservername"] == null) { echo $tpl->_ENGINE_parse_body("{www_server_name}:NULL !"); exit; } $apache = new vhosts(); $array = $apache->SearchHosts($_GET["webservername"] . '.' . $_GET["webservername_domain"]); if ($array["apacheservername"] != null) { echo $tpl->_ENGINE_parse_body($_GET["webservername"] . '.' . $_GET["webservername_domain"] . " {error_domain_exists}"); exit; } $admin_password = $_GET["admin_password"]; $domain = $_GET["domain"]; $mailman = new mailman_control($ou_q); $mailman->list_name = $listname; $mailman->list_domain = $domain; $mailman->admin_email = $admin_email; $mailman->admin_password = $_GET["admin_password"]; $mailman->webservername = $_GET["webservername"] . '.' . $_GET["webservername_domain"]; if ($mailman->EditList()) { } $sock = new sockets(); $sock->getFrameWork("cmd.php?syncro-mailman=yes"); }
function page() { $page = CurrentPageName(); $tpl = new templates(); $rebuild_groupware_warning = $tpl->javascript_parse_text("{rebuild_groupware_warning}"); $sock = new sockets(); $h = new vhosts(); $t = $_GET["t"]; $hash = $h->listOfAvailableServices(true); $sql = "SELECT groupware FROM freeweb WHERE servername='{$_GET["servername"]}'"; $page = CurrentPageName(); $users = new usersMenus(); $tpl = new templates(); $q = new mysql(); $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup')); if ($ligne["groupware"] != null) { $groupware_text = "\n\t\t<table style='width:99%' class=form>\n\t\t<tr>\n\t\t\t<td width=1% valign='top'><img src='img/{$h->IMG_ARRAY_64[$ligne["groupware"]]}'></td>\n\t\t\t<td valign='top' width=99%>\n\t\t\t\t<div style='font-size:16px'>{current}: <strong>« {$hash[$ligne["groupware"]]} »</strong><hr>\n\t\t\t\t\t<i style='font-size:13px'>{{$h->TEXT_ARRAY[$ligne["groupware"]]["TEXT"]}}</i>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>"; } $ZarafaAspellInstalled_text = "({not_installed})"; $ZarafaAspellInstalled = 0; if ($users->ASPELL_INSTALLED) { $ZarafaAspellInstalled = 1; $ZarafaAspellInstalled_text = "({installed})"; } $NGINX_INSTALLED = 0; $free = new freeweb($_GET["servername"]); $PARAMS = $free->Params["ZARAFAWEB_PARAMS"]; if (!isset($PARAMS["ZarafaWebNTLM"])) { $PARAMS["ZarafaWebNTLM"] = $sock->GET_INFO("ZarafaWebNTLM"); } if (!isset($PARAMS["ZarafaEnablePlugins"])) { $PARAMS["ZarafaEnablePlugins"] = $sock->GET_INFO("ZarafaEnablePlugins"); } if (!isset($PARAMS["ZarafaAspellEnabled"])) { $PARAMS["ZarafaAspellEnabled"] = $sock->GET_INFO("ZarafaAspellEnabled"); } if (!isset($PARAMS["EnableZarafaRemoteServer"])) { $PARAMS["EnableZarafaRemoteServer"] = 0; } if (!isset($PARAMS["EnableDebugMode"])) { $PARAMS["EnableDebugMode"] = 0; } if ($users->NGINX_INSTALLED) { $NGINX_INSTALLED = 1; } $EnablePHPFPM = $sock->GET_INFO("EnablePHPFPM"); if (!is_numeric($EnablePHPFPM)) { $EnablePHPFPM = 0; } if ($EnablePHPFPM == 0) { $NGINX_INSTALLED = 0; } $EnableDebugMode = $PARAMS["EnableDebugMode"]; $ZarafaWebNTLM = $PARAMS["ZarafaWebNTLM"]; $ZarafaEnablePlugins = $PARAMS["ZarafaEnablePlugins"]; $ZarafaAspellEnabled = $PARAMS["ZarafaAspellEnabled"]; $EnableZarafaRemoteServer = $PARAMS["EnableZarafaRemoteServer"]; $EnableZarafaRemoteServerAddr = $PARAMS["EnableZarafaRemoteServerAddr"]; $ZarafaEnablePluginPassword = $PARAMS["ZarafaEnablePluginPassword"]; $EnableZarafaSecondInstance = $PARAMS["EnableZarafaSecondInstance"]; $post_max_size = $PARAMS["post_max_size"]; $upload_max_filesize = $PARAMS["upload_max_filesize"]; $zPushInside = $PARAMS["zPushInside"]; $ZarafaXMPPDomain = $PARAMS["ZarafaXMPPDomain"]; $AutoDiscoverUri = $PARAMS["AutoDiscoverUri"]; $t = time(); if (!is_numeric($ZarafaWebNTLM)) { $ZarafaWebNTLM = 0; } if (!is_numeric($ZarafaEnablePlugins)) { $ZarafaEnablePlugins = 0; } if (!is_numeric($ZarafaAspellEnabled)) { $ZarafaAspellEnabled = 0; } if (!is_numeric($EnableZarafaRemoteServer)) { $EnableZarafaRemoteServer = 0; } if (!is_numeric($EnableDebugMode)) { $EnableDebugMode = 0; } if (!is_numeric($post_max_size)) { $post_max_size = 50; } if (!is_numeric($upload_max_filesize)) { $upload_max_filesize = 50; } if (!is_numeric($ZarafaEnablePluginPassword)) { $ZarafaEnablePluginPassword = 0; } if (!is_numeric($zPushInside)) { $zPushInside = 1; } if (!is_numeric($EnableZarafaSecondInstance)) { $EnableZarafaSecondInstance = 0; } $zPushInstalled = 0; if (!is_numeric($t)) { $t = time(); } if ($users->Z_PUSH_INSTALLED) { $zPushInstalled = 1; } if ($users->EJABBERD_INSTALLED) { $ejabberdEnabled = $sock->GET_INFO("ejabberdEnabled"); $ejabberdInsideZarafa = $sock->GET_INFO("ejabberdInsideZarafa"); if (!is_numeric($ejabberdEnabled)) { $ejabberdEnabled = 1; } if (!is_numeric($ejabberdInsideZarafa)) { $ejabberdInsideZarafa = 0; } if ($ejabberdEnabled == 1) { if ($ejabberdInsideZarafa == 1) { $sql = "SELECT hostname FROM ejabberd WHERE enabled=1"; $results = $q->QUERY_SQL($sql, "artica_backup"); $TT[null] = "{select}"; while ($ligne = mysql_fetch_assoc($results)) { $TT[$ligne["hostname"]] = $ligne["hostname"]; } $ejjaberd_field = Field_array_Hash($TT, "ZarafaXMPPDomain-{$t}", $ZarafaXMPPDomain, null, null, 0, "font-size:14px"); $ejjaberd_row = "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=legend style='font-size:14px'>{InstantMessagingDomain}:</td>\n\t\t\t\t\t\t<td>{$ejjaberd_field}</td>\n\t\t\t\t\t</tr>\t\t\n\t\t\t\t"; } } } $sock = new sockets(); $ZarafaDBEnable2Instance = $sock->GET_INFO("ZarafaDBEnable2Instance"); if (!is_numeric($ZarafaDBEnable2Instance)) { $ZarafaDBEnable2Instance = 0; } $html = "<div style='width:100%' id='{$t}'></div>\n\n{$groupware_text}\n<div style='width:98%' class=form>\n<table style='width:100%'>\n<tbody>\n\n\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{NginxFrontEnd}:</td>\n\t\t<td>" . Field_checkbox("NginxFrontEnd-{$t}", 1, $free->NginxFrontEnd, "NginxFrontEndCK{$t}()") . "</td>\n\t</tr>\n\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{EnableZpush}:</td>\n\t\t<td>" . Field_checkbox("zPushInside-{$t}", 1, $zPushInside, "zPushInsideCheck{$t}()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px' valign='top'>{AutoDiscover_webserver}:</td>\n\t\t<td>" . Field_text("AutoDiscoverUri-{$t}", $AutoDiscoverUri, "font-size:14px;width:98%;font-weight:bold") . "\n\t\t<div style='text-align:right'><a href=\"javascript:blur();\" \n\t\t\t\tOnClick=\"javascript:s_PopUpFull('http://mail-appliance.org/index.php?cID=387','1024','900');\"\n\t\t\t\tstyle='font-size:11px;text-decoration:underline'>«{online_help}»</a></div>\t\n\t\t</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{debug_mode}:</td>\n\t\t<td>" . Field_checkbox("EnableDebugMode-{$t}", 1, $EnableDebugMode) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{ZarafaWebNTLM}:<div style='font-size:11px'>{ZarafaWebNTLM_explain}</div></td>\n\t\t<td>" . Field_checkbox("ZarafaWebNTLM-{$t}", 1, $ZarafaWebNTLM) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{ZarafaEnablePlugins}:</td>\n\t\t<td>" . Field_checkbox("ZarafaEnablePlugins-{$t}", 1, $ZarafaEnablePlugins) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{spell_checker} {$ZarafaAspellInstalled_text} :</td>\n\t\t<td>" . Field_checkbox("ZarafaAspellEnabled-{$t}", 1, $ZarafaAspellEnabled) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{UseRemoteServer}:</td>\n\t\t<td>" . Field_checkbox("EnableZarafaRemoteServer-{$t}", 1, $EnableZarafaRemoteServer, "EnableZarafaRemoteServerCheck{$t}()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{remote_server}:</td>\n\t\t<td>" . Field_text("EnableZarafaRemoteServerAddr-{$t}", $EnableZarafaRemoteServerAddr, "font-size:14px;width:220px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{use_second_instance}:</td>\n\t\t<td>" . Field_checkbox("EnableZarafaSecondInstance-{$t}", 1, $EnableZarafaSecondInstance, "ZarafaDBEnable2InstanceCheck{$t}()") . "</td>\n\t</tr>\t\n\t{$ejjaberd_row}\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{post_max_size}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("post_max_size-{$t}", $post_max_size, "font-size:14px;width:60px") . " M</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{upload_max_filesize}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("upload_max_filesize-{$t}", $upload_max_filesize, "font-size:14px;width:60px") . " M</td>\n\t</tr>\n\t\n\t\t\t\t\t\t\t\t\t\t\t\n</table>\n\n<div style='text-align:right'><hr>" . button("{apply}", "SaveZarafaWebFree{$t}()", 18) . "</div>\n</div>\n\n\n\n\t<script>\n\t\n\t\tfunction NginxFrontEndCK{$t}(){\n\t\t\tvar NGINX_INSTALLED={$NGINX_INSTALLED};\n\t\t\tif(NGINX_INSTALLED==0){\n\t\t\t\tdocument.getElementById('NginxFrontEnd-{$t}').checked=false;\n\t\t\t\tdocument.getElementById('NginxFrontEnd-{$t}').disabled=true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\n\t\tif(document.getElementById('NginxFrontEnd-{$t}').checked){\n\t\t\tdocument.getElementById('zPushInside-{$t}').disabled=true;\n\t\t\tdocument.getElementById('AutoDiscoverUri-{$t}').disabled=true;\n\t\t\tdocument.getElementById('EnableZarafaSecondInstance-{$t}').disabled=true;\n\t\t\tdocument.getElementById('post_max_size-{$t}').disabled=true;\n\t\t\tdocument.getElementById('upload_max_filesize-{$t}').disabled=true;\n\t\t\tdocument.getElementById('ZarafaWebNTLM-{$t}').disabled=true;\n\t\t}else{\n\t\t\tdocument.getElementById('zPushInside-{$t}').disabled=false;\n\t\t\tdocument.getElementById('AutoDiscoverUri-{$t}').disabled=false;\n\t\t\tdocument.getElementById('EnableZarafaSecondInstance-{$t}').disabled=false;\n\t\t\tdocument.getElementById('post_max_size-{$t}').disabled=false;\n\t\t\tdocument.getElementById('upload_max_filesize-{$t}').disabled=false;\n\t\t\tdocument.getElementById('ZarafaWebNTLM-{$t}').disabled=false;\t\t\n\t\t\n\t\t}\n\t\t\t\n\t\t}\n\t\n\t\n\t\tvar x_SaveZarafaWebFree{$t}=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>3){alert(results);}\n\t\t\tdocument.getElementById('{$t}').innerHTML='';\n\t\t}\t\n\n\t\tfunction EnableZarafaRemoteServerCheck{$t}(){\n\t\t\tvar zPushInstalled={$zPushInstalled};\n\t\t\t\n\t\t\tdocument.getElementById('zPushInside-{$t}').disabled=true;\n\t\t\tdocument.getElementById('EnableZarafaRemoteServerAddr-{$t}').disabled=true;\n\t\t\tif(!document.getElementById('EnableZarafaRemoteServer-{$t}').disabled){\n\t\t\t\tif(document.getElementById('EnableZarafaRemoteServer-{$t}').checked){\n\t\t\t\t\tdocument.getElementById('EnableZarafaRemoteServerAddr-{$t}').disabled=false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(zPushInstalled==1){\n\t\t\t\tdocument.getElementById('zPushInside-{$t}').disabled=false;\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfunction zPushInsideCheck{$t}(){\n\t\t\tdocument.getElementById('AutoDiscoverUri-{$t}').disabled=true;\n\t\t\tif(document.getElementById('zPushInside-{$t}').checked){\n\t\t\t\tdocument.getElementById('AutoDiscoverUri-{$t}').disabled=false;\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\tfunction ZarafaDBEnable2InstanceCheck{$t}(){\n\t\t\tvar ZarafaDBEnable2Instance={$ZarafaDBEnable2Instance};\n\t\t\tdocument.getElementById('EnableZarafaSecondInstance-{$t}').disabled=true;\n\t\t\tdocument.getElementById('EnableZarafaRemoteServer-{$t}').disabled=true;\n\t\t\t\n\t\t\tif(ZarafaDBEnable2Instance==0){\n\t\t\t\tdocument.getElementById('EnableZarafaRemoteServer-{$t}').disabled=false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdocument.getElementById('EnableZarafaSecondInstance-{$t}').disabled=false;\n\t\t\tif(document.getElementById('EnableZarafaSecondInstance-{$t}').checked){\n\t\t\t\tdocument.getElementById('EnableZarafaRemoteServer-{$t}').disabled=true;\t\t\t\n\t\t\t}else{\n\t\t\t\tdocument.getElementById('EnableZarafaRemoteServer-{$t}').disabled=false;\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tEnableZarafaRemoteServerCheck{$t}();\n\t\t\t\n\t\t}\n\n\t\n\t\n\t\tfunction SaveZarafaWebFree{$t}(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('servername','{$_GET["servername"]}');\n\t\t\tZarafaXMPPDomain='';\n\t\t\tif(document.getElementById('EnableDebugMode-{$t}').checked){XHR.appendData('EnableDebugMode',1);}else{XHR.appendData('EnableDebugMode',0);}\n\t\t\tif(document.getElementById('EnableZarafaRemoteServer-{$t}').checked){XHR.appendData('EnableZarafaRemoteServer',1);}else{XHR.appendData('EnableZarafaRemoteServer',0);}\n\t\t\tif(document.getElementById('ZarafaWebNTLM-{$t}').checked){XHR.appendData('ZarafaWebNTLM',1);}else{XHR.appendData('ZarafaWebNTLM',0);}\n\t\t\tif(document.getElementById('ZarafaEnablePlugins-{$t}').checked){XHR.appendData('ZarafaEnablePlugins',1);}else{XHR.appendData('ZarafaEnablePlugins',0);}\n\t\t\tif(document.getElementById('ZarafaAspellEnabled-{$t}').checked){XHR.appendData('ZarafaAspellEnabled',1);}else{XHR.appendData('ZarafaAspellEnabled',0);}\n\t\t\tif(document.getElementById('zPushInside-{$t}').checked){XHR.appendData('zPushInside',1);}else{XHR.appendData('zPushInside',0);}\n\t\t\tif(document.getElementById('EnableZarafaSecondInstance-{$t}').checked){XHR.appendData('EnableZarafaSecondInstance',1);}else{XHR.appendData('EnableZarafaSecondInstance',0);}\n\t\t\tif(document.getElementById('NginxFrontEnd-{$t}').checked){XHR.appendData('NginxFrontEnd',1);}else{XHR.appendData('NginxFrontEnd',0);}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tXHR.appendData('EnableZarafaRemoteServerAddr',document.getElementById('EnableZarafaRemoteServerAddr-{$t}').value);\n\t\t\tif(document.getElementById('ZarafaXMPPDomain')){ZarafaXMPPDomain=document.getElementById('ZarafaXMPPDomain-{$t}').value;}\n\t\t\tXHR.appendData('ZarafaXMPPDomain',ZarafaXMPPDomain);\n\t\t\tXHR.appendData('post_max_size',document.getElementById('post_max_size-{$t}').value);\n\t\t\tXHR.appendData('AutoDiscoverUri',document.getElementById('AutoDiscoverUri-{$t}').value);\n\t\t\tXHR.appendData('upload_max_filesize',document.getElementById('upload_max_filesize-{$t}').value);\n\t\t\tAnimateDiv('{$t}');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveZarafaWebFree{$t});\n\t\t}\n\t\tZarafaDBEnable2InstanceCheck{$t}();\n\t\tNginxFrontEndCK{$t}();\n\t\t\n\t</script>\n\t\n\t"; $tpl = new templates(); $datas = $tpl->_ENGINE_parse_body($html); echo $datas; }
function groupwares_index(){ $h=new vhosts(); $hash=$h->listOfAvailableServices(true); $sql="SELECT groupware FROM freeweb WHERE servername='{$_GET["servername"]}'"; $page=CurrentPageName(); $tpl=new templates(); $q=new mysql(); $ligne=@mysql_fetch_array($q->QUERY_SQL($sql,'artica_backup')); if($ligne["groupware"]<>null){ $groupware_text=" <table style='width:100%' class=form> <tr> <td width=1% valign='top'><img src='img/{$h->IMG_ARRAY_64[$ligne["groupware"]]}'></td> <td valign='top' width=99%> <div style='font-size:16px'>{current}: <strong>« {$hash[$ligne["groupware"]]} »</strong><hr> <i style='font-size:13px'>{{$h->TEXT_ARRAY[$ligne["groupware"]]["TEXT"]}}</i> </div> </td> </tr> </table>"; } $page=CurrentPageName(); while (list ($key, $title) = each ($hash) ){ if($h->IMG_ARRAY_64[$key]==null){continue;} $js="javascript:FreeWebToGroupWare('$key');"; $tr[]=$tpl->_ENGINE_parse_body(Paragraphe($h->IMG_ARRAY_64[$key],$title,"{{$h->TEXT_ARRAY[$key]["TEXT"]}}",$js)); } $tables[]="<table style='width:100%'><tr>"; $t=0; while (list ($key, $line) = each ($tr) ){ $line=trim($line); if($line==null){continue;} $t=$t+1; $tables[]="<td valign='top'>$line</td>"; if($t==3){$t=0;$tables[]="</tr><tr>";} } if($t<3){ for($i=0;$i<=$t;$i++){ $tables[]="<td valign='top'> </td>"; } } $groupware_text=$tpl->_ENGINE_parse_body($groupware_text); $freeweb_groupware_explain=$tpl->_ENGINE_parse_body("{freeweb_groupware_explain}"); $html=" <div class=explain>$freeweb_groupware_explain</div> $groupware_text <div style='width:700px'>". implode("\n",$tables)."</div> <script> var x_FreeWebToGroupWare=function (obj) { var results=obj.responseText; if(results.length>0){alert(results);return;} RefreshTab('main_config_freewebedit'); } function FreeWebToGroupWare(key){ var XHR = new XHRConnection(); XHR.appendData('FreeWebToGroupWare',key); XHR.appendData('servername','{$_GET["servername"]}'); XHR.sendAndLoad('$page', 'POST',x_FreeWebToGroupWare); } </script> "; echo $html; }