From: Matteo Nastasi (mop) Date: Fri, 4 Jan 2013 09:08:32 +0000 (+0100) Subject: user ip address management and check fixed X-Git-Tag: v4.5.3~3 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=19608661d2c4cdd071374e5c18a0c031808f0f85;p=brisk.git user ip address management and check fixed --- diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index f8c9225..5ed3588 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -288,6 +288,18 @@ Copyright 2006-2012 Matteo Nasta
version '.$G_brisk_version.'

Copyright 2006-2012
Matteo Nastasi (aka mop)

'); +function addrtoipv4($addr) +{ + $ipv4addr_arr = explode(':' , $addr); + if (isset($ipv4addr_arr[3])) { + $ipv4addr = $ipv4addr_arr[3]; + } + else { + $ipv4addr = $addr; + } + return $ipv4addr; +} + function mop_flush() { for ($i = 0; $i < ob_get_level(); $i++) diff --git a/web/briskin5/index_wr.php b/web/briskin5/index_wr.php index 4c816fd..9f9764f 100644 --- a/web/briskin5/index_wr.php +++ b/web/briskin5/index_wr.php @@ -38,10 +38,12 @@ require_once("Obj/briskin5.phh"); /* * MAIN */ -function bin5_index_wr_main(&$bri, $remote_addr, $get, $post, $cookie) +function bin5_index_wr_main(&$bri, $remote_addr_full, $get, $post, $cookie) { GLOBAL $G_base, $G_dbasetype; + $remote_addr = addrtoipv4($remote_addr_full); + $curtime = time(); if ($bri == NULL) { return FALSE; diff --git a/web/index.php b/web/index.php index 9fa8101..d89a091 100644 --- a/web/index.php +++ b/web/index.php @@ -283,13 +283,8 @@ function index_main(&$room, $transp_type, &$header_out, $addr, $get, $post, $coo $room->garbage_manager(TRUE); /* try login */ - $ipv4addr_arr = explode(':' , $addr); - if (isset($ipv4addr_arr[3])) { - $ipv4addr = $ipv4addr_arr[3]; - } - else { - $ipv4addr = $addr; - } + + $ipv4addr = addrtoipv4($addr); if (($user = $room->add_user(&$sess, &$idx, $name, $pass_private, $ipv4addr, $cookie)) != FALSE) { $ACTION = "room"; if ($idx < 0) { diff --git a/web/index_wr.php b/web/index_wr.php index 14c7f79..9db78fc 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -79,10 +79,12 @@ $mlang_indwr = array( 'btn_backtotab' => array( 'it' => 'Torna ai tavoli.', ); -function index_wr_main(&$room, $remote_addr, $get, $post, $cookie) +function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie) { GLOBAL $G_shutdown, $G_black_list, $G_lang, $G_room_help, $G_room_about, $G_room_passwdhowto, $mlang_indwr; + $remote_addr = addrtoipv4($remote_addr_full); + log_load("index_wr.php"); if (($mesg = gpcs_var('mesg', $get, $post, $cookie)) === FALSE)