user_info will not work in that case.
* Fix a small issue with the general_accounting_info_order
* Fix a problem in failed_logins when NASIPAddress is not set.
* Allow for multiple regular profile attributes in a user entry.
+* Allow for normal ldap user attributes to be utf8 encoded instead of ascii. Changing attribute values through
+ user_info will not work in that case.
Ver 1.59:
* Small html fixes in user_edit.php3 and password.php3
* Show number of failed logins in the last 7 days in the user admin page
general_prefered_lang: el
general_prefered_lang_name: Greek
#
+# Uncomment this if normal attributes (not the ;lang-xx ones) in ldap
+# are utf8 encoded.
+# Changing user attribute through user_info will *not* work in that case,
+# but you will at least be able to see user attributes.
+#
+#general_decode_normal_attributes: yes
+#
general_base_dir: /usr/local/dialup_admin
general_radiusd_base_dir: /usr/local/radiusd
general_domain: company.com
</head>
<?php
+if ($config[general_decode_normal_attributes] == 'yes'){
+ if (is_file("../lib/lang/$config[general_prefered_lang]/utf8.php3"))
+ include_once("../lib/lang/$config[general_prefered_lang]/utf8.php3");
+ else
+ include_once('../lib/lang/default/utf8.php3');
+ $k = init_decoder();
+ $decode_normal = 1;
+}
require('../lib/functions.php3');
require("../lib/$config[general_lib_type]/functions.php3");
if ($finger_info[$servers_num][$num]['callerid'] == '')
$finger_info[$servers_num][$num]['callerid'] = '-';
if ($user_info["$user"] == ''){
- $user_info["$user"] = get_user_info($link2,$user,$config);
+ $user_info["$user"] = get_user_info($link2,$user,$config,$decode_normal,$k);
if ($user_info["$user"] == '' || $user_info["$user"] == ' ')
$user_info["$user"] = 'Unknown User';
}
return $ds;
}
-function get_user_info($ds,$user,$config)
+function get_user_info($ds,$user,$config,$decode_normal,$k)
{
if ($ds){
$attrs = array('cn');
$sr=@ldap_search($ds,"$config[ldap_base]", "uid=" . $user,$attrs);
$info = @ldap_get_entries($ds, $sr);
$cn = $info[0]["cn"][0];
+ if ($cn != '' && $decode_normal == 1)
+ $cn = decode_string($cn,$k);
if ($cn == '')
$cn = '-';
return $cn;
$mail = '-';
$mailalt = '-';
+if ($config[general_decode_normal_attributes] == 'yes')
+ $decode_normal = 1;
+
$ds=@ldap_connect("$config[ldap_server]"); // must be a valid ldap server!
if ($ds) {
$r=@da_ldap_bind($ds,$config);
unset($item_vals);
$k = init_decoder();
$cn = ($info[0]['cn'][0]) ? $info[0]['cn'][0] : '-';
+ if ($decode_normal)
+ $cn = decode_string($cn,$k);
$cn_lang = $info[0]["cn;lang-$config[general_prefered_lang]"][0];
$cn_lang = decode_string("$cn_lang", $k);
$cn_lang = ($cn_lang) ? $cn_lang : '-';
$telephonenumber = ($info[0]['telephonenumber'][0]) ? $info[0]['telephonenumber'][0] : '-';
$homephone = ($info[0]['homephone'][0]) ? $info[0]['homephone'][0] : '-';
$address = ($info[0]['postaladdress'][0]) ? $info[0]['postaladdress'][0] : '-';
+ if ($decode_normal)
+ $address = decode_string($address,$k);
$address_lang = $info[0]["postaladdress;lang-$config[general_prefered_lang]"][0];
$address_lang = decode_string("$address_lang",$k);
$address_lang = ($address_lang) ? $address_lang : '-';
$fax = ($info[0]['facsimiletelephonenumber'][0]) ? $info[0]['facsimiletelephonenumber'][0] : '-';
$url = ($info[0]['labeleduri'][0]) ? $info[0]['labeleduri'][0] : '-';
$ou = $info[0]['ou'][0];
+ if ($decode_normal)
+ $ou = decode_string($ou,$k);
$ou_lang = $info[0]["ou;lang-$config[general_prefered_lang]"][0];
$ou_lang = decode_string("$ou_lang", $k);
$ou_lang = ($ou_lang) ? $ou_lang : '-';
$mail = ($info[0]['mail'][0]) ? $info[0]['mail'][0] : '-';
$title = ($info[0]['title'][0]) ? $info[0]['title'][0] : '-';
+ if ($decode_normal)
+ $title = decode_string($title,$k);
$title_lang = $info[0]["title;lang-$config[general_prefered_lang]"][0];
$title_lang = decode_string("$title_lang", $k);
$title_lang = ($title_lang) ? $title_lang : '-';