is_valid) { $captchaError = 'The captcha was incorrect.'; $hasError = true; } } if ((!isset($hasError)) || (geocraft_get_option('reg_captcha') == 'off') || (geocraft_get_option('reg_captcha') == '')) { if (isset($_POST['register']) && $_POST['register']) { require_once( ABSPATH . WPINC . '/registration.php'); // Get (and clean) data $fields = array( 'your_username', 'your_email', 'your_password', 'your_password_2', 'capcode' ); foreach ($fields as $field) { $posted[$field] = stripslashes(trim($_POST[$field])); } $user_login = sanitize_user($posted['your_username']); $user_email = apply_filters('user_registration_email', $posted['your_email']); // Check the username if ($posted['your_username'] == '') $errors->add('empty_username', __('ERROR: ' . ENTER_UNM, THEME_SLUG)); elseif (!validate_username($posted['your_username'])) { $errors->add('invalid_username', __('ERROR: ' . INVLD_UNM, THEME_SLUG)); $posted['your_username'] = ''; } elseif (username_exists($posted['your_username'])) $errors->add('username_exists', __('ERROR: ' . LRD_UNM, THEME_SLUG)); // Check the e-mail address if ($posted['your_email'] == '') { $errors->add('empty_email', __('ERROR: ' . TYPE_EMAIL, THEME_SLUG)); } elseif (!is_email($posted['your_email'])) { $errors->add('invalid_email', __('ERROR: ' . EMAIL_ISNT, THEME_SLUG)); $posted['your_email'] = ''; } elseif (email_exists($posted['your_email'])) $errors->add('email_exists', __('ERROR: ' . LRD_EMAIL, THEME_SLUG)); // Check Passwords match if ($posted['your_password'] == '') $errors->add('empty_password', __('ERROR: ' . ENTER_PW, THEME_SLUG)); elseif ($posted['your_password_2'] == '') $errors->add('empty_password', __('ERROR: ' . PW_AGAIN, THEME_SLUG)); elseif ($posted['your_password'] !== $posted['your_password_2']) $errors->add('wrong_password', __('ERROR: ' . PW_NT_EQUAL, THEME_SLUG)); session_start(); // Get captcha value from session //do_action('register_post', $posted['your_username'], $posted['your_email'], $errors); $errors = apply_filters('registration_errors', $errors, $posted['your_username'], $posted['your_email']); //print_r($errors); if (!$errors->get_error_code()) { $user_pass = $posted['your_password']; $user_id = wp_create_user($posted['your_username'], $user_pass, $posted['your_email']); if (!$user_id) { $errors->add('registerfail', sprintf(__('ERROR: Couldn’t register you... please contact the webmaster !', THEME_SLUG), get_option('admin_email'))); return array('errors' => $errors, 'posted' => $posted); } // Change role wp_update_user(array('ID' => $user_id, 'role' => 'contributor')); wp_new_user_notification($user_id, $user_pass); $secure_cookie = is_ssl() ? true : false; wp_set_auth_cookie($user_id, true, $secure_cookie); ### Redirect wp_redirect($success_redirect); exit; } else { return array('errors' => $errors, 'posted' => $posted); } } } endif; } function geocraft_register_form($action = '') { global $posted; $multi_site = ''; if (defined(WP_ALLOW_MULTISITE)) { $multi_site = WP_ALLOW_MULTISITE; } $privatekey = geocraft_get_option('recaptcha_private'); $publickey = geocraft_get_option('recaptcha_public'); if (isset($_POST["recaptcha_response_field"])) { $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { $captchaError = 'The captcha was incorrect.'; $hasError = true; } } if (get_option('users_can_register') || $multi_site == true) : if (!$action) $action = site_url('wp-login.php?action=register'); // $captcha_value1 = geocraft_captcha1(); //$captcha_value2 = geocraft_captcha2(); // $geocraft_sbs_captcha = $captcha_value1 + $captcha_value2; ?>

The captcha was incorrect.

'; } } ?>
" class="submit" tabindex="103" />