account password column was removed

This commit is contained in:
vfedosevich 2015-04-16 03:12:44 -07:00
parent e97f71d30e
commit 3df70d70bf
6 changed files with 150 additions and 73 deletions

View file

@ -2389,7 +2389,7 @@ namespace WebsitePanel.EnterpriseServer
public static int AddExchangeAccount(int itemId, int accountType, string accountName,
string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder,
string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, string subscriberNumber)
string mailboxManagerActions, string samAccountName, int mailboxPlanId, string subscriberNumber)
{
SqlParameter outParam = new SqlParameter("@AccountID", SqlDbType.Int);
outParam.Direction = ParameterDirection.Output;
@ -2407,7 +2407,6 @@ namespace WebsitePanel.EnterpriseServer
new SqlParameter("@MailEnabledPublicFolder", mailEnabledPublicFolder),
new SqlParameter("@MailboxManagerActions", mailboxManagerActions),
new SqlParameter("@SamAccountName", samAccountName),
new SqlParameter("@AccountPassword", accountPassword),
new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId),
new SqlParameter("@SubscriberNumber", (string.IsNullOrEmpty(subscriberNumber) ? (object)DBNull.Value : (object)subscriberNumber))
);
@ -2592,7 +2591,7 @@ namespace WebsitePanel.EnterpriseServer
public static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType,
string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder,
string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, int archivePlanId, string subscriberNumber,
string mailboxManagerActions, string samAccountName, int mailboxPlanId, int archivePlanId, string subscriberNumber,
bool EnableArchiving)
{
SqlHelper.ExecuteNonQuery(
@ -2606,7 +2605,6 @@ namespace WebsitePanel.EnterpriseServer
new SqlParameter("@PrimaryEmailAddress", primaryEmailAddress),
new SqlParameter("@MailEnabledPublicFolder", mailEnabledPublicFolder),
new SqlParameter("@MailboxManagerActions", mailboxManagerActions),
new SqlParameter("@Password", string.IsNullOrEmpty(accountPassword) ? (object)DBNull.Value : (object)accountPassword),
new SqlParameter("@SamAccountName", samAccountName),
new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId),
new SqlParameter("@ArchivingMailboxPlanId", (archivePlanId < 1) ? (object)DBNull.Value : (object)archivePlanId),

View file

@ -1211,9 +1211,6 @@ namespace WebsitePanel.EnterpriseServer
if (account == null)
return null;
// decrypt password
account.AccountPassword = CryptoUtils.Decrypt(account.AccountPassword);
return account;
}
@ -1225,9 +1222,6 @@ namespace WebsitePanel.EnterpriseServer
if (account == null)
return null;
// decrypt password
account.AccountPassword = CryptoUtils.Decrypt(account.AccountPassword);
return account;
}
@ -1268,9 +1262,6 @@ namespace WebsitePanel.EnterpriseServer
if (account == null)
return null;
// decrypt password
account.AccountPassword = CryptoUtils.Decrypt(account.AccountPassword);
return account;
}
@ -1280,14 +1271,14 @@ namespace WebsitePanel.EnterpriseServer
{
return DataProvider.AddExchangeAccount(itemId, (int)accountType,
accountName, displayName, primaryEmailAddress, mailEnabledPublicFolder,
mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword), mailboxPlanId, (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim()));
mailboxManagerActions.ToString(), samAccountName, mailboxPlanId, (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim()));
}
private static void UpdateAccount(ExchangeAccount account)
{
DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName,
account.PrimaryEmailAddress, account.MailEnabledPublicFolder,
account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword, account.MailboxPlanId, account.ArchivingMailboxPlanId,
account.MailboxManagerActions.ToString(), account.SamAccountName, account.MailboxPlanId, account.ArchivingMailboxPlanId,
(string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim()),
account.EnableArchiving);
}
@ -1674,7 +1665,6 @@ namespace WebsitePanel.EnterpriseServer
mailEnabledPublicFolder,
mailboxManagerActions,
samAccountName,
CryptoUtils.Encrypt(accountPassword),
mailboxPlanId, archivePlanId,
(string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim()), EnableArchiving);
}
@ -1952,7 +1942,6 @@ namespace WebsitePanel.EnterpriseServer
account.AccountType = ExchangeAccountType.User;
account.MailEnabledPublicFolder = false;
account.AccountPassword = null;
UpdateAccount(account);
DataProvider.DeleteUserEmailAddresses(account.AccountId, account.PrimaryEmailAddress);
@ -2338,7 +2327,6 @@ namespace WebsitePanel.EnterpriseServer
}
// save account
account.AccountPassword = null;
UpdateAccount(account);
return 0;
@ -2562,7 +2550,6 @@ namespace WebsitePanel.EnterpriseServer
else account.MailboxManagerActions &= ~action;
// update account
account.AccountPassword = null;
UpdateAccount(account);
return 0;
@ -2626,6 +2613,7 @@ namespace WebsitePanel.EnterpriseServer
// add account
items["Account"] = account;
items["PswResetUrl"] = OrganizationController.GenerateUserPasswordResetLink(account.ItemId, account.AccountId);
items["AccountDomain"] = account.PrimaryEmailAddress.Substring(account.PrimaryEmailAddress.IndexOf("@") + 1);
items["DefaultDomain"] = org.DefaultDomain;
@ -3895,7 +3883,6 @@ namespace WebsitePanel.EnterpriseServer
// update account
account.DisplayName = displayName;
account.PrimaryEmailAddress = emailAddress;
account.AccountPassword = null;
UpdateAccount(account);
return 0;
@ -4218,7 +4205,6 @@ namespace WebsitePanel.EnterpriseServer
// update account
account.DisplayName = displayName;
account.AccountPassword = null;
UpdateAccount(account);
return 0;
@ -4434,7 +4420,6 @@ namespace WebsitePanel.EnterpriseServer
addressLists.ToArray());
// save account
account.AccountPassword = null;
UpdateAccount(account);
return 0;
@ -4997,7 +4982,6 @@ namespace WebsitePanel.EnterpriseServer
account.AccountName = accountName;
account.MailEnabledPublicFolder = true;
account.PrimaryEmailAddress = email;
account.AccountPassword = null;
UpdateAccount(account);
// register e-mail
@ -5049,7 +5033,6 @@ namespace WebsitePanel.EnterpriseServer
// update and save account
account.MailEnabledPublicFolder = false;
account.PrimaryEmailAddress = "";
account.AccountPassword = null;
UpdateAccount(account);
@ -5168,7 +5151,6 @@ namespace WebsitePanel.EnterpriseServer
{
// rename original folder
account.DisplayName = newFullName;
account.AccountPassword = null;
UpdateAccount(account);
// rename nested folders
@ -5383,7 +5365,6 @@ namespace WebsitePanel.EnterpriseServer
emailAddress);
// save account
account.AccountPassword = null;
UpdateAccount(account);
return 0;

