A hint: This file contains one or more very long lines, so maybe it is better readable using the pure text view mode that shows the contents as wrapped lines within the browser window.
1 <?php 2 3 echo ' 4 <html> 5 <head>'; 6 7 if (!$title) { 8 echo '<title>Node Runner - Open Source Network Monitor</title>'; 9 } else { 10 echo '<title>Node Runner - '.$title.'</title>'; 11 } 12 13 echo '<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">'; 14 15 16 if (!$_GET["nohead"]) { // used for printable reports 17 18 echo ' 19 <script type="text/javascript"> 20 21 /*********************************************** 22 * AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com) 23 * This notice MUST stay intact for legal use 24 * Visit http://www.dynamicdrive.com/ for full source code 25 ***********************************************/ 26 27 //Contents for menu 1 28 var menu1=new Array() 29 menu1[0]=\'<div style="border-style:solid;border-width:1px;border-color:#AD8802 #A6091C #A6091C #A6091C;"><a class="dropmenu" href="addedit-nodes.php"> • Add/Edit Nodes</a></div>\' 30 31 //Contents for menu 2, and so on 32 var menu2=new Array() 33 menu2[0]=\'<div style="border-style:solid;border-width:1px;border-color:#AD8802 #A6091C #A6091C #A6091C;"><a class="dropmenu" href="addedit-users.php"> • Configure User Groups</a></div>\' 34 menu2[1]=\'<div style="border-style:solid;border-width:1px;border-color:#AD8802 #A6091C #A6091C #A6091C;"><a class="dropmenu" href="addedit-mail.php"> • Configure Mail Groups</a></div>\' 35 36 var menu3=new Array() 37 menu3[0]=\'<div style="border-style:solid;border-width:1px;border-color:#AD8802 #A6091C #A6091C #A6091C;"><a class="dropmenu" href="index.php"> • Main Page</a></div>\' 38 menu3[1]=\'<div style="border-style:solid;border-width:1px;border-color:#AD8802 #A6091C #A6091C #A6091C;"><a class="dropmenu" href="recent-failures.php"> • Recent Failures</a></div>\' 39 menu3[2]=\'<div style="border-style:solid;border-width:1px;border-color:#AD8802 #A6091C #A6091C #A6091C;"><a class="dropmenu" href="node-reports.php"> • Historical Reports</a></div>\' 40 41 var menu4=new Array() 42 menu4[0]=\'<div style="border-style:solid;border-width:1px;border-color:#AD8802 #A6091C #A6091C #A6091C;"><a class="dropmenu" href="db-maintenance.php"> • DB Maintenance</a></div>\' 43 44 var menu5=new Array() 45 menu5[0]=\'<div style="border-style:solid;border-width:1px;border-color:#AD8802 #A6091C #A6091C #A6091C;"><a class="dropmenu" href="help.php?contents=1"> • Contents</a></div>\' 46 menu5[1]=\'<div style="border-style:solid;border-width:1px;border-color:#AD8802 #A6091C #A6091C #A6091C;"><a class="dropmenu" href="about.php?nohead=1" onClick="AboutNR(400,450);return false" onfocus="this.blur()"> • About NR</a></div>\' 47 48 49 var menuwidth=\'155px\' //default menu width 50 var menubgcolor=\'#AD8802\' //menu bgcolor 51 var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds) 52 var hidemenu_onclick="yes" //hide menu when user clicks within menu? 53 54 /////No further editting needed 55 56 var ie4=document.all 57 var ns6=document.getElementById&&!document.all 58 59 if (ns6) { 60 document.write(\'<div id="dropmenudiv" style="visibility:hidden;width:\'+menuwidth+\';background-color:\'+menubgcolor+\'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>\') 61 } else { 62 document.write(\'<div id="dropmenudivIE" style="visibility:hidden;width:\'+menuwidth+\';background-color:\'+menubgcolor+\'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>\') 63 } 64 65 function getposOffset(what, offsettype){ 66 var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop; 67 var parentEl=what.offsetParent; 68 while (parentEl!=null){ 69 totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; 70 parentEl=parentEl.offsetParent; 71 } 72 return totaloffset; 73 } 74 75 76 function showhide(obj, e, visible, hidden, menuwidth){ 77 if (ie4||ns6) 78 dropmenuobj.style.left=dropmenuobj.style.top=-500 79 if (menuwidth!=""){ 80 dropmenuobj.widthobj=dropmenuobj.style 81 dropmenuobj.widthobj.width=menuwidth 82 } 83 if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") 84 obj.visibility=visible 85 else if (e.type=="click") 86 obj.visibility=hidden 87 } 88 89 function iecompattest(){ 90 return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body 91 } 92 93 function clearbrowseredge(obj, whichedge){ 94 var edgeoffset=0 95 if (whichedge=="rightedge"){ 96 var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15 97 dropmenuobj.contentmeasure=dropmenuobj.offsetWidth 98 if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure) 99 edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth 100 } 101 else{ 102 var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18 103 dropmenuobj.contentmeasure=dropmenuobj.offsetHeight 104 if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure) 105 edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight 106 } 107 return edgeoffset 108 } 109 110 function populatemenu(what){ 111 if (ie4||ns6) 112 dropmenuobj.innerHTML=what.join("") 113 } 114 115 116 function dropdownmenu(obj, e, menucontents, menuwidth){ 117 if (window.event) event.cancelBubble=true 118 else if (e.stopPropagation) e.stopPropagation() 119 clearhidemenu() 120 if (ns6) { 121 dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv 122 } else { 123 dropmenuobj=document.getElementById? document.getElementById("dropmenudivIE") : dropmenudivIE 124 } 125 populatemenu(menucontents) 126 127 if (ie4||ns6){ 128 showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth) 129 dropmenuobj.x=getposOffset(obj, "left") 130 dropmenuobj.y=getposOffset(obj, "top") 131 dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px" 132 dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px" 133 } 134 135 return clickreturnvalue() 136 } 137 138 function clickreturnvalue(){ 139 if (ie4||ns6) return false 140 else return true 141 } 142 143 function contains_ns6(a, b) { 144 while (b.parentNode) 145 if ((b = b.parentNode) == a) 146 return true; 147 return false; 148 } 149 150 function dynamichide(e){ 151 if (ie4&&!dropmenuobj.contains(e.toElement)) 152 delayhidemenu() 153 else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)) 154 delayhidemenu() 155 } 156 157 function hidemenu(e){ 158 if (typeof dropmenuobj!="undefined"){ 159 if (ie4||ns6) 160 dropmenuobj.style.visibility="hidden" 161 } 162 } 163 164 function delayhidemenu(){ 165 if (ie4||ns6) 166 delayhide=setTimeout("hidemenu()",disappeardelay) 167 } 168 169 function clearhidemenu(){ 170 if (typeof delayhide!="undefined") 171 clearTimeout(delayhide) 172 } 173 174 if (hidemenu_onclick=="yes") 175 document.onclick=hidemenu 176 177 </script>'; 178 179 } // end if (!$_GET["nohead"]) 180 181 echo ' 182 <link rel="stylesheet" href="style.css" type="text/css"> 183 <script language="Javascript"> 184 185 function openHelp(url,width,height) { 186 window.open(url, "NodeRunnerHelp", "width="+width+",height="+height+",menubar=no,status=no,location=no,toolbar=no,scrollbars=no,resizable=yes"); 187 return false; 188 } 189 190 function AboutNR(width,height) { 191 var LeftPosition=(screen.width)?(screen.width-width)/2:100; 192 var TopPosition=(screen.height)?(screen.height-height)/2:100; 193 window.open("about.php?nohead=1", "AboutNodeRunner", "width="+width+",height="+height+",top="+TopPosition+",left="+LeftPosition+",menubar=no,status=no,location=no,toolbar=no,scrollbars=no,resizable=yes"); 194 return false; 195 } 196 '; 197 198 if ($title == "Add/Edit Nodes") { 199 200 echo ' 201 // Disable certain fields for certain query_types. 202 function disableAddEditFields() { 203 document.addedit.snmp_comm.disabled=true; 204 document.addedit.snmp_comm.value=""; 205 document.addedit.port.disabled=true; 206 document.addedit.port.value=""; 207 document.addedit.url.disabled=true; 208 document.addedit.url.value=""; 209 document.addedit.auth_user.disabled=true; 210 document.addedit.auth_user.value=""; 211 document.addedit.auth_pass.disabled=true; 212 document.addedit.auth_pass.value=""; 213 214 if ((document.addedit.query_type.value == "TCP") || (document.addedit.query_type.value == "UDP")) { 215 document.addedit.port.disabled=false; 216 } else if (document.addedit.query_type.value == "SNMP") { 217 document.addedit.snmp_comm.disabled=false; 218 } else if (document.addedit.query_type.value == "HTTP") { 219 document.addedit.port.disabled=false; 220 if (document.addedit.port.value == "") { 221 document.addedit.port.value="80"; 222 } 223 document.addedit.url.disabled=false; 224 document.addedit.auth_user.disabled=false; 225 document.addedit.auth_pass.disabled=false; 226 } 227 } 228 229 230 // Form validation 231 function verify() { 232 var themessage = "You are required to complete the following fields: "; 233 if (document.addedit.description.value=="") { 234 themessage = themessage + "\n - Node Name"; 235 } 236 if (document.addedit.ipaddress.value=="") { 237 themessage = themessage + "\n - IP Address"; 238 } 239 if (document.addedit.query_type.value==0) { 240 themessage = themessage + "\n - Query Type"; 241 } 242 if (document.addedit.ptime.value=="") { 243 themessage = themessage + "\n - Query Timeout"; 244 } 245 if ((document.addedit.port.disabled==false) && (document.addedit.port.value=="")) { 246 themessage = themessage + "\n - Port to Query"; 247 } 248 if ((document.addedit.url.disabled==false) && (document.addedit.url.value=="")) { 249 themessage = themessage + "\n - URL to Query"; 250 } 251 if ((document.addedit.snmp_comm.disabled==false) && (document.addedit.snmp_comm.value=="")) { 252 themessage = themessage + "\n - SNMP Community"; 253 } 254 255 //alert if fields are empty and cancel form submit 256 if (themessage == "You are required to complete the following fields: ") { 257 document.addedit.submit(); 258 } else { 259 alert(themessage); 260 return false; 261 } 262 } 263 264 '; 265 266 } // end if Add/Edit Nodes 267 268 269 if ($title == "Add/Edit Users") { 270 echo ' 271 // Form validation 272 function verify() { 273 var themessage = "You are required to complete the following fields: "; 274 var passwordconfirm = "Password Confirmed"; 275 if (document.addedit.add_username.value=="") { 276 themessage = themessage + "\n - Username"; 277 } 278 if (document.addedit.add_password.value=="") { 279 themessage = themessage + "\n - Password"; 280 } 281 if (document.addedit.add_confirm_password.value=="") { 282 themessage = themessage + "\n - Re-Type Password"; 283 } 284 //alert if fields are empty and cancel form submit 285 if (themessage == "You are required to complete the following fields: ") { 286 287 if (document.addedit.add_password.value != document.addedit.add_confirm_password.value) { 288 passwordconfirm = "The passwords do not match!"; 289 } 290 291 if (passwordconfirm == "Password Confirmed") { 292 document.addedit.submit(); 293 } else { 294 alert(passwordconfirm); 295 return false; 296 } 297 298 299 } else { 300 alert(themessage); 301 return false; 302 } 303 } 304 305 function verify2() { 306 var themessage = "You are required to complete the following fields: "; 307 var passwordconfirm = "Password Confirmed"; 308 if (document.addedit2.edit_password.value=="") { 309 themessage = themessage + "\n - Password"; 310 } 311 if (document.addedit2.edit_confirm_password.value=="") { 312 themessage = themessage + "\n - Re-Type Password"; 313 } 314 //alert if fields are empty and cancel form submit 315 if (themessage == "You are required to complete the following fields: ") { 316 317 if (document.addedit2.edit_password.value != document.addedit2.edit_confirm_password.value) { 318 passwordconfirm = "The passwords do not match!"; 319 } 320 321 if (passwordconfirm == "Password Confirmed") { 322 document.addedit2.submit(); 323 } else { 324 alert(passwordconfirm); 325 return false; 326 } 327 328 329 } else { 330 alert(themessage); 331 return false; 332 } 333 } 334 335 '; 336 } // end if Add/Edit Users 337 338 339 if ($title == "Configure Mail Groups") { 340 echo ' 341 // Form validation 342 function verify() { 343 var themessage = "You are required to complete the following fields: "; 344 if (document.mailgroups.add_groupname.value=="") { 345 themessage = themessage + "\n - Group Name"; 346 } 347 if (document.mailgroups.add_addresses.value=="") { 348 themessage = themessage + "\n - Email Addresses"; 349 } 350 //alert if fields are empty and cancel form submit 351 if (themessage == "You are required to complete the following fields: ") { 352 document.mailgroups.submit(); 353 } else { 354 alert(themessage); 355 return false; 356 } 357 } 358 '; 359 360 } // end if Configure Mail Groups 361 362 363 364 if ($title == "Node Reports") { 365 echo ' 366 // Form validation 367 function verify() { 368 var themessage = "You are required to complete the following fields: "; 369 if (document.nodereports.smonth.value=="") { 370 themessage = themessage + "\n - Report Start Date - Month"; 371 } 372 if (document.nodereports.sday.value=="") { 373 themessage = themessage + "\n - Report Start Date - Day"; 374 } 375 if (document.nodereports.syear.value=="") { 376 themessage = themessage + "\n - Report Start Date - Year"; 377 } 378 if (document.nodereports.emonth.value=="") { 379 themessage = themessage + "\n - Report End Date - Month"; 380 } 381 if (document.nodereports.eday.value=="") { 382 themessage = themessage + "\n - Report End Date - Day"; 383 } 384 if (document.nodereports.eyear.value=="") { 385 themessage = themessage + "\n - Report End Date - Year"; 386 } 387 //alert if fields are empty and cancel form submit 388 if (themessage == "You are required to complete the following fields: ") { 389 document.nodereports.submit(); 390 } else { 391 alert(themessage); 392 return false; 393 } 394 } 395 396 function disableFields() { 397 if (document.nodereports.op_OnlySum.checked==true) { 398 document.nodereports.op_OnlyLog.disabled=true; 399 document.nodereports.op_OnlyLog.value=""; 400 } else { 401 document.nodereports.op_OnlyLog.disabled=false; 402 document.nodereports.op_OnlyLog.value=""; 403 } 404 if (document.nodereports.op_OnlyLog.checked==true) { 405 document.nodereports.op_OnlySum.disabled=true; 406 document.nodereports.op_OnlySum.value=""; 407 } else { 408 document.nodereports.op_OnlySum.disabled=false; 409 document.nodereports.op_OnlySum.value=""; 410 } 411 } 412 413 '; 414 415 } // end if Node Reports 416 417 418 echo ' 419 </script> 420 </head> 421 <body topmargin="0">'; 422 423 if (!$_GET["nohead"]) { // used for printable reports 424 echo ' 425 <table align="center" width="780" border="0" cellspacing="0" cellpadding="0"> 426 <tr> 427 <td width="410" align="right" valign="middle" bgcolor="#A000000"><font color="#FFFFFF" size="2"><strong><a href="http://sourceforge.net/projects/node-runner/"><font color="white">Node 428 Runner v'.$nr_ver.'</font></a> is licensed under the <a href="http://www.gnu.org/copyleft/gpl.html" target="_blank"><font color="white">GNU 429 GPL</font></a>. <br>'; 430 431 if ($_SESSION["isloggedin"] == $glbl_hash) { 432 echo 'You are currently logged in as: <i>'.$_SESSION["username"].'</i> / <a href="logout.php"><font color="white">LOGOUT</font></a>'; 433 } else { 434 echo 'You are not currently logged in. Please <a href="login.php"><font color="white">LOGIN</font></a>.'; 435 } 436 437 echo ' 438 </strong></font> </td> 439 <td width="370" align="right" bgcolor="#A00000"><img src="images/nr_title.gif" width="364" height="45"></td> 440 </tr> 441 </table> 442 <table align="center" width="780" border="0" cellspacing="0" cellpadding="1"> 443 <tr> 444 <td width="125" style="border-style:solid;border-color:#AD8802 #A6091C #A6091C #A6091C;border-width:1px;" align="center" bgcolor="#AD8802" height="25"> 445 <a class="topdropmenu" href="#" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, \'126px\')" onMouseout="delayhidemenu()">Network Nodes</a> 446 </td> 447 <td width="152" style="border-style:solid;border-color:#AD8802 #A6091C #A6091C #AD8802;border-width:1px;" align="center" bgcolor="#AD8802" height="25"> 448 <a class="topdropmenu" href="#" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu2, \'153px\')" onMouseout="delayhidemenu()">User Administration</a> 449 </td> 450 <td width="156" style="border-style:solid;border-color:#AD8802 #A6091C #A6091C #AD8802;border-width:1px;" align="center" bgcolor="#AD8802" height="25"> 451 <a class="topdropmenu" href="status-monitor.php" target="_blank">Network Dashboard</a> 452 </td> 453 <td width="135" style="border-style:solid;border-color:#AD8802 #A6091C #A6091C #AD8802;border-width:1px;" align="center" bgcolor="#AD8802" height="25"> 454 <a class="topdropmenu" href="#" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu3, \'136px\')" onMouseout="delayhidemenu()">Status Reporting</a> 455 </td> 456 <td width="122" style="border-style:solid;border-color:#AD8802 #A6091C #A6091C #AD8802;border-width:1px;" align="center" bgcolor="#AD8802" height="25"> 457 <a class="topdropmenu" href="#" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu4, \'122px\')" onMouseout="delayhidemenu()">Misc. Utilities</a> 458 </td> 459 <td width="90" style="border-style:solid;border-color:#AD8802 #A6091C #A6091C #AD8802;border-width:1px;" align="center" bgcolor="#AD8802" height="25"> 460 <a class="topdropmenu" href="#" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu5, \'87px\')" onMouseout="delayhidemenu()">Help</a> 461 </td>'; 462 463 464 echo ' 465 </tr> 466 </table> 467 <table align="center" width="780" border="0" cellspacing="0" cellpadding="5"> 468 <tr> 469 <td valign="top"> 470 <p> </p> 471 '; 472 473 } // end if (!$_GET["nohead"]) 474 475 ?>