* Set $user_info in lib/{ldap,sql}/user_info.php3 and only if the user exists and has personal info
* Show language attributes only if general_prefered_lang is not 'en'
* Set a few more personal information attributes to defaults in lib/sql/user_info.php3
* Fix a typo for department
* Set personal information attributes to defaults in lib/ldap/user_info.php3
+* Have adddress and home address in user personal info
+* Set $user_info in lib/{ldap,sql}/user_info.php3 and only if the user exists and has personal info
+* Show language attributes only if general_prefered_lang is not 'en'
Ver 1.30:
* Add limit of results returned in accounting.php3
* Fix a bug in time2strclock() in lib/functions.php3. Seconds ammount more than 9 would not show.
if (is_file("../lib/$config[general_lib_type]/user_info.php3")){
include("../lib/$config[general_lib_type]/user_info.php3");
- $user_info = 1;
if ($user_exists == 'no'){
echo <<<EOM
<title>user information page</title>
<br>
EOM;
-if ($user_info) print <<<EOM
+if ($user_info){
+ echo <<<EOM
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
$cn
</td>
</tr>
+EOM;
+ if ($config[general_prefered_lang] != 'en'){
+ echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>name ($config[general_prefered_lang_name])</b>
$cn_lang
</td>
</tr>
+EOM;
+ }
+ echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>department</b>
$ou
</td>
</tr>
+EOM;
+ if ($config[general_prefered_lang] != 'en'){
+ echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>department ($config[general_prefered_lang_name])</b>
$ou_lang
</td>
</tr>
+EOM;
+ }
+ echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>title</b>
$title
</td>
</tr>
+EOM;
+ if ($config[general_prefered_lang] != 'en'){
+ echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>title ($config[general_prefered_lang_name])</b>
$title_lang
</td>
</tr>
+EOM;
+ }
+ echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>address</b>
</td>
<td>
- $homeaddress
+ $address
</td>
</tr>
+EOM;
+ if ($config[general_prefered_lang] != 'en'){
+ echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>address ($config[general_prefered_lang_name])</b>
</td>
<td>
+ $address_lang
+ </td>
+ </tr>
+EOM;
+ }
+ echo <<<EOM
+ <tr>
+ <td align=center bgcolor="#d0ddb0">
+ <b>home address</b>
+ </td>
+ <td>
+ $homeaddress
+ </td>
+ </tr>
+EOM;
+ if ($config[general_prefered_lang] != 'en'){
+ echo <<<EOM
+ <tr>
+ <td align=center bgcolor="#d0ddb0">
+ <b>home address ($config[general_prefered_lang_name])</b>
+ </td>
+ <td>
$homeaddress_lang
</td>
</tr>
+EOM;
+ }
+ echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>phone</b>
</table>
EOM;
+}
?>
<tr> <td colspan=3 height=1></td></tr>
<tr> <td colspan=3>
$cn = '-';
$cn_lang = '-';
+$address = '-';
+$address_lang = '-';
$homeaddress = '-';
$homeaddress_lang = '-';
$fax = '-';
$user_exists = 'no';
else{
$user_exists = 'yes';
+ $user_info = 1;
unset($item_vals);
$k = init_decoder();
$cn = ($info[0]['cn'][0]) ? $info[0]['cn'][0] : '-';
$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] : '-';
+ $address_lang = $info[0]["postaladdress;lang-$config[general_prefered_lang]"][0];
+ $address_lang = decode_string("$address_lang",$k);
+ $address_lang = ($address_lang) ? $address_lang : '-';
$homeaddress = ($info[0]['homepostaladdress'][0]) ? $info[0]['homepostaladdress'][0] : '-';
$homeaddress_lang = $info[0]["homepostaladdress;lang-$config[general_prefered_lang]"][0];
$homeaddress_lang = decode_string("$homeaddress_lang", $k);
$cn = '-';
$cn_lang = '-';
+$address = '-';
+$address_lang = '-';
$homeaddress = '-';
$homeaddress_lang = '-';
$fax = '-';
$res = @da_sql_query($link,$config,
"SELECT * FROM $config[sql_user_info_table] WHERE UserName = '$login';");
if ($res){
- if (@da_sql_num_rows($res,$config))
+ if (@da_sql_num_rows($res,$config)){
$user_exists = 'yes';
+ $user_info = 1;
+ }
if (($row = @da_sql_fetch_array($res,$config))){
$cn = ($row[Name] != '') ? $row[Name] : '-';
$telephonenumber = ($row[WorkPhone] != '') ? $row[WorkPhone] : '-';