From 01893985c3f0c484d5cf6bde1733da449a44623a Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 6 Oct 2003 15:59:49 +0000 Subject: [PATCH] changed default attributes to show in lists, better error handling for list settings --- lam/config/lam.conf_sample | 4 ++-- lam/lib/ldap.inc | 4 +++- lam/templates/lists/listgroups.php | 6 ++++-- lam/templates/lists/listhosts.php | 6 ++++-- lam/templates/lists/listusers.php | 6 ++++-- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/lam/config/lam.conf_sample b/lam/config/lam.conf_sample index ca476dbd..43fb2d04 100644 --- a/lam/config/lam.conf_sample +++ b/lam/config/lam.conf_sample @@ -43,7 +43,7 @@ maxMachine: 35000 # entries can either be predefined values (e.g. '#cn' or '#uid') # or individual ones (e.g. 'uid:User ID' or 'host:Host Name') # values have to be seperated by semicolons -userlistAttributes: #uid;#cn;#uidNumber;#gidNumber +userlistAttributes: #uid;#givenName;#sn;#uidNumber;#gidNumber # list of attributes to show in group list # entries can either be predefined values (e.g. '#cn' or '#gidNumber') @@ -55,7 +55,7 @@ grouplistAttributes: #cn;#gidNumber;#memberUID;#description # entries can either be predefined values (e.g. '#cn' or '#uid') # or individual ones (e.g. 'cn:Host Name') # values have to be seperated by semicolons -hostlistAttributes: #cn;#rid;#description;gidNumber:GID +hostlistAttributes: #cn;#description;#uidNumber;#gidNumber # maximum number of rows to show in user/group/host lists maxlistentries: 30 diff --git a/lam/lib/ldap.inc b/lam/lib/ldap.inc index 97890217..7137b875 100644 --- a/lam/lib/ldap.inc +++ b/lam/lib/ldap.inc @@ -157,7 +157,9 @@ class Ldap{ "uid" => _("Host username"), "cn" => _("Host name"), "rid" => _("RID (Windows UID)"), - "description" => _("Host description") + "description" => _("Host description"), + "uidnumber" => _("UID number"), + "gidnumber" => _("GID number") ); return true; } diff --git a/lam/templates/lists/listgroups.php b/lam/templates/lists/listgroups.php index 366b3bda..1bc38728 100644 --- a/lam/templates/lists/listgroups.php +++ b/lam/templates/lists/listgroups.php @@ -86,13 +86,15 @@ for ($i = 0; $i < sizeof($temp_array); $i++) { if (substr($temp_array[$i],0,1) == "#") { $attr = strtolower(substr($temp_array[$i],1)); $attr_array[$i] = $attr; - $desc_array[] = strtoupper($hash_table[$attr]); + if ($hash_table[$attr]) $desc_array[] = strtoupper($hash_table[$attr]); + else $desc_array[] = strtoupper($attr); } // if not predefined, the attribute is seperated by a ":" from description else { $attr = explode(":", $temp_array[$i]); $attr_array[$i] = $attr[0]; - $desc_array[$i] = strtoupper($attr[1]); + if ($attr[1]) $desc_array[$i] = strtoupper($attr[1]); + else $desc_array[$i] = strtoupper($attr[0]); } } diff --git a/lam/templates/lists/listhosts.php b/lam/templates/lists/listhosts.php index daed1343..5b05abc1 100644 --- a/lam/templates/lists/listhosts.php +++ b/lam/templates/lists/listhosts.php @@ -86,13 +86,15 @@ for ($i = 0; $i < sizeof($temp_array); $i++) { if (substr($temp_array[$i],0,1) == "#") { $attr = strtolower(substr($temp_array[$i],1)); $attr_array[$i] = $attr; - $desc_array[] = strtoupper($hash_table[$attr]); + if ($hash_table[$attr]) $desc_array[] = strtoupper($hash_table[$attr]); + else $desc_array[] = strtoupper($attr); } // if not predefined, the attribute is seperated by a ":" from description else { $attr = explode(":", $temp_array[$i]); $attr_array[$i] = $attr[0]; - $desc_array[$i] = strtoupper($attr[1]); + if ($attr[1]) $desc_array[$i] = strtoupper($attr[1]); + else $desc_array[$i] = strtoupper($attr[0]); } } diff --git a/lam/templates/lists/listusers.php b/lam/templates/lists/listusers.php index 02779063..0578cdce 100644 --- a/lam/templates/lists/listusers.php +++ b/lam/templates/lists/listusers.php @@ -131,13 +131,15 @@ for ($i = 0; $i < sizeof($temp_array); $i++) { if (substr($temp_array[$i],0,1) == "#") { $attr = strtolower(substr($temp_array[$i],1)); $attr_array[$i] = $attr; - $desc_array[] = strtoupper($hash_table[$attr]); + if ($hash_table[$attr]) $desc_array[] = strtoupper($hash_table[$attr]); + else $desc_array[] = strtoupper($attr); } // if not predefined, the attribute is seperated by a ":" from description else { $attr = explode(":", $temp_array[$i]); $attr_array[$i] = $attr[0]; - $desc_array[$i] = strtoupper($attr[1]); + if ($attr[1]) $desc_array[$i] = strtoupper($attr[1]); + else $desc_array[$i] = strtoupper($attr[0]); } }