Beispiel #1
0
 public function check($code, $key = '')
 {
     $key = $this->authcode($this->seKey) . $key;
     // 验证码不能为空
     $secode = Util_Session::get($key);
     if (empty($code) || empty($secode)) {
         return false;
     }
     // session 过期
     if ($this->_nowTime->timeStamp - $secode['verify_time'] > $this->expire) {
         Util_Session::delete($key);
         return false;
     }
     if ($this->authcode(strtoupper($code)) == $secode['verify_code']) {
         $this->reset && Util_Session::delete($key);
         return true;
     }
     return false;
 }