This commit is contained in:
Virtuworks 2013-01-07 13:34:11 -05:00
commit 3a297c89a9
6 changed files with 140 additions and 31 deletions

View file

@ -678,6 +678,12 @@ namespace WebsitePanel.EnterpriseServer
TaskManager.StartTask(taskId, "USER", "CHANGE_STATUS", user.Username); TaskManager.StartTask(taskId, "USER", "CHANGE_STATUS", user.Username);
TaskManager.ItemId = user.UserId; TaskManager.ItemId = user.UserId;
// update user packages
List<PackageInfo> packages = new List<PackageInfo>();
// Add the users package(s)
packages.AddRange(PackageController.GetPackages(userId));
try try
{ {
@ -699,20 +705,24 @@ namespace WebsitePanel.EnterpriseServer
List<UserInfo> children = GetUsers(userId, true); List<UserInfo> children = GetUsers(userId, true);
foreach (UserInfo child in children) foreach (UserInfo child in children)
{ {
result = ChangeUserStatusInternal(child.UserId, status); // Add the child users packages
if (result < 0) packages.AddRange(PackageController.GetPackages(child.UserId));
return result;
// change child user peers
List<UserInfo> childPeers = GetUserPeers(child.UserId);
foreach (UserInfo peer in childPeers)
{
result = ChangeUserStatusInternal(peer.UserId, status);
if (result < 0)
return result;
}
// change child account
result = ChangeUserStatusInternal(child.UserId, status);
if (result < 0)
return result;
} }
// update user packages
List<PackageInfo> packages = new List<PackageInfo>();
// his packages
packages.AddRange(PackageController.GetMyPackages(userId));
// children packages
packages.AddRange(PackageController.GetPackages(userId));
PackageStatus packageStatus = PackageStatus.Active; PackageStatus packageStatus = PackageStatus.Active;
switch (status) switch (status)
{ {

View file

@ -171,7 +171,7 @@ namespace WebsitePanel.Portal.ProviderControls
// Build url manually, EditUrl throws exception: module is Null // Build url manually, EditUrl throws exception: module is Null
// pid=Servers&mid=137&ctl=edit_platforminstaller&ServerID=1&Product=HeliconApe // pid=Servers&mid=137&ctl=edit_platforminstaller&ServerID=1&Product=HeliconApe
List<string> qsParts= new List<string>(); List<string> qsParts = new List<string>();
qsParts.Add("pid=Servers"); qsParts.Add("pid=Servers");
qsParts.Add("ctl=edit_platforminstaller"); qsParts.Add("ctl=edit_platforminstaller");
@ -180,6 +180,7 @@ namespace WebsitePanel.Portal.ProviderControls
qsParts.Add("WPIProduct=HeliconApe"); qsParts.Add("WPIProduct=HeliconApe");
InstallHeliconApeLink.Attributes["href"] = "Default.aspx?" + String.Join("&", qsParts.ToArray()); InstallHeliconApeLink.Attributes["href"] = "Default.aspx?" + String.Join("&", qsParts.ToArray());
ViewState["HeliconApeInitiallyEnabled"] = null;
} }
// //
@ -273,25 +274,24 @@ namespace WebsitePanel.Portal.ProviderControls
ActiveDirectoryIntegration.SaveSettings(settings); ActiveDirectoryIntegration.SaveSettings(settings);
// Helicon Ape // Helicon Ape
bool registerHeliconApeGlobbally = chkHeliconApeGlobalRegistration.Checked; if (null != ViewState["HeliconApeInitiallyEnabled"])
bool bHeliconApeInitiallyEnabled = false;
if (ViewState["HeliconApeInitiallyEnabled"] != null)
bHeliconApeInitiallyEnabled = (bool)ViewState["HeliconApeInitiallyEnabled"];
if (registerHeliconApeGlobbally != bHeliconApeInitiallyEnabled)
{ {
if (registerHeliconApeGlobbally) bool registerHeliconApeGlobbally = chkHeliconApeGlobalRegistration.Checked;
if (registerHeliconApeGlobbally != (bool)ViewState["HeliconApeInitiallyEnabled"])
{ {
ES.Services.WebServers.EnableHeliconApeGlobally(int.Parse(Request.QueryString["ServiceID"])); if (registerHeliconApeGlobbally)
{
ES.Services.WebServers.EnableHeliconApeGlobally(int.Parse(Request.QueryString["ServiceID"]));
}
else
{
ES.Services.WebServers.DisableHeliconApeGlobally(int.Parse(Request.QueryString["ServiceID"]));
}
} }
else
{
ES.Services.WebServers.DisableHeliconApeGlobally(int.Parse(Request.QueryString["ServiceID"]));
}
}
}
if (WDeployEnabledCheckBox.Checked) if (WDeployEnabledCheckBox.Checked)

View file

@ -52,6 +52,10 @@
<asp:RegularExpressionValidator ID="regexpTextValue" runat="server" <asp:RegularExpressionValidator ID="regexpTextValue" runat="server"
ControlToValidate="textValue" Text="!" ValidationGroup="wag" ControlToValidate="textValue" Text="!" ValidationGroup="wag"
Display="Dynamic" SetFocusOnError="True"></asp:RegularExpressionValidator> Display="Dynamic" SetFocusOnError="True"></asp:RegularExpressionValidator>
<asp:CustomValidator runat="server" ID="MysqlUsernameLengthValidator"
ControlToValidate="textValue" OnServerValidate="mysqlUsernameLen_OnServerValidate"
Display="Dynamic" SetFocusOnError="True" ValidationGroup="wag" Enabled="False"
Text="Mysql username can not be longer than 16 characters"></asp:CustomValidator>
</div> </div>
</div> </div>

View file

@ -1,4 +1,32 @@
using System; // 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.
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Web; using System.Web;
using System.Web.UI; using System.Web.UI;
@ -213,6 +241,15 @@ namespace WebsitePanel.Portal
textValue.Text = DefaultValue; textValue.Text = DefaultValue;
valPrefix.Text = ValuePrefix; valPrefix.Text = ValuePrefix;
valSuffix.Text = ValueSuffix; valSuffix.Text = ValueSuffix;
if (
(WellKnownTags & DeploymentParameterWellKnownTag.MySql) == DeploymentParameterWellKnownTag.MySql
&&
(WellKnownTags & DeploymentParameterWellKnownTag.DBUserName) == DeploymentParameterWellKnownTag.DBUserName
)
{
MysqlUsernameLengthValidator.Enabled = true;
}
} }
@ -248,5 +285,20 @@ namespace WebsitePanel.Portal
} }
protected void mysqlUsernameLen_OnServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = true;
// get entered database name with prefixes / suffixes
string value = GetParameterValue();
// check length
if (!string.IsNullOrEmpty(value) && value.Length <= 16)
return;
// validation failed
args.IsValid = false;
}
} }
} }

View file

@ -1,4 +1,32 @@
//------------------------------------------------------------------------------ // 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> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// //
@ -165,6 +193,15 @@ namespace WebsitePanel.Portal {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator regexpTextValue; protected global::System.Web.UI.WebControls.RegularExpressionValidator regexpTextValue;
/// <summary>
/// MysqlUsernameLengthValidator 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.CustomValidator MysqlUsernameLengthValidator;
/// <summary> /// <summary>
/// BooleanControl control. /// BooleanControl control.
/// </summary> /// </summary>

View file

@ -334,7 +334,13 @@ namespace WebsitePanel.Portal
protected void databaseMode_SelectedIndexChanged(object sender, EventArgs e) protected void databaseMode_SelectedIndexChanged(object sender, EventArgs e)
{ {
BindParameters(); // load parameters
List<DeploymentParameter> parameters = GetApplicationParameters();
if (parameters == null)
return;
BindDBPolicies(parameters);
BindParameters(parameters);
} }
private void BindParameters() private void BindParameters()