After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 502220 - Catch ldap authentication error in new_account.php
Catch ldap authentication error in new_account.php
Status: RESOLVED FIXED
Product: sysadmin
Classification: Infrastructure
Component: Mango (obsolete)
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Sysadmins
GNOME Sysadmins
Depends on: 502229
Blocks:
 
 
Reported: 2007-12-06 23:30 UTC by Patrick Fey
Modified: 2007-12-08 14:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for www/new_account.php (753 bytes, patch)
2007-12-06 23:33 UTC, Patrick Fey
committed Details | Review

Description Patrick Fey 2007-12-06 23:30:21 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).
Comment 1 Patrick Fey 2007-12-06 23:33:17 UTC
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.
Comment 2 Olav Vitters 2007-12-07 08:23:24 UTC
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.
Comment 3 Olav Vitters 2007-12-08 14:49:44 UTC
Applied, thanks!