Location: PHPKode > projects > phpServerAdmin > phpserveradmin/pptpd/plugins/pingtime/setup.php
<?php

   /*
    *  pingtime
    *  By George Vieira <hide@address.com>
    *  (c) 2005
    *
    */


   function plugin_init_pingtime() {
       global $plugin_hooks;
       $plugin_hooks["maintable_tunnelinfotitle"]["pingtime"] = "display_pingtime_title";
       $plugin_hooks["maintable_tunnelinfodata"]["pingtime"] = "display_pingtime_info";
   }


   function display_pingtime_title() {
      echo "<TH width='65' height=20 noWrap scope=col><FONT class=datasheetField>&nbsp;Ping Times</FONT></TH>";
   }

   function display_pingtime_info( $tunneldata ) {
	 		$fr = @fopen( "/var/lock/vpnipcheck/ppp-".$tunneldata[TUNNEL_DEVICE].".ping" , "r");
			if ( $fr )
			{
				$pingtime = fgets($fr);
				fclose($fr);
			}
			if ( trim($pingtime) )
				$pingtime.="ms";
			else
				$pingtime="icmp block";
      echo "<TD noWrap height=20 bgcolor=#fffff7><FONT class=datasheetField>&nbsp;".$pingtime."</FONT></TD>";
   }

   function pingtime_version() {
      return '1.0';
   }

?>
Return current item: phpServerAdmin