protected SitkaController(NebulaDbContext dbContext, ILogger <T> logger, KeystoneService keystoneService, IOptions <NebulaConfiguration> nebulaConfiguration) { _dbContext = dbContext; _logger = logger; _keystoneService = keystoneService; _nebulaConfiguration = nebulaConfiguration.Value; }
public static UserDto GetUserFromHttpContext(NebulaDbContext dbContext, HttpContext httpContext) { var claimsPrincipal = httpContext.User; if (!claimsPrincipal.Claims.Any()) { return(null); } var userGuid = Guid.Parse(claimsPrincipal.Claims.Single(c => c.Type == "sub").Value); var keystoneUser = Nebula.EFModels.Entities.User.GetByUserGuid(dbContext, userGuid); return(keystoneUser); }
private MailMessage GenerateUserCreatedEmail(string nebulaUrl, UserDto user, NebulaDbContext dbContext, SitkaSmtpClientService smtpClient) { var messageBody = $@"A new user has signed up to the {_nebulaConfiguration.PlatformLongName}: <br/><br/> {user.FullName} ({user.Email}) <br/><br/> As an administrator of the {_nebulaConfiguration.PlatformShortName}, you can assign them a role and associate them with a Billing Account by following <a href='{nebulaUrl}/users/{user.UserID}'>this link</a>. <br/><br/> {smtpClient.GetSupportNotificationEmailSignature()}"; var mailMessage = new MailMessage { Subject = $"New User in {_nebulaConfiguration.PlatformLongName}", Body = $"Hello,<br /><br />{messageBody}", }; mailMessage.To.Add(smtpClient.GetDefaultEmailFrom()); return(mailMessage); }
public RoleController(NebulaDbContext dbContext, ILogger <RoleController> logger, KeystoneService keystoneService, IOptions <NebulaConfiguration> nebulaConfiguration) : base(dbContext, logger, keystoneService, nebulaConfiguration) { }
public HomeController(NebulaDbContext context) { this.context = context; }
public FlightsController(NebulaDbContext context) { this.context = context; }
public DestinationsController(NebulaDbContext context) { this.context = context; }
public UserController(NebulaDbContext context, UserManager manager) { this.context = context; this.manager = manager; }
public SpaceshipsController(NebulaDbContext context) { this.context = context; }