Change the location of the sysadm server internal settings file (QSettings file), and add support for an optional sysadm.conf file which is loaded on server startup.

This commit is contained in:
Ken Moore
2016-02-22 12:25:52 -05:00
parent 9ebf28134e
commit 7e230c5f5f
6 changed files with 94 additions and 13 deletions

View File

@@ -4,6 +4,7 @@
// Written by: Ken Moore <ken@pcbsd.org> July 2015
// =================================
#include "WebServer.h"
#include "globals.h"
#define DEBUG 0
@@ -105,8 +106,7 @@ bool WebServer::allowConnection(QHostAddress addr){
if(!CONFIG->contains(key) ){ return true; } //not in the list
//Address on the list - see if the timeout has expired
QDateTime dt = CONFIG->value(key,QDateTime()).toDateTime();
int minblock = CONFIG->value("blacklist/RefuseMinutes",60).toInt();
if(dt.addSecs(minblock*60) < QDateTime::currentDateTime()){
if(dt.addSecs(BlackList_BlockMinutes*60) < QDateTime::currentDateTime()){
//This entry has timed out - go ahead and allow it
CONFIG->remove(key); //make the next connection check for this IP faster again
return true;