コード例 #1
0
        public ActionResult SaveSettings(Settings s)
        {
            if (!Settings.Default.InitialConfiguration)
            {
                CurrentUserModel.CheckIsSiteAdmin();
            }

            Settings.Default.DataPath      = s.DataPath;
            Settings.Default.OperationMode = s.OperationMode;
            Settings.Default.WebSiteHost   = s.WebSiteHost;
            Settings.Default.SmtpHost      = s.SmtpHost;
            Settings.Default.SmtpPassword  = s.SmtpPassword;
            Settings.Default.SmtpPort      = s.SmtpPort;
            Settings.Default.SmtpUser      = s.SmtpUser;
            Settings.Default.SmtpUseSSL    = s.SmtpUseSSL;

            CurrentUserModel.UpdateSettings(Settings.Default);

            Cydin.MvcApplication.UpdateRoutes();
            if (!CurrentServiceModel.ThereIsAdministrator())
            {
                return(Redirect(ControllerHelper.GetActionUrl("home", "Login", "User")));
            }
            else
            {
                CurrentServiceModel.EndInitialConfiguration();
                return(Redirect(ControllerHelper.GetActionUrl("home", null, null)));
            }
        }