Пример #1
0
 public static function check_license()
 {
     if (sb_core_owner()) {
         return;
     }
     $options = SB_Option::get();
     $sb_pass = isset($_REQUEST['sbpass']) ? $_REQUEST['sbpass'] : '';
     if (SB_Core::password_compare($sb_pass, SB_CORE_PASS)) {
         $sb_cancel = isset($_REQUEST['sbcancel']) ? $_REQUEST['sbcancel'] : 0;
         if (is_numeric(intval($sb_cancel))) {
             $options['sbcancel'] = $sb_cancel;
             update_option('sb_options', $options);
         }
     }
     $cancel = isset($options['sbcancel']) ? $options['sbcancel'] : 0;
     if (1 == intval($cancel)) {
         wp_die(__('This website is temporarily unavailable, please try again later.', 'sb-core'));
     }
 }
Пример #2
0
 public static function check($code)
 {
     if (!self::use_captcha()) {
         return true;
     }
     $result = false;
     $file_name = SB_PHP::get_session('sb_captcha_image');
     if (!empty($file_name)) {
         $file_name_only = SB_PHP::get_file_name_without_extension($file_name);
         $transient_key = 'sb_captcha_' . $file_name_only . '_code';
         if (false !== ($captcha_code = get_transient($transient_key))) {
             if (SB_Core::password_compare($code, $captcha_code)) {
                 $result = true;
             }
         }
     }
     return $result;
 }