コード例 #1
0
        //
        // GET: /Settings/
        public ActionResult Index()
        {
            ViewBag.Version = VersionUtil.GetFullVersionString();
            ServiceAvailability.Reload();

            return(View(new SettingsViewModel(Settings.ActiveSettings)));
        }
コード例 #2
0
        public ActionResult LogOn(LogOnModel model, string returnUrl)
        {
            if (ModelState.IsValid)
            {
                if (MembershipService.ValidateUser(model.UserName, model.Password))
                {
                    FormsService.SignIn(model.UserName, model.RememberMe);
                    ServiceAvailability.Reload();
                    Log.Debug("User {0} logged in from host {1}", model.UserName, Request.UserHostAddress);
                    if (Url.IsLocalUrl(returnUrl))
                    {
                        return(Redirect(returnUrl));
                    }
                    else
                    {
                        return(RedirectToAction("Index", "Home"));
                    }
                }
                else
                {
                    ModelState.AddModelError("", FormStrings.UsernamePasswordIncorrect);
                }
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
コード例 #3
0
        // **************************************
        // URL: /Account/LogOff
        // **************************************
        public ActionResult LogOff()
        {
            Log.Debug("User {0} logged out", HttpContext.User.Identity.Name);
            FormsService.SignOut();
            ServiceAvailability.Reload();

            return(RedirectToAction("Index", "Home"));
        }
コード例 #4
0
 public ActionResult Services(ServiceAddressesViewModel model)
 {
     Configuration.WebMediaPortal.MASUrl          = model.MAS;
     Configuration.WebMediaPortal.TASUrl          = model.TAS;
     Configuration.WebMediaPortal.ServiceUsername = model.Username;
     Configuration.WebMediaPortal.ServicePassword = model.Password;
     Configuration.Save();
     Connections.SetUrls(model.MAS, model.TAS);
     Log.Info("WebMediaPortal version {0} now connected with MAS {1} and TAS {2}",
              VersionUtil.GetFullVersionString(), Settings.ActiveSettings.MASUrl, Settings.ActiveSettings.TASUrl);
     Connections.LogServiceVersions();
     ServiceAvailability.Reload();
     return(View("ServicesSaved"));
 }