Exemplo n.º 1
0
    $_REQUEST['action'] = 'edit';
}
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
$obook_static_url = empty($jieqiConfigs['obook']['staticurl']) ? $jieqiModules['obook']['url'] : $jieqiConfigs['obook']['staticurl'];
$obook_dynamic_url = empty($jieqiConfigs['obook']['dynamicurl']) ? $jieqiModules['obook']['url'] : $jieqiConfigs['obook']['dynamicurl'];
switch ($_REQUEST['action']) {
    case 'update':
        $_REQUEST['obookname'] = trim($_REQUEST['obookname']);
        $_POST['author'] = trim($_POST['author']);
        $_REQUEST['agent'] = trim($_REQUEST['agent']);
        $errtext = '';
        include_once JIEQI_ROOT_PATH . '/lib/text/textfunction.php';
        //检查标题
        if (strlen($_REQUEST['obookname']) == 0) {
            $errtext .= $jieqiLang['obook']['need_obook_title'] . '<br />';
        } elseif (!jieqi_safestring($_REQUEST['obookname'])) {
            $errtext .= $jieqiLang['obook']['limit_obook_title'] . '<br />';
        }
        if (!empty($_FILES['obookspic']['name'])) {
            if (eregi("\\.(gif|jpg|jpeg|png|bmp|swf|svg)\$", $_FILES['obookspic']['name'])) {
                if (strstr(strtolower($_FILES['obookspic']['name']), strtolower($jieqiConfigs['obook']['imagetype'])) != strtolower($jieqiConfigs['obook']['imagetype'])) {
                    $errtext .= sprintf($jieqiLang['obook']['simage_type_error'], $jieqiConfigs['obook']['imagetype']) . '<br />';
                }
            } else {
                $errtext .= sprintf($jieqiLang['obook']['simage_not_image'], $_FILES['obookspic']['name']) . '<br />';
            }
            if (!empty($errtext)) {
                jieqi_delfile($_FILES['obookspic']['tmp_name']);
            }
        }
        if (!empty($_FILES['obooklpic']['name'])) {
Exemplo n.º 2
0
             $file_content .= $config_array[$i] . ';';
         }
         $file_content .= "\r\n\r\n?>";
         //写入配置文件
         if (!jieqi_writefile($file_name, $file_content)) {
             $errtext .= $jieqiLang[JIEQI_MODULE_NAME]['write_file_error'] . '<br />';
         }
     }
 }
 //检测注册账号合法性
 if ($_POST['system_user'] && $_POST['system_pass'] && $_POST['system_pass_confirm']) {
     //检查用户名格式
     if (strlen($_POST['system_user']) == 0) {
         $errtext .= $jieqiLang[JIEQI_MODULE_NAME]['need_user_name'] . '<br />';
     }
     if (!jieqi_safestring($_POST['system_user']) || strpos($_POST['system_user'], ' ') !== false) {
         $errtext .= $jieqiLang[JIEQI_MODULE_NAME]['error_user_format'] . '<br />';
     }
     if ($jieqiConfigs['system']['usernamelimit'] == 1 && !preg_match('/^[A-Za-z0-9]+$/', $_POST['system_user'])) {
         $errtext .= $jieqiLang[JIEQI_MODULE_NAME]['username_need_engnum'] . '<br />';
     }
     //检查密码
     if (strlen($_POST['system_pass']) == 0 || strlen($_POST['system_pass_confirm']) == 0) {
         $errtext .= $jieqiLang[JIEQI_MODULE_NAME]['need_pass_word'] . '<br />';
     }
     if ($_POST['system_pass'] != $_POST['system_pass_confirm']) {
         $errtext .= $jieqiLang[JIEQI_MODULE_NAME]['pass_not_equal'] . '<br />';
     }
     //检查Email
     if (strlen($_POST['system_email']) == 0) {
         $errtext .= $jieqiLang[JIEQI_MODULE_NAME]['need_email'] . '<br />';
Exemplo n.º 3
0
    $_REQUEST['action'] = 'obook';
}
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
$obook_static_url = empty($jieqiConfigs['obook']['staticurl']) ? $jieqiModules['obook']['url'] : $jieqiConfigs['obook']['staticurl'];
$obook_dynamic_url = empty($jieqiConfigs['obook']['dynamicurl']) ? $jieqiModules['obook']['url'] : $jieqiConfigs['obook']['dynamicurl'];
switch ($_REQUEST['action']) {
    case 'newobook':
        $_POST['obookname'] = trim($_POST['obookname']);
        $_POST['author'] = trim($_POST['author']);
        $_POST['agent'] = trim($_POST['agent']);
        $errtext = '';
        include_once JIEQI_ROOT_PATH . '/lib/text/textfunction.php';
        //检查标题
        if (strlen($_POST['obookname']) == 0) {
            $errtext .= $jieqiLang['obook']['need_obook_title'] . '<br />';
        } elseif (!jieqi_safestring($_POST['obookname'])) {
            $errtext .= $jieqiLang['obook']['limit_obook_title'] . '<br />';
        }
        if (!empty($_FILES['obookspic']['name'])) {
            if (eregi("\\.(gif|jpg|jpeg|png|bmp|swf|svg)\$", $_FILES['obookspic']['name'])) {
                if (strstr(strtolower($_FILES['obookspic']['name']), strtolower($jieqiConfigs['obook']['imagetype'])) != strtolower($jieqiConfigs['obook']['imagetype'])) {
                    $errtext .= sprintf($jieqiLang['obook']['simage_type_error'], $jieqiConfigs['obook']['imagetype']) . '<br />';
                }
            } else {
                $errtext .= sprintf($jieqiLang['obook']['simage_not_image'], $_FILES['obookspic']['name']) . '<br />';
            }
            if (!empty($errtext)) {
                jieqi_delfile($_FILES['obookspic']['tmp_name']);
            }
        }
        if (!empty($_FILES['obooklpic']['name'])) {
Exemplo n.º 4
0
jieqi_getconfigs(JIEQI_MODULE_NAME, 'option', 'jieqiOption');
$article_static_url = empty($jieqiConfigs['article']['staticurl']) ? $jieqiModules['article']['url'] : $jieqiConfigs['article']['staticurl'];
$article_dynamic_url = empty($jieqiConfigs['article']['dynamicurl']) ? $jieqiModules['article']['url'] : $jieqiConfigs['article']['dynamicurl'];
switch ($_REQUEST['action']) {
    case 'newarticle':
        $_POST['articlename'] = trim($_POST['articlename']);
        $_POST['author'] = trim($_POST['author']);
        $_POST['agent'] = trim($_POST['agent']);
        //$_POST['author'] = strtolower(trim($_POST['author']));
        //$_POST['agent'] = strtolower(trim($_POST['agent']));
        $errtext = '';
        include_once JIEQI_ROOT_PATH . '/lib/text/textfunction.php';
        //检查标题
        if (strlen($_POST['articlename']) == 0) {
            $errtext .= $jieqiLang['article']['need_article_title'] . '<br />';
        } elseif (!jieqi_safestring($_POST['articlename'])) {
            $errtext .= $jieqiLang['article']['limit_article_title'] . '<br />';
        }
        //检查标题和简介有没有违禁单词
        if (!isset($jieqiConfigs['system'])) {
            jieqi_getconfigs('system', 'configs');
        }
        if (!empty($jieqiConfigs['system']['postdenywords'])) {
            include_once JIEQI_ROOT_PATH . '/include/checker.php';
            $checker = new JieqiChecker();
            $matchwords1 = $checker->deny_words($_POST['articlename'], $jieqiConfigs['system']['postdenywords'], true);
            $matchwords2 = $checker->deny_words($_POST['intro'], $jieqiConfigs['system']['postdenywords'], true);
            if (is_array($matchwords1) || is_array($matchwords2)) {
                if (!isset($jieqiLang['system']['post'])) {
                    jieqi_loadlang('post', 'system');
                }