From e228f3c3cda1a0093f7bf5ac3dc3b465732d23b7 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 25 Jul 2008 13:38:37 +0000 Subject: [PATCH] Updated error messages before exit() statements git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12059 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index cf8ed7cc6..d674e0d4c 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -348,7 +348,9 @@ function ldap_init ($server, $base, $binddn='', $pass='') /* Sadly we've no proper return values here. Use the error message instead. */ if (!$ldap->success()){ - echo sprintf(_("FATAL: Error when connecting the LDAP. Server said '%s'."), $ldap->get_error()); + msg_dialog::display(_("Fatal error"), + sprintf(_("FATAL: Error when connecting the LDAP. Server said '%s'."), $ldap->get_error()), + FATAL_ERROR_DIALOG); exit(); } @@ -374,10 +376,9 @@ function process_htaccess ($username, $kerberos= FALSE) /* Look for entry or realm */ $ldap= $config->get_ldap_link(); if (!$ldap->success()){ - msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), "", LDAP_AUTH, ERROR_DIALOG)); - $smarty= get_smarty(); - $smarty->display(get_template_path('headers.tpl')); - echo "".session::get('errors').""; + msg_dialog::display(_("LDAP error"), + msgPool::ldaperror($ldap->get_error(), "", LDAP_AUTH)."

".session::get('errors'), + FATAL_ERROR_DIALOG)); exit(); } $ldap->search("(&(objectClass=gosaAccount)(|(uid=$username)(userPassword={$mode}$username)))", array("uid")); @@ -401,10 +402,9 @@ function ldap_login_user_htaccess ($username) /* Look for entry or realm */ $ldap= $config->get_ldap_link(); if (!$ldap->success()){ - msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), "", LDAP_AUTH, FATAL_ERROR_DIALOG)); - $smarty= get_smarty(); - $smarty->display(get_template_path('headers.tpl')); - echo "".session::get('errors').""; + msg_dialog::display(_("LDAP error"), + msgPool::ldaperror($ldap->get_error(), "", LDAP_AUTH)."

".session::get('errors'), + FATAL_ERROR_DIALOG)); exit(); } $ldap->search("(&(objectClass=gosaAccount)(uid=$username))", array("uid")); @@ -439,10 +439,9 @@ function ldap_login_user ($username, $password) /* look through the entire ldap */ $ldap = $config->get_ldap_link(); if (!$ldap->success()){ - msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error()), FATAL_ERROR_DIALOG); - $smarty= get_smarty(); - $smarty->display(get_template_path('headers.tpl')); - echo "".session::get('errors').""; + msg_dialog::display(_("LDAP error"), + msgPool::ldaperror($ldap->get_error(), "", LDAP_AUTH)."

".session::get('errors'), + FATAL_ERROR_DIALOG)); exit(); } $ldap->cd($config->current['BASE']); -- 2.30.2