Beispiel #1
0
function mstripslashes($string)
{
    if (is_array($string)) {
        foreach ($string as $key => $val) {
            $string[$key] = mstripslashes($val);
        }
    } else {
        $string = stripslashes($string);
    }
    return $string;
}
Beispiel #2
0
                    $c_ftp->mrmdir($checkdir);
                } else {
                    if (!$c_ftp->mdelete($checkfile)) {
                        $checkmsg .= 'settings_remote_delerr';
                    } else {
                        $c_ftp->mrmdir($checkdir);
                        $checkmsg = 'settings_remote_ok';
                    }
                }
            }
        }
    }
    echo '<script language="javascript" reload="1">alert(\'' . addslashes($checkmsg) . '\');parent.$(\'cfupload\').action=\'?entry=mconfigs&action=cfupload\';parent.$(\'cfupload\').target=\'_self\'</script>';
} elseif ($action == 'dbcheck') {
    $checkmsg = '';
    $dbsourcenew = mstripslashes($dbsourcenew);
    if (in_str('********', $dbsourcenew['dbpw'])) {
        $dbsourcenew['dbpw'] = authcode($dbsourcenew['dbpw0'], 'DECODE', md5($authkey));
    }
    $alertarr = array('add' => array('dbsourceadd', 'dbsourcesedit'), 'edit' => array('dbsourcedetail', 'dbsourcedetail'));
    $dbsourcenew['cname'] = trim(strip_tags($dbsourcenew['cname']));
    $dbsourcenew['dbhost'] = trim(strip_tags($dbsourcenew['dbhost']));
    $dbsourcenew['dbuser'] = trim(strip_tags($dbsourcenew['dbuser']));
    $dbsourcenew['dbname'] = trim(strip_tags($dbsourcenew['dbname']));
    if (empty($dbsourcenew['cname']) || empty($dbsourcenew['dbhost']) || empty($dbsourcenew['dbuser']) || empty($dbsourcenew['dbname'])) {
        $checkmsg = lang('dbsrc_data_miss');
    } else {
        $s_db = new cls_mysql();
        if (!$s_db->connect($dbsourcenew['dbhost'], $dbsourcenew['dbuser'], $dbsourcenew['dbpw'], $dbsourcenew['dbname'], 0, false, $dbsourcenew['dbcharset'])) {
            $checkmsg = lang('dbsrc_connect_error');
        } else {