Пример #1
0
        public DataController()
        {
            Des      = DES.Create();
            Des.Mode = CipherMode.CFB;
            var bytes = Encoding.ASCII.GetBytes(FirstKey + SecondKey);

            Des.Key = bytes;
            Des.IV  = bytes;

            RootPath = Directory.GetParent(Environment.CurrentDirectory).Parent.Parent.FullName;

            FilePath = Path.Combine(new String[] {
                RootPath,
                "IS_1",
                "Data",
                "user.json"
            });

            var admin = new UserModel()
            {
                Login               = "******",
                Password            = String.Empty,
                AuthCnt             = 0,
                Rule                = true,
                PasswordRestriction = false
            };

            if (!CreateDataFile())
            {
                try
                {
                    UserList.Add(admin);
                    var add = UserList.Get(admin);
                    BaseDESEncode();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                    System.Environment.Exit(0);
                }
            }
            else
            {
                try
                {
                    BaseDESDecode();
                    var add = UserList.Get(admin);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                    System.Environment.Exit(0);
                }
            }
        }
Пример #2
0
        public ActionResult UserList()
        {
            var m = UserListModel.Get();

            ViewBag.Title = @Piranha.Resources.Settings.ListTitleUsers;

            return(View(@"~/Areas/Manager/Views/Settings/UserList.cshtml", m));
        }
Пример #3
0
        public ActionResult UserList()
        {
            var m = UserListModel.Get();

            ViewBag.Title = @Piranha.Resources.Settings.ListTitleUsers;

            // Executes the user list loaded hook, if registered
            if (WebPages.Hooks.Manager.UserListModelLoaded != null)
            {
                WebPages.Hooks.Manager.UserListModelLoaded(this, WebPages.Manager.GetActiveMenuItem(), m);
            }

            return(View(@"~/Areas/Manager/Views/Settings/UserList.cshtml", m));
        }
Пример #4
0
 public UserListModel Get()
 {
     return(UserListModel.Get(_db));
 }
Пример #5
0
        public IActionResult List()
        {
            var model = UserListModel.Get(userManager);

            return(View(model));
        }
Пример #6
0
 public IActionResult List()
 {
     return(View(UserListModel.Get(_db)));
 }
Пример #7
0
 public ActionResult UserList()
 {
     return(View("UserList", UserListModel.Get()));
 }