Exemplo n.º 1
0
        public void SetGenerator(IValidateCode generator)
        {
            var    Request = base.Page.Request;
            string url     = "http://" + Request.Url.Host + ":" + Request.Url.Port + base.Page.ClientScript.GetWebResourceUrl(typeof(ImageValidator), "Rocky.Web.Controls.Validator.Resource.Mbg.jpg");

            SetGenerator(generator, url);
        }
Exemplo n.º 2
0
 public ControllerBase(IOptions <WebSettings> webSettings, IValidateCode validateCode, HttpContextExtension httpExtension, ICMSAdminBO cmsAdminBO, ICMSAdminCookie cmsAdminCookie)
 {
     WebSettings    = webSettings;
     ValidateCode   = validateCode;
     HttpExtension  = httpExtension;
     CMSAdminBO     = cmsAdminBO;
     CMSAdminCookie = cmsAdminCookie;
 }
Exemplo n.º 3
0
        public bool Validate(string value)
        {
            IValidateCode generator = (IValidateCode)base.Page.Session[ImageValidatorKey];

            if (generator == null)
            {
                throw new NullReferenceException("IValidateCode");
            }
            return(generator.Validate(this.ValidID, value));
        }
Exemplo n.º 4
0
 public HomeController(IOptions <WebSettings> webSettings, IValidateCode validateCode, HttpContextExtension httpExtension, ICMSAdminBO cmsAdminBO, ICMSAdminCookie cmsAdminCookie)
     : base(webSettings, validateCode, httpExtension, cmsAdminBO, cmsAdminCookie)
 {
 }
Exemplo n.º 5
0
 public void SetGenerator(IValidateCode generator, string bgUrl)
 {
     base.Page.Session[ImageValidatorKey] = generator;
     base.ImageUrl = generatedURL = string.Format(GenerateURL, this.ValidID, this.CodeLength, bgUrl);
 }
 /// <summary>
 /// 初始化安全授权控制器
 /// </summary>
 /// <param name="identityService">系统服务</param>
 /// <param name="validateCode">验证码</param>
 public AuthenticationController(IIdentityService identityService, IValidateCode validateCode)
 {
     IdentityService = identityService;
     ValidateCode = validateCode;
 }