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