Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
101
application/controllers/admin/config/Browscapupdate.php
Normal file
101
application/controllers/admin/config/Browscapupdate.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Browscapupdate class
|
||||
*
|
||||
* Copyright (c) CIBoard <www.ciboard.co.kr>
|
||||
*
|
||||
* @author CIBoard (develop@ciboard.co.kr)
|
||||
*/
|
||||
|
||||
/**
|
||||
* 관리자>환경설정>Browscap 업데이트 controller 입니다.
|
||||
*/
|
||||
class Browscapupdate extends CB_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 관리자 페이지 상의 현재 디렉토리입니다
|
||||
* 페이지 이동시 필요한 정보입니다
|
||||
*/
|
||||
public $pagedir = 'config/browscapupdate';
|
||||
|
||||
/**
|
||||
* 모델을 로딩합니다
|
||||
*/
|
||||
protected $models = array();
|
||||
|
||||
/**
|
||||
* 이 컨트롤러의 메인 모델 이름입니다
|
||||
*/
|
||||
protected $modelname = '';
|
||||
|
||||
/**
|
||||
* 헬퍼를 로딩합니다
|
||||
*/
|
||||
protected $helpers = array('form', 'array');
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
/**
|
||||
* 라이브러리를 로딩합니다
|
||||
*/
|
||||
$this->load->library(array('querystring'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Browscap 업데이트 페이지입니다
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_browscapupdate_index';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'index');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_browscapupdate_update';
|
||||
$this->load->event($eventname);
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
Events::trigger('before', $eventname);
|
||||
|
||||
$dir = FCPATH . 'plugin/browscap';
|
||||
if ( ! (is_readable($dir) && is_writeable($dir))) {
|
||||
exit(json_encode(array('success' => 'no', 'message' => 'plugin/browscap 경로가 파일쓰기가 금지되어있습니다. 퍼미션 확인 후에 다시 실행바랍니다')));
|
||||
}
|
||||
|
||||
ini_set('memory_limit', '-1');
|
||||
require_once FCPATH . 'plugin/browscap/Browscap.php';
|
||||
|
||||
$browscap = new phpbrowscap\Browscap($dir);
|
||||
$browscap->updateMethod = 'cURL';
|
||||
$browscap->cacheFilename = 'browscap_cache.php';
|
||||
$browscap->updateCache();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
Events::trigger('after', $eventname);
|
||||
|
||||
exit(json_encode(array('success' => 'ok', 'message' => 'Browscap 업데이트가 완료되었습니다')));
|
||||
}
|
||||
}
|
||||
1105
application/controllers/admin/config/Cbconfigs.php
Normal file
1105
application/controllers/admin/config/Cbconfigs.php
Normal file
File diff suppressed because it is too large
Load Diff
94
application/controllers/admin/config/Cbversion.php
Normal file
94
application/controllers/admin/config/Cbversion.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Cbversion class
|
||||
*
|
||||
* Copyright (c) CIBoard <www.ciboard.co.kr>
|
||||
*
|
||||
* @author CIBoard (develop@ciboard.co.kr)
|
||||
*/
|
||||
|
||||
/**
|
||||
* 관리자>환경설정>버전정보 controller 입니다.
|
||||
*/
|
||||
class Cbversion extends CB_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 관리자 페이지 상의 현재 디렉토리입니다
|
||||
* 페이지 이동시 필요한 정보입니다
|
||||
*/
|
||||
public $pagedir = 'config/cbversion';
|
||||
|
||||
/**
|
||||
* 모델을 로딩합니다
|
||||
*/
|
||||
protected $models = array();
|
||||
|
||||
/**
|
||||
* 이 컨트롤러의 메인 모델 이름입니다
|
||||
*/
|
||||
protected $modelname = '';
|
||||
|
||||
/**
|
||||
* 헬퍼를 로딩합니다
|
||||
*/
|
||||
protected $helpers = array('form', 'array', 'file');
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
/**
|
||||
* 라이브러리를 로딩합니다
|
||||
*/
|
||||
$this->load->library(array('requests'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 버전정보 페이지입니다
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_cbversion_index';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
Requests::register_autoloader();
|
||||
$headers = array('Accept' => 'application/json');
|
||||
$postdata = array('requesturl' => current_full_url(), 'package' => CB_PACKAGE, 'version' => CB_VERSION);
|
||||
|
||||
try {
|
||||
$request = Requests::post(config_item('ciboard_check_latest_version'), $headers, $postdata);
|
||||
$view['view']['latest_versions'] = json_decode($request->body, true);
|
||||
if (strtolower(CB_PACKAGE) === 'pro') {
|
||||
$view['view']['latest_version_name'] = $view['view']['latest_versions']['pro_version'];
|
||||
$view['view']['latest_download_url'] = $view['view']['latest_versions']['pro_downloadurl'];
|
||||
} else {
|
||||
$view['view']['latest_version_name'] = $view['view']['latest_versions']['lite_version'];
|
||||
$view['view']['latest_download_url'] = $view['view']['latest_versions']['lite_downloadurl'];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
log_message('error', 'Caught exception: '.$e->getMessage());
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'index');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
}
|
||||
848
application/controllers/admin/config/Cleanlog.php
Normal file
848
application/controllers/admin/config/Cleanlog.php
Normal file
@@ -0,0 +1,848 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Cleanlog class
|
||||
*
|
||||
* Copyright (c) CIBoard <www.ciboard.co.kr>
|
||||
*
|
||||
* @author CIBoard (develop@ciboard.co.kr)
|
||||
*/
|
||||
|
||||
/**
|
||||
* 관리자>환경설정>오래된로그삭제 controller 입니다.
|
||||
*/
|
||||
class Cleanlog extends CB_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 관리자 페이지 상의 현재 디렉토리입니다
|
||||
* 페이지 이동시 필요한 정보입니다
|
||||
*/
|
||||
public $pagedir = 'config/cleanlog';
|
||||
|
||||
/**
|
||||
* 모델을 로딩합니다
|
||||
*/
|
||||
protected $models = array();
|
||||
|
||||
/**
|
||||
* 이 컨트롤러의 메인 모델 이름입니다
|
||||
*/
|
||||
protected $modelname = '';
|
||||
|
||||
/**
|
||||
* 헬퍼를 로딩합니다
|
||||
*/
|
||||
protected $helpers = array('form', 'array', 'file');
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
/**
|
||||
* 라이브러리를 로딩합니다
|
||||
*/
|
||||
$this->load->library(array('querystring'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 오래된로그 삭제>캐시삭제 페이지입니다
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$this->cache();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 오래된로그 삭제>캐시삭제 페이지입니다
|
||||
*/
|
||||
public function cache()
|
||||
{
|
||||
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_cleanlog_cache';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'execute',
|
||||
'label' => '실행',
|
||||
'rules' => 'trim',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
$result = $this->cache->clean();
|
||||
if ($result !== false) {
|
||||
$view['view']['alert_message'] = '캐시가 삭제되었습니다';
|
||||
} else {
|
||||
$view['view']['alert_message'] = '캐시 삭제에 실패했습니다';
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'cache');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
/**
|
||||
* 오래된로그 삭제>썸네일삭제 페이지입니다
|
||||
*/
|
||||
public function thumbnail()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_cleanlog_thumbnail';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'execute',
|
||||
'label' => '실행',
|
||||
'rules' => 'trim',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
$result = delete_files(config_item('uploads_dir') . '/cache/', true);
|
||||
if ($result !== false) {
|
||||
$view['view']['alert_message'] = '썸네일이 모두 삭제되었습니다';
|
||||
} else {
|
||||
$view['view']['alert_message'] = '썸네일 삭제에 실패했습니다';
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'thumbnail');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
/**
|
||||
* 오래된로그 삭제>방문자로그삭제 페이지입니다
|
||||
*/
|
||||
public function visitlog()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_cleanlog_visitlog';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
$this->load->model(array('Stat_count_model', 'Stat_count_date_model'));
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'day',
|
||||
'label' => '기간',
|
||||
'rules' => 'trim|required|numeric|is_natural',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
if ($this->input->post('criterion') && $this->input->post('day')) {
|
||||
|
||||
$deletewhere = array(
|
||||
'sco_date <=' => $this->input->post('criterion'),
|
||||
);
|
||||
$this->Stat_count_model->delete_where($deletewhere);
|
||||
|
||||
$deletewhere = array(
|
||||
'scd_date <=' => $this->input->post('criterion')
|
||||
);
|
||||
$this->Stat_count_date_model->delete_where($deletewhere);
|
||||
|
||||
$view['view']['alert_message'] = '총 ' . number_format($this->input->post('log_count')) . ' 건의 '
|
||||
. $this->input->post('day') . '일 이상된 방문자로그가 모두 삭제되었습니다';
|
||||
|
||||
} else {
|
||||
|
||||
$criterion = cdate('Y-m-d', ctimestamp() - $this->input->post('day') * 24 * 60 * 60);
|
||||
|
||||
$countwhere = array(
|
||||
'sco_date <=' => $criterion,
|
||||
);
|
||||
$log_count = $this->Stat_count_model->count_by($countwhere);
|
||||
|
||||
$view['view']['criterion'] = $criterion;
|
||||
$view['view']['day'] = $this->input->post('day');
|
||||
$view['view']['log_count'] = $log_count;
|
||||
|
||||
if ($log_count > 0) {
|
||||
$view['view']['msg'] = '총 ' . number_format($log_count) . ' 건의 ' . $this->input->post('day')
|
||||
. '일 이상된 방문자로그가 발견되었습니다. 이를 모두 삭제하시겠습니까?';
|
||||
} else {
|
||||
$view['view']['alert_message'] = $this->input->post('day')
|
||||
. '일 이상된 방문자로그가 발견되지 않았습니다';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'visitlog');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
/**
|
||||
* 오래된로그 삭제>로그인로그삭제 페이지입니다
|
||||
*/
|
||||
public function loginlog()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_cleanlog_loginlog';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
$this->load->model('Member_login_log_model');
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'day',
|
||||
'label' => '기간',
|
||||
'rules' => 'trim|required|numeric|is_natural',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
if ($this->input->post('criterion') && $this->input->post('day')) {
|
||||
|
||||
$deletewhere = array(
|
||||
'mll_datetime <=' => $this->input->post('criterion'),
|
||||
);
|
||||
$this->Member_login_log_model->delete_where($deletewhere);
|
||||
|
||||
$view['view']['alert_message'] = '총 ' . number_format($this->input->post('log_count')) . ' 건의 '
|
||||
. $this->input->post('day') . '일 이상된 로그인로그가 모두 삭제되었습니다';
|
||||
|
||||
} else {
|
||||
|
||||
$criterion = cdate('Y-m-d H:i:s', ctimestamp() - $this->input->post('day') * 24 * 60 * 60);
|
||||
|
||||
$countwhere = array(
|
||||
'mll_datetime <=' => $criterion,
|
||||
);
|
||||
$log_count = $this->Member_login_log_model->count_by($countwhere);
|
||||
$view['view']['criterion'] = $criterion;
|
||||
$view['view']['day'] = $this->input->post('day');
|
||||
$view['view']['log_count'] = $log_count;
|
||||
if ($log_count > 0) {
|
||||
$view['view']['msg'] = '총 ' . number_format($log_count) . ' 건의 ' . $this->input->post('day')
|
||||
. '일 이상된 로그인로그가 발견되었습니다. 이를 모두 삭제하시겠습니까?';
|
||||
} else {
|
||||
$view['view']['alert_message'] = $this->input->post('day') . '일 이상된 로그인로그가 발견되지 않았습니다';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'loginlog');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
/**
|
||||
* 오래된로그 삭제>파일다운로드로그삭제 페이지입니다
|
||||
*/
|
||||
public function filedownloadlog()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_cleanlog_filedownloadlog';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
$this->load->model('Post_file_download_log_model');
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'day',
|
||||
'label' => '기간',
|
||||
'rules' => 'trim|required|numeric|is_natural',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
if ($this->input->post('criterion') && $this->input->post('day')) {
|
||||
|
||||
$deletewhere = array(
|
||||
'pfd_datetime <=' => $this->input->post('criterion'),
|
||||
);
|
||||
$this->Post_file_download_log_model->delete_where($deletewhere);
|
||||
|
||||
$view['view']['alert_message'] = '총 ' . number_format($this->input->post('log_count')) . ' 건의 '
|
||||
. $this->input->post('day') . '일 이상된 파일 다운로드 로그가 모두 삭제되었습니다';
|
||||
|
||||
} else {
|
||||
|
||||
$criterion = cdate('Y-m-d H:i:s', ctimestamp() - $this->input->post('day') * 24 * 60 * 60);
|
||||
$countwhere = array(
|
||||
'pfd_datetime <=' => $criterion,
|
||||
);
|
||||
$log_count = $this->Post_file_download_log_model->count_by($countwhere);
|
||||
$view['view']['criterion'] = $criterion;
|
||||
$view['view']['day'] = $this->input->post('day');
|
||||
$view['view']['log_count'] = $log_count;
|
||||
if ($log_count > 0) {
|
||||
$view['view']['msg'] = '총 ' . number_format($log_count) . ' 건의 ' . $this->input->post('day') . '일 이상된 파일 다운로드 로그가 발견되었습니다. 이를 모두 삭제하시겠습니까?';
|
||||
} else {
|
||||
$view['view']['alert_message'] = $this->input->post('day') . '일 이상된 파일 다운로드 로그가 발견되지 않았습니다';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'filedownloadlog');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
/**
|
||||
* 오래된로그 삭제>게시물변경로그삭제 페이지입니다
|
||||
*/
|
||||
public function posthistory()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_cleanlog_posthistory';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
$this->load->model('Post_history_model');
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'day',
|
||||
'label' => '기간',
|
||||
'rules' => 'trim|required|numeric|is_natural',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
if ($this->input->post('criterion') && $this->input->post('day')) {
|
||||
$deletewhere = array(
|
||||
'phi_datetime <=' => $this->input->post('criterion'),
|
||||
);
|
||||
$this->Post_history_model->delete_where($deletewhere);
|
||||
$view['view']['alert_message'] = '총 ' . number_format($this->input->post('log_count')) . ' 건의 ' . $this->input->post('day') . '일 이상된 게시물변경로그가 모두 삭제되었습니다';
|
||||
} else {
|
||||
$criterion = cdate('Y-m-d H:i:s', ctimestamp() - $this->input->post('day') * 24 * 60 * 60);
|
||||
$countwhere = array(
|
||||
'phi_datetime <=' => $criterion,
|
||||
);
|
||||
$log_count = $this->Post_history_model->count_by($countwhere);
|
||||
$view['view']['criterion'] = $criterion;
|
||||
$view['view']['day'] = $this->input->post('day');
|
||||
$view['view']['log_count'] = $log_count;
|
||||
if ($log_count > 0) {
|
||||
$view['view']['msg'] = '총 ' . number_format($log_count) . ' 건의 ' . $this->input->post('day') . '일 이상된 게시물변경로그가 발견되었습니다. 이를 모두 삭제하시겠습니까?';
|
||||
} else {
|
||||
$view['view']['alert_message'] = $this->input->post('day') . '일 이상된 게시물변경로그로그가 발견되지 않았습니다';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'posthistory');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
/**
|
||||
* 오래된로그 삭제>링크클릭로그 삭제 페이지입니다
|
||||
*/
|
||||
public function linkclicklog()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_cleanlog_linkclicklog';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
$this->load->model('Post_link_click_log_model');
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'day',
|
||||
'label' => '기간',
|
||||
'rules' => 'trim|required|numeric|is_natural',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
if ($this->input->post('criterion') && $this->input->post('day')) {
|
||||
|
||||
$deletewhere = array(
|
||||
'plc_datetime <=' => $this->input->post('criterion'),
|
||||
);
|
||||
$this->Post_link_click_log_model->delete_where($deletewhere);
|
||||
|
||||
$view['view']['alert_message'] = '총 ' . number_format($this->input->post('log_count')) . ' 건의 ' . $this->input->post('day') . '일 이상된 링크클릭로그가 모두 삭제되었습니다';
|
||||
} else {
|
||||
$criterion = cdate('Y-m-d H:i:s', ctimestamp() - $this->input->post('day') * 24 * 60 * 60);
|
||||
$countwhere = array(
|
||||
'plc_datetime <=' => $criterion,
|
||||
);
|
||||
$log_count = $this->Post_link_click_log_model->count_by($countwhere);
|
||||
$view['view']['criterion'] = $criterion;
|
||||
$view['view']['day'] = $this->input->post('day');
|
||||
$view['view']['log_count'] = $log_count;
|
||||
if ($log_count > 0) {
|
||||
$view['view']['msg'] = '총 ' . number_format($log_count) . ' 건의 ' . $this->input->post('day') . '일 이상된 링크클릭로그가 발견되었습니다. 이를 모두 삭제하시겠습니까?';
|
||||
} else {
|
||||
$view['view']['alert_message'] = $this->input->post('day') . '일 이상된 링크클릭로그가 발견되지 않았습니다';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'linkclicklog');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
/**
|
||||
* 오래된로그 삭제>오래된쪽지삭제 페이지입니다
|
||||
*/
|
||||
public function note()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_cleanlog_note';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
$this->load->model('Note_model');
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'day',
|
||||
'label' => '기간',
|
||||
'rules' => 'trim|required|numeric|is_natural',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
if ($this->input->post('criterion') && $this->input->post('day')) {
|
||||
$deletewhere = array(
|
||||
'nte_datetime <=' => $this->input->post('criterion')
|
||||
);
|
||||
$this->Note_model->delete_where($deletewhere);
|
||||
|
||||
$view['view']['alert_message'] = '총 ' . number_format($this->input->post('log_count')) . ' 건의 ' . $this->input->post('day') . '일 이상된 쪽지가 모두 삭제되었습니다';
|
||||
|
||||
} else {
|
||||
$criterion = cdate('Y-m-d H:i:s', ctimestamp() - $this->input->post('day') * 24 * 60 * 60);
|
||||
$countwhere = array(
|
||||
'nte_datetime <=' => $criterion,
|
||||
);
|
||||
$log_count = $this->Note_model->count_by($countwhere);
|
||||
$view['view']['criterion'] = $criterion;
|
||||
$view['view']['day'] = $this->input->post('day');
|
||||
$view['view']['log_count'] = $log_count;
|
||||
if ($log_count > 0) {
|
||||
$view['view']['msg'] = '총 ' . number_format($log_count) . ' 건의 ' . $this->input->post('day') . '일 이상된 쪽지가 발견되었습니다. 이를 모두 삭제하시겠습니까?';
|
||||
} else {
|
||||
$view['view']['alert_message'] = $this->input->post('day') . '일 이상된 쪽지가 발견되지 않았습니다';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'note');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
/**
|
||||
* 오래된로그 삭제>자동로그인로그삭제 페이지입니다
|
||||
*/
|
||||
public function autologin()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_cleanlog_autologin';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'day',
|
||||
'label' => '기간',
|
||||
'rules' => 'trim|required|numeric|is_natural',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
$this->load->model('Autologin_model');
|
||||
if ($this->input->post('criterion') && $this->input->post('day')) {
|
||||
$deletewhere = array(
|
||||
'aul_datetime <=' => $this->input->post('criterion'),
|
||||
);
|
||||
$this->Autologin_model->delete_where($deletewhere);
|
||||
$view['view']['alert_message'] = '총 ' . number_format($this->input->post('log_count')) . ' 건의 ' . $this->input->post('day') . '일 이상된 자동로그인로그가 모두 삭제되었습니다';
|
||||
} else {
|
||||
$criterion = cdate('Y-m-d H:i:s', ctimestamp() - $this->input->post('day') * 24 * 60 * 60);
|
||||
$countwhere = array(
|
||||
'aul_datetime <=' => $criterion,
|
||||
);
|
||||
$log_count = $this->Autologin_model->count_by($countwhere);
|
||||
$view['view']['criterion'] = $criterion;
|
||||
$view['view']['day'] = $this->input->post('day');
|
||||
$view['view']['log_count'] = $log_count;
|
||||
if ($log_count > 0) {
|
||||
$view['view']['msg'] = '총 ' . number_format($log_count) . ' 건의 ' . $this->input->post('day') . '일 이상된 자동로그인로그가 발견되었습니다. 이를 모두 삭제하시겠습니까?';
|
||||
} else {
|
||||
$view['view']['alert_message'] = $this->input->post('day') . '일 이상된 자동로그인로그가 발견되지 않았습니다';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'autologin');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
}
|
||||
130
application/controllers/admin/config/Dbupgrade.php
Normal file
130
application/controllers/admin/config/Dbupgrade.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Dbupgrade class
|
||||
*
|
||||
* Copyright (c) CIBoard <www.ciboard.co.kr>
|
||||
*
|
||||
* @author CIBoard (develop@ciboard.co.kr)
|
||||
*/
|
||||
|
||||
/**
|
||||
* 관리자>환경설정>DB 업그레이드 controller 입니다.
|
||||
*/
|
||||
class Dbupgrade extends CB_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 관리자 페이지 상의 현재 디렉토리입니다
|
||||
* 페이지 이동시 필요한 정보입니다
|
||||
*/
|
||||
public $pagedir = 'config/dbupgrade';
|
||||
|
||||
/**
|
||||
* 모델을 로딩합니다
|
||||
*/
|
||||
protected $models = array();
|
||||
|
||||
/**
|
||||
* 이 컨트롤러의 메인 모델 이름입니다
|
||||
*/
|
||||
protected $modelname = '';
|
||||
|
||||
/**
|
||||
* 헬퍼를 로딩합니다
|
||||
*/
|
||||
protected $helpers = array('form', 'array');
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
/**
|
||||
* 라이브러리를 로딩합니다
|
||||
*/
|
||||
$this->load->library(array('querystring'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 디비 업그레이드 페이지입니다
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_dbupgrade_index';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* 마이그레이션 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('migration');
|
||||
$this->config->load('migration');
|
||||
$row = $this->db->get('migrations')->row();
|
||||
$view['view']['current_version'] = $row ? $row->version : 0;
|
||||
$view['view']['latest_version'] = $latest_version = config_item('migration_version');
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'execute',
|
||||
'label' => '실행',
|
||||
'rules' => 'trim',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
if ($this->migration->version($latest_version) === false) {
|
||||
$view['view']['alert_message'] = $this->migration->error_string();
|
||||
} else {
|
||||
$row = $this->db->get('migrations')->row();
|
||||
$view['view']['current_version'] = $row ? $row->version : 0;
|
||||
$view['view']['latest_version'] = config_item('migration_version');
|
||||
$view['view']['alert_message'] = '최신버전으로 업그레이드가 완료되었습니다';
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'index');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
}
|
||||
1333
application/controllers/admin/config/Emailform.php
Normal file
1333
application/controllers/admin/config/Emailform.php
Normal file
File diff suppressed because it is too large
Load Diff
1500
application/controllers/admin/config/Layoutskin.php
Normal file
1500
application/controllers/admin/config/Layoutskin.php
Normal file
File diff suppressed because it is too large
Load Diff
1014
application/controllers/admin/config/Memberconfig.php
Normal file
1014
application/controllers/admin/config/Memberconfig.php
Normal file
File diff suppressed because it is too large
Load Diff
124
application/controllers/admin/config/Optimize.php
Normal file
124
application/controllers/admin/config/Optimize.php
Normal file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Optimize class
|
||||
*
|
||||
* Copyright (c) CIBoard <www.ciboard.co.kr>
|
||||
*
|
||||
* @author CIBoard (develop@ciboard.co.kr)
|
||||
*/
|
||||
|
||||
/**
|
||||
* 관리자>환경설정>복구/최적화 controller 입니다.
|
||||
*/
|
||||
class Optimize extends CB_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 관리자 페이지 상의 현재 디렉토리입니다
|
||||
* 페이지 이동시 필요한 정보입니다
|
||||
*/
|
||||
public $pagedir = 'config/optimize';
|
||||
|
||||
/**
|
||||
* 모델을 로딩합니다
|
||||
*/
|
||||
protected $models = array();
|
||||
|
||||
/**
|
||||
* 이 컨트롤러의 메인 모델 이름입니다
|
||||
*/
|
||||
protected $modelname = '';
|
||||
|
||||
/**
|
||||
* 헬퍼를 로딩합니다
|
||||
*/
|
||||
protected $helpers = array('form', 'array');
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
/**
|
||||
* 라이브러리를 로딩합니다
|
||||
*/
|
||||
$this->load->library(array('querystring'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 복구/최적화 페이지입니다
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_optimize_index';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'execute',
|
||||
'label' => '실행',
|
||||
'rules' => 'trim',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
$view['view']['alert_message'] = '';
|
||||
$this->load->dbutil();
|
||||
$result = $this->dbutil->optimize_database();
|
||||
if ($result !== false) {
|
||||
foreach ($result as $key => $val) {
|
||||
$view['view']['alert_message'] .= $key . ' : ' . $val['Msg_text'] . '<br />';
|
||||
}
|
||||
$view['view']['alert_message'] .= '복구/ 최적화가 완료되었습니다';
|
||||
} else {
|
||||
$view['view']['alert_message'] .= '복구/ 최적화에 실패했습니다';
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'index');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
}
|
||||
68
application/controllers/admin/config/Phpinfo.php
Normal file
68
application/controllers/admin/config/Phpinfo.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Phpinfo class
|
||||
*
|
||||
* Copyright (c) CIBoard <www.ciboard.co.kr>
|
||||
*
|
||||
* @author CIBoard (develop@ciboard.co.kr)
|
||||
*/
|
||||
|
||||
/**
|
||||
* 관리자>환경설정>phpinfo controller 입니다.
|
||||
*/
|
||||
class Phpinfo extends CB_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 관리자 페이지 상의 현재 디렉토리입니다
|
||||
* 페이지 이동시 필요한 정보입니다
|
||||
*/
|
||||
public $pagedir = 'config/phpinfo';
|
||||
|
||||
/**
|
||||
* 모델을 로딩합니다
|
||||
*/
|
||||
protected $models = array();
|
||||
|
||||
/**
|
||||
* 이 컨트롤러의 메인 모델 이름입니다
|
||||
*/
|
||||
protected $modelname = '';
|
||||
|
||||
/**
|
||||
* 헬퍼를 로딩합니다
|
||||
*/
|
||||
protected $helpers = array('form', 'array');
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* phpinfo 페이지입니다
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_phpinfo_index';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('skin' => 'index');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = false;
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
}
|
||||
216
application/controllers/admin/config/Preview.php
Normal file
216
application/controllers/admin/config/Preview.php
Normal file
@@ -0,0 +1,216 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Preview class
|
||||
*
|
||||
* Copyright (c) CIBoard <www.ciboard.co.kr>
|
||||
*
|
||||
* @author CIBoard (develop@ciboard.co.kr)
|
||||
*/
|
||||
|
||||
/**
|
||||
* 관리자>환경설정>Preview controller 입니다.
|
||||
*/
|
||||
class Preview extends CB_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 관리자 페이지 상의 현재 디렉토리입니다
|
||||
* 페이지 이동시 필요한 정보입니다
|
||||
*/
|
||||
public $pagedir = 'config/preview';
|
||||
|
||||
/**
|
||||
* 모델을 로딩합니다
|
||||
*/
|
||||
protected $models = array();
|
||||
|
||||
/**
|
||||
* 이 컨트롤러의 메인 모델 이름입니다
|
||||
*/
|
||||
protected $modelname = '';
|
||||
|
||||
/**
|
||||
* 헬퍼를 로딩합니다
|
||||
*/
|
||||
protected $helpers = array('form', 'array');
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Preview 페이지입니다
|
||||
*/
|
||||
public function preview($pagetype)
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_preview_preview';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
$pagename = array(
|
||||
'main' => '메인페이지',
|
||||
'board' => '게시판',
|
||||
'group' => '게시판그룹',
|
||||
'document' => '일반문서페이지',
|
||||
'faq' => 'FAQ',
|
||||
'register' => '회원가입',
|
||||
'findaccount' => '아이디패스워드찾기',
|
||||
'login' => '로그인',
|
||||
'mypage' => '마이페이지',
|
||||
'currentvisitor' => '현재접속자',
|
||||
'search' => '검색페이지',
|
||||
'tag' => '태그페이지',
|
||||
'note' => '쪽지',
|
||||
'profile' => '프로필',
|
||||
'formmail' => '폼메일',
|
||||
'notification' => '알림페이지',
|
||||
'helptool' => '헬프툴',
|
||||
);
|
||||
|
||||
if ( ! element($pagetype, $pagename)) {
|
||||
alert('잘못된 접근입니다');
|
||||
}
|
||||
|
||||
$previewurl = '';
|
||||
$pageurl = '';
|
||||
$use_sidebar_option = true;
|
||||
|
||||
if ($pagetype === 'main'
|
||||
OR $pagetype === 'mypage'
|
||||
OR $pagetype === 'currentvisitor'
|
||||
OR $pagetype === 'notification'
|
||||
OR $pagetype === 'login'
|
||||
OR $pagetype === 'findaccount') {
|
||||
|
||||
$pageurl = $pagetype;
|
||||
|
||||
}
|
||||
if ($pagetype === 'board') {
|
||||
$this->load->model('Post_model');
|
||||
$where = array('post_del' => 0);
|
||||
$latest = $this->Post_model->get('', '', $where, 1, '', 'post_id', 'desc');
|
||||
$val = element(0, $latest);
|
||||
if (empty($val)) {
|
||||
alert_close('최소 1개 이상의 게시물이 작성된 후에 미리보기가 가능합니다');
|
||||
}
|
||||
$pageurl = 'board_post/post/' . element('post_id', $val);
|
||||
}
|
||||
if ($pagetype === 'group') {
|
||||
$this->load->model('Board_group_model');
|
||||
$val = $this->Board_group_model->get_one();
|
||||
|
||||
if (empty($val)) {
|
||||
alert_close('최소 1개 이상의 그룹이 생성된 후에 미리보기가 가능합니다');
|
||||
}
|
||||
$pageurl = 'group/index/' . element('bgr_key', $val);
|
||||
}
|
||||
if ($pagetype === 'document') {
|
||||
$this->load->model('Document_model');
|
||||
$latest = $this->Document_model->get('', '', '', 1, '', 'doc_id', 'desc');
|
||||
$val = element(0, $latest);
|
||||
if (empty($val)) {
|
||||
alert_close('최소 1개 이상의 일반문서가 작성된 후에 미리보기가 가능합니다');
|
||||
}
|
||||
$pageurl = 'document/index/' . element('doc_key', $val);
|
||||
}
|
||||
if ($pagetype === 'faq') {
|
||||
$this->load->model('Faq_group_model');
|
||||
$latest = $this->Faq_group_model->get('', '', '', 1, '', 'fgr_id', 'desc');
|
||||
$val = element(0, $latest);
|
||||
if (empty($val)) {
|
||||
alert_close('최소 1개 이상의 FAQ가 작성된 후에 미리보기가 가능합니다');
|
||||
}
|
||||
$pageurl = 'faq/index/' . element('fgr_key', $val);
|
||||
}
|
||||
if ($pagetype === 'search') {
|
||||
$pageurl = 'search/?skeyword=검색&';
|
||||
}
|
||||
if ($pagetype === 'tag') {
|
||||
$this->load->model('Post_tag_model');
|
||||
$latest = $this->Post_tag_model->get('', '', '', 1, '', 'pta_id', 'desc');
|
||||
$val = element(0, $latest);
|
||||
if (empty($val)) {
|
||||
alert_close('최소 1개 이상의 태그가 작성된 후에 미리보기가 가능합니다');
|
||||
}
|
||||
$pageurl = 'tags/?tag=' . element('pta_tag', $val) . '&';
|
||||
}
|
||||
if ($pagetype === 'note') {
|
||||
$use_sidebar_option = false;
|
||||
$this->load->model('Note_model');
|
||||
$where = array(
|
||||
'recv_mem_id' => $this->member->item('mem_id'),
|
||||
'nte_type' => 1,
|
||||
);
|
||||
$latest = $this->Note_model->get('', '', $where, 1, '', 'nte_id', 'desc');
|
||||
$val = element(0, $latest);
|
||||
if (empty($val)) {
|
||||
alert_close('최소 1개 이상의 쪽지를 수신한 후에 미리보기가 가능합니다');
|
||||
}
|
||||
$pageurl = 'note/view/recv/' . element('nte_id', $val);
|
||||
}
|
||||
if ($pagetype === 'profile') {
|
||||
$use_sidebar_option = false;
|
||||
$pageurl = 'profile/index/' . $this->member->item('mem_userid');
|
||||
}
|
||||
if ($pagetype === 'formmail') {
|
||||
$use_sidebar_option = false;
|
||||
$pageurl = 'formmail/write/' . $this->member->item('mem_userid');
|
||||
}
|
||||
if ($pagetype === 'helptool') {
|
||||
$use_sidebar_option = false;
|
||||
$pageurl = 'helptool/emoticon';
|
||||
}
|
||||
if ($pagetype === 'register') {
|
||||
$pageurl = 'register/form';
|
||||
}
|
||||
|
||||
$previewurl = admin_url('preview/adminshow/' . $pageurl);
|
||||
$previewurl .= '?layout=' . $this->input->get('layout', null, '') . '&sidebar=' . $this->input->get('sidebar', null, '') . '&skin=' . $this->input->get('skin', null, '') . '&is_mobile=' . $this->input->get('is_mobile', null, '');
|
||||
|
||||
$view['view']['pagetype'] = $pagetype;
|
||||
$view['view']['previewurl'] = $previewurl;
|
||||
$view['view']['use_sidebar_option'] = $use_sidebar_option;
|
||||
$view['view']['pagename'] = element($pagetype, $pagename);
|
||||
$view['view']['layout_option'] = get_skin_name(
|
||||
'_layout',
|
||||
$this->input->get('layout', null, ''),
|
||||
'기본설정따름'
|
||||
);
|
||||
$view['view']['skin_option'] = get_skin_name(
|
||||
$pagetype,
|
||||
$this->input->get('skin', null, ''),
|
||||
'기본설정따름'
|
||||
);
|
||||
$view['view']['mobile_layout_option'] = get_skin_name(
|
||||
'_layout',
|
||||
$this->input->get('mobile_layout', null, ''),
|
||||
'기본설정따름'
|
||||
);
|
||||
$view['view']['mobile_skin_option'] = get_skin_name(
|
||||
$pagetype,
|
||||
$this->input->get('mobile_skin', null, ''),
|
||||
'기본설정따름'
|
||||
);
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout_popup', 'skin' => 'index');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
}
|
||||
416
application/controllers/admin/config/Rssconfig.php
Normal file
416
application/controllers/admin/config/Rssconfig.php
Normal file
@@ -0,0 +1,416 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Rssconfig class
|
||||
*
|
||||
* Copyright (c) CIBoard <www.ciboard.co.kr>
|
||||
*
|
||||
* @author CIBoard (develop@ciboard.co.kr)
|
||||
*/
|
||||
|
||||
/**
|
||||
* 관리자>환경설정>RSS 피드 controller 입니다.
|
||||
*/
|
||||
class Rssconfig extends CB_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 관리자 페이지 상의 현재 디렉토리입니다
|
||||
* 페이지 이동시 필요한 정보입니다
|
||||
*/
|
||||
public $pagedir = 'config/rssconfig';
|
||||
|
||||
/**
|
||||
* 모델을 로딩합니다
|
||||
*/
|
||||
protected $models = array('Config', 'Board');
|
||||
|
||||
/**
|
||||
* 이 컨트롤러의 메인 모델 이름입니다
|
||||
*/
|
||||
protected $modelname = 'Config_model';
|
||||
|
||||
/**
|
||||
* 헬퍼를 로딩합니다
|
||||
*/
|
||||
protected $helpers = array('form', 'array');
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* 환경설정>RSS 피드 페이지입니다
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_rssconfig_index';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'is_submit',
|
||||
'label' => '전송',
|
||||
'rules' => 'trim|numeric',
|
||||
),
|
||||
array(
|
||||
'field' => 'use_total_rss_feed',
|
||||
'label' => '통합 RSS 피드사용',
|
||||
'rules' => 'trim|numeric',
|
||||
),
|
||||
array(
|
||||
'field' => 'total_rss_feed_content',
|
||||
'label' => '통합 RSS 내용공개',
|
||||
'rules' => 'trim|numeric',
|
||||
),
|
||||
array(
|
||||
'field' => 'total_rss_feed_title',
|
||||
'label' => '통합 RSS 제목',
|
||||
'rules' => 'trim',
|
||||
),
|
||||
array(
|
||||
'field' => 'total_rss_feed_description',
|
||||
'label' => '통합 RSS 설명',
|
||||
'rules' => 'trim',
|
||||
),
|
||||
array(
|
||||
'field' => 'total_rss_feed_copyright',
|
||||
'label' => 'RSS 표시 저작권',
|
||||
'rules' => 'trim',
|
||||
),
|
||||
array(
|
||||
'field' => 'total_rss_feed_count',
|
||||
'label' => 'RSS 출력 게시물수',
|
||||
'rules' => 'trim|numeric|is_natural',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
$array = array(
|
||||
'use_total_rss_feed', 'total_rss_feed_content', 'total_rss_feed_title',
|
||||
'total_rss_feed_description', 'total_rss_feed_copyright', 'total_rss_feed_count'
|
||||
);
|
||||
foreach ($array as $value) {
|
||||
$savedata[$value] = $this->input->post($value, null, '');
|
||||
}
|
||||
$post_brd_id = $this->input->post('brd_id');
|
||||
$boardlist = $this->Board_model->get_board_list();
|
||||
if ($boardlist && is_array($boardlist)) {
|
||||
$this->load->model('Board_meta_model');
|
||||
foreach ($boardlist as $key => $val) {
|
||||
if (element(element('brd_id', $val), $post_brd_id)) {
|
||||
$metadata = array('use_rss_total_feed' => '1');
|
||||
} else {
|
||||
$metadata = array('use_rss_total_feed' => '');
|
||||
}
|
||||
$this->Board_meta_model->save(element('brd_id', $val), $metadata);
|
||||
}
|
||||
}
|
||||
|
||||
$this->Config_model->save($savedata);
|
||||
$view['view']['alert_message'] = 'RSS 피드설정이 저장되었습니다';
|
||||
}
|
||||
|
||||
$getdata = $this->Config_model->get_all_meta();
|
||||
$view['view']['data'] = $getdata;
|
||||
|
||||
$boardlist = $this->Board_model->get_board_list();
|
||||
if ($boardlist && is_array($boardlist)) {
|
||||
$this->load->model('Board_meta_model');
|
||||
foreach ($boardlist as $key => $val) {
|
||||
$whereboard = array(
|
||||
'brd_id' => element('brd_id', $val),
|
||||
'bmt_key' => 'use_rss_total_feed',
|
||||
);
|
||||
$userss = $this->Board_meta_model->get_one('', '', $whereboard);
|
||||
$boardlist[$key]['userss'] = element('bmt_value', $userss);
|
||||
}
|
||||
}
|
||||
$view['view']['boardlist'] = $boardlist;
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'index');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 환경설정>사이트맵 페이지입니다
|
||||
*/
|
||||
public function sitemap()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_rssconfig_sitemap';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'is_submit',
|
||||
'label' => '전송',
|
||||
'rules' => 'trim|numeric',
|
||||
),
|
||||
array(
|
||||
'field' => 'use_sitemap',
|
||||
'label' => '사이트맵 사용',
|
||||
'rules' => 'trim|numeric',
|
||||
),
|
||||
array(
|
||||
'field' => 'sitemap_count',
|
||||
'label' => '사이트맵 출력 게시물수',
|
||||
'rules' => 'trim|numeric|is_natural',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
$array = array(
|
||||
'use_sitemap', 'sitemap_count'
|
||||
);
|
||||
foreach ($array as $value) {
|
||||
$savedata[$value] = $this->input->post($value, null, '');
|
||||
}
|
||||
$post_brd_id = $this->input->post('brd_id');
|
||||
$boardlist = $this->Board_model->get_board_list();
|
||||
if ($boardlist && is_array($boardlist)) {
|
||||
$this->load->model('Board_meta_model');
|
||||
foreach ($boardlist as $key => $val) {
|
||||
if (element(element('brd_id', $val), $post_brd_id)) {
|
||||
$metadata = array('use_sitemap' => '1');
|
||||
} else {
|
||||
$metadata = array('use_sitemap' => '');
|
||||
}
|
||||
$this->Board_meta_model->save(element('brd_id', $val), $metadata);
|
||||
}
|
||||
}
|
||||
|
||||
$this->Config_model->save($savedata);
|
||||
$view['view']['alert_message'] = '사이트맵 설정이 저장되었습니다';
|
||||
}
|
||||
|
||||
$getdata = $this->Config_model->get_all_meta();
|
||||
if ( ! element('sitemap_count', $getdata)) {
|
||||
$getdata['sitemap_count'] = 100;
|
||||
}
|
||||
$view['view']['data'] = $getdata;
|
||||
|
||||
$boardlist = $this->Board_model->get_board_list();
|
||||
if ($boardlist && is_array($boardlist)) {
|
||||
$this->load->model('Board_meta_model');
|
||||
foreach ($boardlist as $key => $val) {
|
||||
$whereboard = array(
|
||||
'brd_id' => element('brd_id', $val),
|
||||
'bmt_key' => 'use_sitemap',
|
||||
);
|
||||
$usesitemap = $this->Board_meta_model->get_one('', '', $whereboard);
|
||||
$boardlist[$key]['usesitemap'] = element('bmt_value', $usesitemap);
|
||||
}
|
||||
}
|
||||
$view['view']['boardlist'] = $boardlist;
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'sitemap');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 환경설정>네이버 블로그 글쓰기 관리 페이지입니다
|
||||
*/
|
||||
public function naverblog()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_rssconfig_naverblog';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'is_submit',
|
||||
'label' => '전송',
|
||||
'rules' => 'trim|numeric',
|
||||
),
|
||||
array(
|
||||
'field' => 'use_naver_blog_post',
|
||||
'label' => '네이버 블로그 자동 글쓰기 기능 사용',
|
||||
'rules' => 'trim|numeric',
|
||||
),
|
||||
array(
|
||||
'field' => 'naver_blog_userid',
|
||||
'label' => '네이버 블로그 회원 아이디',
|
||||
'rules' => 'trim',
|
||||
),
|
||||
array(
|
||||
'field' => 'naver_blog_api_key',
|
||||
'label' => '네이버 블로그 글쓰기 API',
|
||||
'rules' => 'trim',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
$array = array(
|
||||
'use_naver_blog_post', 'naver_blog_userid', 'naver_blog_api_key'
|
||||
);
|
||||
foreach ($array as $value) {
|
||||
$savedata[$value] = $this->input->post($value, null, '');
|
||||
}
|
||||
$post_brd_id = $this->input->post('brd_id');
|
||||
$boardlist = $this->Board_model->get_board_list();
|
||||
if ($boardlist && is_array($boardlist)) {
|
||||
$this->load->model('Board_meta_model');
|
||||
foreach ($boardlist as $key => $val) {
|
||||
if (element(element('brd_id', $val), $post_brd_id)) {
|
||||
$metadata = array('use_naver_blog_post' => '1');
|
||||
} else {
|
||||
$metadata = array('use_naver_blog_post' => '');
|
||||
}
|
||||
$this->Board_meta_model->save(element('brd_id', $val), $metadata);
|
||||
}
|
||||
}
|
||||
|
||||
$this->Config_model->save($savedata);
|
||||
$view['view']['alert_message'] = '네이버 블로그 자동 글쓰기 설정이 저장되었습니다';
|
||||
}
|
||||
|
||||
$getdata = $this->Config_model->get_all_meta();
|
||||
$view['view']['data'] = $getdata;
|
||||
|
||||
$boardlist = $this->Board_model->get_board_list();
|
||||
if ($boardlist && is_array($boardlist)) {
|
||||
$this->load->model('Board_meta_model');
|
||||
foreach ($boardlist as $key => $val) {
|
||||
$whereboard = array(
|
||||
'brd_id' => element('brd_id', $val),
|
||||
'bmt_key' => 'use_naver_blog_post',
|
||||
);
|
||||
$usenaverblog = $this->Board_meta_model->get_one('', '', $whereboard);
|
||||
$boardlist[$key]['usenaverblog'] = element('bmt_value', $usenaverblog);
|
||||
}
|
||||
}
|
||||
$view['view']['boardlist'] = $boardlist;
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'naverblog');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
}
|
||||
391
application/controllers/admin/config/Scheduler.php
Normal file
391
application/controllers/admin/config/Scheduler.php
Normal file
@@ -0,0 +1,391 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Scheduler class
|
||||
*
|
||||
* Copyright (c) CIBoard <www.ciboard.co.kr>
|
||||
*
|
||||
* @author CIBoard (develop@ciboard.co.kr)
|
||||
*/
|
||||
|
||||
/**
|
||||
* 관리자>환경설정>스케쥴러 관리 controller 입니다.
|
||||
*/
|
||||
class Scheduler extends CB_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 관리자 페이지 상의 현재 디렉토리입니다
|
||||
* 페이지 이동시 필요한 정보입니다
|
||||
*/
|
||||
public $pagedir = 'config/scheduler';
|
||||
|
||||
/**
|
||||
* 모델을 로딩합니다
|
||||
*/
|
||||
protected $models = array('Config');
|
||||
|
||||
/**
|
||||
* 이 컨트롤러의 메인 모델 이름입니다
|
||||
*/
|
||||
protected $modelname = 'Config_model';
|
||||
|
||||
/**
|
||||
* 헬퍼를 로딩합니다
|
||||
*/
|
||||
protected $helpers = array('form', 'array');
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 스케쥴러 관리 페이지입니다
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_scheduler_index';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 's',
|
||||
'label' => '스케쥴러',
|
||||
'rules' => 'trim',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
$updatedata = $this->input->post();
|
||||
|
||||
if ( ! isset($updatedata['library_name']) OR ! is_array($updatedata['library_name'])) {
|
||||
$savedata = array(
|
||||
'scheduler' => '',
|
||||
);
|
||||
$this->Config_model->save($savedata);
|
||||
$view['view']['alert_message'] = '정상적으로 저장되었습니다';
|
||||
} else {
|
||||
$array_count_values = array_count_values($updatedata['library_name']);
|
||||
$fail = false;
|
||||
if ($fail === false) {
|
||||
foreach ($array_count_values as $akey => $aval) {
|
||||
if ($aval > 1) {
|
||||
$view['view']['warning_message'] = $akey . ' 값이 ' . $aval . ' 회 중복 입력되었습니다. 라이브러리명이 중복되지 않게 입력해주세요';
|
||||
$fail = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($fail === false) {
|
||||
foreach (element('library_name', $updatedata) as $fkey => $fval) {
|
||||
if (empty($fval)) {
|
||||
$view['view']['warning_message'] = '비어있는 라이브러리명이 있습니다. 라이브러리 값을 빠뜨리지 말고 입력해주세요';
|
||||
$fail = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($fail === false) {
|
||||
$order = 0;
|
||||
$update = array();
|
||||
|
||||
$alldata = $this->Config_model->get_all_meta();
|
||||
|
||||
$origindata = json_decode(element('scheduler', $alldata), true);
|
||||
|
||||
foreach (element('key', $updatedata) as $key => $value) {
|
||||
|
||||
if ($value) {
|
||||
$update[$value] = array(
|
||||
'library_name' => element($order, element('library_name', $updatedata)),
|
||||
'interval_field_name' => element($value, element('interval_field_name', $updatedata)),
|
||||
'lasttime' => element('lasttime', element(element($order, element('library_name', $updatedata)), $origindata)),
|
||||
|
||||
);
|
||||
} else {
|
||||
$update[$updatedata['library_name'][$order]] = array(
|
||||
'library_name' => element($order, element('library_name', $updatedata)),
|
||||
'interval_field_name' => element($key, element('interval_field_name', $updatedata)),
|
||||
);
|
||||
}
|
||||
$order++;
|
||||
}
|
||||
|
||||
$savedata = array(
|
||||
'scheduler' => json_encode($update),
|
||||
);
|
||||
$this->Config_model->save($savedata);
|
||||
$view['view']['alert_message'] = '정상적으로 저장되었습니다';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$getdata = $this->Config_model->get_all_meta();
|
||||
|
||||
$getdata['result'] = json_decode(element('scheduler', $getdata), true);
|
||||
$getdata['scheduler_interval'] = json_decode(element('scheduler_interval', $getdata), true);
|
||||
|
||||
if ( ! element('scheduler_interval', $getdata) ) {
|
||||
alert('스케쥴 주기명을 먼저 생성하신 후에 스케쥴러 등록이 가능합니다. 스케쥴 주기명 생성 페이지로 이동합니다', admin_url($this->pagedir . '/interval'));
|
||||
}
|
||||
|
||||
if ($getdata['result'] && is_array($getdata['result'])) {
|
||||
foreach ($getdata['result'] as $key => $value) {
|
||||
$getdata['result'][$key]['class_exists'] = '';
|
||||
if (file_exists(APPPATH . 'libraries/Scheduler/' . $key . '.php')) {
|
||||
$this->load->library('Scheduler/' . $key);
|
||||
if (class_exists($key)) {
|
||||
$getdata['result'][$key]['class_exists'] = '1';
|
||||
}
|
||||
}
|
||||
$getdata['result'][$key]['lastexecutetime'] = element('lasttime', $value) ? cdate("Y-m-d H:i:s", element('lasttime', $value)) : '-';
|
||||
$getdata['result'][$key]['nextexecutetime'] = '-';
|
||||
if (
|
||||
element('lasttime', $value)
|
||||
&& ($scheduler_interval = element('scheduler_interval', $getdata))
|
||||
&& ($field_name = element(element('interval_field_name', $value), $scheduler_interval))
|
||||
&& element('interval', $field_name)
|
||||
) {
|
||||
$nexttime = element('lasttime', $value) + element('interval', $field_name);
|
||||
$getdata['result'][$key]['nextexecutetime'] = $nexttime ? cdate("Y-m-d H:i:s", $nexttime) : '-';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$view['view']['data'] = $getdata;
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'index');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 스케쥴러 주기 관리 페이지입니다
|
||||
*/
|
||||
public function interval()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_scheduler_interval';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 's',
|
||||
'label' => '스케쥴러',
|
||||
'rules' => 'trim',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
$updatedata = $this->input->post();
|
||||
|
||||
if ( ! isset($updatedata['field_name']) OR ! is_array($updatedata['field_name'])) {
|
||||
$savedata = array(
|
||||
'scheduler_interval' => '',
|
||||
);
|
||||
$this->Config_model->save($savedata);
|
||||
$view['view']['alert_message'] = '정상적으로 저장되었습니다';
|
||||
} else {
|
||||
$array_count_values = array_count_values($updatedata['field_name']);
|
||||
$fail = false;
|
||||
if ($fail === false) {
|
||||
foreach ($array_count_values as $akey => $aval) {
|
||||
if ($aval > 1) {
|
||||
$view['view']['warning_message'] = $akey . ' 값이 ' . $aval . ' 회 중복 입력되었습니다. ID 값이 중복되지 않게 입력해주세요';
|
||||
$fail = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($fail === false) {
|
||||
foreach (element('field_name', $updatedata) as $fkey => $fval) {
|
||||
if (empty($fval)) {
|
||||
$view['view']['warning_message'] = '비어있는 ID 값이 있습니다. ID 값을 빠뜨리지 말고 입력해주세요';
|
||||
$fail = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($fail === false) {
|
||||
foreach (element('display_name', $updatedata) as $fkey => $fval) {
|
||||
if (empty($fval)) {
|
||||
$view['view']['warning_message'] = '비어있는 주기명이 있습니다. 입력항목제목 값을 빠뜨리지 말고 입력해주세요';
|
||||
$fail = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($fail === false) {
|
||||
$order = 0;
|
||||
$update = array();
|
||||
|
||||
foreach (element('key', $updatedata) as $key => $value) {
|
||||
if ($value) {
|
||||
$update[$value] = array(
|
||||
'field_name' => element($order, element('field_name', $updatedata)),
|
||||
'interval' => element($order, element('interval', $updatedata)),
|
||||
'display_name' => element($order, element('display_name', $updatedata)),
|
||||
);
|
||||
} else {
|
||||
$update[$updatedata['field_name'][$order]] = array(
|
||||
'field_name' => element($order, element('field_name', $updatedata)),
|
||||
'interval' => element($order, element('interval', $updatedata)),
|
||||
'display_name' => element($order, element('display_name', $updatedata)),
|
||||
);
|
||||
}
|
||||
$order++;
|
||||
}
|
||||
|
||||
$savedata = array(
|
||||
'scheduler_interval' => json_encode($update),
|
||||
);
|
||||
$this->Config_model->save($savedata);
|
||||
$view['view']['alert_message'] = '정상적으로 저장되었습니다';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$getdata = $this->Config_model->get_all_meta();
|
||||
|
||||
$getdata['scheduler'] = json_decode(element('scheduler', $getdata), true);
|
||||
$getdata['result'] = json_decode(element('scheduler_interval', $getdata), true);
|
||||
|
||||
if ($getdata['scheduler'] && is_array($getdata['scheduler'])) {
|
||||
foreach ($getdata['scheduler'] as $key => $value) {
|
||||
if ( ! isset($getdata['result'][element('interval_field_name', $value)]['registered_scheduler'])) {
|
||||
$getdata['result'][element('interval_field_name', $value)]['registered_scheduler'] = 0;
|
||||
}
|
||||
$getdata['result'][element('interval_field_name', $value)]['registered_scheduler']++;
|
||||
}
|
||||
}
|
||||
|
||||
$view['view']['data'] = $getdata;
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'interval');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 스케쥴러 실행 페이지입니다
|
||||
*/
|
||||
public function execute($libraryname)
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_scheduler_execute';
|
||||
$this->load->event($eventname);
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
Events::trigger('before', $eventname);
|
||||
|
||||
if (file_exists(APPPATH . 'libraries/Scheduler/' . $libraryname . '.php')) {
|
||||
$this->load->library('Scheduler/' . $libraryname);
|
||||
$s = new $libraryname();
|
||||
if (method_exists($s, 'scheduler')) {
|
||||
$s->scheduler();
|
||||
|
||||
$scheduler_data = $this->cbconfig->item('scheduler');
|
||||
$scheduler_array = json_decode($scheduler_data, true);
|
||||
$interval_data = $this->cbconfig->item('scheduler_interval');
|
||||
$interval_array = json_decode($interval_data, true);
|
||||
|
||||
$scheduler_array[$libraryname]['lasttime'] = ctimestamp();
|
||||
|
||||
$savedata['scheduler'] = json_encode($scheduler_array);
|
||||
$this->load->model('Config_model');
|
||||
$this->Config_model->save($savedata);
|
||||
exit(json_encode(array('success' => 'ok', 'message' => $libraryname . ' 라이브러리가 실행되었습니다.')));
|
||||
} else {
|
||||
exit(json_encode(array('success' => 'fail', 'message' => $libraryname . ' 클래스 안에 scheduler 메소드가 존재하지 않습니다.')));
|
||||
}
|
||||
} else {
|
||||
exit(json_encode(array('success' => 'fail', 'message' => $libraryname . ' 라이브러리가 존재하지 않습니다.')));
|
||||
}
|
||||
}
|
||||
}
|
||||
135
application/controllers/admin/config/Testemail.php
Normal file
135
application/controllers/admin/config/Testemail.php
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Testemail class
|
||||
*
|
||||
* Copyright (c) CIBoard <www.ciboard.co.kr>
|
||||
*
|
||||
* @author CIBoard (develop@ciboard.co.kr)
|
||||
*/
|
||||
|
||||
/**
|
||||
* 관리자>환경설정>메일발송테스트 controller 입니다.
|
||||
*/
|
||||
class Testemail extends CB_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 관리자 페이지 상의 현재 디렉토리입니다
|
||||
* 페이지 이동시 필요한 정보입니다
|
||||
*/
|
||||
public $pagedir = 'config/testemail';
|
||||
|
||||
/**
|
||||
* 모델을 로딩합니다
|
||||
*/
|
||||
protected $models = array();
|
||||
|
||||
/**
|
||||
* 이 컨트롤러의 메인 모델 이름입니다
|
||||
*/
|
||||
protected $modelname = '';
|
||||
|
||||
/**
|
||||
* 헬퍼를 로딩합니다
|
||||
*/
|
||||
protected $helpers = array('form', 'array');
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
/**
|
||||
* 라이브러리를 로딩합니다
|
||||
*/
|
||||
$this->load->library(array('querystring'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 테스트 이메일을 보내는 페이지입니다
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// 이벤트 라이브러리를 로딩합니다
|
||||
$eventname = 'event_admin_config_testemail_index';
|
||||
$this->load->event($eventname);
|
||||
|
||||
$view = array();
|
||||
$view['view'] = array();
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before'] = Events::trigger('before', $eventname);
|
||||
|
||||
$getdata['webmaster_email'] = $this->cbconfig->item('webmaster_email');
|
||||
$getdata['webmaster_name'] = $this->cbconfig->item('webmaster_name');
|
||||
$getdata['site_title'] = $this->cbconfig->item('site_title');
|
||||
|
||||
/**
|
||||
* Validation 라이브러리를 가져옵니다
|
||||
*/
|
||||
$this->load->library('form_validation');
|
||||
|
||||
/**
|
||||
* 전송된 데이터의 유효성을 체크합니다
|
||||
*/
|
||||
$config = array(
|
||||
array(
|
||||
'field' => 'recv_email',
|
||||
'label' => '받는이 이메일 주소',
|
||||
'rules' => 'trim|required|valid_email',
|
||||
),
|
||||
);
|
||||
$this->form_validation->set_rules($config);
|
||||
|
||||
/**
|
||||
* 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
|
||||
* 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
|
||||
*/
|
||||
if ($this->form_validation->run() === false) {
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
|
||||
|
||||
} else {
|
||||
/**
|
||||
* 유효성 검사를 통과한 경우입니다.
|
||||
* 즉 데이터의 insert 나 update 의 process 처리가 필요한 상황입니다
|
||||
*/
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
|
||||
|
||||
$this->load->library('email');
|
||||
$this->email->from(element('webmaster_email', $getdata), element('webmaster_name', $getdata));
|
||||
$this->email->to($this->input->post('recv_email'));
|
||||
|
||||
$this->email->subject('이메일 발송 테스트입니다');
|
||||
$emailform['emailform'] = $getdata;
|
||||
$message = $this->load->view('admin/' . ADMIN_SKIN . '/' . $this->pagedir . '/email_form', $emailform, true);
|
||||
$this->email->message($message);
|
||||
|
||||
if ($this->email->send() === false) {
|
||||
$view['view']['alert_message'] = '이메일을 발송하지 못하였습니다. 메일 설정을 확인하여주세요';
|
||||
} else {
|
||||
$view['view']['alert_message'] = '이메일을 발송하였습니다';
|
||||
}
|
||||
//echo $this->email->print_debugger();
|
||||
|
||||
}
|
||||
|
||||
$view['view']['data'] = $getdata;
|
||||
|
||||
// 이벤트가 존재하면 실행합니다
|
||||
$view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
|
||||
|
||||
/**
|
||||
* 어드민 레이아웃을 정의합니다
|
||||
*/
|
||||
$layoutconfig = array('layout' => 'layout', 'skin' => 'index');
|
||||
$view['layout'] = $this->managelayout->admin($layoutconfig, $this->cbconfig->get_device_view_type());
|
||||
$this->data = $view;
|
||||
$this->layout = element('layout_skin_file', element('layout', $view));
|
||||
$this->view = element('view_skin_file', element('layout', $view));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user