This commit is contained in:
Alexander Trofimov 2015-05-28 09:20:31 +03:00
commit 1b5f9765d0
35 changed files with 8593 additions and 6066 deletions

View file

@ -195,4 +195,16 @@
<data name="lblPasswordResetLinkLifeSpan.Text" xml:space="preserve">
<value>Password Reset Link Life Span (hours):</value>
</data>
<data name="OwaSettings.Text" xml:space="preserve">
<value>Office Web Apps</value>
</data>
<data name="locEnableOwa.Text" xml:space="preserve">
<value>Enable OWA:</value>
</data>
<data name="chkEnableOwa.Text" xml:space="preserve">
<value>Yes</value>
</data>
<data name="locOwaUrl.Text" xml:space="preserve">
<value>OWA URL:</value>
</data>
</root>

View file

@ -38,83 +38,107 @@
<uc1:MailboxTabs ID="MailboxTabsId" runat="server" SelectedTab="edit_user" />
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<table>
<tr>
<td class="FormLabel150"> <asp:Localize ID="locUserPrincipalName" runat="server" meta:resourcekey="locUserPrincipalName" Text="Login Name:"></asp:Localize></td>
<td>
<asp:Label runat="server" ID="lblUserPrincipalName" />
<wsp:EmailAddress id="upn" runat="server" ValidationGroup="CreateMailbox"></wsp:EmailAddress>
<asp:DropDownList ID="ddlEmailAddresses" runat="server" CssClass="NormalTextBox"></asp:DropDownList>
</td>
<table>
<tr>
<td>
<asp:Button id="btnSetUserPrincipalName" runat="server" Text="Set Login" CssClass="Button1"
meta:resourcekey="btnSetUserPrincipalName" OnClick="btnSetUserPrincipalName_Click"></asp:Button>
</td>
<td>
<asp:CheckBox ID="chkInherit" runat="server" meta:resourcekey="chkInherit" Text="Services inherit Login Name" checked="true"/>
</td>
</tr>
<table>
<tr>
<td class="FormLabel150"> <asp:Localize ID="locUserPrincipalName" runat="server" meta:resourcekey="locUserPrincipalName" Text="Login Name:"></asp:Localize></td>
<td>
<asp:Label runat="server" ID="lblUserPrincipalName" />
<wsp:EmailAddress id="upn" runat="server" ValidationGroup="CreateMailbox"></wsp:EmailAddress>
<asp:DropDownList ID="ddlEmailAddresses" runat="server" CssClass="NormalTextBox"></asp:DropDownList>
</td>
<td>
<asp:Button id="btnSetUserPrincipalName" runat="server" Text="Set Login" CssClass="Button1"
meta:resourcekey="btnSetUserPrincipalName" OnClick="btnSetUserPrincipalName_Click"></asp:Button>
</td>
<td>
<asp:CheckBox ID="chkInherit" runat="server" meta:resourcekey="chkInherit" Text="Services inherit Login Name" checked="true"/>
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locDisplayName" runat="server" meta:resourcekey="locDisplayName" Text="Display Name: *"></asp:Localize></td>
<td>
<asp:TextBox ID="txtDisplayName" runat="server" CssClass="HugeTextBox200"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireDisplayName" runat="server" meta:resourcekey="valRequireDisplayName" ControlToValidate="txtDisplayName"
ErrorMessage="Enter Display Name" ValidationGroup="EditMailbox" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locDisplayName" runat="server" meta:resourcekey="locDisplayName" Text="Display Name: *"></asp:Localize></td>
<td>
<asp:TextBox ID="txtDisplayName" runat="server" CssClass="HugeTextBox200"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireDisplayName" runat="server" meta:resourcekey="valRequireDisplayName" ControlToValidate="txtDisplayName"
ErrorMessage="Enter Display Name" ValidationGroup="EditMailbox" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="FormLabel150" valign="top"><asp:Localize ID="locPassword" runat="server" meta:resourcekey="locPassword" Text="Password:"></asp:Localize></td>
<td>
<wsp:PasswordControl id="password" runat="server" ValidationGroup="ValidatePassword">
</wsp:PasswordControl>
<tr>
<td class="FormLabel150" valign="top"><asp:Localize ID="locPassword" runat="server" meta:resourcekey="locPassword" Text="Password:"></asp:Localize></td>
<td>
<wsp:PasswordControl id="password" runat="server" ValidationGroup="ValidatePassword">
</wsp:PasswordControl>
</td>
<td>
<asp:Button id="btnSetUserPassword" runat="server" Text="Set Password" CssClass="Button1"
meta:resourcekey="btnSetUserPassword" OnClick="btnSetUserPassword_Click" ValidationGroup="ValidatePassword"></asp:Button>
<asp:ValidationSummary ID="ValidationSummary2" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="ValidatePassword" />
<asp:Button id="btnResetUserPassword" runat="server" Text="Reset Password" CssClass="Button1"
meta:resourcekey="btnResetUserPassword" OnClick="btnResetUserPassword_Click"></asp:Button>
</td>
</tr>
<tr>
<td></td>
<td>
<asp:CheckBox ID="chkUserMustChangePassword" runat="server" meta:resourcekey="chkUserMustChangePassword" Text="User must change password at next login" />
<br />
<asp:CheckBox ID="chkDisable" runat="server" meta:resourcekey="chkDisable" Text="Disable User" />
<br />
<asp:CheckBox ID="chkLocked" runat="server" meta:resourcekey="chkLocked" Text="Lock User" />
<br />
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locFirstName" runat="server" meta:resourcekey="locFirstName" Text="First Name:"></asp:Localize></td>
<td>
<asp:TextBox ID="txtFirstName" runat="server" CssClass="TextBox100"></asp:TextBox>
&nbsp;
<asp:Localize ID="locInitials" runat="server" meta:resourcekey="locInitials" Text="Middle Initial:" />
<asp:TextBox ID="txtInitials" runat="server" MaxLength="6" CssClass="TextBox100"></asp:TextBox>
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locLastName" runat="server" meta:resourcekey="locLastName" Text="Last Name:"></asp:Localize></td>
<td>
<asp:TextBox ID="txtLastName" runat="server" CssClass="TextBox200"></asp:TextBox>
</td>
</tr>
<tr>
<td class="FormLabel150" valign="top"><asp:Localize ID="locSubscriberNumber" runat="server" meta:resourcekey="locSubscriberNumber" ></asp:Localize></td>
<td><asp:TextBox runat="server" ID="txtSubscriberNumber" CssClass="TextBox200"/></td>
</tr>
<tr>
<td class="FormLabel150" valign="top"><asp:Localize ID="locExternalEmailAddress" runat="server" meta:resourcekey="locExternalEmailAddress" ></asp:Localize></td>
<td><asp:TextBox runat="server" ID="txtExternalEmailAddress" CssClass="TextBox200"/></td>
</tr>
</table>
</td>
<td>
<asp:Button id="btnSetUserPassword" runat="server" Text="Set Password" CssClass="Button1"
meta:resourcekey="btnSetUserPassword" OnClick="btnSetUserPassword_Click" ValidationGroup="ValidatePassword"></asp:Button>
<asp:ValidationSummary ID="ValidationSummary2" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="ValidatePassword" />
<asp:Button id="btnResetUserPassword" runat="server" Text="Reset Password" CssClass="Button1"
meta:resourcekey="btnResetUserPassword" OnClick="btnResetUserPassword_Click"></asp:Button>
</td>
</tr>
<tr>
<td></td>
<td>
<asp:CheckBox ID="chkUserMustChangePassword" runat="server" meta:resourcekey="chkUserMustChangePassword" Text="User must change password at next login" />
<br />
<asp:CheckBox ID="chkDisable" runat="server" meta:resourcekey="chkDisable" Text="Disable User" />
<br />
<asp:CheckBox ID="chkLocked" runat="server" meta:resourcekey="chkLocked" Text="Lock User" />
<br />
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locFirstName" runat="server" meta:resourcekey="locFirstName" Text="First Name:"></asp:Localize></td>
<td>
<asp:TextBox ID="txtFirstName" runat="server" CssClass="TextBox100"></asp:TextBox>
&nbsp;
<asp:Localize ID="locInitials" runat="server" meta:resourcekey="locInitials" Text="Middle Initial:" />
<asp:TextBox ID="txtInitials" runat="server" MaxLength="6" CssClass="TextBox100"></asp:TextBox>
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locLastName" runat="server" meta:resourcekey="locLastName" Text="Last Name:"></asp:Localize></td>
<td>
<asp:TextBox ID="txtLastName" runat="server" CssClass="TextBox200"></asp:TextBox>
</td>
</tr>
<tr>
<td class="FormLabel150" valign="top"><asp:Localize ID="locSubscriberNumber" runat="server" meta:resourcekey="locSubscriberNumber" ></asp:Localize></td>
<td><asp:TextBox runat="server" ID="txtSubscriberNumber" CssClass="TextBox200"/></td>
</tr>
<tr>
<td class="FormLabel150" valign="top"><asp:Localize ID="locExternalEmailAddress" runat="server" meta:resourcekey="locExternalEmailAddress" ></asp:Localize></td>
<td><asp:TextBox runat="server" ID="txtExternalEmailAddress" CssClass="TextBox200"/></td>
</tr>
<asp:Panel ID="pnlThumbnailphoto" runat="server" HorizontalAlign="Right" Width="200px">
<div class="FormLabel150">
<asp:Localize ID="locThumbnailphoto" runat="server" meta:resourcekey="locThumbnailphoto" Text="Thumbnail photo:"></asp:Localize>
</div>
<asp:Image ID="imgThumbnailphoto" runat="server" />
<br />
<asp:FileUpload ID="upThumbnailphoto" ClientIDMode="Static" runat="server" Style="display: none;"
onchange="__doPostBack('<%= btnLoadThumbnailphoto.ClientID %>', '')" />
<asp:Button ID="btnLoadThumbnailphoto" runat="server" meta:resourcekey="btnLoadThumbnailphoto"
CssClass="CommandButton" Text="Load"
OnClientClick="$('#upThumbnailphoto').click(); return false;" />
<asp:Button ID="btnClearThumbnailphoto" runat="server" meta:resourcekey="btnClearThumbnailphoto"
CssClass="CommandButton" Text="Clear"
OnClick="btnClearThumbnailphoto_Click" />
</table>
</asp:Panel>
</td>
</tr>
</table>
<table>
<tr>
<td class="FormLabel150"><asp:Localize ID="locNotes" runat="server" meta:resourcekey="locNotes" Text="Notes:"></asp:Localize></td>
@ -282,8 +306,6 @@
</tr>
</table>
</asp:Panel>
<div class="FormFooterClean">
<wsp:ItemButtonPanel id="buttonPanel" runat="server" ValidationGroup="EditMailbox"
@ -293,6 +315,7 @@
</div>
</div>
</div>
</div>
</div>

