X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2FObj%2Fbrisk.phh;h=5fe56c628593cc1e1f3b3554792653f40f8b5e48;hb=fd07ee7fe6eb1e0193fe878bfc49a9071f1ad8d2;hp=f221518bd8d83a54ab7d267f59792cdf8a4e663a;hpb=860fbd36c87a6da4a71ef5e42d661c555bb3b3d6;p=brisk.git diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index f221518..5fe56c6 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -2,7 +2,7 @@ /* * brisk - brisk.phh * - * Copyright (C) 2006-2014 Matteo Nastasi + * Copyright (C) 2006-2015 Matteo Nastasi * mailto: nastasi@alternativeoutput.it * matteo.nastasi@milug.org * web: http://www.alternativeoutput.it @@ -347,16 +347,35 @@ $G_PG_cons_n = 345; function ip2int($s) { - $v = ip2long($s); + return (ip2long($s)); +} + +function int2ip($i) +{ + return (long2ip($i)); +} + +function int2four($l) +{ if (PHP_INT_SIZE == 4) - return ($v); + return ($l); - return ( ($v & 0x80000000 ? 0xffffffff00000000 : 0x00) | $v ); + return ( ($l & 0x80000000 ? 0xffffffff00000000 : 0x00) | $l ); } -function int2ip($i) +function four2int($s) +{ + return ($s & 0xffffffff); +} + +function ip2four($s) +{ + return int2four( ip2int($s) ); +} + +function four2ip($i) { - return long2ip($i & 0xffffffff); + return int2ip( four2int($i) ); } function nickserv_msg($dt, $msg) { @@ -797,13 +816,13 @@ class Table { if ($sitted < PLAYERS_N) { switch ($this->auth_type) { case TABLE_AUTH_TY_CERT: - if ($user->is_cert()) + if ($user->is_cert() && !$user->is_appr()) $act = "sitcert"; else $act = 'resercert'; break; case TABLE_AUTH_TY_AUTH: - if ($user->is_auth()) + if ($user->is_auth() && !$user->is_appr()) $act = "sitreser"; else $act = 'reserved';