In lib/sql/attrmap.php3, only register variables once. Go through $show_attrs and...
authorkkalev <kkalev>
Fri, 22 Apr 2005 13:21:31 +0000 (13:21 +0000)
committerkkalev <kkalev>
Fri, 22 Apr 2005 13:21:31 +0000 (13:21 +0000)
mappings for any attribute that a mapping does not exist.

dialup_admin/Changelog
dialup_admin/lib/sql/attrmap.php3

index 41fab0b..87bda0e 100644 (file)
@@ -9,6 +9,8 @@ Ver 1.80:
 * Count online users correctly (through a separate query) in user_finger.
 * Use the correct max results variable in lib/*/find.php3
 * In time2strclock also show days if applicable
+* In lib/sql/attrmap.php3, only register variables once. Go through $show_attrs and set default attribute
+  mappings for any attribute that a mapping does not exist.
 Ver 1.78:
 * Add a snmp_clearsession which can disconnect a user by using the Cisco AAA Session MIB
 * Add a configuration directive general_sessionclear_bin
index f7e5e8f..ae3a5cd 100644 (file)
@@ -9,15 +9,26 @@ if (isset($_SESSION['attrmap'])){
        $rev_attrmap =$_SESSION['rev_attrmap'];
        $attr_type = $_SESSION['attr_type'];
 }
-$ARR = file("$config[general_sql_attrmap]");
-foreach($ARR as $val){
-       $val=chop($val);
-       if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
-               continue;
-       list($type,$key,$v)=split('[[:space:]]+',$val);
-       $attrmap["$key"]=$v;
-       $rev_attrmap["$v"] = $key;
-       $attr_type["$key"]=$type;
+else{
+       $ARR = file("$config[general_sql_attrmap]");
+       foreach($ARR as $val){
+               $val=chop($val);
+               if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
+                       continue;
+               list($type,$key,$v)=split('[[:space:]]+',$val);
+               $attrmap["$key"]=$v;
+               $rev_attrmap["$v"] = $key;
+               $attr_type["$key"]=$type;
+       }
+       if (isset($show_attrs)){
+               foreach($show_attrs as $key => $desc){
+                       if ($attrmap["$key"] == ''){
+                               $attrmap["$key"] = $key;
+                               $attr_type["key"] = 'replyItem';
+                               $rev_attrmap["$key"] = $key;
+                       }
+               }
+       }
        if ($config[general_use_session] == 'yes'){
                session_register('attrmap');
                session_register('rev_attrmap');