View file

@ -33,6 +33,7 @@ using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.ResultObjects;
namespace WebsitePanel.Portal.HostedSolution
@ -47,12 +48,45 @@ namespace WebsitePanel.Portal.HostedSolution
BindSettings();
BindPicture();
MailboxTabsId.Visible = (PanelRequest.Context == "Mailbox");
UserTabsId.Visible = (PanelRequest.Context == "User");
if (GetLocalizedString("buttonPanel.OnSaveClientClick") != null)
buttonPanel.OnSaveClientClick = GetLocalizedString("buttonPanel.OnSaveClientClick");
}
else
{
if (upThumbnailphoto.HasFile)
SavePicture(upThumbnailphoto.FileBytes);
}
}
private void BindPicture()
{
try
{
// get settings
OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID,
PanelRequest.AccountID);
if ((user.AccountType== ExchangeAccountType.Mailbox) ||
(user.AccountType== ExchangeAccountType.Room) ||
(user.AccountType== ExchangeAccountType.SharedMailbox) ||
(user.AccountType== ExchangeAccountType.Equipment))
{
imgThumbnailphoto.Visible = true;
imgThumbnailphoto.ImageUrl = "~/DesktopModules/WebsitePanel/ThumbnailPhoto.ashx" + "?" + "ItemID=" + PanelRequest.ItemID +
"&AccountID=" + PanelRequest.AccountID;
}
else
{
imgThumbnailphoto.Visible = false;
}
}
catch { } // skip
}
private void BindSettings()
@ -450,5 +484,35 @@ namespace WebsitePanel.Portal.HostedSolution
"Context=" + ((PanelRequest.Context == "Mailbox") ? "Mailbox" : "User"),
"AccountID=" + PanelRequest.AccountID));
}
private void SavePicture(byte[] picture)
{
try
{
ResultObject result = ES.Services.ExchangeServer.SetPicture(
PanelRequest.ItemID, PanelRequest.AccountID,
picture);
if (!result.IsSuccess)
{
messageBox.ShowErrorMessage("ORGANIZATION_UPDATE_USER_SETTINGS");
return;
}
messageBox.ShowSuccessMessage("ORGANIZATION_UPDATE_USER_SETTINGS");
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("ORGANIZATION_UPDATE_USER_SETTINGS", ex);
}
BindPicture();
}
protected void btnClearThumbnailphoto_Click(object sender, EventArgs e)
{
SavePicture(null);
}
}
}

