Ejemplo n.º 1
0
        public async Task <ActionResult> Authorize(string code, string scope)
        {
            User user = _sessionHelper.Get("CurrentUser") as User;

            await _twitchIntegration.AuthorizeTwitch(user.ID, code);

            return(RedirectToAction("EditIntegrations", "Account"));
        }
Ejemplo n.º 2
0
        public ActionResult Rate(string userName)
        {
            var loggedInUser = _sessionHelper.Get("CurrentUser") as User;

            if (loggedInUser == null)
            {
                return(RedirectToAction("Login", "Login"));
            }

            var userToRate = _userManager.GetByUserName(userName);

            if (userToRate == null)
            {
                return(HttpNotFound());
            }

            UserRatingViewModel viewModel = new UserRatingViewModel
            {
                Ratings    = _ratingManager.GetAll(),
                UserRating = new UserRating
                {
                    UserBeingRatedID = userToRate.ID,
                    UserBeingRated   = userToRate,
                    RaterUserID      = loggedInUser.ID
                }
            };

            return(View(nameof(Rate), viewModel));
        }
Ejemplo n.º 3
0
        public ActionResult EditIntegrations()
        {
            User user = (User)_sessionHelper.Get("CurrentUser") as User;

            if (user == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            user = _userManger.GetById(user.ID);
            return(View(nameof(EditIntegrations), user.UserIntegrations));
        }
Ejemplo n.º 4
0
        public async Task <ActionResult> AuthorizeYoutube(string code)
        {
            var user = _sessionHelper.Get("CurrentUser") as User;

            if (user == null)
            {
                return(RedirectToAction("Login", "Login"));
            }
            await _youtubeIntegration.Authorize(user.ID, code);

            return(RedirectToAction("EditIntegrations", "Account"));
        }
Ejemplo n.º 5
0
        public ActionResult AuthorizeTwitter()
        {
            var currentUser = _sessionHelper.Get("CurrentUser") as T5.Brothership.Entities.Models.User;

            if (currentUser == null)
            {
                RedirectToAction("Login", "Login");
            }

            var appCreds = _twitterIntegration.GetCustomerCredentials();

#if DEBUG
            var redirectURL = "http://localhost:60920/Twitter/ValidateTwitterAuth";
#else
            var redirectURL = "http://" + Request.Url.Authority + "/Twitter/ValidateTwitterAuth";
#endif
            _authenticationContext = AuthFlow.InitAuthentication(appCreds, redirectURL);

            return(new RedirectResult(_authenticationContext.AuthorizationURL));
        }
        public IActionResult Index()
        {
            var publicRegisterSearchCriteria = SessionHelper.Get <PublicRegisterSearchCriteria>("publicRegisterSearchCriteria");
            var submitButtonType             = SessionHelper.GetString("publicRegisterSearchCriteria_submitButtonType");

            if (publicRegisterSearchCriteria != null && submitButtonType != null)
            {
                var publicRegisterLicenceListViewModel = publicRegisterViewModelBuilder.BuildEmptySearch();
                publicRegisterLicenceListViewModel.PublicRegisterSearchCriteria = publicRegisterSearchCriteria;

                publicRegisterLicenceListViewModel = HandlePostActions(publicRegisterLicenceListViewModel, submitButtonType);

                return(View(publicRegisterLicenceListViewModel));
            }
            else
            {
                var licences = publicRegisterViewModelBuilder.BuildEmptySearch();

                return(View(licences));
            }
        }
Ejemplo n.º 7
0
 public ActionResult Login()
 {
     return(_sessionHelper.Get("CurrentUser") == null ? (ActionResult)View(nameof(Login)) : RedirectToAction("Index", "Home"));
 }