check() 정적인 공개 메소드

static public check ( $captcha_code )
예제 #1
0
 function pageEntry($inPath)
 {
     /**
      * 初始化类
      */
     $cap = new SCaptcha();
     /**
      * 生成图片,返回验证码
      */
     $code = $cap->CreateImage();
     /**
      * 检验验证码
      */
     if (SCaptcha::check($code)) {
         error_log(true);
     } else {
         error_log(false);
     }
 }
예제 #2
0
 function pagelogin($inPath)
 {
     $urlParams = $this->getUrlParams($inPath);
     if (!$_POST) {
         $this->params['head_title'] = "管理登录-" . $this->params['head_title'];
         return $this->render("main/login.html", $this->params);
     } else {
         $_POST = base_Utils::shtmlspecialchars($_POST);
         //session_start();
         if (!SCaptcha::check($_POST['captcha'])) {
             $modelAdmin = new m_admin();
             $loginInfo = $modelAdmin->checkLogin($_POST['username'], $_POST['pwd'], (int) $_POST['timeout']);
             if ($loginInfo) {
                 $this->redirect($this->createUrl('/'));
             } else {
                 $this->ShowMsg("用户名或者密码错误!");
             }
         } else {
             $this->ShowMsg("验证码错误!");
         }
     }
 }
예제 #3
0
 /**
  * 验证验证码
  */
 public function checkCatcha($s)
 {
     session_start();
     $oSC = new SCaptcha();
     return $oSC->check($s);
 }