function cforms2_check_pluggable_captchas_authn_users($field_type)
{
    $captchas = cforms2_get_pluggable_captchas();
    return array_key_exists($field_type, $captchas) && is_user_logged_in() && !$captchas[$field_type]->check_authn_users();
}
     $cflimit = 'reached';
     return;
 }
 $usermessage_text = preg_replace('|\\r\\n|', '<br />', stripslashes($cformsSettings['form' . $no]['cforms' . $no . '_success']));
 $track = array();
 $trackinstance = array();
 $to_one = -1;
 $ccme = false;
 $field_email = '';
 $filefield = 0;
 $taf_youremail = false;
 $taf_friendsemail = false;
 $send2author = false;
 $inpFieldArr = array();
 // for var[] type input fields
 $captchas = cforms2_get_pluggable_captchas();
 $key = 0;
 for ($i = 1; $i <= $field_count; $i++) {
     if (!$custom) {
         $field_stat = explode('$#$', $cformsSettings['form' . $no]['cforms' . $no . '_count_field_' . $i]);
     } else {
         $field_stat = explode('$#$', $customfields[$i - 1]);
     }
     $field_stat[] = "";
     ###  filter non input fields
     while (in_array($field_stat[1], array_merge(array_keys($captchas), array('fieldsetstart', 'fieldsetend', 'textonly', 'captcha')))) {
         if ($field_stat[1] == 'captcha' && !(is_user_logged_in() && !$captchaopt['fo'] == '1')) {
             break;
         }
         if (cforms2_check_pluggable_captchas_authn_users($field_stat[1])) {
             break;
Exemple #3
0
function cforms2_field()
{
    check_admin_referer('cforms2_field');
    static $html5 = array('html5color', 'html5date', 'html5datetime', 'html5datetime-local', 'html5email', 'html5month', 'html5number', 'html5range', 'html5search', 'html5time', 'html5url', 'html5week', 'html5tel');
    static $fieldsetstart = array('fieldsetstart', 'fieldsetend');
    static $checkbox = array('ccbox', 'checkbox');
    static $selectbox = array('emailtobox', 'selectbox', 'multiselectbox');
    static $textfield = array('upload', 'datepicker', 'textfield', 'textarea', 'pwfield', 'hidden', 'captcha', 'yourname', 'youremail', 'friendsname', 'friendsemail', 'cauthor', 'email', 'url', 'comment');
    static $checkboxgroup = array('checkboxgroup', 'radiobuttons', 'send2author');
    $type = $_REQUEST['type'];
    if (in_array($type, $html5)) {
        require 'js/include/html5field.php';
    } else {
        if (in_array($type, $checkbox)) {
            require 'js/include/checkbox.php';
        } else {
            if (in_array($type, $checkboxgroup)) {
                require 'js/include/checkboxgroup.php';
            } else {
                if (in_array($type, $fieldsetstart)) {
                    require 'js/include/fieldsetstart.php';
                } else {
                    if (in_array($type, $selectbox)) {
                        require 'js/include/selectbox.php';
                    } else {
                        if (in_array($type, $textfield)) {
                            require 'js/include/textfield.php';
                        } else {
                            if ($type == 'textonly') {
                                require 'js/include/textonly.php';
                            } else {
                                $captchas = cforms2_get_pluggable_captchas();
                                if (array_key_exists($type, $captchas)) {
                                    $captchas[$type]->render_settings();
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    die;
}