mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
parent
58a3cd7fef
commit
f8f86d89a4
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "remote/apiuser.hpp"
|
#include "remote/apiuser.hpp"
|
||||||
#include "remote/apiuser.tcpp"
|
#include "remote/apiuser.tcpp"
|
||||||
|
#include "base/dynamictype.hpp"
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
@ -38,3 +39,13 @@ bool ApiUser::CheckPassword(const String& password) const
|
|||||||
{
|
{
|
||||||
return password == GetPasswordRaw();
|
return password == GetPasswordRaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ApiUser::Ptr ApiUser::GetByClientCN(const String& cn)
|
||||||
|
{
|
||||||
|
BOOST_FOREACH(const ApiUser::Ptr& user, DynamicType::GetObjectsByType<ApiUser>()) {
|
||||||
|
if (user->GetClientCN() == cn)
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ApiUser::Ptr();
|
||||||
|
}
|
||||||
|
@ -38,6 +38,8 @@ public:
|
|||||||
String GetPassword(void) const;
|
String GetPassword(void) const;
|
||||||
void SetPassword(const String& password);
|
void SetPassword(const String& password);
|
||||||
bool CheckPassword(const String& password) const;
|
bool CheckPassword(const String& password) const;
|
||||||
|
|
||||||
|
static ApiUser::Ptr GetByClientCN(const String& cn);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ namespace icinga
|
|||||||
class ApiUser : DynamicObject
|
class ApiUser : DynamicObject
|
||||||
{
|
{
|
||||||
[config, protected] String password (PasswordRaw);
|
[config, protected] String password (PasswordRaw);
|
||||||
[config] String client_cn;
|
[config] String client_cn (ClientCN);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user