Add BypassGuestPassword configuration
Used to bypass the password for local connections
This commit is contained in:
@@ -13,5 +13,6 @@
|
|||||||
public string LogFilePath { get; set; } = "log.txt";
|
public string LogFilePath { get; set; } = "log.txt";
|
||||||
|
|
||||||
public string Guest { get; set; } = "";
|
public string Guest { get; set; } = "";
|
||||||
|
public bool BypassGuestPassword { get; set; } = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using DearFTP.Utils;
|
using DearFTP.Utils;
|
||||||
|
using DearFTP.Utils.Extensions;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ namespace DearFTP.Connection.Commands
|
|||||||
|
|
||||||
user = configuration.Users.First(x => x.Name == guest);
|
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.");
|
stream.Send(ResponseCode.NeedPassword, "Please specify the password.");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user