function sendHeaders() { global $mode, $user, $authed, $oldmode, $viewmode, $actionFunction, $skin; global $shibauthed; $setwrapreferer = processInputVar('am', ARG_NUMERIC, 0); if (!$authed && $mode == "auth") { header("Location: " . BASEURL . SCRIPT . "?mode=selectauth"); dbDisconnect(); exit; } switch ($mode) { case 'logout': if ($shibauthed) { $shibdata = getShibauthData($shibauthed); if (array_key_exists('Shib-logouturl', $shibdata) && !empty($shibdata['Shib-logouturl'])) { dbDisconnect(); header("Location: {$shibdata['Shib-logouturl']}"); exit; } } case 'shiblogout': setcookie("ITECSAUTH", "", time() - 10, "/", COOKIEDOMAIN); setcookie("VCLAUTH", "", time() - 10, "/", COOKIEDOMAIN); if ($shibauthed) { $msg = ''; $shibdata = getShibauthData($shibauthed); # find and clear shib cookies /*foreach(array_keys($_COOKIE) as $key) { if(preg_match('/^_shibsession[_0-9a-fA-F]+$/', $key)) setcookie($key, "", time() - 10, "/", $_SERVER['SERVER_NAME']); elseif(preg_match('/^_shibstate_/', $key)) setcookie($key, "", time() - 10, "/", $_SERVER['SERVER_NAME']); }*/ doQuery("DELETE FROM shibauth WHERE id = {$shibauthed}", 101); stopSession(); dbDisconnect(); if (array_key_exists('Shib-logouturl', $shibdata) && !empty($shibdata['Shib-logouturl'])) { print "<html>\n"; print " <head>\n"; print " <style type=\"text/css\">\n"; print " .red {\n"; print " color: red;\n"; print " }\n"; print " body{\n"; print " margin:0px; color: red;\n"; print " }\n"; print " </style>\n"; print " </head>\n"; print " <body>\n"; print " <span class=red>Done.</span> <a target=\"_top\" href=\"" . BASEURL . "/\">Return to VCL</a>\n"; print " </body>\n"; print "</html>\n"; } else { print "<html>\n"; print "<head>\n"; print "<META HTTP-EQUIV=REFRESH CONTENT=\"5;url=" . BASEURL . "\">\n"; print "<style type=\"text/css\">\n"; print " .hidden {\n"; print " display: none;\n"; print " }\n"; print "</style>\n"; print "</head>\n"; print "<body>\n"; print "Logging out of VCL..."; print "<iframe src=\"http://{$_SERVER['SERVER_NAME']}/Shibboleth.sso/Logout\" class=hidden>\n"; print "</iframe>\n"; if (array_key_exists('Shib-Identity-Provider', $shibdata) && !empty($shibdata['Shib-Identity-Provider'])) { $tmp = explode('/', $shibdata['Shib-Identity-Provider']); $idp = "{$tmp[0]}//{$tmp[2]}"; print "<iframe src=\"{$idp}/idp/logout.jsp\" class=hidden>\n"; print "</iframe>\n"; } print "</body>\n"; print "</html>\n"; } exit; } header("Location: " . HOMEURL); stopSession(); dbDisconnect(); exit; } if ($mode == "submitviewmode") { $expire = time() + 31536000; //expire in 1 year $newviewmode = processInputVar("viewmode", ARG_NUMERIC); if (!empty($newviewmode) && $newviewmode <= $user['adminlevelid']) { setcookie("VCLVIEWMODE", $newviewmode, $expire, "/", COOKIEDOMAIN); } stopSession(); header("Location: " . BASEURL . SCRIPT); dbDisconnect(); exit; } if ($mode == "statgraphday" || $mode == "statgraphdayconcuruser" || $mode == "statgraphdayconcurblade" || $mode == "statgraphhour") { $actionFunction(); dbDisconnect(); exit; } if ($mode == "viewNodes") { $openNodes = processInputVar("openNodes", ARG_STRING); $activeNode = processInputVar("activeNode", ARG_NUMERIC); if (!empty($openNodes)) { $expire = time() + 31536000; //expire in 1 year setcookie("VCLNODES", $openNodes, $expire, "/", COOKIEDOMAIN); } if (!empty($activeNode)) { $expire = time() + 31536000; //expire in 1 year setcookie("VCLACTIVENODE", $activeNode, $expire, "/", COOKIEDOMAIN); } return; } if ($mode == "submitDeleteNode") { $activeNode = processInputVar("activeNode", ARG_NUMERIC); $nodeinfo = getNodeInfo($activeNode); $expire = time() + 31536000; //expire in 1 year setcookie("VCLACTIVENODE", $nodeinfo["parent"], $expire, "/", COOKIEDOMAIN); } if ($mode == "sendRDPfile") { header("Cache-Control: max-age=5, must-revalidate"); header('Pragma: cache'); } else { header("Cache-Control: no-cache, must-revalidate"); } header("Expires: Sat, 1 Jan 2000 00:00:00 GMT"); }
<?php /** * $Id: stats.php,v 1.1 2002/01/21 18:28:24 seth Exp $ * Fetch stats about other systems */ /** this also serves as a test / demo of the xmlrpc-epi client */ require_once dirname(__FILE__) . '/epi-utils.php'; require_once '../config.php'; require_once '../functions.php'; connectToDatabase(); if (empty($_GET)) { echo "please specify a node on the querystring<br />\n"; exit; } $info = getNodeInfo($_GET['node']); $method = "stats.getNumViews"; $params = ""; $server = array('host' => $info['Hostname'], 'uri' => $info['Path'], 'port' => $info['Port']); function remoteStat($server, $method, $params = '') { return xu_rpc_http_concise(array('method' => $method, 'args' => $params, 'host' => $server['host'], 'uri' => $server['uri'], 'port' => $server['port'], 'debug' => $debug, 'output' => $output)); } $online = remoteStat($server, 'planworld.online'); ?> <html> <body> Statistics for node '<?php echo $_GET['node']; ?> ':<br />
function AJsubmitAddChildNode() { global $user; $parent = processInputVar("activeNode", ARG_NUMERIC); if (!checkUserHasPriv("nodeAdmin", $user["id"], $parent)) { $text = "You do not have rights to add children to this node."; print "alert('{$text}');"; dbDisconnect(); exit; } $nodeInfo = getNodeInfo($parent); $newnode = processInputVar("newnode", ARG_STRING); if (!ereg('^[-A-Za-z0-9_. ]+$', $newnode)) { $text = "You can only use letters, numbers, " . "spaces, dashes(-), dots(.), underscores(_), and spaces."; print "alert('{$text}');"; dbDisconnect(); exit; } # check to see if a node with the submitted name already exists $query = "SELECT id " . "FROM privnode " . "WHERE name = '{$newnode}' AND " . "parent = {$parent}"; $qh = doQuery($query, 335); if (mysql_num_rows($qh)) { $text = "A node of that name already exists " . "under " . $nodeInfo["name"]; print "alert('{$text}');"; dbDisconnect(); exit; } $query = "INSERT INTO privnode " . "(parent, " . "name) " . "VALUES " . "({$parent}, " . "'{$newnode}')"; doQuery($query, 336); $qh = doQuery("SELECT LAST_INSERT_ID() FROM privnode", 101); if (!($row = mysql_fetch_row($qh))) { abort(101); } $nodeid = $row[0]; $privs = array(); foreach (array("nodeAdmin", "userGrant", "resourceGrant") as $type) { if (!checkUserHasPriv($type, $user["id"], $nodeid)) { array_push($privs, $type); } } if (count($privs)) { array_push($privs, "cascade"); } updateUserOrGroupPrivs($user["id"], $nodeid, $privs, array(), "user"); print "addChildNode('{$newnode}', {$nodeid});"; dbDisconnect(); exit; }
$old_path = getcwd(); chdir('/var/www/kubernetes'); $a = popen('sh down_cluster.sh', 'r'); while ($b = fgets($a, 2048)) { echo "<p style='color:#337ab7; font-size: 12px;'>.{$b}.</p>" . "<br>\n"; ob_flush(); flush(); } pclose($a); $_SESSION['clusterUp'] = 'false'; chdir($old_path); } if ($_SESSION['clusterUp'] == 'true' or $_SESSION['clusterUp'] == 'exists') { $repcont_count = getRcInfo(); $service_count = getServiceInfo(); $node_count = getNodeInfo(); if (isset($deleteRc)) { foreach ($deleteRc as $key => $value) { echo "<pre style='background-color: #f5f5f5; border: 0px; color:#337ab7; font-size: 10px;'>"; delete_rc($value, $_SESSION['imageName'], '/api/v1/namespaces/default/replicationcontrollers/' . $value); echo "</pre>"; } $repcont_count = getRcInfo(); } if (isset($deleteService)) { foreach ($deleteService as $key => $value) { echo "<pre style='background-color: #f5f5f5; border: 0px; color:#337ab7; font-size: 10px;'>"; delete_service($value, '/api/v1/namespaces/default/services/' . $value); echo "</pre>"; } $service_count = getServiceInfo();
function AJsubmitAddChildNode() { global $user; $parent = processInputVar("activeNode", ARG_NUMERIC); if (!checkUserHasPriv("nodeAdmin", $user["id"], $parent)) { $text = "You do not have rights to add children to this node."; print "dojo.byId('childNodeName').value = ''; "; print "dijit.byId('addNodePane').hide(); "; print "alert('{$text}');"; return; } $newnode = processInputVar("newnode", ARG_STRING); $errmsg = ''; if (!validateNodeName($newnode, $errmsg)) { print "dojo.byId('addChildNodeStatus').innerHTML = '{$errmsg}';"; return; } $nodeInfo = getNodeInfo($parent); # check to see if a node with the submitted name already exists $query = "SELECT id " . "FROM privnode " . "WHERE name = '{$newnode}' AND " . "parent = {$parent}"; $qh = doQuery($query, 335); if (mysql_num_rows($qh)) { $text = "A node of that name already exists " . "under " . $nodeInfo["name"]; print "dojo.byId('addChildNodeStatus').innerHTML = '{$text}';"; return; } $query = "INSERT INTO privnode " . "(parent, " . "name) " . "VALUES " . "({$parent}, " . "'{$newnode}')"; doQuery($query, 336); $qh = doQuery("SELECT LAST_INSERT_ID() FROM privnode", 101); if (!($row = mysql_fetch_row($qh))) { abort(101); } $nodeid = $row[0]; $privs = array(); foreach (array("nodeAdmin", "userGrant", "resourceGrant") as $type) { if (!checkUserHasPriv($type, $user["id"], $nodeid)) { array_push($privs, $type); } } if (count($privs)) { array_push($privs, "cascade"); updateUserOrGroupPrivs($user["id"], $nodeid, $privs, array(), "user"); } print "addChildNode('{$newnode}', {$nodeid});"; }
function XMLRPCaddNode($nodeName, $parentNode) { require_once ".ht-inc/privileges.php"; global $user; if (!is_numeric($parentNode)) { return array('status' => 'error', 'errorcode' => 78, 'errormsg' => 'Invalid nodeid specified'); } if (in_array("nodeAdmin", $user['privileges'])) { $nodeInfo = getNodeInfo($parentNode); if (is_null($nodeInfo)) { return array('status' => 'error', 'errorcode' => 78, 'errormsg' => 'Invalid nodeid specified'); } if (!validateNodeName($nodeName, $tmp)) { return array('status' => 'error', 'errorcode' => 81, 'errormsg' => 'Invalid node name'); } if (checkUserHasPriv("nodeAdmin", $user['id'], $parentNode)) { $query = "SELECT id " . "FROM privnode " . "WHERE name = '{$nodeName}' AND parent = {$parentNode}"; $qh = doQuery($query); if (mysql_num_rows($qh)) { return array('status' => 'error', 'errorcode' => 82, 'errormsg' => 'A node of that name already exists under ' . $nodeInfo['name']); } $query = "INSERT IGNORE INTO privnode " . "(parent, name) " . "VALUES " . "({$parentNode}, '{$nodeName}')"; doQuery($query); $qh = doQuery("SELECT LAST_INSERT_ID() FROM privnode", 101); if (!($row = mysql_fetch_row($qh))) { return array('status' => 'error', 'errorcode' => 85, 'errormsg' => 'Could not add node to database'); } $nodeid = $row[0]; return array('status' => 'success', 'nodeid' => $nodeid); } else { return array('status' => 'error', 'errorcode' => 49, 'errormsg' => 'Unable to add node at this location'); } } else { return array('status' => 'error', 'errorcode' => 70, 'errormsg' => 'User cannot access node content'); } }