View file

@ -1635,7 +1635,7 @@ namespace WebsitePanel.EnterpriseServer
DataProvider.DeleteExpiredAccessTokens();
}
private static string GenerateUserPasswordResetLink(int itemId, int accountId)
public static string GenerateUserPasswordResetLink(int itemId, int accountId)
{
string passwordResetUrlFormat = "account/password-reset/step-2";
@ -1838,7 +1838,7 @@ namespace WebsitePanel.EnterpriseServer
private static int AddOrganizationUser(int itemId, string accountName, string displayName, string email, string sAMAccountName, string accountPassword, string subscriberNumber)
{
return DataProvider.AddExchangeAccount(itemId, (int)ExchangeAccountType.User, accountName, displayName, email, false, string.Empty,
sAMAccountName, CryptoUtils.Encrypt(accountPassword), 0, subscriberNumber.Trim());
sAMAccountName, 0, subscriberNumber.Trim());
}
@ -2526,9 +2526,6 @@ namespace WebsitePanel.EnterpriseServer
if (account == null)
return null;
// decrypt password
account.AccountPassword = CryptoUtils.Decrypt(account.AccountPassword);
return account;
}
@ -2690,10 +2687,6 @@ namespace WebsitePanel.EnterpriseServer
account.IsVIP = isVIP;
//account.
if (!String.IsNullOrEmpty(password))
account.AccountPassword = CryptoUtils.Encrypt(password);
else
account.AccountPassword = null;
UpdateAccount(account);
UpdateAccountServiceLevelSettings(account);
@ -2847,10 +2840,6 @@ namespace WebsitePanel.EnterpriseServer
password);
//account.
if (!String.IsNullOrEmpty(password))
account.AccountPassword = CryptoUtils.Encrypt(password);
else
account.AccountPassword = null;
UpdateAccount(account);
@ -2875,7 +2864,7 @@ namespace WebsitePanel.EnterpriseServer
{
DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName,
account.PrimaryEmailAddress, account.MailEnabledPublicFolder,
account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword, account.MailboxPlanId, account.ArchivingMailboxPlanId,
account.MailboxManagerActions.ToString(), account.SamAccountName, account.MailboxPlanId, account.ArchivingMailboxPlanId,
(string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim()),
account.EnableArchiving);
}
@ -3112,7 +3101,7 @@ namespace WebsitePanel.EnterpriseServer
{
return DataProvider.AddExchangeAccount(itemId, (int)accountType,
accountName, displayName, primaryEmailAddress, mailEnabledPublicFolder,
mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword), mailboxPlanId, (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim()));
mailboxManagerActions.ToString(), samAccountName, mailboxPlanId, (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim()));
}
#region Additional Default Groups