public ActionResult EditRegions()
        {
            if (Helpers.SessionVariables.Instance.LoggedIn == false || Helpers.SessionVariables.Instance.IsAdmin == false)
            {
                return(null);
            }

            int  n;
            bool isNumeric = int.TryParse(VpnSite.Helpers.GlobalHelper.RequestParam("id").Trim().ToLower(), out n);

            var edit = new LibLogic.Admin.Regions();

            string description = VpnSite.Helpers.GlobalHelper.RequestParam("desc").Trim().ToLower();

            string activeString = VpnSite.Helpers.GlobalHelper.RequestParam("active");
            bool   active       = false;

            if (activeString != null)
            {
                active = true;
            }

            if (isNumeric)
            {
                edit.Update(n, description, active);
            }
            else
            {
                edit.Insert(description, active);
            }


            return(View());
        }
Example #2
0
        public void Setup()
        {
            var peterAccount = new LibLogic.Accounts.CreateAccount(
                new LibLogic.Accounts.CreateAccountInfo()
            {
                Email           = emailAddress,
                EmailConfirm    = emailAddress,
                Firstname       = "Bobby",
                Lastname        = "Smith",
                Password        = "******",
                PasswordConfirm = "Password54",
                BetaKey         = ""
            }
                , false, LibLogic.Setup.Email);

            this.userid = peterAccount.Execute();

            var region = new LibLogic.Admin.Regions();

            regionid = region.Insert("Test region", true);

            var vpnserver = new LibLogic.Admin.VpnServers();

            vpnseverid = vpnserver.Insert("localhost", 5678, "a fake vpnserver for testing", regionid, true);
        }
Example #3
0
 public AdminRegions()
 {
     _regionList = new LibLogic.Admin.Regions().Select();
 }