twilio fix

This commit is contained in:
vfedosevich 2015-05-04 00:53:56 -07:00
parent d022ecf960
commit 70c772cd3b
8 changed files with 127 additions and 45 deletions

View file

@ -208,7 +208,14 @@ namespace WebsitePanel.WebDavPortal.Controllers
var user = WspContext.Services.Organizations.GetUserGeneralSettings(accessToken.ItemId, accessToken.AccountId);
if (string.IsNullOrEmpty(user.MobilePhone))
var settings = WspContext.Services.System.GetSystemSettingsActive(EnterpriseServer.SystemSettings.TWILIO_SETTINGS, false);
bool twilioEnabled = settings != null
&& !string.IsNullOrEmpty(settings.GetValueOrDefault(EnterpriseServer.SystemSettings.TWILIO_ACCOUNTSID_KEY, string.Empty))
&& !string.IsNullOrEmpty(settings.GetValueOrDefault(EnterpriseServer.SystemSettings.TWILIO_AUTHTOKEN_KEY, string.Empty))
&& !string.IsNullOrEmpty(settings.GetValueOrDefault(EnterpriseServer.SystemSettings.TWILIO_PHONEFROM_KEY, string.Empty));
if (string.IsNullOrEmpty(user.MobilePhone) || twilioEnabled == false)
{
var result = WspContext.Services.Organizations.SendResetUserPasswordPincodeEmail(accessToken.AccessTokenGuid, user.PrimaryEmailAddress);