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

use correct error property for auth plugins, fixes #4374

Closes #4374

Merge request studip/studip!3179
parent 2961e78d
No related branches found
No related tags found
No related merge requests found
...@@ -535,7 +535,10 @@ class StudipAuthAbstract ...@@ -535,7 +535,10 @@ class StudipAuthAbstract
*/ */
function isUsedUsername($username) 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; return false;
} }
...@@ -551,7 +554,10 @@ class StudipAuthAbstract ...@@ -551,7 +554,10 @@ class StudipAuthAbstract
*/ */
function isAuthenticated($username, $password) 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; return false;
} }
......
...@@ -188,18 +188,18 @@ class StudipAuthLdap extends StudipAuthAbstract ...@@ -188,18 +188,18 @@ class StudipAuthLdap extends StudipAuthAbstract
function isUsedUsername($username) function isUsedUsername($username)
{ {
if (!$this->anonymous_bind) { 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; return false;
} }
if (!$this->doLdapConnect()) { if (!$this->doLdapConnect()) {
return false; return false;
} }
if (!($r = @ldap_bind($this->conn))) { if (!($r = @ldap_bind($this->conn))) {
$this->error = _('Anonymer Bind fehlgeschlagen.') . $this->getLdapError(); $this->error_msg = _('Anonymer Bind fehlgeschlagen.') . $this->getLdapError();
return false; return false;
} }
if (!($result = @ldap_search($this->conn, $this->base_dn, $this->getLdapFilter($username), ['dn']))) { 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; return false;
} }
if (!ldap_count_entries($this->conn, $result)) { 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