Changeset 2308331
- Timestamp:
- 05/20/2020 01:03:25 AM (6 years ago)
- Location:
- vaptcha/trunk
- Files:
-
- 3 edited
-
VaptchaPlugin.php (modified) (7 diffs)
-
lib/Vaptcha.class.php (modified) (4 diffs)
-
lib/config.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vaptcha/trunk/VaptchaPlugin.php
r2306831 r2308331 16 16 register_activation_hook(plugin_dir_path( __FILE__ ). 'vaptcha.php', array($this, 'init_default_options')); 17 17 register_activation_hook(plugin_dir_path( __FILE__ ) . 'vaptcha.php', array($this, 'uninstall')); 18 // register_activation_hook( dirname(__FILE__) . '/vaptcha.php', array($this, 'init_default_options'));19 // register_activation_hook( dirname(__FILE__) . '/vaptcha.php', array($this, 'uninstall'));20 18 $this->init_add_actions(); 21 19 … … 24 22 $this->options = $options; 25 23 } 26 27 // public function knock() {28 // return $this->vaptcha->getknock($_REQUEST['scene']);29 // }30 24 31 25 public function offline() { … … 42 36 $vid = get_option('vaptcha_options')['vaptcha_vid']; 43 37 $lang = get_option('vaptcha_options')['vaptcha_lang']; 44 // $ai = get_option('vaptcha_options')['vaptcha_ai'];45 38 $height = get_option('vaptcha_options')['vaptcha_height']; 46 39 $width = get_option('vaptcha_options')['vaptcha_width']; … … 134 127 $challenge =sanitize_text_field( $_POST['vaptcha_challenge'] ); 135 128 } 136 // $challenge = $_POST['vaptcha_challenge'];137 129 $token = sanitize_text_field( $_POST['vaptcha_token'] ); 138 130 if (!$token || !$this->vaptcha->validate($challenge, $token)) { … … 176 168 $challenge =sanitize_text_field( $_POST['vaptcha_challenge'] ); 177 169 } 178 // $challenge = $_POST['vaptcha_challenge'];179 170 $token = sanitize_text_field( $_POST['vaptcha_token'] ); 180 171 if (!$token || !$this->vaptcha->validate($challenge, $token)) { … … 226 217 'vaptcha_width' => '', 227 218 'vaptcha_height' => '', 228 // 'vaptcha_ai' => 'true',229 219 'https' => 'false', 230 220 'button_style' => 'dark', … … 242 232 243 233 function load_textdomain() { 244 // die(dirname( plugin_basename( __FILE__ ) ) . '/languages');245 234 load_plugin_textdomain( 'vaptcha', false , dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 246 235 } -
vaptcha/trunk/lib/Vaptcha.class.php
r2306831 r2308331 18 18 public function __construct($vid, $key) 19 19 { 20 // date_default_timezone_set("UTC");21 20 $this->vid = $vid; 22 21 $this->key = $key; … … 40 39 $knock = self::readContentFormGet("$url?$query&signature=$signature"); 41 40 if ($knock === $this->config['REQUEST_UESD_UP']) { 42 // $this->lastCheckdownTime = $now;43 // $this->isDown = true;44 41 self::$passedSignatures = array(); 45 42 return $this->getDownTimeCaptcha(); … … 286 283 if ($storageTIme && $storageTIme==$time) { 287 284 return true; 288 // if (in_array($signature, self::$passedSignatures)) {289 // return false;290 // } else {291 // array_push(self::$passedSignatures, $signature);292 // $length = count(self::$passedSignatures);293 // if ($length > MAX_LENGTH) {294 // array_splice(self::$passedSignatures, 0, $length - MAX_LENGTH + 1);295 // }296 297 // return true;298 // }299 285 } else { 300 286 return false; … … 310 296 $md5 = md5($time . $this->key); 311 297 $captcha = substr($md5, 0, 3); 312 // if (!self::$publicKey) {313 // self::$publicKey = $this->getPublicKey();314 // }315 298 $data = $this->getChannelData(); 316 299 $knock = md5($captcha . $$time . $data['offline_key']); 317 300 $ul = $this->getImgUrl(); 318 301 $url = md5($data['offline_key'] . $ul); 319 // self::$imgid = $url;320 302 $this->set($knock, $url); 321 // Session::set($knock, $url);322 303 return $callback===null?array( 323 304 "time" => $time, -
vaptcha/trunk/lib/config.php
r2303059 r2308331 6 6 'MAX_LENGTH' => 50000, 7 7 'PIC_POST_FIX' => ".png", 8 // 'PUBLIC_KEY_PATH' => "http://down.vaptcha.com/publickey",9 // 'IS_DOWN_PATH' => "http://down.vaptcha.com/isdown",10 // 'Channel_DownTime' => "https://channel.vaptcha.com/config/",11 8 'Channel_DownTime' => "http://channel2.vaptcha.com/config/", 12 9 'DOWN_TIME_PATH' => "offline/", … … 15 12 'SDK_LANG' => 'php', 16 13 'API_URL' => 'http://0.vaptcha.com', 17 // 'GET_CHALLENGE_URL' => '/challenge',18 14 'GET_knock_URL' => '/knock', 19 15 'VALIDATE_URL' => '/verify',
Note: See TracChangeset
for help on using the changeset viewer.