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.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
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
#
$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);
$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
$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");
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)){
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"];
if (!$res || !@da_sql_affected_rows($link,$res,$config))
echo "<b>Change failed for attribute $key</b><br>\n";
}
- $j++;
}
}
}