Ticket #5093: SyncAutobanLimitsBetweenServiceAndGUI.patch

File SyncAutobanLimitsBetweenServiceAndGUI.patch, 4.0 KB (added by eyebex, 10 years ago)
  • FileZilla

     
    16811681                >
    16821682            </File>
    16831683            <File
     1684                RelativePath=".\OptionLimits.h"
     1685                >
     1686            </File>
     1687            <File
    16841688                RelativePath="Options.h"
    16851689                >
    16861690            </File>
  • Interface/FileZilla

     
    20212021                >
    20222022            </File>
    20232023            <File
     2024                RelativePath="..\OptionLimits.h"
     2025                >
     2026            </File>
     2027            <File
    20242028                RelativePath="Options.h"
    20252029                >
    20262030            </File>
  • Interface/OptionsAutobanPage.cpp

     
    2222#include "Options.h"
    2323#include "OptionsPage.h"
    2424#include "OptionsAutobanPage.h"
     25#include "../OptionLimits.h"
    2526
    2627#if defined(_DEBUG) && !defined(MMGR)
    2728#define new DEBUG_NEW
     
    100101        return TRUE;
    101102
    102103    int attempts = _ttoi(m_attempts);
    103     if (attempts < 5 || attempts > 999)
     104    if (attempts < OPTION_AUTOBAN_ATTEMPTS_MIN || attempts > OPTION_AUTOBAN_ATTEMPTS_MAX)
    104105    {
    105         AfxMessageBox(_T("Attempts has to be a number between 5 and 999"));
     106        AfxMessageBox(_T("\"Attempts\" has to be a number between " QUOTEMACRO(OPTION_AUTOBAN_ATTEMPTS_MIN) " and " QUOTEMACRO(OPTION_AUTOBAN_ATTEMPTS_MAX) "."));
    106107        return FALSE;
    107108    }
    108109
  • OptionLimits.h

     
     1// FileZilla Server - a Windows ftp server
     2
     3// Copyright (C) 2002-2004 - Tim Kosse <tim.kosse@gmx.de>
     4
     5// This program is free software; you can redistribute it and/or
     6// modify it under the terms of the GNU General Public License
     7// as published by the Free Software Foundation; either version 2
     8// of the License, or (at your option) any later version.
     9
     10// This program is distributed in the hope that it will be useful,
     11// but WITHOUT ANY WARRANTY; without even the implied warranty of
     12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13// GNU General Public License for more details.
     14
     15// You should have received a copy of the GNU General Public License
     16// along with this program; if not, write to the Free Software
     17// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
     18
     19#if !defined(OPTION_LIMITS_INCLUDED)
     20#define OPTION_LIMITS_INCLUDED
     21
     22#if _MSC_VER > 1000
     23#pragma once
     24#endif // _MSC_VER > 1000
     25// OptionLimits.h : Header-Datei
     26//
     27#define QUOTE(x) #x
     28#define QUOTEMACRO(x) QUOTE(x)
     29
     30#define OPTION_AUTOBAN_ATTEMPTS_MIN 10
     31#define OPTION_AUTOBAN_ATTEMPTS_MAX 999
     32
     33#endif // OPTION_LIMITS_INCLUDED
  • Options.cpp

     
    2525#include "version.h"
    2626#include "tinyxml/tinyxml.h"
    2727#include "iputils.h"
     28#include "OptionLimits.h"
    2829
    2930#ifdef _DEBUG
    3031#undef THIS_FILE
     
    237238            value = 0;
    238239        break;
    239240    case OPTION_AUTOBAN_ATTEMPTS:
    240         if (value < 10)
    241             value = 10;
    242         if (value > 999)
    243             value = 999;
     241        if (value < OPTION_AUTOBAN_ATTEMPTS_MIN)
     242            value = OPTION_AUTOBAN_ATTEMPTS_MIN;
     243        if (value > OPTION_AUTOBAN_ATTEMPTS_MAX)
     244            value = OPTION_AUTOBAN_ATTEMPTS_MAX;
    244245        break;
    245246    case OPTION_AUTOBAN_BANTIME:
    246247        if (value < 1)
  • OptionTypes.h

     
    2222#if _MSC_VER > 1000
    2323#pragma once
    2424#endif // _MSC_VER > 1000
    25 // Options.h : Header-Datei
     25// OptionTypes.h : Header-Datei
    2626//
    2727#define OPTION_SERVERPORT 1
    2828#define OPTION_THREADNUM 2