GNOME Bugzilla – Bug 502220
Catch ldap authentication error in new_account.php
Last modified: 2007-12-08 14:49:44 UTC
If you provide the wrong ldap credentials in the configuration file, the following fatal error will be thrown by PHP when executing new_account.php: Fatal error: Cannot use object of type PEAR_Error as array in /home/nachtarbeiter/gnomesvn/mango/www/new_account.php on line 67 The PEAR error that is raised in lib/ldap.php / lib/module.php and returned to www/new_account.php should be catched properly so that the user gets a nice error message instead of the php error, that does not really provide information about the real cause of the problem (wrong ldap credentials in config file).
Created attachment 100485 [details] [review] patch for www/new_account.php This patch catches the errors raised in lib/ldap.php and lib/modules.php and gives the user a nice error message instead of the php error. E.g. you get Error: LDAP authentication failed if you provide wrong ldap credentials in the config file.
I wondered about LDAP errors. That basically is a fatal error. IMO it would be nice not to check for such LDAP errors (connecting), and just throw some 'fatal error', let it be catched by something that would throw a general error page. But I guess the current Mango structure doesn't allow this.
Applied, thanks!