Skip to content
Snippets Groups Projects
Commit bceab271 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

use correct error property for auth plugins, fixes #4374

Closes #4374

Merge request studip/studip!3179
parent 57dbc9c7
No related branches found
No related tags found
No related merge requests found
......@@ -535,7 +535,10 @@ class StudipAuthAbstract
*/
function isUsedUsername($username)
{
$this->error_msg = sprintf(_('Methode %s nicht implementiert!'), get_class($this) . '::isUsedUsername()');
$this->error_msg = sprintf(
_('Methode %s nicht implementiert!'),
__METHOD__
);
return false;
}
......@@ -551,7 +554,10 @@ class StudipAuthAbstract
*/
function isAuthenticated($username, $password)
{
$this->error = sprintf(_('Methode %s nicht implementiert!'), get_class($this) . '::isAuthenticated()');
$this->error_msg = sprintf(
_('Methode %s nicht implementiert!'),
__METHOD__
);
return false;
}
......
......@@ -188,18 +188,18 @@ class StudipAuthLdap extends StudipAuthAbstract
function isUsedUsername($username)
{
if (!$this->anonymous_bind) {
$this->error = _('Kann den Benutzernamen nicht überprüfen, anonymous_bind ist ausgeschaltet!');
$this->error_msg = _('Kann den Benutzernamen nicht überprüfen, anonymous_bind ist ausgeschaltet!');
return false;
}
if (!$this->doLdapConnect()) {
return false;
}
if (!($r = @ldap_bind($this->conn))) {
$this->error = _('Anonymer Bind fehlgeschlagen.') . $this->getLdapError();
$this->error_msg = _('Anonymer Bind fehlgeschlagen.') . $this->getLdapError();
return false;
}
if (!($result = @ldap_search($this->conn, $this->base_dn, $this->getLdapFilter($username), ['dn']))) {
$this->error = _('Anonymes Durchsuchen des LDAP Baumes fehlgeschlagen.') . $this->getLdapError();
$this->error_msg = _('Anonymes Durchsuchen des LDAP Baumes fehlgeschlagen.') . $this->getLdapError();
return false;
}
if (!ldap_count_entries($this->conn, $result)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment