bug fixes

This commit is contained in:
vfedosevich 2013-11-15 14:18:50 +03:00
parent d9bbd4aa81
commit 203e61ade4
4 changed files with 50 additions and 67 deletions

View file

@ -145,6 +145,11 @@ namespace WebsitePanel.EnterpriseServer
{
Organization org = OrganizationController.GetOrganization(itemId);
if (org == null)
{
return false;
}
return CheckUsersDomainExistsInternal(itemId, org.PackageId);
}

View file

@ -5,7 +5,12 @@
<asp:Label ID="lblSpacesFolder" runat="server" meta:resourcekey="lblSpacesFolder" Text="User Packages Path:"></asp:Label>
</td>
<td width="100%">
<asp:TextBox runat="server" ID="txtFolder" Width="300px" CssClass="NormalTextBox"></asp:TextBox></td>
<asp:TextBox runat="server" ID="txtFolder" Width="300px" CssClass="NormalTextBox"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequiredFolder" runat="server" ControlToValidate="txtFolder"
ErrorMessage="*"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valExpressionFolder" runat="server" ValidationExpression="[a-zA-Z]:\\((\w(\s)?)+(\\)?)+"
ControlToValidate="txtFolder" ErrorMessage="*"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap>
@ -13,8 +18,10 @@
</td>
<td width="100%">
<asp:TextBox runat="server" ID="txtDomain" Width="300px" CssClass="NormalTextBox"></asp:TextBox>
<asp:RequiredFieldValidator ID="valDomain" runat="server" ControlToValidate="txtDomain"
<asp:RequiredFieldValidator ID="valRequiredDomain" runat="server" ControlToValidate="txtDomain"
ErrorMessage="*"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valExpressionDomain" runat="server" ValidationExpression="(http(s)?://)?([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"
ControlToValidate="txtDomain" ErrorMessage="*"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>

View file

@ -73,13 +73,13 @@ namespace WebsitePanel.Portal.ProviderControls
var drive = System.IO.Path.GetPathRoot(txtFolder.Text);
var folder = txtFolder.Text.Replace(drive, string.Empty);
if (!string.IsNullOrEmpty(drive) && !string.IsNullOrEmpty(folder))
{
settings["LocationDrive"] = drive.Split(':')[0];
settings["UsersHome"] = folder;
settings["UsersDomain"] = txtDomain.Text;
settings["EnableHardQuota"] = chkEnableHardQuota.Checked.ToString().ToLower();
}
var uri = new UriBuilder(txtDomain.Text).Uri;
var domain = uri.Host;
settings["LocationDrive"] = drive.Split(':')[0];
settings["UsersHome"] = folder;
settings["UsersDomain"] = domain;
settings["EnableHardQuota"] = chkEnableHardQuota.Checked.ToString().ToLower();
}
}
}

View file

@ -1,59 +1,3 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -86,6 +30,24 @@ namespace WebsitePanel.Portal.ProviderControls {
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtFolder;
/// <summary>
/// valRequiredFolder control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredFolder;
/// <summary>
/// valExpressionFolder control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator valExpressionFolder;
/// <summary>
/// lblDomain control.
/// </summary>
@ -105,13 +67,22 @@ namespace WebsitePanel.Portal.ProviderControls {
protected global::System.Web.UI.WebControls.TextBox txtDomain;
/// <summary>
/// valDomain control.
/// valRequiredDomain control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator valDomain;
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredDomain;
/// <summary>
/// valExpressionDomain control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator valExpressionDomain;
/// <summary>
/// chkEnableHardQuota control.