Ejemplo n.º 1
0
 public function actionCreate()
 {
     is_admin();
     $ip = @$_GET['ip'];
     if (valid_ip($ip) == false) {
         header("Location:index.php?action=control_panel&subtab=message");
         exit;
     }
     if (is_baned($ip)) {
         header("Location:index.php?action=control_panel&subtab=ban_ip");
         exit;
     }
     $this->_model->query(sprintf(parse_tbprefix("INSERT INTO <badip> ( ip ) VALUES ( '%s' )"), $ip));
     header("Location:index.php?action=control_panel&subtab=ban_ip");
 }
Ejemplo n.º 2
0
require APPROOT . '/includes/database/YDB.php';
//载入配置文件,若尚未安装则载入默认的配置文件
if (file_exists(conf_path() . '/config.php')) {
    include_once conf_path() . '/config.php';
} else {
    include './sites/default/default.config.php';
}
//定义常量
define('CONFIGFILE', conf_path() . '/config.php');
define('MP_VERSION', '2.0 alpha');
define('THEMEDIR', 'themes/');
define('SMILEYDIR', 'http://mapleleaf.googlecode.com/files/');
if (!function_exists('json_encode')) {
    include 'CJSON.php';
}
include_once 'Imgcode.php';
//载入框架类
require 'ZFramework.php';
//检查服务器支持情况
$gd_exist = gd_loaded();
$zip_support = class_exists('ZipArchive') ? 'On' : 'Off';
if (is_installed()) {
    //若已经安装,执行IP检查
    if (is_baned(getIP())) {
        die('Access denied!');
    }
    is_closedMode();
} elseif ($_GET['action'] != 'install') {
    header("Location:index.php?action=install");
    exit;
}