function qa_user_use_captcha($userlevel = null) { if (qa_to_override(__FUNCTION__)) { $args = func_get_args(); return qa_call_override(__FUNCTION__, $args); } return qa_user_captcha_reason($userlevel) != false; }
$qa_content['error'] = qa_insert_login_links(qa_lang_html('question/ask_must_confirm'), qa_request(), isset($followpostid) ? array('follow' => $followpostid) : null); break; case 'limit': $qa_content['error'] = qa_lang_html('question/ask_limit'); break; case 'approve': $qa_content['error'] = qa_lang_html('question/ask_must_be_approved'); break; default: $qa_content['error'] = qa_lang_html('users/no_permission'); break; } return $qa_content; } // Process input $captchareason = qa_user_captcha_reason(); $in['title'] = qa_post_text('title'); // allow title and tags to be posted by an external form $in['extra'] = qa_opt('extra_field_active') ? qa_post_text('extra') : null; if (qa_using_tags()) { $in['tags'] = qa_get_tags_field_value('tags'); } if (qa_clicked('doask')) { require_once QA_INCLUDE_DIR . 'qa-app-post-create.php'; require_once QA_INCLUDE_DIR . 'qa-util-string.php'; $categoryids = array_keys(qa_category_path($categories, @$in['categoryid'])); $userlevel = qa_user_level_for_categories($categoryids); $in['name'] = qa_post_text('name'); $in['notify'] = qa_post_text('notify') ? true : false; $in['email'] = qa_post_text('email'); $in['queued'] = qa_user_moderation_reason($userlevel) ? true : false;
$qa_content['error'] = qa_insert_login_links(qa_lang_html('main/view_q_must_login'), $topage); break; case 'confirm': $qa_content['error'] = qa_insert_login_links(qa_lang_html('main/view_q_must_confirm'), $topage); break; case 'approve': $qa_content['error'] = qa_lang_html('main/view_q_must_be_approved'); break; default: $qa_content['error'] = qa_lang_html('users/no_permission'); break; } return $qa_content; } // Determine if captchas will be required $captchareason = qa_user_captcha_reason(qa_user_level_for_post($question)); $usecaptcha = $captchareason != false; // If we're responding to an HTTP POST, include file that handles all posting/editing/etc... logic // This is in a separate file because it's a *lot* of logic, and will slow down ordinary page views $pagestart = qa_get_start(); $pagestate = qa_get_state(); $showid = qa_get('show'); $pageerror = null; $formtype = null; $formpostid = null; $jumptoanchor = null; $commentsall = null; if (substr($pagestate, 0, 13) == 'showcomments-') { $commentsall = substr($pagestate, 13); $pagestate = null; } elseif (isset($showid)) {