summaryrefslogtreecommitdiff
path: root/src/connectionhandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/connectionhandler.cc')
-rw-r--r--src/connectionhandler.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/connectionhandler.cc b/src/connectionhandler.cc
index 8b48c03..419556e 100644
--- a/src/connectionhandler.cc
+++ b/src/connectionhandler.cc
@@ -30,6 +30,7 @@
#include <stdio.h>
#include "hugin.hpp"
+#include "acl.h"
// Global ConnectionHandler.
ConnectionHandler connection_handler;
@@ -57,9 +58,13 @@ void ConnectionHandler::close(clientid_t clientid)
DEBUG(conn, "Removed connection\n");
}
-void ConnectionHandler::login(clientid_t clientid, std::string user, std::string password)
+void ConnectionHandler::login(clientid_t clientid,
+ const std::string& user,
+ const std::string& password)
{
- authlist[clientid] = (password == "hundemad");
+ ACL acl(CONFDIR"/users");
+ acl.load();
+ authlist[clientid] = acl.checkPassword(user, password);
DEBUG(conn, "Authentication %d\n", authlist[clientid]);
}