Browse Source

Added enabled config around 'delete' for email.

tags/2.0.3
Teknikode 4 years ago
parent
commit
b6809d4390
1 changed files with 10 additions and 7 deletions
  1. 10
    7
      Teknik/Areas/Profile/Controllers/ProfileController.cs

+ 10
- 7
Teknik/Areas/Profile/Controllers/ProfileController.cs View File

@@ -339,13 +339,16 @@ namespace Teknik.Areas.Profile.Controllers
{
if (ModelState.IsValid)
{
// Delete Email
var app = new hMailServer.Application();
app.Connect();
app.Authenticate(Config.EmailConfig.Username, Config.EmailConfig.Password);
var domain = app.Domains.ItemByName[Config.EmailConfig.Domain];
var account = domain.Accounts.ItemByAddress[string.Format("{0}@{1}", User.Identity.Name, Config.EmailConfig.Domain)];
account.Delete();
if (Config.EmailConfig.Enabled)
{
// Delete Email
var app = new hMailServer.Application();
app.Connect();
app.Authenticate(Config.EmailConfig.Username, Config.EmailConfig.Password);
var domain = app.Domains.ItemByName[Config.EmailConfig.Domain];
var account = domain.Accounts.ItemByAddress[string.Format("{0}@{1}", User.Identity.Name, Config.EmailConfig.Domain)];
account.Delete();
}

// Delete Git
if (Config.GitConfig.Enabled)

Loading…
Cancel
Save