[geeklog-cvs] Geeklog-1.x/public_html lib-common.php,1.670,1.671

Dirk Haun dhaun at qs1489.pair.com
Thu Jan 3 09:02:47 EST 2008


Update of /cvsroot/geeklog/Geeklog-1.x/public_html
In directory qs1489.pair.com:/tmp/cvs-serv94996/public_html

Modified Files:
	lib-common.php 
Log Message:
New function COM_resetSpeedlimit


Index: lib-common.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/lib-common.php,v
retrieving revision 1.670
retrieving revision 1.671
diff -C2 -d -r1.670 -r1.671
*** lib-common.php	2 Jan 2008 14:40:21 -0000	1.670
--- lib-common.php	3 Jan 2008 14:02:45 -0000	1.671
***************
*** 9,13 ****
  // | Geeklog common library.                                                   |
  // +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2007 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs        - tony AT tonybibbs DOT com                    |
--- 9,13 ----
  // | Geeklog common library.                                                   |
  // +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2008 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs        - tony AT tonybibbs DOT com                    |
***************
*** 5069,5072 ****
--- 5069,5091 ----
      $sql .= "(date < unix_timestamp() - $speedlimit)";
      DB_query( $sql );
+ }
+ 
+ /**
+ * Reset the speedlimit for an IP address
+ *
+ * @param    string  $type   type of speed limit to reset, e.g. 'submit'
+ * @param    string  $ip     IP address (use current IP address if empty)
+ *
+ */
+ function COM_resetSpeedlimit($type = 'submit', $ip = '')
+ {
+     global $_TABLES;
+ 
+     if (empty($ip)) {
+         $ip = $_SERVER['REMOTE_ADDR'];
+     }
+     $ip = addslashes($ip);
+ 
+     DB_query("DELETE FROM {$_TABLES['speedlimit']} WHERE (type = '$type') AND (ipaddress = '$ip')");
  }
  




More information about the geeklog-cvs mailing list