/usr/share/arc/ldap-monitor/includes/headfoot.inc is in nordugrid-arc-ldap-monitor 5.0.5-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | <?php
// Author: oxana.smirnova@hep.lu.se
/**
* A class to set up HTML pages
*/
class LmDoc { // class LmDoc
var $module;
var $version;
var $title = "";
var $refresh = 120;
var $bg = "#ffffff";
var $lc = "#cc0000";
var $language = "en";
var $strings = array();
var $errors = array();
var $countries = array();
var $mdsattr = array();
var $isattr = array();
var $loadmon = array();
var $clusdes = array();
var $jobstat = array();
var $volist = array();
var $vousers = array();
var $userlist = array();
var $userres = array();
var $attlist = array();
var $quelist = array();
var $sestat = array();
var $allusers = array();
var $ldapdump = array();
var $giislist = array();
var $emirslist = array();
var $cert;
/**
* @return LmDoc
* @param wintyp string
* @param extratitle string
* @desc Creates a new HTML document of type wintyp, title appended with an optional extratitle
*/
function LmDoc ( $wintyp="", $extratitle="" ) { // function LmDoc ()
header("Content-type: text/html; charset=utf-8");
ob_implicit_flush(0);
ob_start();
// ini_set("max_execution_time","120");
// ini_set("memory_limit","15M");
// set_time_limit(10);
// Dumps the page start HTML code
//echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n";
//echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n";
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD W3 HTML//EN\">\n";
echo "<html><head>\n";
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n";
echo "<meta name=\"robots\" content=\"noindex,nofollow\">\n";
echo "<script type=\"text/javascript\" src=\"monitor.js\"></script>\n";
echo "<script type=\"text/javascript\" src=\"mylo.js\"></script>\n";
if ( $wintyp ) {
$this->module = $wintyp;
// Localize
$yaccept = @$_SERVER["HTTP_ACCEPT_LANGUAGE"] ;
if ( !$yaccept ) $yaccept = "en";
if ( FORCE_LANG != "default" ) $yaccept = FORCE_LANG;
$yazyk = "en";
$yazyki = explode(",",$yaccept);
foreach ( $yazyki as $option ) {
if ( $yazyk != "en" ) continue;
$option = trim($option);
$option = substr($option,0,2);
// some sniffing
// touch("test/".$option);
// echo "<!--$option-->\n";
$locfile = $option.".inc";
if ( !file_exists("lang/".$locfile) ) continue;
$yazyk = $option;
}
$locfile = $yazyk.".inc";
include $locfile;
setlocale(LC_ALL, $yazyk);
$this->language = $yazyk;
$this->strings = $message;
$this->errors = $message["errors"];
$this->countries = $message["tlconvert"];
$this->mdsattr = $message["mdsattr"];
$this->isattr = $message["isattr"];
// Assigns $this->clusdes = $message["clusdes"];
$this->$wintyp = $message[$wintyp];
$toptitle = $message[$wintyp][0];
// Set page parameters
require ('settings.inc');
$inpnam = implode("_",array("def",$wintyp));
// Page style definitions (see settings.inc)
// Sets top window title
$this->title = ( $toptitle ) ? $toptitle : "";
// Refresh rate
$this->refresh = (${$inpnam}["refresh"]) ? ${$inpnam}["refresh"] : 0;
// Background and link colors
$this->bg = (${$inpnam}["bgcolor"]) ? ${$inpnam}["bgcolor"] : "#ffffff";
$this->lc = (${$inpnam}["lcolor"]) ? ${$inpnam}["lcolor"] : "#cc0000";
// Dumps the header HTML code
$titles = explode(":",$this->title); // sometimes titles are many
echo "<title>".$titles[0]." ".$extratitle."</title>\n";
if ( $this->refresh ) echo "<meta http-equiv=\"refresh\" content=".$this->refresh.">\n";
echo "<style>\n";
echo "<!--\n";
echo "A {text-decoration:none; }\n";
echo "A:link {color: ".$this->lc."; }\n";
echo "A:visited {color: ".$this->lc."; }\n";
echo "A:first-child {color: ".$this->lc."; }\n";
echo "BODY {background-color: ".$this->bg."; font-size:small; height:auto;}\n";
echo "P {padding: 0em; margin: 10px 0px 6px 0px; font-size:small; }\n";
echo "TD {font-size:small;}\n";
echo "DT {text-align: justify;}\n";
echo "DD {text-align: justify;}\n";
echo ".right {text-align: right; padding: 0em; margin: 0em;}\n";
echo ".fix {font-family: monospace;}\n";
echo "//-->\n";
echo "</style>\n";
// define giislist
$this->giislist = $giislist;
$this->emirslist= $emirslist;
$this->cert = $cert;
}
// Finishes HTML header, starts document body
echo "</head>\n";
echo "<body>\n";
echo "<center>\n";
}
/**
* @return void
* @param errors array
* @param title string
* @param subtitle string
* @desc Makes an opening Monitor header
*/
function tabletop ( $toptitle="", $subtitle="" ) { // function tabletop()
$lang = FORCE_LANG;
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr><td nowrap align=\"center\" colspan=\"2\"><b>".$toptitle."</b></td>\n";
echo "<tr><td nowrap align=\"left\"><b><i>".$subtitle."</i></b></td>\n";
echo "<td nowrap align=\"right\"><a href=\"javascript: window.location.reload()\">\n";
echo " <img src=\"./mon-icons/icon-refresh.png\" vspace=\"4\" width=\"24\" height=\"24\" border=\"0\" align=\"absmiddle\" title=\"".$this->errors["301"]."\" alt=\"".$this->errors["301"]."\"></a>\n";
echo " <a href=\"javascript:(self.print();)\" onClick=\"self.print();\">\n";
echo " <img src=\"./mon-icons/icon-print.png\" vspace=\"4\" width=\"24\" height=\"24\" border=\"0\" align=\"absmiddle\" title=\"".$this->errors["302"]."\" alt=\"".$this->errors["302"]."\"></a>\n";
echo " <a href=\"javascript:monitor('help.php?module=".$this->module."&lang=".$lang."',400,300,10);\" onClick=\"javascript:monitor('help.php?module=".$this->module."',400,300,10);\">\n";
echo " <img src=\"./mon-icons/icon-help.png\" vspace=\"4\" width=\"24\" height=\"24\" border=\"0\" align=\"absmiddle\" title=\"".$this->errors["303"]."\" alt=\"".$this->errors["303"]."\"></a>\n";
echo " <a href=\"javascript:(self.close();)\" onClick=\"self.close();\">\n";
echo " <img src=\"./mon-icons/icon-close.png\" vspace=\"4\" width=\"24\" height=\"24\" border=\"0\" align=\"absmiddle\" title=\"".$this->errors["304"]."\" alt=\"".$this->errors["304"]."\"></a>\n";
echo "</td></tr></table>\n";
}
/**
* @return string
* @desc returns version number from README
*/
function getVersion ()
{
$v = "N/A";
if ( file_exists("README") ) {
$readme = fopen("README","r");
$fline = fgets($readme);
$v = substr(stristr($fline,"version "),8);
fclose($readme);
}
$this->version = $v;
return $v;
}
/**
* @return void
* @desc Closes an HTML document
*/
function close ()
{
// Closes the HTML document
echo "\n</center>\n";
echo "</body></html>\n";
ob_end_flush();
ob_implicit_flush();
}
}
/**
* Below are some generic functions, non-class-specific
*
* function dbgmsg ( string ) : prints out a message and flushes output; useful for debugging
* function popup ( string, int, int, int ) : opens up a new window, depending on the client
*/
/**
* @return void
* @param dbgtxt string
* @desc Outputs a debug message outside the table
*/
function dbgmsg( $dbgtxt="Debug" )
{
echo "$dbgtxt\n";
flush();
}
/**
* @return void
* @param contact string
* @param x int
* @param y int
* @param n int
* @desc Returns a new monitor window URL
*/
$agent = @$_SERVER["HTTP_USER_AGENT"] ;
if ( !defined("USERAGENT") ) define("USERAGENT",$agent);
function popup( $contact, $x=400, $y=300, $n=1, $lang, $debug )
{
( USERAGENT ) ? $agent = USERAGENT : $agent = "lynx";
if ( preg_match("/opera/i",$agent)
|| preg_match("/lynx/i",$agent)
|| preg_match("/konqueror/i",$agent)
) return $contact;
// $link = "javascript:monitor('".$contact."',$x,$y,$n)";
if ( $lang != "default" && $lang != FALSE ) {
if ( strpos($contact,"?") ) {
$contact .= "&" ;
} else {
$contact .= "?" ;
}
$contact .= "lang=$lang";
}
if ( $debug ) {
if ( strpos($contact,"?") ) {
$contact .= "&" ;
} else {
$contact .= "?" ;
}
$contact .= "debug=$debug";
}
$link = $contact."\" target=\"win".$n."\" onClick=\"monitor('".$contact."',$x,$y,$n); return false";
return $link;
}
?>
|