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 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; $vhosts->apachedomainname = $domain; $vhosts->apacheIPAddress = $IP; } else { $hostname = $_GET["host"]; } $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); }