Esempio n. 1
0
        public async Task <IActionResult> SiteCssDialog()
        {
            var siteContext = _siteContextAccessor.GetContext();

            var cssSetting = await _siteManager.GetSiteSettingAsync(siteContext.SiteId, SiteSettingKeys.SITE_CSS);

            return(PartialView("/UI/Views/Public/SitePage/StyleSheetModal.cshtml", cssSetting));
        }
Esempio n. 2
0
        public async Task <IActionResult> Profile()
        {
            var siteContext = _siteContextAccessor.GetContext();

            var userId               = User.GetUserId();
            var siteSecurityPoolId   = siteContext.SecurityPoolId;
            var clientSecurityPoolId = siteContext.Client.SecurityPoolId;
            var thisUser             = await _userManager.GetUserAsync(userId);

            var userSiteRoles = await _poolManager.GetUserRolesAsync(siteSecurityPoolId, userId);

            var userClientRoles = await _poolManager.GetUserRolesAsync(clientSecurityPoolId, userId);

            var userCorpRoles = await _poolManager.GetUserRolesAsync("MyCompany-corp-pool", userId);

            //TODO: pull in user claims (permissions)
            var model = thisUser.ProjectTo <UserProfileViewModel>();

            model.SiteRoles   = userSiteRoles;
            model.ClientRoles = userClientRoles;
            model.CorpRoles   = userCorpRoles;

            var providers = await _userManager.GetWirelessProvidersAsync();

            model.WirelessProviderId = model.WirelessProviderId == null ? "" : providers.FirstOrDefault(p => p.Id == model.WirelessProviderId).Name;


            return(View(model));
        }
Esempio n. 3
0
        public IActionResult Index([FromQuery] string q)
        {
            var siteContext = _siteContextAccessor.GetContext();
            var siteOptions = siteContext.Options;

            if (siteOptions.ContainsKey("GoogleSiteId"))
            {
                return(GoogleSearch(q, siteOptions["GoogleSiteId"], siteOptions["GoogleSearchCode"]));
            }

            // else
            return(LuceneSearch(q, siteContext.SiteId));
        }
Esempio n. 4
0
 public NotifyMeSignUpController(ILogger <NotifyMeSignUpController> logger,
                                 UserGroupManager userGroupManager,
                                 NotificationManager notificationManager,
                                 UserContext userContext,
                                 SiteContextAccessor siteContextAccessor,
                                 PageMasterManager masterPageManager,
                                 IOptions <AegisOptions> aegisOptions) : base(logger)
 {
     _userGroupManager    = userGroupManager;
     _notificationManager = notificationManager;
     _userContext         = userContext;
     _siteContext         = siteContextAccessor.GetContext();
     _masterPageManager   = masterPageManager;
     _aegisOptions        = aegisOptions.Value;
 }
Esempio n. 5
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var siteContext = _siteContextAccessor.GetContext();
            var viewName    = "LuceneInput";

            ViewData["SiteUrl"] = siteContext.DefaultUrl;

            if (siteContext.Options.ContainsKey("GoogleSiteId"))
            {
                viewName = "GoogleInput";

                ViewData["GoogleSiteId"]     = siteContext.Options["GoogleSiteId"];
                ViewData["GoogleSearchCode"] = siteContext.Options["GoogleSearchCode"];
            }


            return(await Task.FromResult(View($"~/UI/Search/Views/{viewName}.cshtml")));
        }