Пример #1
0
require_once "../lib-common.php";
// Path to your lib-common.php
require_once $_CONF['path'] . 'plugins/nexform/lib-uploadfiles.php';
// Functions for managing uploading of files
$myvars = array('form_id', 'op', 'id');
ppGetData($myvars, true);
$fe_errmg = '';
// Form Editor Error Message - if errors occur during form processing
$returnURL = DB_getItem($_TABLES['nxform_definitions'], "return_url", "id='{$form_id}'");
if (trim($returnURL) == '') {
    $returnURL = $_CONF['site_url'] . '/index.php';
}
// Check if CAPTCHA Field is enabled and form field exists
if (function_exists('plugin_itemPreSave_captcha') and isset($_POST['captcha'])) {
    $str = COM_applyFilter($_POST['captcha']);
    list($rc, $msg) = CAPTCHA_checkInput($type, $str);
    if ($msg != '') {
        $retval = COM_siteHeader();
        $retval .= COM_startBlock($LANG_FEMSG[2], '', COM_getBlockTemplate('_msg_block', 'header')) . $msg . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
        $retval .= COM_siteFooter();
        echo $retval;
        exit;
    }
}
/* Check to see if testing a post of the form */
if ($_POST['formhandler'] == 'dbsave') {
    $newform = COM_applyFilter($_REQUEST['newform'], true);
    /* Save results to Database */
    if ($newform == 1) {
        //this form was already saved by the file uploader ajax
        $result_id = COM_applyFilter($_REQUEST['res_id'], true);
Пример #2
0
            exit;
        }
        break;
    case 'other':
        COM_clearSpeedlimit($_CONF['login_speedlimit'], 'tokenexpired');
        if (COM_checkSpeedlimit('tokenexpired', 5) > 0) {
            echo COM_refresh($_CONF['site_url']);
            exit;
        }
        if (isset($_POST['captcha'])) {
            $str = COM_applyFilter($_POST['captcha']);
        } else {
            $str = '';
        }
        COM_updateSpeedlimit('tokenexpired');
        list($rc, $msg) = CAPTCHA_checkInput($str, 'token');
        if ($rc == 1) {
            _rebuild_data();
            unset($_POST['loginname']);
            COM_clearSpeedlimit(0, 'tokenexpired');
            return;
        }
        $display = COM_siteHeader();
        $display .= SEC_tokenreauthForm($LANG_ACCESS['validation_failed'], $desturl);
        $display .= COM_siteFooter();
        echo $display;
        exit;
        break;
}
function _rebuild_data()
{