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 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; }