Add BypassGuestPassword configuration

Used to bypass the password for local connections
This commit is contained in:
2019-07-21 21:28:28 +02:00
parent e8baee2d1e
commit 594e7eb1dd
2 changed files with 3 additions and 1 deletions

View File

@@ -13,5 +13,6 @@
public string LogFilePath { get; set; } = "log.txt";
public string Guest { get; set; } = "";
public bool BypassGuestPassword { get; set; } = false;
}
}

View File

@@ -1,4 +1,5 @@
using DearFTP.Utils;
using DearFTP.Utils.Extensions;
using System;
using System.Linq;
@@ -30,7 +31,7 @@ namespace DearFTP.Connection.Commands
user = configuration.Users.First(x => x.Name == guest);
}
if (!string.IsNullOrWhiteSpace(user.Password))
if (!string.IsNullOrWhiteSpace(user.Password) && !(session.RemoteIP.IsInternal() && configuration.Server.BypassGuestPassword))
{
stream.Send(ResponseCode.NeedPassword, "Please specify the password.");