From: Andreas Gohr Date: Wed, 5 Dec 2007 14:56:54 +0000 (+0100) Subject: catch a few more LDAP errors and display them in a nicer way X-Git-Tag: 0.7.1~27 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=22e2654edd759859ca0ec9f7e6b905d9325d709f;p=contagged catch a few more LDAP errors and display them in a nicer way darcs-hash:20071205145654-6e07b-5775495f3f5d527beec66ed368b6aceea42d3b65.gz --- diff --git a/entry.php b/entry.php index bb207ce..524bb54 100644 --- a/entry.php +++ b/entry.php @@ -89,8 +89,9 @@ function _fetchData($dn){ global $smarty; global $users; //contains the users for manager role - $sr = ldap_search($LDAP_CON,$dn,'(objectClass=inetOrgPerson)'); - if(!ldap_count_entries($LDAP_CON,$sr)){ + $sr = @ldap_search($LDAP_CON,$dn,'(objectClass=inetOrgPerson)'); + tpl_ldaperror(); + if(!@ldap_count_entries($LDAP_CON,$sr)){ return false; } $result = ldap_get_binentries($LDAP_CON, $sr); diff --git a/inc/functions.php b/inc/functions.php index bb24f23..33300c6 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -386,8 +386,9 @@ function ldap_queryabooks($filter,$types){ $result2 = array(); // public addressbook - $sr = ldap_list($LDAP_CON,$conf['publicbook'], - $filter,$types); + $sr = @ldap_list($LDAP_CON,$conf['publicbook'], + $filter,$types); + tpl_ldaperror(); $result1 = ldap_get_binentries($LDAP_CON, $sr); ldap_free_result($sr); @@ -396,6 +397,7 @@ function ldap_queryabooks($filter,$types){ $sr = @ldap_list($LDAP_CON,$conf['privatebook']. ','.$_SESSION['ldapab']['binddn'], $filter,$types); + tpl_ldaperror(); $result2 = ldap_get_binentries($LDAP_CON, $sr); } diff --git a/inc/template.php b/inc/template.php index 8ebe359..93095a1 100644 --- a/inc/template.php +++ b/inc/template.php @@ -97,7 +97,6 @@ function tpl_ldaperror($message=""){ if(!empty($message)){ $__LDAPERROR__ .= "($message)"; } - $__LDAPERROR__ .= '\n'; } $smarty->assign("LDAPERRORS",$__LDAPERROR__); } diff --git a/pix/ldaperror.png b/pix/ldaperror.png new file mode 100644 index 0000000..1fb7d19 Binary files /dev/null and b/pix/ldaperror.png differ diff --git a/styles/design.css b/styles/design.css index f23a280..aab3323 100644 --- a/styles/design.css +++ b/styles/design.css @@ -148,3 +148,20 @@ a.cloud_4 {font-size: 160%; } a.cloud_5 {font-size: 180%; } a.cloud_6 {font-size: 200%; } + +div.ldaperror { + border: 1px solid #c33; + background: #fcc url(../pix/ldaperror.png) 10px 10px no-repeat; + width: 50%; + position: absolute; + z-index: 555; + top: 20%; + left: 25%; + padding: 0.5em 0.5em 1em 80px; + height: auto !important; + height: 60px; + min-height: 60px; + opacity: 0.9; + cursor: pointer; +} + diff --git a/templates/header.tpl b/templates/header.tpl index 4939c97..224538e 100644 --- a/templates/header.tpl +++ b/templates/header.tpl @@ -28,9 +28,6 @@