Update of /cvsroot/phpmp/phpMP/includes
In directory sc8-pr-cvs1:/tmp/cvs-serv32327/includes
Modified Files:
session.php
Log Message:
Updated the session table definition. Added the ability to decode the IPs we've encoded in the database. Fixed a word that was incorrect in index.php.
Index: session.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/includes/session.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** session.php 23 Apr 2003 07:21:03 -0000 1.1
--- session.php 23 Apr 2003 08:28:41 -0000 1.2
***************
*** 188,191 ****
--- 188,198 ----
return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]);
}
+
+ // Taken from phpBB2.
+ function decodeIP($encoded_ip)
+ {
+ $hexipbang = explode('.', chunk_split($encoded_ip, 2, '.'));
+ return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);
+ }
}
|