[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");
|
Log.WriteInfo("Find users nodes");
|
||||||
// find users node
|
// find users node
|
||||||
XmlNode nodeUsers = doc.SelectSingleNode("/FileZillaServer/Users");
|
XmlNode fzServerNode = doc.SelectSingleNode("/FileZillaServer");
|
||||||
|
XmlNode fzAccountsNode = fzServerNode.SelectSingleNode("/Users");
|
||||||
XmlElement nodeUser = doc.CreateElement("User");
|
if (fzAccountsNode == null)
|
||||||
if (nodeUsers != null) nodeUsers.AppendChild(nodeUser);
|
{
|
||||||
|
fzAccountsNode = doc.CreateElement("Users");
|
||||||
|
fzServerNode.AppendChild(fzAccountsNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
XmlElement fzAccountNode = doc.CreateElement("User");
|
||||||
|
fzAccountsNode.AppendChild(fzAccountNode);
|
||||||
// set properties
|
// set properties
|
||||||
nodeUser.SetAttribute("Name", account.Name);
|
fzAccountNode.SetAttribute("Name", account.Name);
|
||||||
SetOption(nodeUser, "Pass", MD5(account.Password));
|
SetOption(fzAccountNode, "Pass", MD5(account.Password));
|
||||||
SetOption(nodeUser, "Group", "");
|
SetOption(fzAccountNode, "Group", "");
|
||||||
SetOption(nodeUser, "Bypass server userlimit", "0");
|
SetOption(fzAccountNode, "Bypass server userlimit", "0");
|
||||||
SetOption(nodeUser, "User Limit", "0");
|
SetOption(fzAccountNode, "User Limit", "0");
|
||||||
SetOption(nodeUser, "IP Limit", "0");
|
SetOption(fzAccountNode, "IP Limit", "0");
|
||||||
SetOption(nodeUser, "Enabled", BoolToString(account.Enabled));
|
SetOption(fzAccountNode, "Enabled", BoolToString(account.Enabled));
|
||||||
SetOption(nodeUser, "Comments", "");
|
SetOption(fzAccountNode, "Comments", "");
|
||||||
SetOption(nodeUser, "ForceSsl", "0");
|
SetOption(fzAccountNode, "ForceSsl", "0");
|
||||||
|
|
||||||
// IP filter
|
// IP filter
|
||||||
XmlElement nodeIPFilter = doc.CreateElement("IpFilter");
|
XmlElement nodeIPFilter = doc.CreateElement("IpFilter");
|
||||||
nodeUser.AppendChild(nodeIPFilter);
|
fzAccountNode.AppendChild(nodeIPFilter);
|
||||||
|
|
||||||
XmlElement nodeDisallowed = doc.CreateElement("Disallowed");
|
XmlElement nodeDisallowed = doc.CreateElement("Disallowed");
|
||||||
nodeIPFilter.AppendChild(nodeDisallowed);
|
nodeIPFilter.AppendChild(nodeDisallowed);
|
||||||
|
@ -182,7 +187,7 @@ namespace WebsitePanel.Providers.FTP
|
||||||
|
|
||||||
// folder
|
// folder
|
||||||
XmlElement nodePermissions = doc.CreateElement("Permissions");
|
XmlElement nodePermissions = doc.CreateElement("Permissions");
|
||||||
nodeUser.AppendChild(nodePermissions);
|
fzAccountNode.AppendChild(nodePermissions);
|
||||||
|
|
||||||
XmlElement nodePermission = doc.CreateElement("Permission");
|
XmlElement nodePermission = doc.CreateElement("Permission");
|
||||||
nodePermissions.AppendChild(nodePermission);
|
nodePermissions.AppendChild(nodePermission);
|
||||||
|
@ -201,7 +206,7 @@ namespace WebsitePanel.Providers.FTP
|
||||||
|
|
||||||
// speed limits
|
// speed limits
|
||||||
XmlElement nodeSpeedLimits = doc.CreateElement("SpeedLimits");
|
XmlElement nodeSpeedLimits = doc.CreateElement("SpeedLimits");
|
||||||
nodeUser.AppendChild(nodeSpeedLimits);
|
fzAccountNode.AppendChild(nodeSpeedLimits);
|
||||||
nodeSpeedLimits.SetAttribute("DlType", "0");
|
nodeSpeedLimits.SetAttribute("DlType", "0");
|
||||||
nodeSpeedLimits.SetAttribute("DlLimit", "10");
|
nodeSpeedLimits.SetAttribute("DlLimit", "10");
|
||||||
nodeSpeedLimits.SetAttribute("ServerDlLimitBypass", "0");
|
nodeSpeedLimits.SetAttribute("ServerDlLimitBypass", "0");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue