function qa_user_permit_error($permitoption = null, $limitaction = null) { if (qa_to_override(__FUNCTION__)) { $args = func_get_args(); return qa_call_override(__FUNCTION__, $args); } require_once QA_INCLUDE_DIR . 'qa-app-limits.php'; $userid = qa_get_logged_in_userid(); $flags = qa_get_logged_in_flags(); $error = qa_permit_error($permitoption, $userid, qa_get_logged_in_level(), $flags); if (!$error && qa_is_ip_blocked()) { $error = 'ipblock'; } if (!$error && isset($userid) && $flags & QA_USER_FLAGS_MUST_CONFIRM) { $error = 'confirm'; } if (isset($limitaction) && !$error) { if (qa_limits_remaining(qa_get_logged_in_userid(), $limitaction) <= 0) { $error = 'limit'; } } return $error; }
function qa_user_permit_error($permitoption = null, $limitaction = null, $userlevel = null, $checkblocks = true) { if (qa_to_override(__FUNCTION__)) { $args = func_get_args(); return qa_call_override(__FUNCTION__, $args); } require_once QA_INCLUDE_DIR . 'app/limits.php'; $userid = qa_get_logged_in_userid(); if (!isset($userlevel)) { $userlevel = qa_get_logged_in_level(); } $flags = qa_get_logged_in_flags(); if (!$checkblocks) { $flags &= ~QA_USER_FLAGS_USER_BLOCKED; } $error = qa_permit_error($permitoption, $userid, $userlevel, $flags); if ($checkblocks && !$error && qa_is_ip_blocked()) { $error = 'ipblock'; } if (!$error && isset($userid) && $flags & QA_USER_FLAGS_MUST_CONFIRM && qa_opt('confirm_user_emails')) { $error = 'confirm'; } if (!$error && isset($userid) && $flags & QA_USER_FLAGS_MUST_APPROVE && qa_opt('moderate_users')) { $error = 'approve'; } if (isset($limitaction) && !$error) { if (qa_user_limits_remaining($limitaction) <= 0) { $error = 'limit'; } } return $error; }
function qa_user_permit_error($permitoption = null, $actioncode = null) { require_once QA_INCLUDE_DIR . 'qa-app-limits.php'; $error = qa_permit_error($permitoption, qa_get_logged_in_userid(), qa_get_logged_in_level(), qa_get_logged_in_flags()); if (!$error && qa_is_ip_blocked()) { $error = 'ipblock'; } if (isset($actioncode) && !$error) { if (qa_limits_remaining(qa_get_logged_in_userid(), $actioncode) <= 0) { $error = 'limit'; } } return $error; }