Browse Source

Added checking of email/git accounts and re-adding them if they do not exist. (All for one, and one for all)

pull/29/head
Teknikode 6 years ago
parent
commit
3d5e2a359d
  1. 12
      Teknik/Areas/User/Controllers/UserController.cs

12
Teknik/Areas/User/Controllers/UserController.cs

@ -170,6 +170,18 @@ namespace Teknik.Areas.Users.Controllers @@ -170,6 +170,18 @@ namespace Teknik.Areas.Users.Controllers
db.Entry(user).State = EntityState.Modified;
db.SaveChanges();
// Let's double check their email and git accounts to make sure they exist
string email = UserHelper.GetUserEmailAddress(Config, username);
if (Config.EmailConfig.Enabled && !UserHelper.UserEmailExists(Config, email))
{
UserHelper.AddUserEmail(Config, email, model.Password);
}
if (Config.GitConfig.Enabled && !UserHelper.UserGitExists(Config, username))
{
UserHelper.AddUserGit(Config, username, model.Password);
}
bool twoFactor = false;
string returnUrl = model.ReturnUrl;
if (user.SecuritySettings.TwoFactorEnabled)

Loading…
Cancel
Save