Include LDAP diagnostic error message when we have an LDAP error

This commit is contained in:
Deon George 2025-03-14 08:25:32 +11:00
parent b01f7d5baf
commit eb6e0b8d43

View File

@ -136,17 +136,14 @@ class HomeController extends Controller
// @todo when we create an entry, and it already exists, enable a redirect to it // @todo when we create an entry, and it already exists, enable a redirect to it
} catch (LdapRecordException $e) { } catch (LdapRecordException $e) {
$request->flash(); return Redirect::back()
->withInput()
switch ($x=$e->getDetailedError()->getErrorCode()) { ->withErrors(sprintf('%s: %s - %s: %s',
case 8: __('LDAP Server Error Code'),
return Redirect::to('/') $e->getDetailedError()->getErrorCode(),
->withInput() __($e->getDetailedError()->getErrorMessage()),
->withErrors(sprintf('%s: %s (%s)',__('LDAP Server Error Code'),$x,__($e->getDetailedError()->getErrorMessage()))); $e->getDetailedError()->getDiagnosticMessage(),
));
default:
abort(599,$e->getDetailedError()->getErrorMessage());
}
} }
return Redirect::to('/') return Redirect::to('/')
@ -345,17 +342,14 @@ class HomeController extends Controller
} }
} catch (LdapRecordException $e) { } catch (LdapRecordException $e) {
$request->flash(); return Redirect::to('/')
->withInput()
switch ($x=$e->getDetailedError()->getErrorCode()) { ->withErrors(sprintf('%s: %s - %s: %s',
case 8: __('LDAP Server Error Code'),
return Redirect::to('/') $e->getDetailedError()->getErrorCode(),
->withInput() __($e->getDetailedError()->getErrorMessage()),
->withErrors(sprintf('%s: %s (%s)',__('LDAP Server Error Code'),$x,__($e->getDetailedError()->getErrorMessage()))); $e->getDetailedError()->getDiagnosticMessage(),
));
default:
abort(599,$e->getDetailedError()->getErrorMessage());
}
} }
return Redirect::to('/') return Redirect::to('/')