23 #include "user_verifier.h" 25 #include <core/exception.h> 26 #include <config/config.h> 27 #include <logging/logger.h> 68 std::string userpath = std::string(
"/webview/users/") + user;
69 std::string confpass = config->
get_string(userpath.c_str());
71 if (confpass.find(
"!cleartext!") == 0) {
72 return (confpass.substr(11) == password);
77 (apr_password_validate(password, confpass.c_str()) == APR_SUCCESS);
79 #elif defined(HAVE_CRYPT) 84 char *crypted = crypt_r(password, confpass.c_str(), &cd);
86 char *crypted = crypt(password, confpass.c_str());
89 if (confpass == crypted) {
97 return (confpass == password);
Fawkes library namespace.
virtual ~WebviewUserVerifier()
Destructor.
virtual bool verify_user(const char *user, const char *password)
Verify a user.
Base class for exceptions in Fawkes.
Interface for configuration handling.
WebviewUserVerifier(fawkes::Configuration *config, fawkes::Logger *logger)
Constructor.
virtual std::string get_string(const char *path)=0
Get value from configuration which is of type string.