View file

@ -336,6 +336,60 @@ namespace WebsitePanel.Portal.HostedSolution {
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtExternalEmailAddress;
/// <summary>
/// pnlThumbnailphoto 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.Panel pnlThumbnailphoto;
/// <summary>
/// locThumbnailphoto 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.Localize locThumbnailphoto;
/// <summary>
/// imgThumbnailphoto 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.Image imgThumbnailphoto;
/// <summary>
/// upThumbnailphoto 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.FileUpload upThumbnailphoto;
/// <summary>
/// btnLoadThumbnailphoto 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.Button btnLoadThumbnailphoto;
/// <summary>
/// btnClearThumbnailphoto 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.Button btnClearThumbnailphoto;
/// <summary>
/// locNotes control.
/// </summary>

View file

@ -10,42 +10,44 @@
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="imgEditRDSCollection" SkinID="EnterpriseStorageSpace48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit RDS Collection"></asp:Localize>
-
<asp:Literal ID="litCollectionName" runat="server" Text="" />
</div>
<div class="FormContentRDS">
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<wsp:CollectionTabs id="tabs" runat="server" SelectedTab="rds_collection_edit_users" />
<wsp:CollapsiblePanel id="secRdsUsers" runat="server"
TargetControlID="panelRdsUsers" meta:resourcekey="secRdsUsers" Text="">
</wsp:CollapsiblePanel>
<asp:Panel runat="server" ID="panelRdsUsers">
<div style="padding: 10px;">
<wsp:CollectionUsers id="users" runat="server" />
</div>
</asp:Panel>
<div>
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Users Created:"></asp:Localize>
&nbsp;&nbsp;&nbsp;
<wsp:QuotaViewer ID="usersQuota" runat="server" QuotaTypeId="2" DisplayGauge="true" />
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="imgEditRDSCollection" SkinID="EnterpriseStorageSpace48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit RDS Collection"></asp:Localize>
-
<asp:Literal ID="litCollectionName" runat="server" Text="" />
</div>
<div class="FormContentRDS">
<asp:UpdatePanel runat="server" ID="messageUpdatePanel">
<ContentTemplate>
<wsp:SimpleMessageBox id="messageBox" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<wsp:CollectionTabs id="tabs" runat="server" SelectedTab="rds_collection_edit_users" />
<wsp:CollapsiblePanel id="secRdsUsers" runat="server"
TargetControlID="panelRdsUsers" meta:resourcekey="secRdsUsers" Text="">
</wsp:CollapsiblePanel>
<asp:Panel runat="server" ID="panelRdsUsers">
<div style="padding: 10px;">
<wsp:CollectionUsers id="users" runat="server" />
</div>
</asp:Panel>
<div>
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Users Created:"></asp:Localize>
&nbsp;&nbsp;&nbsp;
<wsp:QuotaViewer ID="usersQuota" runat="server" QuotaTypeId="2" DisplayGauge="true" />
</div>
<div class="FormFooterClean">
<wsp:ItemButtonPanel id="buttonPanel" runat="server" ValidationGroup="SaveRDSCollection"
OnSaveClick="btnSave_Click" OnSaveExitClick="btnSaveExit_Click" />
</div>
</div>
</div>
<div class="FormFooterClean">
<wsp:ItemButtonPanel id="buttonPanel" runat="server" ValidationGroup="SaveRDSCollection"
OnSaveClick="btnSave_Click" OnSaveExitClick="btnSaveExit_Click" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -26,7 +26,9 @@
// (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 AjaxControlToolkit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer;
@ -41,31 +43,18 @@ namespace WebsitePanel.Portal.RDS
protected void Page_Load(object sender, EventArgs e)
{
users.Module = Module;
users.Module = Module;
users.OnRefreshClicked -= OnRefreshClicked;
users.OnRefreshClicked += OnRefreshClicked;
if (!IsPostBack)
{
BindQuota();
var collectionUsers = ES.Services.RDS.GetRdsCollectionUsers(PanelRequest.CollectionID);
{
var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
var localAdmins = ES.Services.RDS.GetRdsCollectionLocalAdmins(PanelRequest.CollectionID);
foreach (var user in collectionUsers)
{
if (localAdmins.Select(l => l.AccountName).Contains(user.AccountName))
{
user.IsVIP = true;
}
else
{
user.IsVIP = false;
}
}
litCollectionName.Text = collection.DisplayName;
users.SetUsers(collectionUsers);
BindQuota();
users.BindUsers();
}
}
}
private void BindQuota()
{
@ -87,6 +76,17 @@ namespace WebsitePanel.Portal.RDS
}
}
private void OnRefreshClicked(object sender, EventArgs e)
{
((ModalPopupExtender)asyncTasks.FindControl("ModalPopupProperties")).Hide();
var users = (List<string>)sender;
if (users.Any())
{
messageBox.ShowErrorMessage("RDS_USERS_NOT_DELETED", new Exception(string.Join(", ", users)));
}
}
private bool SaveRdsUsers()
{
try

View file

@ -48,6 +48,15 @@ namespace WebsitePanel.Portal.RDS {
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litCollectionName;
/// <summary>
/// messageUpdatePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel messageUpdatePanel;
/// <summary>
/// messageBox control.
/// </summary>

View file

@ -126,6 +126,9 @@
<data name="btnCancel.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="btnCancelDeleteWarning.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="btnDelete.Text" xml:space="preserve">
<value>Delete</value>
</data>
@ -153,4 +156,10 @@
<data name="headerAddAccounts.Text" xml:space="preserve">
<value>Enabled Users</value>
</data>
<data name="headerDeleteWarning.Text" xml:space="preserve">
<value>Warning</value>
</data>
<data name="locDeleteWarning.Text" xml:space="preserve">
<value>Unable to remove the following user(s) since they are local admins&lt;br/&gt;or they were granted access to remote applications</value>
</data>
</root>

View file

@ -5,7 +5,7 @@
<ContentTemplate>
<div class="FormButtonsBarClean">
<asp:Button ID="btnAdd" runat="server" Text="Add..." CssClass="Button1" OnClick="btnAdd_Click" meta:resourcekey="btnAdd" />
<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" OnClientClick="ShowProgressDialog('Checking users ...');return true;" meta:resourcekey="btnDelete"/>
</div>
<asp:GridView ID="gvUsers" runat="server" meta:resourcekey="gvUsers" AutoGenerateColumns="False"
Width="600px" CssSelectorClass="NormalGridView" OnRowCommand="gvUsers_RowCommand"
@ -113,6 +113,41 @@
</div>
</asp:Panel>
<asp:Panel ID="DeleteWarningPanel" runat="server" CssClass="Popup" style="display:none">
<table class="Popup-Header" cellpadding="0" cellspacing="0">
<tr>
<td class="Popup-HeaderLeft"/>
<td class="Popup-HeaderTitle">
<asp:Localize ID="lcDeleteWarningHeader" runat="server" meta:resourcekey="headerDeleteWarning"></asp:Localize>
</td>
<td class="Popup-HeaderRight"/>
</tr>
</table>
<div class="Popup-Content">
<div class="Popup-Body">
<br />
<asp:UpdatePanel ID="deleteWarningUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<div class="Popup-Scroll" style="height:auto;">
<asp:Panel runat="server" ID="panelDeleteWarning">
<asp:Localize runat="server" ID="locDeleteWarning" Text="Unable to remove the following user(s) since they are local admins or<br/>they were granted access to remote applications" />
<br/>
<asp:Literal runat="server" ID="ltUsers" Text="" />
</asp:Panel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
</div>
<div class="FormFooter">
<asp:Button ID="btnCancelDeleteWarning" runat="server" CssClass="Button1" meta:resourcekey="btnCancelDeleteWarning" Text="Cancel" CausesValidation="false" />
</div>
</div>
</asp:Panel>
<asp:Button ID="btnDeleteWarningFake" runat="server" style="display:none;" />
<ajaxToolkit:ModalPopupExtender ID="DeleteWarningModal" runat="server" TargetControlID="btnDeleteWarningFake" PopupControlID="DeleteWarningPanel"
BackgroundCssClass="modalBackground" DropShadow="false" CancelControlID="btnCancelDeleteWarning"/>
<asp:Button ID="btnAddAccountsFake" runat="server" style="display:none;" />
<ajaxToolkit:ModalPopupExtender ID="AddAccountsModal" runat="server"
TargetControlID="btnAddAccountsFake" PopupControlID="AddAccountsPanel"

View file

@ -41,6 +41,7 @@ namespace WebsitePanel.Portal.RDS.UserControls
public partial class RDSCollectionUsers : WebsitePanelControlBase
{
public const string DirectionString = "DirectionString";
public event EventHandler OnRefreshClicked;
public bool ButtonAddEnabled
{
@ -100,9 +101,26 @@ namespace WebsitePanel.Portal.RDS.UserControls
protected void btnDelete_Click(object sender, EventArgs e)
{
List<OrganizationUser> selectedAccounts = GetGridViewUsers(SelectedState.Unselected);
if (PanelRequest.Ctl == "rds_collection_edit_users")
{
var lockedUsers = CheckDeletedUsers();
BindAccounts(selectedAccounts.ToArray(), false);
if (!lockedUsers.Any())
{
List<OrganizationUser> selectedAccounts = GetGridViewUsers(SelectedState.Unselected);
BindAccounts(selectedAccounts.ToArray(), false);
}
if (OnRefreshClicked != null)
{
OnRefreshClicked(lockedUsers, new EventArgs());
}
}
else
{
List<OrganizationUser> selectedAccounts = GetGridViewUsers(SelectedState.Unselected);
BindAccounts(selectedAccounts.ToArray(), false);
}
}
protected void btnAddSelected_Click(object sender, EventArgs e)
@ -134,9 +152,58 @@ namespace WebsitePanel.Portal.RDS.UserControls
return GetThemedImage("Exchange/" + imgName);
}
public List<string> CheckDeletedUsers()
{
var rdsUsers = GetGridViewUsers(SelectedState.Selected);
var localAdmins = ES.Services.RDS.GetRdsCollectionLocalAdmins(PanelRequest.CollectionID);
var organizationUsers = ES.Services.Organizations.GetOrganizationUsersPaged(PanelRequest.ItemID, null, null, null, 0, Int32.MaxValue).PageUsers;
var applicationUsers = ES.Services.RDS.GetApplicationUsers(PanelRequest.ItemID, PanelRequest.CollectionID, null);
var remoteAppUsers = organizationUsers.Where(x => applicationUsers.Select(a => a.Split('\\').Last().ToLower()).Contains(x.SamAccountName.Split('\\').Last().ToLower()));
var deletedUsers = new List<OrganizationUser>();
deletedUsers.AddRange(rdsUsers.Where(r => localAdmins.Select(l => l.AccountName.ToLower()).Contains(r.AccountName.ToLower())));
remoteAppUsers = remoteAppUsers.Where(r => !localAdmins.Select(l => l.AccountName.ToLower()).Contains(r.AccountName.ToLower()));
deletedUsers.AddRange(rdsUsers.Where(r => remoteAppUsers.Select(l => l.AccountName.ToLower()).Contains(r.AccountName.ToLower())));
deletedUsers = deletedUsers.Distinct().ToList();
return deletedUsers.Select(d => d.DisplayName).ToList();
}
public void BindUsers()
{
var collectionUsers = ES.Services.RDS.GetRdsCollectionUsers(PanelRequest.CollectionID);
var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
var localAdmins = ES.Services.RDS.GetRdsCollectionLocalAdmins(PanelRequest.CollectionID);
foreach (var user in collectionUsers)
{
if (localAdmins.Select(l => l.AccountName).Contains(user.AccountName))
{
user.IsVIP = true;
}
else
{
user.IsVIP = false;
}
}
SetUsers(collectionUsers);
}
protected void BindPopupAccounts()
{
OrganizationUser[] accounts = ES.Services.Organizations.GetOrganizationUsersPaged(PanelRequest.ItemID, null, null, null, 0, Int32.MaxValue).PageUsers;
OrganizationUser[] accounts;
if (PanelRequest.Ctl == "rds_collection_edit_users")
{
accounts = ES.Services.Organizations.GetOrganizationUsersPaged(PanelRequest.ItemID, null, null, null, 0, Int32.MaxValue).PageUsers;
}
else
{
accounts = ES.Services.RDS.GetRdsCollectionUsers(PanelRequest.CollectionID);
}
var localAdmins = ES.Services.RDS.GetRdsCollectionLocalAdmins(PanelRequest.CollectionID);
foreach (var user in accounts)

View file

@ -138,6 +138,87 @@ namespace WebsitePanel.Portal.RDS.UserControls {
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnCancelAdd;
/// <summary>
/// DeleteWarningPanel 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.Panel DeleteWarningPanel;
/// <summary>
/// lcDeleteWarningHeader 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.Localize lcDeleteWarningHeader;
/// <summary>
/// deleteWarningUpdatePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel deleteWarningUpdatePanel;
/// <summary>
/// panelDeleteWarning 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.Panel panelDeleteWarning;
/// <summary>
/// locDeleteWarning 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.Localize locDeleteWarning;
/// <summary>
/// ltUsers 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.Literal ltUsers;
/// <summary>
/// btnCancelDeleteWarning 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.Button btnCancelDeleteWarning;
/// <summary>
/// btnDeleteWarningFake 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.Button btnDeleteWarningFake;
/// <summary>
/// DeleteWarningModal control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::AjaxControlToolkit.ModalPopupExtender DeleteWarningModal;
/// <summary>
/// btnAddAccountsFake control.
/// </summary>

View file

@ -104,6 +104,22 @@
</table>
</asp:Panel>
<wsp:CollapsiblePanel ID="OwaSettings" runat="server" TargetControlID="PanelOwaSettings" meta:resourcekey="OwaSettings" Text="Office Web Apps" />
<asp:Panel ID="PanelOwaSettings" runat="server" Height="0" style="overflow:hidden;">
<table>
<tr>
<td class="SubHead"><asp:Localize ID="locEnableOwa" runat="server" meta:resourcekey="locEnableOwa" /></td>
<td class="Normal">
<asp:CheckBox ID="chkEnableOwa" runat="server" Text="Yes" meta:resourcekey="chkEnableOwa" />
</td>
</tr>
<tr>
<td class="SubHead" style="width:200px;"><asp:Localize ID="locOwaUrl" runat="server" meta:resourcekey="locOwaUrl" />
<td><asp:TextBox runat="server" ID="txtOwaUrl" Width="450px" /></td>
</tr>
</table>
</asp:Panel>
<wsp:CollapsiblePanel ID="TwilioSettings" runat="server" TargetControlID="PanelTwilioSettings" meta:resourcekey="TwilioSettings" Text="Webdav Portal" />
<asp:Panel ID="PanelTwilioSettings" runat="server" Height="0" style="overflow:hidden;">
<table>

View file

@ -167,6 +167,9 @@ namespace WebsitePanel.Portal
chkEnablePasswordReset.Checked = Utils.ParseBool(settings[WSP.SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY], false);
txtWebdavPortalUrl.Text = settings[WEBDAV_PORTAL_URL];
txtPasswordResetLinkLifeSpan.Text = settings[WSP.SystemSettings.WEBDAV_PASSWORD_RESET_LINK_LIFE_SPAN];
chkEnableOwa.Checked = Utils.ParseBool(settings[WSP.SystemSettings.WEBDAV_OWA_ENABLED_KEY], false);
txtOwaUrl.Text = settings[WSP.SystemSettings.WEBDAV_OWA_URL];
}
// Twilio portal
@ -264,6 +267,10 @@ namespace WebsitePanel.Portal
settings[WEBDAV_PORTAL_URL] = txtWebdavPortalUrl.Text;
settings[WSP.SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY] = chkEnablePasswordReset.Checked.ToString();
settings[WSP.SystemSettings.WEBDAV_PASSWORD_RESET_LINK_LIFE_SPAN] = txtPasswordResetLinkLifeSpan.Text;
settings[WSP.SystemSettings.WEBDAV_OWA_ENABLED_KEY] = chkEnableOwa.Checked.ToString();
settings[WSP.SystemSettings.WEBDAV_OWA_URL] = txtOwaUrl.Text;
result = ES.Services.System.SetSystemSettings(WSP.SystemSettings.WEBDAV_PORTAL_SETTINGS, settings);
if (result < 0)

View file

@ -300,6 +300,60 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtWebdavPortalUrl;
/// <summary>
/// OwaSettings control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel OwaSettings;
/// <summary>
/// PanelOwaSettings 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.Panel PanelOwaSettings;
/// <summary>
/// locEnableOwa 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.Localize locEnableOwa;
/// <summary>
/// chkEnableOwa 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.CheckBox chkEnableOwa;
/// <summary>
/// locOwaUrl 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.Localize locOwaUrl;
/// <summary>
/// txtOwaUrl 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.TextBox txtOwaUrl;
/// <summary>
/// TwilioSettings control.
/// </summary>

View file

@ -0,0 +1 @@
<%@ WebHandler Language="C#" CodeBehind="ThumbnailPhoto.ashx.cs" Class="WebsitePanel.Portal.ThumbnailPhoto" %>

View file

@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.ResultObjects;
namespace WebsitePanel.Portal
{
/// <summary>
/// Summary description for ThumbnailPhoto
/// </summary>
public class ThumbnailPhoto : IHttpHandler
{
public HttpContext Context = null;
public int Param(string key)
{
string val = Context.Request.QueryString[key];
if (val == null)
{
val = Context.Request.Form[key];
if (val == null) return 0;
}
int res = 0;
int.TryParse(val, out res);
return res;
}
public void ProcessRequest(HttpContext context)
{
Context = context;
int ItemID = Param("ItemID");
int AccountID = Param("AccountID");
BytesResult res = ES.Services.ExchangeServer.GetPicture(ItemID, AccountID);
if (res.IsSuccess)
{
context.Response.ContentType = "image/jpeg";
context.Response.BinaryWrite(res.Value);
}
else
{
context.Response.Redirect(PortalUtils.GetThemedImage("empty.gif"), true);
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
}

View file

@ -346,6 +346,9 @@
<Compile Include="SettingsUserPasswordRequestLetter.ascx.designer.cs">
<DependentUpon>SettingsUserPasswordRequestLetter.ascx</DependentUpon>
</Compile>
<Compile Include="ThumbnailPhoto.ashx.cs">
<DependentUpon>ThumbnailPhoto.ashx</DependentUpon>
</Compile>
<Compile Include="UserControls\SendToControl.ascx.cs">
<DependentUpon>SendToControl.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -7509,6 +7512,7 @@
<Content Include="VPSForPC\VirtualMachineSnapshotImage.ashx" />
<Content Include="VPS2012\VirtualMachineImage.ashx" />
<Content Include="VPS2012\VirtualMachineSnapshotImage.ashx" />
<Content Include="ThumbnailPhoto.ashx" />
<None Include="Web.config">
<SubType>Designer</SubType>
</None>