function qa_is_ip_blocked() { $blockipclauses = qa_block_ips_explode(qa_opt('block_ips_write')); foreach ($blockipclauses as $blockipclause) { if (qa_block_ip_match(qa_remote_ip_address(), $blockipclause)) { return true; } } return false; }
qa_redirect(qa_request()); } } } // Combine sets of questions and get information for users $questions = qa_any_sort_by_date(array_merge($qs, $qs_queued, $qs_hidden, $a_qs, $a_queued_qs, $a_hidden_qs, $c_qs, $c_queued_qs, $c_hidden_qs, $edit_qs)); $usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions)); $hostname = gethostbyaddr($ip); // Prepare content for theme $qa_content = qa_content_prepare(); $qa_content['title'] = qa_lang_html_sub('main/ip_address_x', qa_html($ip)); $qa_content['error'] = @$pageerror; $qa_content['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'style' => 'wide', 'fields' => array('host' => array('type' => 'static', 'label' => qa_lang_html('misc/host_name'), 'value' => qa_html($hostname))), 'hidden' => array('code' => qa_get_form_security_code('ip-' . $ip))); if ($blockable) { require_once QA_INCLUDE_DIR . 'qa-app-limits.php'; $blockipclauses = qa_block_ips_explode(qa_opt('block_ips_write')); $matchclauses = array(); foreach ($blockipclauses as $blockipclause) { if (qa_block_ip_match($ip, $blockipclause)) { $matchclauses[] = $blockipclause; } } if (count($matchclauses)) { $qa_content['form']['fields']['status'] = array('type' => 'static', 'label' => qa_lang_html('misc/matches_blocked_ips'), 'value' => qa_html(implode("\n", $matchclauses), true)); $qa_content['form']['buttons']['unblock'] = array('tags' => 'name="dounblock"', 'label' => qa_lang_html('misc/unblock_ip_button')); if (count($questions) && !qa_user_maximum_permit_error('permit_hide_show')) { $qa_content['form']['buttons']['hideall'] = array('tags' => 'name="dohideall" onclick="qa_show_waiting_after(this, false);"', 'label' => qa_lang_html('misc/hide_all_ip_button')); } } else { $qa_content['form']['buttons']['block'] = array('tags' => 'name="doblock"', 'label' => qa_lang_html('misc/block_ip_button')); }
function qa_is_ip_blocked() { if (qa_to_override(__FUNCTION__)) { $args = func_get_args(); return qa_call_override(__FUNCTION__, $args); } $blockipclauses = qa_block_ips_explode(qa_opt('block_ips_write')); foreach ($blockipclauses as $blockipclause) { if (qa_block_ip_match(qa_remote_ip_address(), $blockipclause)) { return true; } } return false; }
// seems to be a very common mistake and will mess up URLs $optionvalue .= '/'; } break; case 'hot_weight_views': case 'hot_weight_answers': case 'hot_weight_votes': case 'hot_weight_q_age': case 'hot_weight_a_age': if (qa_opt($optionname) != $optionvalue) { $recalchotness = true; } break; case 'block_ips_write': require_once QA_INCLUDE_DIR . 'qa-app-limits.php'; $optionvalue = implode(' , ', qa_block_ips_explode($optionvalue)); break; case 'block_bad_words': require_once QA_INCLUDE_DIR . 'qa-util-string.php'; $optionvalue = implode(' , ', qa_block_words_explode($optionvalue)); break; } qa_set_option($optionname, $optionvalue); } $formokhtml = qa_lang_html('admin/options_saved'); // Uploading default avatar if (is_array(@$_FILES['avatar_default_file']) && $_FILES['avatar_default_file']['size']) { require_once QA_INCLUDE_DIR . 'qa-util-image.php'; $oldblobid = qa_opt('avatar_default_blobid'); $toobig = qa_image_file_too_big($_FILES['avatar_default_file']['tmp_name'], qa_opt('avatar_store_size')); if ($toobig) {