[workitem:225] Could not create FTP account in a vanilla fresh installation of FileZilla
This commit is contained in:
parent
d1b07ef269
commit
0ef2f7b808
1 changed files with 294 additions and 289 deletions
|
@ -154,25 +154,30 @@ namespace WebsitePanel.Providers.FTP
|
|||
|
||||
Log.WriteInfo("Find users nodes");
|
||||
// find users node
|
||||
XmlNode nodeUsers = doc.SelectSingleNode("/FileZillaServer/Users");
|
||||
|
||||
XmlElement nodeUser = doc.CreateElement("User");
|
||||
if (nodeUsers != null) nodeUsers.AppendChild(nodeUser);
|
||||
XmlNode fzServerNode = doc.SelectSingleNode("/FileZillaServer");
|
||||
XmlNode fzAccountsNode = fzServerNode.SelectSingleNode("/Users");
|
||||
if (fzAccountsNode == null)
|
||||
{
|
||||
fzAccountsNode = doc.CreateElement("Users");
|
||||
fzServerNode.AppendChild(fzAccountsNode);
|
||||
}
|
||||
|
||||
XmlElement fzAccountNode = doc.CreateElement("User");
|
||||
fzAccountsNode.AppendChild(fzAccountNode);
|
||||
// set properties
|
||||
nodeUser.SetAttribute("Name", account.Name);
|
||||
SetOption(nodeUser, "Pass", MD5(account.Password));
|
||||
SetOption(nodeUser, "Group", "");
|
||||
SetOption(nodeUser, "Bypass server userlimit", "0");
|
||||
SetOption(nodeUser, "User Limit", "0");
|
||||
SetOption(nodeUser, "IP Limit", "0");
|
||||
SetOption(nodeUser, "Enabled", BoolToString(account.Enabled));
|
||||
SetOption(nodeUser, "Comments", "");
|
||||
SetOption(nodeUser, "ForceSsl", "0");
|
||||
fzAccountNode.SetAttribute("Name", account.Name);
|
||||
SetOption(fzAccountNode, "Pass", MD5(account.Password));
|
||||
SetOption(fzAccountNode, "Group", "");
|
||||
SetOption(fzAccountNode, "Bypass server userlimit", "0");
|
||||
SetOption(fzAccountNode, "User Limit", "0");
|
||||
SetOption(fzAccountNode, "IP Limit", "0");
|
||||
SetOption(fzAccountNode, "Enabled", BoolToString(account.Enabled));
|
||||
SetOption(fzAccountNode, "Comments", "");
|
||||
SetOption(fzAccountNode, "ForceSsl", "0");
|
||||
|
||||
// IP filter
|
||||
XmlElement nodeIPFilter = doc.CreateElement("IpFilter");
|
||||
nodeUser.AppendChild(nodeIPFilter);
|
||||
fzAccountNode.AppendChild(nodeIPFilter);
|
||||
|
||||
XmlElement nodeDisallowed = doc.CreateElement("Disallowed");
|
||||
nodeIPFilter.AppendChild(nodeDisallowed);
|
||||
|
@ -182,7 +187,7 @@ namespace WebsitePanel.Providers.FTP
|
|||
|
||||
// folder
|
||||
XmlElement nodePermissions = doc.CreateElement("Permissions");
|
||||
nodeUser.AppendChild(nodePermissions);
|
||||
fzAccountNode.AppendChild(nodePermissions);
|
||||
|
||||
XmlElement nodePermission = doc.CreateElement("Permission");
|
||||
nodePermissions.AppendChild(nodePermission);
|
||||
|
@ -201,7 +206,7 @@ namespace WebsitePanel.Providers.FTP
|
|||
|
||||
// speed limits
|
||||
XmlElement nodeSpeedLimits = doc.CreateElement("SpeedLimits");
|
||||
nodeUser.AppendChild(nodeSpeedLimits);
|
||||
fzAccountNode.AppendChild(nodeSpeedLimits);
|
||||
nodeSpeedLimits.SetAttribute("DlType", "0");
|
||||
nodeSpeedLimits.SetAttribute("DlLimit", "10");
|
||||
nodeSpeedLimits.SetAttribute("ServerDlLimitBypass", "0");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue