Small fixes

This commit is contained in:
vfedosevich 2015-02-27 02:30:22 -08:00
parent e9c7b0868b
commit 789cd6ca11
5 changed files with 41 additions and 11 deletions

View file

@ -67,11 +67,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
private const string RdsGroupFormat = "rds-{0}-{1}"; private const string RdsGroupFormat = "rds-{0}-{1}";
private const string RdsModuleName = "RemoteDesktopServices"; private const string RdsModuleName = "RemoteDesktopServices";
private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\""; private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\"";
private const string WspAdministratorsGroupName = "WSP-Administrators"; private const string WspAdministratorsGroupName = "WSP-Org-Administrators";
private const string WspAdministratorsGroupDescription = "WSP Administrators"; private const string WspAdministratorsGroupDescription = "WSP Org Administrators";
private const string RdsServersOU = "RDSServers"; private const string RdsServersOU = "RDSServers";
private const string RDSHelpDeskComputerGroup = "Websitepanel-RDSHelpDesk-Computer"; private const string RDSHelpDeskComputerGroup = "Websitepanel-RDSHelpDesk-Computer";
private const string RDSHelpDeskAdminsGroup = "WSP-HelpdeskAdmins"; private const string RDSHelpDeskGroup = "WSP-HelpDeskAdministrators";
private const string RDSHelpDeskGroupDescription = "WSP Help Desk Administrators";
#endregion #endregion
@ -1178,14 +1179,31 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
private void AddHelpDeskAdminsGroupToLocalAdmins(Runspace runspace, string hostName) private void AddHelpDeskAdminsGroupToLocalAdmins(Runspace runspace, string hostName)
{ {
var helpDeskAdminsGroupPath = GetHelpDeskGroupPath(RDSHelpDeskAdminsGroup); var helpDeskAdminsGroupPath = GetHelpDeskGroupPath(RDSHelpDeskGroup);
DirectoryEntry groupEntry = null;
if (!ActiveDirectoryUtils.AdObjectExists(helpDeskAdminsGroupPath)) if (!ActiveDirectoryUtils.AdObjectExists(helpDeskAdminsGroupPath))
{ {
ActiveDirectoryUtils.CreateGroup(GetRootOUPath(), RDSHelpDeskAdminsGroup); ActiveDirectoryUtils.CreateGroup(GetRootOUPath(), RDSHelpDeskGroup);
groupEntry = ActiveDirectoryUtils.GetADObject(helpDeskAdminsGroupPath);
if (groupEntry.Properties.Contains("Description"))
{
groupEntry.Properties["Description"][0] = RDSHelpDeskGroupDescription;
}
else
{
groupEntry.Properties["Description"].Add(RDSHelpDeskGroupDescription);
}
groupEntry.CommitChanges();
}
if (groupEntry == null)
{
groupEntry = ActiveDirectoryUtils.GetADObject(helpDeskAdminsGroupPath);
} }
var groupEntry = ActiveDirectoryUtils.GetADObject(helpDeskAdminsGroupPath);
var samAccountName = ActiveDirectoryUtils.GetADObjectProperty(groupEntry, "sAMAccountName"); var samAccountName = ActiveDirectoryUtils.GetADObjectProperty(groupEntry, "sAMAccountName");
var scripts = new List<string> var scripts = new List<string>

View file

@ -47,8 +47,8 @@
<Columns> <Columns>
<asp:TemplateField HeaderText="gvCollectionName" SortExpression="DisplayName"> <asp:TemplateField HeaderText="gvCollectionName" SortExpression="DisplayName">
<ItemStyle Width="40%"></ItemStyle> <ItemStyle Width="40%"></ItemStyle>
<ItemTemplate> <ItemTemplate>
<asp:hyperlink id="lnkCollectionName" meta:resourcekey="lnkApps" runat="server" NavigateUrl='<%# GetCollectionEditUrl(Eval("Id").ToString()) %>'><%# Eval("DisplayName").ToString() %></asp:hyperlink> <asp:LinkButton id="lnkCollectionName" meta:resourcekey="lnkCollectionName" runat="server" CommandName="EditCollection" CommandArgument='<%# Eval("Id") %>' OnClientClick="ShowProgressDialog('Loading ...');return true;"><%# Eval("DisplayName").ToString() %></asp:LinkButton>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="gvServer"> <asp:TemplateField HeaderText="gvServer">

View file

@ -95,6 +95,10 @@ namespace WebsitePanel.Portal.RDS
ShowErrorMessage("REMOTE_DESKTOP_SERVICES_REMOVE_COLLECTION", ex); ShowErrorMessage("REMOTE_DESKTOP_SERVICES_REMOVE_COLLECTION", ex);
} }
} }
else if (e.CommandName == "EditCollection")
{
Response.Redirect(GetCollectionEditUrl(e.CommandArgument.ToString()));
}
} }
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)

