Esempio n. 1
0
        public async Task <IActionResult> Index()
        {
            CommonModels.MVCGetPartial thisModel = new CommonModels.MVCGetPartial
            {
                ViewName        = "_AntiForgery",
                _TempData       = null,
                _thisController = ControllerContext
            };

            var result = await mvcApplication.ReturnViewToStringAsync(thisModel);

            List <DynamicModels.RootReportFilter> getBaseAppfilters = new List <DynamicModels.RootReportFilter>();

            getBaseAppfilters.Add(new DynamicModels.RootReportFilter {
                FilterName = "ENABLED_", DBType = SqlDbType.VarChar, ParamValue = "Y"
            });

            DataTable getApps = await _DynamicOutputProcedures._DynoProcSearchAsync(_Connect, "Custom Query", "SP_S_VW__APPLICATIONS_SEARCH",
                                                                                    new DataTableDotNetModelMetaData { length = -1, order = "", start = 0, verify = "T" },
                                                                                    getBaseAppfilters);

            Revamp.IO.Tools.Box._WriteEventLog("Test", IO.Structs.Enums.EventLogType.success);

            return(View());
        }
Esempio n. 2
0
        // GET: Authentication/LoginJson
        public async Task <JsonResult> get(Guid?token)
        {
            var jsonContent = Json(new
            {
                access = false
            });

            if (token != null)
            {
                List <DynamicModels.RootReportFilter> filters = new List <DynamicModels.RootReportFilter> {
                    new DynamicModels.RootReportFilter {
                        FilterName = "APPLICATION_NAME_", ParamValue = "Revamp System"
                    },
                    new DynamicModels.RootReportFilter {
                        FilterName = "STAGE_NAME_", ParamValue = "login"
                    },
                    new DynamicModels.RootReportFilter {
                        FilterName = "GRIP_NAME_", ParamValue = "login"
                    }
                };

                DataTable Result = await _DynamicOutputProcedures._DynoProcSearchAsync(_Connect, "Custom Query", "SP_S_VW_APPLICATION_OBJECTS_SEARCH",
                                                                                       new DataTableDotNetModelMetaData { length = -1, order = "APPLICATIONS_ID asc, STAGES_ID asc, GRIPS_ID asc, OBJECT_SETS_ID asc, OBJ_PROP_SETS_ID asc ", start = 0, verify = "T" },
                                                                                       filters);

                string captchaText = await mvcApplication.ReturnViewToStringAsync(new CommonModels.MVCGetPartial
                {
                    _thisController = ControllerContext,
                    ViewName        = "Shared/_Captcha",
                    model           = null
                });

                string AntiForgeryObject = await GetAntiForgeryObject();

                string AntiForgeryToken = await GetAntiForgeryToken();

                string AntiForgeryObject2 = await GetAntiForgeryObject();

                var content = System.IO.File.ReadAllText(_hostingEnvironment.ContentRootPath + "/Areas/Authentication/Templates/Login/Objects.html");

                ArrayList JsonData   = ER_Tools._GetObjectListFromDataTable(new ArrayList(), Result);
                string    jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(JsonData);
                //var thisUser = HttpContext.User.Identity.Name.ToString();
                var  thisUser     = "";// _httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
                bool isCACEnabled = RevampCoreSettings.IsCacEnabled;
                jsonContent = Json(new
                {
                    access = true,
                    d      = Revamp.IO.Tools.Box.Base64Encode(jsonString),
                    c      = Revamp.IO.Tools.Box.Base64Encode(captchaText),
                    a      = AntiForgeryObject,
                    u      = thisUser,
                    s      = Revamp.IO.Tools.Box.Base64Encode(content),
                    z      = AntiForgeryToken,
                    a2     = AntiForgeryObject2,
                    ca     = isCACAvailable(),
                    ic     = isCACEnabled,
                });
            }

            var jsonResult = Json(jsonContent);

            return(jsonResult);
        }