added: to 'ipban' winix function:

possibility to remove a ban (or all bans)
added: to SessionManager: sorting of the ban list (in the second thread)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@903 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-10-27 09:03:49 +00:00
parent 099dd55d0c
commit 9ef3736989
11 changed files with 113 additions and 9 deletions

View File

@@ -7,8 +7,13 @@
*
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "ipban.h"
#include "functions.h"
#include "core/sessionmanager.h"
@@ -28,15 +33,31 @@ bool IPBanFun::HasAccess()
}
void IPBanFun::MakePost()
{
}
void IPBanFun::MakeGet()
{
if( cur->request->IsParam(L"removeip") )
{
if( cur->request->ParamValue(L"removeip") == L"all" )
{
session_manager->ClearIPBanList();
}
else
{
AssignString(cur->request->ParamValue(L"removeip"), tmp_ip_str);
int ip = (int)inet_addr(tmp_ip_str.c_str());
session_manager->RemoveIPBan(ip);
}
system->RedirectToLastFunction();
}
}

View File

@@ -28,6 +28,10 @@ public:
void MakePost();
void MakeGet();
private:
std::string tmp_ip_str;
};

View File

@@ -49,6 +49,7 @@ private:
std::string pass_decrypted;
std::wstring pass_hashed;
std::wstring salt;
};