mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
parent
b55a313146
commit
b764993091
@ -73,12 +73,9 @@ class DbUserBackend extends UserBackend
|
|||||||
return ($row !== false) ? true : false;
|
return ($row !== false) ? true : false;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new AuthenticationException(
|
throw new AuthenticationException(
|
||||||
sprintf(
|
'Failed to authenticate user "%s" against backend "%s". An exception was thrown:',
|
||||||
'Failed to authenticate user "%s" against backend "%s". An exception was thrown:',
|
$user->getUsername(),
|
||||||
$user->getUsername(),
|
$this->getName(),
|
||||||
$this->getName()
|
|
||||||
),
|
|
||||||
0,
|
|
||||||
$e
|
$e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -125,4 +122,4 @@ class DbUserBackend extends UserBackend
|
|||||||
|
|
||||||
return ($row !== false) ? $row->count : 0;
|
return ($row !== false) ? $row->count : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,21 +68,17 @@ class LdapUserBackend extends UserBackend
|
|||||||
$result = $q->fetchRow();
|
$result = $q->fetchRow();
|
||||||
if (! isset($result)) {
|
if (! isset($result)) {
|
||||||
throw new AuthenticationException(
|
throw new AuthenticationException(
|
||||||
sprintf(
|
'No objects with objectClass="%s" in DN="%s" found.',
|
||||||
'No objects with objectClass="%s" in DN="%s" found.',
|
$this->userClass,
|
||||||
$this->userClass,
|
$this->conn->getDN()
|
||||||
$this->conn->getDN()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($result->{$this->userNameAttribute})) {
|
if (! isset($result->{$this->userNameAttribute})) {
|
||||||
throw new AuthenticationException(
|
throw new AuthenticationException(
|
||||||
sprintf(
|
'UserNameAttribute "%s" not existing in objectClass="%s"',
|
||||||
'UserNameAttribute "%s" not existing in objectClass="%s"',
|
$this->userNameAttribute,
|
||||||
$this->userNameAttribute,
|
$this->userClass
|
||||||
$this->userClass
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -121,11 +117,8 @@ class LdapUserBackend extends UserBackend
|
|||||||
} catch (AuthenticationException $e) {
|
} catch (AuthenticationException $e) {
|
||||||
// Authentication not possible
|
// Authentication not possible
|
||||||
throw new AuthenticationException(
|
throw new AuthenticationException(
|
||||||
sprintf(
|
'Authentication against backend "%s" not possible: ',
|
||||||
'Authentication against backend "%s" not possible: ',
|
$this->getName(),
|
||||||
$this->getName()
|
|
||||||
),
|
|
||||||
0,
|
|
||||||
$e
|
$e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -141,12 +134,9 @@ class LdapUserBackend extends UserBackend
|
|||||||
} catch (LdapException $e) {
|
} catch (LdapException $e) {
|
||||||
// Error during authentication of this specific user
|
// Error during authentication of this specific user
|
||||||
throw new AuthenticationException(
|
throw new AuthenticationException(
|
||||||
sprintf(
|
'Failed to authenticate user "%s" against backend "%s". An exception was thrown:',
|
||||||
'Failed to authenticate user "%s" against backend "%s". An exception was thrown:',
|
$user->getUsername(),
|
||||||
$user->getUsername(),
|
$this->getName(),
|
||||||
$this->getName()
|
|
||||||
),
|
|
||||||
0,
|
|
||||||
$e
|
$e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,9 @@
|
|||||||
|
|
||||||
namespace Icinga\Exception;
|
namespace Icinga\Exception;
|
||||||
|
|
||||||
use RuntimeException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown if an error occurs during authentication
|
* Exception thrown if an error occurs during authentication
|
||||||
*/
|
*/
|
||||||
class AuthenticationException extends RuntimeException
|
class AuthenticationException extends IcingaException
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user