예제 #1
0
 public function __construct()
 {
     parent::__construct();
     // 取第一个数字作为cid 或者 直接给出 `?c=`: 主要为了兼容MY_Controller
     // m/index/int  m/index?c=int m/?c=int
     if (!$this->input->get('c', TRUE) and array_key_exists("p0", $_GET) and is_numeric($_GET['p0'])) {
         $_GET['c'] = $_GET['p0'];
     }
     // 伪子栏目,用户栏目内部关联的模型,ccid默认为0
     if ($this->input->get('cc', TRUE) and trim($this->input->get('cc')) and is_numeric(trim($this->input->get('cc')))) {
         $this->ccid = $this->input->get('cc', TRUE);
     }
     if ($this->input->get('c', TRUE) and trim($this->input->get('c')) and is_numeric(trim($this->input->get('c')))) {
         $this->cid = $this->input->get('c', TRUE);
         if (!$this->mcol->get_one($this->cid, "title")) {
             show_404();
         }
     } else {
         // 检测开发模式,否则 404
         if (defined('ENVIRONMENT') and ENVIRONMENT == "development") {
             log_message("error", lang('modules_no_cid'));
             show_error(lang('modules_no_cid'));
         } else {
             show_404();
         }
     }
     // TODO: 验证 config 对 对应栏目配置 是否显示处理
     $this->load->model('tags_model', 'mtags');
     $this->load->model('coltypes_model', 'mctypes');
 }
예제 #2
0
 function __construct()
 {
     parent::__construct();
     $this->load->library(array('ion_auth'));
     if (!$this->ion_auth->logged_in()) {
         redirect('/auth', 'refresh');
     }
     $this->load->model(array('admin/quiz_session'));
 }
예제 #3
0
 function __construct()
 {
     $this->s_model = "Tipos_inmueble_model";
     $this->m_model = "tipos_inmueble_model";
     $this->_controller = "tipos_inmueble";
     $this->_view = "admin/tipos_inmueble";
     parent::__construct();
     // Secure the access
     $this->_security();
     // Comprobación de acceso
     $this->utilities->check_security_access_perfiles_or(array("session_es_admin"));
 }
예제 #4
0
파일: log.php 프로젝트: PoppyLi/PCMS
 public function __construct()
 {
     parent::__construct();
     // var_dump($this->model->get_count_mouth());
     // 对log日志严格控制
     $actions = array('index', 'search');
     if (!in_array($this->router->method, $actions)) {
         $vdata = array("status" => 0, "msg" => "非法操作,不提供此功能!");
         if ($this->input->is_ajax_request()) {
             $this->output->set_content_type('application/json')->set_output(json_encode($vdata));
         } else {
             $this->load->view('msg', $vdata);
         }
     }
 }
예제 #5
0
파일: coltypes.php 프로젝트: PoppyLi/PCMS
 public function __construct()
 {
     parent::__construct();
     if (!$this->input->is_ajax_request()) {
         $this->load->helper('valid');
         $status = 1;
         if (isset($_GET['c']) and is_numeric(trim($cid = $this->input->get('c', true)))) {
             $this->cid = trim($cid);
         } else {
             if (isset($_GET['cid']) and is_numeric(trim($cid = $this->input->get('cid', true)))) {
                 $this->cid = trim($cid);
             } else {
                 $this->url_col = site_url();
                 $status = 0;
             }
         }
         // 分类名
         if ($field = $this->input->get('field', true) and is_name(trim($field), 'EN')) {
             $this->name = trim($field);
         } else {
             $status = 0;
         }
         // 返回控制器
         if ($rc = $this->input->get('rc', true) and is_name(trim($rc), 'EN')) {
             $tmp_url = site_url($rc . '/index');
             if ($this->cid) {
                 $tmp_url .= '/' . $this->cid;
             }
             $this->url_col = $tmp_url;
             $this->rc = $rc;
         } else {
             $this->url_col = site_url('welcome');
             $status = 0;
         }
         $this->status = $status;
         if ($this->status === 0) {
             $_GET['back_url'] = $this->url_col;
             $vdata['status'] = 0;
             $vdata['msg'] = '无效页面!';
             $this->view = "msg.php";
             $this->_display($vdata, "msg.php");
         }
     }
     // end is ajax
 }
예제 #6
0
파일: acount.php 프로젝트: PoppyLi/PCMS
 function __construct()
 {
     parent::__construct();
     $this->load->model('Article_model', 'marticle');
 }
예제 #7
0
 function __construct()
 {
     parent::__construct();
 }
예제 #8
0
파일: tags.php 프로젝트: PoppyLi/PCMS
 function __construct()
 {
     parent::__construct();
     // $this->load->library('phpanalysis', array('utf-8', 'utf-8', false), 'pa');
 }
예제 #9
0
파일: media.php 프로젝트: PoppyLi/PCMS
 public function __construct()
 {
     parent::__construct();
     $this->model->change_table('upload');
 }