Example #1
0
     if (!is_dir($filedirectory)) {
         EasyContactFormsUtils::createFolder($filedirectory);
     }
     $ds = DIRECTORY_SEPARATOR;
     $sid = $map['sid'];
     $filespec = $_FILES[$filerequestid];
     $newpath = $filedirectory . $ds . $sid . $fld->get('id');
     $tmpname = $filespec['tmp_name'];
     if (!move_uploaded_file($tmpname, $newpath)) {
         return;
     }
     $newpath = str_replace("\\", "/", $newpath);
     $filespec['tmp_name'] = $newpath;
     $filespec = serialize($filespec);
     $filespec = EasyContactFormsUtils::addMSlashes($filespec);
     EasyContactFormsSecurityManager::setSessionValue($filerequestid, $filespec, $map);
     break;
 case 3:
     if (!isset($this->sessionid)) {
         $this->sessionid = EasyContactFormsSecurityManager::getSid();
     }
     $varmap['id-' . $fldid] = $this->sessionid;
     break;
 case 8:
     if (isset($ufovalidators) && $ufovalidators === FALSE) {
         $ufovalidators = TRUE;
         $vjs[] = "if(typeof(ufoValidators)=='undefined'){ufoValidators={};};";
     }
     if (!isset($form->fileuploadsriptloaded)) {
         $form->fileuploadsriptloaded = true;
         $vjs[] = "ufoValidators.validfileattached = function(config, evt){var fileupload = ufoFormsConfig.uploads[config.form][config.id];if (!fileupload.fileattached && !config.Required) return undefined;if (!fileupload.fileattached && config.Required) return false;return true;};";
Example #2
0
         EasyContactFormsSecurityManager::setSessionValue('ufo_forms_recaptcha', 'TRUE', $map);
         echo 'true';
     } else {
         EasyContactFormsSecurityManager::setSessionValue('ufo_forms_recaptcha', 'FALSE', $map);
         echo 'false';
     }
     break;
 case 3:
     $pbk = (string) $xml->ReCaptchaPublicKey;
     if (!empty($pbk)) {
         if (!isset($this->sessionid)) {
             $this->sessionid = EasyContactFormsSecurityManager::getSid();
         }
         $sessmap = array();
         $sessmap['sid'] = $this->sessionid;
         EasyContactFormsSecurityManager::setSessionValue('ufo_forms_recaptcha', 'FALSE', $sessmap);
         $varmap['id-' . $fldid] = $this->sessionid;
     }
     break;
 case 8:
     if (isset($ufovalidators) && $ufovalidators === FALSE) {
         $ufovalidators = TRUE;
         $vjs[] = "if(typeof(ufoValidators)=='undefined'){ufoValidators={};};";
     }
     $vjs[] = "ufoValidators.recaptcharequired = function(config, evt){ var submits = ufoForms.submits[config.form]; var setkeypress = function() { var respel = ufoForms.get('recaptcha_response_field'); ufoForms.addEvent(respel, 'keypress', function(){ for (var i = 0; i < submits.length; i++) { submits[i].disabled = false; } ufoForms.fieldReset(config); config.isvalid = true; ufoForms.validateForm(config.form); }); }; var respel = ufoForms.get('recaptcha_response_field'); if (!config.reselblur) { config.reselblur = true; setkeypress(); } if (respel.value == '') { return false; } if (config.validCaptha == true) { return true; } for (var i = 0; i < submits.length; i++) { ufoForms.addClass(submits[i].domEl, 'ufo-loading'); submits[i].disabled = true; } ufoForms.fieldReset(config); var callback = function(){}; var chlel = ufoForms.get('recaptcha_challenge_field'); var values = []; var id = config.id.split('-'); id = id[id.length - 2] + '-' + id[id.length - 1]; values.push(id+'=1'); var hidden = ufoForms.get(config.id+'-sid'); values.push('sid='+hidden.value); values.push('recaptcha_challenge_field='+chlel.value); values.push('recaptcha_response_field='+respel.value); values = values.join('&'); ufoForms.request(values, callback, 'val', false); var result = (uhxr.responseText == 'true'); config.validCaptha = result; if (!result) { var rcdiv = ufoForms.get(config.id); rcdiv.style.height = rcdiv.offsetHeight+'px'; config.rcparams.callback = setkeypress; Recaptcha.create(config.pbk, config.id, config.rcparams); config.reselblur = false; } for (var i = 0; i < submits.length; i++) { ufoForms.removeClass(submits[i].domEl, 'ufo-loading'); submits[i].disabled = false; } return result; };";
     break;
 case 5:
     $cxml = simplexml_load_string($fld->get('Settings'));
     if (!isset($pvk)) {
         $pvk = (string) $cxml->ReCaptchaPrivateKey;
     }