This commit is contained in:
Alexander Trofimov 2015-05-05 16:01:09 +03:00
commit dd5eda604c
8 changed files with 127 additions and 45 deletions

View file

@ -120,8 +120,8 @@
<data name="btnResetPassoword.Text" xml:space="preserve">
<value>Send Password Reset Email</value>
</data>
<data name="chkDontSaveAsMobile.Text" xml:space="preserve">
<value>Don't save as user mobile</value>
<data name="chkSaveAsMobile.Text" xml:space="preserve">
<value>Save as user mobile</value>
</data>
<data name="locEmailAddress.Text" xml:space="preserve">
<value>Email:</value>

View file

@ -45,7 +45,7 @@
<asp:Localize ID="locMobile" runat="server" meta:resourcekey="locMobile"></asp:Localize></td>
<td>
<asp:TextBox runat="server" ID="txtMobile" CssClass="TextBox200" />
<asp:CheckBox ID="chkDontSaveAsMobile" runat="server" Text="Don't save as mobile" meta:resourcekey="chkDontSaveAsMobile" Checked="True" />
<asp:CheckBox ID="chkSaveAsMobile" runat="server" Text="Save as mobile" meta:resourcekey="chkSaveAsMobile" Checked="False" />
<asp:RequiredFieldValidator ID="valMobile" runat="server" ErrorMessage="*" ControlToValidate="txtMobile" ValidationGroup="ResetUserPassword"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regexMobileValid" runat="server" ValidationExpression="^\+?\d+$" ValidationGroup="ResetUserPassword" ControlToValidate="txtMobile" ErrorMessage="Invalid Mobile Format"></asp:RegularExpressionValidator>
</td>

View file

@ -5,6 +5,7 @@ using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Providers.HostedSolution;
using WSP = WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal.ExchangeServer
{
@ -28,6 +29,15 @@ namespace WebsitePanel.Portal.ExchangeServer
txtEmailAddress.Text = user.PrimaryEmailAddress;
txtMobile.Text = user.MobilePhone;
var settings = ES.Services.System.GetSystemSettingsActive(WSP.SystemSettings.TWILIO_SETTINGS, false);
bool twilioEnabled = settings != null
&& !string.IsNullOrEmpty(settings.GetValueOrDefault(WSP.SystemSettings.TWILIO_ACCOUNTSID_KEY, string.Empty))
&& !string.IsNullOrEmpty(settings.GetValueOrDefault(WSP.SystemSettings.TWILIO_AUTHTOKEN_KEY, string.Empty))
&& !string.IsNullOrEmpty(settings.GetValueOrDefault(WSP.SystemSettings.TWILIO_PHONEFROM_KEY, string.Empty));
rbtnMobile.Visible = twilioEnabled;
}
protected void btnResetPassoword_Click(object sender, EventArgs e)
@ -54,7 +64,7 @@ namespace WebsitePanel.Portal.ExchangeServer
return;
}
if (chkDontSaveAsMobile.Checked == false)
if (chkSaveAsMobile.Checked)
{
OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID,
PanelRequest.AccountID);

View file

@ -148,13 +148,13 @@ namespace WebsitePanel.Portal.ExchangeServer {
protected global::System.Web.UI.WebControls.TextBox txtMobile;
/// <summary>
/// chkDontSaveAsMobile control.
/// chkSaveAsMobile 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 chkDontSaveAsMobile;
protected global::System.Web.UI.WebControls.CheckBox chkSaveAsMobile;
/// <summary>
/// valMobile control.