示例#1
0
 public void UpdateSettings(Settings s)
 {
     if (!Settings.Default.InitialConfiguration)
         CheckIsSiteAdmin ();
     db.WriteSettings (s);
 }
示例#2
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));
            }
        }