]> git.gsnw.org Git - m0n0chwall.git/commitdiff
Update the doc with 2GB, 4GB wrap mystery and make portal_allow attributes more readable
authorjdegraeve <jdegraeve@e36fee2c-cc09-0410-a7cc-ebac5c6737de>
Fri, 3 Mar 2006 16:30:17 +0000 (16:30 +0000)
committerjdegraeve <jdegraeve@e36fee2c-cc09-0410-a7cc-ebac5c6737de>
Fri, 3 Mar 2006 16:30:17 +0000 (16:30 +0000)
git-svn-id: https://svn.m0n0.ch/wall/trunk@95 e36fee2c-cc09-0410-a7cc-ebac5c6737de

captiveportal/index.php
captiveportal/radius_accounting.inc
phpconf/inc/radius.inc

index 29776955785e44a815cc135dd1dfd97a55912680..d6dbb725fde7e4d25ad412c3cf876a2b5faf4d3d 100755 (executable)
@@ -290,7 +290,10 @@ function portal_allow($clientip,$clientmac,$clientuser,$password = null, $attrib
 
     /* encode password in Base64 just in case it contains commas */
     $bpassword = base64_encode($password);
-    $cpdb[] = array(time(), $ruleno, $clientip, $clientmac, $clientuser, $sessionid, $bpassword, $attributes['session_timeout'], $attributes['idle_timeout'], $attributes['session_terminate_time']);
+    $cpdb[] = array(time(), $ruleno, $clientip, $clientmac, $clientuser, $sessionid, $bpassword,
+            $attributes['session_timeout'],
+            $attributes['idle_timeout'],
+            $attributes['session_terminate_time']);
 
     /* rewrite information to database */
     captiveportal_write_db($cpdb);
index 79adc173852f377ce716ee33b9ffc94f9f5d496e..a01cb32f91f41c9e0ddddc538a395cf3488654ab 100644 (file)
@@ -279,6 +279,13 @@ function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$radius
 
 function gigawords($bytes) {
 
+
+    /*
+     * RFC2866 Specifies a 32bit unsigned integer, so it should be 4294967295
+     * Note that most NAS actually wrap @ 32bit signed which means 2GB.
+     * The put_int function also is 32bit signed so we are forced to wrap @2GB
+     */
+
     // We use BCMath functions since normal integers don't work with so large numbers
     $gigawords = bcdiv( bcsub( $bytes, remainder($bytes) ) , 2147483647) ;
 
index c86df3a78416fcda84032dddc6dda22f659a8117..c1a6fc343943efc734efa566dec8446742992471 100644 (file)
@@ -542,10 +542,10 @@ class Auth_RADIUS extends PEAR {
                     }
                 }
 
-                if ($vendor == RADIUS_VENDOR_BAY) {
+                if ($vendor == 1584) {
 
                     switch ($attrv) {
-                    case RADIUS_BAY_CES_GROUP:
+                    case 102:
                         $this->attributes['ces_group'] = radius_cvt_string($datav);
                         break;
                     }