phpUserTrack
[ class tree: phpUserTrack ] [ index: phpUserTrack ] [ all elements ]

Source for file ipFilter.php

Documentation is available at ipFilter.php

  1. <?php
  2. /**
  3.  * This is an example of what a plugin could look like. Required functions are _type() and invoke()
  4.  */
  5. /**
  6.  * ipFilter plugin class. Filter out IP addresses that admin doesent want recorded.
  7.  * @author Christopher Troup <mini@chatetheory.com>
  8.  * @package phpUserTrack
  9.  * @subpackage Plugins
  10.  */
  11. class ipFilter extends plugins {
  12.     /**
  13.      * Array of IP addresses to ignore
  14.      * @var array
  15.      */
  16.     var $ignoreIPs = array'127.0.0.1');
  17.     
  18.     function ipFilter({
  19.     }
  20.  
  21.     /**
  22.      * Invoke plugins, filter IP addresses
  23.      * @param phpusertrack_ip $ip Profile object
  24.      * @return phpusertrack_ip Altered Profile object
  25.      */
  26.     function invoke($ip{
  27.         if (in_array($ip->getIp()$this->ignoreIPs)) {
  28.                $ip null;
  29.         }
  30.         return $ip;
  31.     }
  32.  
  33.     /**
  34.      * The type of plugin
  35.      * @return string
  36.      */
  37.     function _type({
  38.         return 'ip.pre';
  39.     }
  40.  
  41. }
  42.     
  43. ?>

Documentation generated on Tue, 06 Nov 2007 09:21:56 -0800 by phpDocumentor 1.4.0a2