Esempio n. 1
0
        public ActionResult EditApplication(int id)
        {
            CurrentUserModel.CheckIsSiteAdmin();
            Application app = CurrentServiceModel.GetApplication(id);

            return(View("EditApplication", app));
        }
Esempio n. 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)));
            }
        }
Esempio n. 3
0
        public ActionResult NewApplication()
        {
            CurrentUserModel.CheckIsSiteAdmin();
            Application app = new Application();

            app.Id = -1;
            return(View("EditApplication", app));
        }
Esempio n. 4
0
        public ActionResult AddUser(string login, string password, string email)
        {
            CurrentUserModel.CheckIsSiteAdmin();

            User u = new User();

            u.Email = email;
            u.Login = login;
            u.Name  = login;
            u.SetPassword(password);

            CurrentServiceModel.CreateUser(u);
            return(RedirectToAction("Index"));
        }
Esempio n. 5
0
        public ActionResult EditSettings()
        {
            Settings s = UserModel.GetSettings();

            if (!Settings.Default.InitialConfiguration)
            {
                CurrentUserModel.CheckIsSiteAdmin();
                return(View("Settings", s));
            }
            else
            {
                s.WebSiteHost = HttpContext.Request.Url.Host;
                if (HttpContext.Request.Url.Port != 80)
                {
                    s.WebSiteHost += ":" + HttpContext.Request.Url.Port;
                }
                return(View("Settings", s));
            }
        }
Esempio n. 6
0
 public ActionResult AuthorizeServiceChange()
 {
     CurrentUserModel.CheckIsSiteAdmin();
     BuildService.AuthorizeServiceConnection(BuildService.BuildBotConnectionRequest);
     return(View("Index"));
 }
Esempio n. 7
0
 public ActionResult DisableServiceChange()
 {
     CurrentUserModel.CheckIsSiteAdmin();
     BuildService.AllowChangingService = false;
     return(View("Index"));
 }
Esempio n. 8
0
 public ActionResult Index()
 {
     CurrentUserModel.CheckIsSiteAdmin();
     return(View());
 }