]> git.entuzijast.net Git - freeradius-dialup-admin.git/commitdiff
* Add general_ld_library_path directive and set LD_LIBRARY_PATH accordingly (used...
authorkkalev <kkalev>
Fri, 18 Jan 2002 12:41:20 +0000 (12:41 +0000)
committerkkalev <kkalev>
Fri, 18 Jan 2002 12:41:20 +0000 (12:41 +0000)
  radaclient).
* Add general_finger_type directive to determine if we will use snmpfinger in user_finger.php3
* Fix a bug in config.php3 when we have a directive containing ':'
* Fix a bug in lib/ldap/change_attrs.php3 that did not allow changing more than one value of a
  multivalued attribute simultaneously.

Changelog
conf/admin.conf
conf/config.php3
htdocs/user_finger.php3
htdocs/user_test.php3
lib/ldap/change_attrs.php3
lib/sql/change_attrs.php3

index 11de3f00e65d4174825cf6b694b46cfc33eb245e..ef4b06f0122701fb3cb4644f5f3d088b4808bc84 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,10 @@
+Ver 1.29:
+* Add general_ld_library_path directive and set LD_LIBRARY_PATH accordingly (used in snmpfinger and
+  radaclient).
+* Add general_finger_type directive to determine if we will use snmpfinger in user_finger.php3
+* Fix a bug in config.php3 when we have a directive containing ':'
+* Fix a bug in lib/ldap/change_attrs.php3 that did not allow changing more than one value of a 
+  multivalued attribute simultaneously.
 Ver 1.28:
 * Make user_delete.php3 print something when a user is deleted
 * Cache nas hostname lookups in user_accounting
index a20566c51abcae023d1f4945eca8dc98192ca642..472829a29546fb2ea6a3a10fec74561cec004dc9 100644 (file)
@@ -18,6 +18,12 @@ general_lib_type: ldap
 general_user_edit_attrs_file: %{general_base_dir}/conf/user_edit.attrs
 general_sql_attrs_file: %{general_base_dir}/conf/sql.attrs
 general_default_file: %{general_base_dir}/conf/default.vals
+#general_ld_library_path: /usr/local/snmpd/lib
+#
+# can be 'snmp' (for snmpfinger) or empty to query the radacct table without first
+# querying the nas
+#
+general_finger_type: snmp
 general_snmpfinger_bin: %{general_base_dir}/bin/snmpfinger
 general_radclient_bin: %{general_radiusd_base_dir}/bin/radclient
 #
index 565eb286e9d9709d7204988879491f2a193ecc62..2ebc12229f0785026da39b8a51b2c96c2f6f6935 100644 (file)
@@ -4,7 +4,7 @@ foreach($ARR as $val) {
        $val=chop($val);
        if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
                continue;
-       list($key,$v)=split(":[[:space:]]*",$val);
+       list($key,$v)=split(":[[:space:]]*",$val,2);
        if (preg_match("/%\{(.+)\}/",$v,$matches)){
                $val=$config[$matches[1]];
                $v=preg_replace("/%\{$matches[1]\}/",$val,$v);
index a66c222fecc539d312ae3c66c5eb5419408d58a6..b8dc33d40bc765342cbee82507213f60aa64564c 100644 (file)
@@ -48,11 +48,14 @@ if ($link){
                $community_data = $config[$community];
                $server_name[$i] = $config[$name];
                $server_model[$i] = $config[$model];
-               $users=exec("$config[general_snmpfinger_bin] $name_data $community_data");
-               if (strlen($users))
-                       $extra = "AND UserName IN ($users)";
-               else
-                       $extra = "";
+               if ($config[general_ld_library_path] != '')
+                       putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]");
+               $extra = "";
+               if ($config[general_finger_type] == 'snmp'){
+                       $users=exec("$config[general_snmpfinger_bin] $name_data $community_data");
+                       if (strlen($users))
+                               $extra = "AND UserName IN ($users)";
+               }
                $search = @da_sql_query($link,$config,
                "SELECT DISTINCT UserName,AcctStartTime,FramedIPAddress,CallingStationId
                FROM $config[sql_accounting_table] WHERE
index e28bb68b3788161ae101e28df908141261a0053e..93da0a844463f4e8451c189aaabf7eb929f0d2c5 100644 (file)
@@ -65,6 +65,8 @@ if ($test_user == 1){
                $port = $config[general_radius_server_port];
        $tmp_file = tempnam("$config[general_tmp_dir]",'DA');
        $req=file($config[general_auth_request_file]);
+       if ($config[general_ld_library_path] != '')
+               putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]");
        $comm = $config[general_radclient_bin] . " $server:$port" . ' auth ' . $config[general_radius_server_secret] 
                . ' >' . $tmp_file;
        $fp = popen("$comm","w");
index 7a0ea523bcf45622834b38ed48e269f5cc20e843..23692bdd5872d8d62ced711ee3b375206252e107 100644 (file)
@@ -7,12 +7,14 @@
                        foreach($show_attrs as $key => $attr){
                                if ($attrmap["$key"] == 'none')
                                        continue;
-                               $i = $j = 0;
+                               $i = 0;
+                               $j = -1;
                                $name = $attrmap["$key"] . $i;
                
                                while (isset($$name)){
                                        $val = $$name;
                                        $i++;
+                                       $j++;
                                        $name = $attrmap["$key"] . $i;
 //
 //     if value is the same as the default and the corresponding attribute in ldap does not exist or
 //
                                        if (($val == $default_vals["$key"] || $val == '') && 
                                                isset($item_vals["$key"][$j]))
-                                               $del[$attrmap["$key"]] = $item_vals["$key"][$j];
+                                               $del[$attrmap["$key"]][] = $item_vals["$key"][$j];
 //
 //     else modify the ldap attribute
 //
                                        else{
                                                if (isset($item_vals["$key"][$j])){
-                                                       $mod[$attrmap["$key"]] = $item_vals["$key"][$j];
-                                                       $add_r[$attrmap["$key"]] = $val;
+                                                       $mod[$attrmap["$key"]][] = $item_vals["$key"][$j];
+                                                       $add_r[$attrmap["$key"]][] = $val;
                                                }
                                                else{
-                                                       $add_r[$attrmap["$key"]] = $val;
+                                                       $add_r[$attrmap["$key"]][] = $val;
                                                }
                                        }
-                                       $j++;
                                }
                        }
                        if (isset($mod)){
index 38c5baa90d84d69ed0d56d991713e36bc0bc40d5..de8f76e96d45e4c1a33a3ef7535f6d74f41dfb4f 100644 (file)
@@ -10,12 +10,14 @@ if ($link){
        foreach($show_attrs as $key => $desc){
                if ($attrmap["$key"] == 'none')
                        continue;
-               $i = $j = 0;
+               $i = 0;
+               $j = -1;
                $name = $attrmap["$key"] . $i;
 
                while(isset($$name)){
                        $val=$$name;
                        $i++;
+                       $j++;
                        $name = $attrmap["$key"] . $i;
 
                        $sql_attr=$attrmap["$key"];
@@ -49,7 +51,6 @@ if ($link){
                                if (!$res || !@da_sql_affected_rows($link,$res,$config))
                                        echo "<b>Change failed for attribute $key</b><br>\n";   
                        }
-                       $j++;
                }
        }
 }