View file

@ -9,7 +9,7 @@
<asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="Button1" OnClick="btnDelete_Click" meta:resourcekey="btnDelete"/> <asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="Button1" OnClick="btnDelete_Click" meta:resourcekey="btnDelete"/>
</div> </div>
<asp:GridView ID="gvApps" runat="server" meta:resourcekey="gvApps" AutoGenerateColumns="False" <asp:GridView ID="gvApps" runat="server" meta:resourcekey="gvApps" AutoGenerateColumns="False"
Width="600px" CssSelectorClass="NormalGridView" Width="600px" CssSelectorClass="NormalGridView" OnRowCommand="gvApps_RowCommand"
DataKeyNames="Alias"> DataKeyNames="Alias">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
@ -24,8 +24,8 @@
<asp:TemplateField meta:resourcekey="gvAppName" HeaderText="gvAppName"> <asp:TemplateField meta:resourcekey="gvAppName" HeaderText="gvAppName">
<ItemStyle Width="90%" Wrap="false"> <ItemStyle Width="90%" Wrap="false">
</ItemStyle> </ItemStyle>
<ItemTemplate> <ItemTemplate>
<asp:hyperlink id="lnkDisplayName" meta:resourcekey="lnkDisplayName" runat="server" Text='<%# Eval("DisplayName") %>' NavigateUrl='<%# GetCollectionUsersEditUrl(Eval("Alias").ToString()) %>'/> <asp:LinkButton id="lnkDisplayName" meta:resourcekey="lnkDisplayName" runat="server" Text='<%# Eval("DisplayName")%>' CommandName="EditApplication" CommandArgument='<%# Eval("Alias") %>' OnClientClick="ShowProgressDialog('Loading ...');return true;"/>
<asp:HiddenField ID="hfFilePath" runat="server" Value='<%# Eval("FilePath") %>'/> <asp:HiddenField ID="hfFilePath" runat="server" Value='<%# Eval("FilePath") %>'/>
<asp:HiddenField ID="hfRequiredCommandLine" runat="server" Value='<%# Eval("RequiredCommandLine") %>'/> <asp:HiddenField ID="hfRequiredCommandLine" runat="server" Value='<%# Eval("RequiredCommandLine") %>'/>
</ItemTemplate> </ItemTemplate>

View file

@ -254,6 +254,14 @@ namespace WebsitePanel.Portal.RDS.UserControls
BindPopupApps(); BindPopupApps();
} }
protected void gvApps_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EditApplication")
{
Response.Redirect(GetCollectionUsersEditUrl(e.CommandArgument.ToString()));
}
}
protected SortDirection Direction protected SortDirection Direction
{ {
get { return ViewState[DirectionString] == null ? SortDirection.Descending : (SortDirection)ViewState[DirectionString]; } get { return ViewState[DirectionString] == null ? SortDirection.Descending : (SortDirection)ViewState[DirectionString]; }