function checkcontrol() { global $context; if ($context != "control") { return; } if (empty($_SERVER['PHP_AUTH_PW'])) { authenticate(); } else { #echo "You entered password ". md5($PHP_AUTH_PW) ." ($PHP_AUTH_PW)<br>"; $private = embarrassed(); if (md5($_SERVER['PHP_AUTH_PW']) != $private["controlroom"]) { authenticate(); } } }
<?php /* $Id$ */ $tpl = new Dwoo_Template_File(template("meta_view.tpl")); $data = new Dwoo_Data(); discover_filters(); if (!empty($filter_defs)) { $data->assign("filters", $filter_defs); $data->assign("choose_filter", $choose_filter); } # Find the private clusters. But no one is emabarrassed in the # control room (public only!). if ($context != "control") { $private = embarrassed(); } $source_names = array_keys($grid); # Build a list of cluster names and randomly pick a smaller subset to # display for control room mode. This allows a dedicated host to # eventually cycle through all the graphs w/o scrolling the mouse. A bunch # of these stations could monitor a large grid. # # For the standard meta view still display all the hosts. if ($context == "control") { srand((double) microtime() * 1000000); shuffle($source_names); $subset = array_slice($source_names, 0, abs($controlroom)); $source_names = $subset; } foreach ($source_names as $c) { $cpucount = $metrics[$c]["cpu_num"]['SUM']; if (!$cpucount) {