added: IP ban mechanism (not finished yet -- we need a winix function to remove a ban)

now after some incorrent login attempts your IP can be banned or blocked
       (see new config variables)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@902 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-10-27 07:44:26 +00:00
parent 53b4175d00
commit 099dd55d0c
54 changed files with 2691 additions and 1266 deletions

View File

@@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2011, Tomasz Sowa
* Copyright (c) 2011-2012, Tomasz Sowa
* All rights reserved.
*
*/
@@ -13,6 +13,7 @@
#include "cur.h"
#include "logmanipulators.h"
#include "templates/locale.h"
#include "textstream/textstream.h"
#define WINIX_SLOG_MAX_LOG_SIZE 10240
@@ -68,6 +69,11 @@ public:
SLog & operator<<(size_t s);
SLog & operator<<(double s);
SLog & operator<<(LogManipulators m);
SLog & operator<<(const PT::Date & date);
template<typename char_type, size_t stack_size, size_t heap_block_size>
SLog & operator<<(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & buf);
SLog & TranslateText(const char * str);
SLog & TranslateText(const wchar_t * str);
@@ -95,7 +101,7 @@ public:
private:
template<class LogParam>
SLog & PutLog(LogParam par);
SLog & PutLog(const LogParam & par);
Cur * cur;
Locale * locale;
@@ -111,8 +117,15 @@ SLog::TranslateTextHelper<RawType> T(const RawType & par)
}
template<typename char_type, size_t stack_size, size_t heap_block_size>
SLog & SLog::operator<<(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & buf)
{
return PutLog(buf);
}
template<class LogParam>
SLog & SLog::PutLog(LogParam par)
SLog & SLog::PutLog(const LogParam & par)
{
if( cur && cur->session )
cur->session->log_buffer << par;