Skip to content

Commit

Permalink
add some configurations, make user editable
Browse files Browse the repository at this point in the history
  • Loading branch information
goFrendiAsgard committed Dec 10, 2015
1 parent 69f8d06 commit 6e7d17a
Show file tree
Hide file tree
Showing 16 changed files with 197 additions and 207 deletions.
14 changes: 2 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,12 @@ modules/*/controllers/Info_*.php
# my private modules
modules/gis
modules/typing_defense
modules/ssc
modules/gis_assignment
modules/library_app
modules/pmb_online
modules/town_project
modules/loanword_searchengine
modules/stiki_ibk
modules/pendaftaran_wisuda
modules/library_app
modules/shop
modules/pbfrontend
modules/artificial_intelligence/assets/data/1_*
modules/conference
modules/oepet
modules/breast_cancer
modules/simple_erp
modules/simple_erp_old
modules/mlm
modules/ishare
modules/lifeline
modules/sepatu
9 changes: 7 additions & 2 deletions application/core/CMS_AutoUpdate_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

class CMS_AutoUpdate_Model extends CMS_Model
{
// TODO: change this
private $CURRENT_VERSION = '1.0.3';
private static $module_updated = false;

public function __construct()
Expand Down Expand Up @@ -55,8 +57,7 @@ private function __update_module()
private function __update()
{
$old_version = cms_config('__cms_version');
// TODO: change this
$current_version = '1.0.2';
$current_version = $this->CURRENT_VERSION;

if ($old_version == $current_version) {
return 0;
Expand Down Expand Up @@ -444,5 +445,9 @@ private function __update_to_1_0_2(){
}
}

private function __update_to_1_0_3(){
$this->cms_add_config('site_show_benchmark', 'FALSE', 'Show Benchmark');
}

// TODO : Write your upgrade function here (__update_to_x_y_x)
}
27 changes: 12 additions & 15 deletions application/core/CMS_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@ protected function _guard_controller()
// however if description.txt doesn't exists, than it has nothing todo with the module
if ($module_path != 'main' && $module_path != '' && file_exists(FCPATH.'modules/'.$module_path.'/description.txt')) {
if ($this->cms_module_name($module_path) == '') {
die('<pre>ERROR : Module '.$module_path.' is not installed</pre>');
$this->show_404();
//die('<pre>ERROR : Module '.$module_path.' is not installed</pre>');
}
}
}

private function show_404(){
$this->output->set_status_header('404');
die($this->view('not_found_index', NULL, 'main_404', NULL, TRUE));
}

public function __construct()
{
parent::__construct();
Expand Down Expand Up @@ -81,7 +87,8 @@ public function __construct()
include $subsite_auth_file;
if (isset($protected) && is_bool($protected) && !$protected) {
if (!isset($subsite_allowed) || (is_array($subsite_allowed) && !in_array(CMS_SUBSITE, $subsite_allowed))) {
die('Module is not accessible for '.CMS_SUBSITE.' subsite');
$this->show_404();
// die('Module is not accessible for '.CMS_SUBSITE.' subsite');
}
}
}
Expand Down Expand Up @@ -119,10 +126,10 @@ public function __construct()
}
}

/*
if(!$this->input->is_ajax_request() && ERROR_REPORTING == 'development'){

if(!$this->input->is_ajax_request() && strtoupper(trim($this->cms_get_config('site_show_benchmark'))) == 'TRUE'){
$this->output->enable_profiler(1);
}*/
}
}

public function __call($method, $args){
Expand Down Expand Up @@ -852,16 +859,6 @@ protected function view($view_url, $data = null, $navigation_name = null, $confi
$injected_css .= $css_key . ':' . $value . '!important;';
}
}
// site background blur
if(trim($this->cms_get_config('site_background_blur')) != ''){
$value = $this->cms_get_config('site_background_blur');
/*
$injected_css .= '-webkit-filter: blur(' . $value . 'px)!important;
-moz-filter: blur(' . $value . 'px)!important;
-o-filter: blur(' . $value . 'px)!important;
-ms-filter: blur(' . $value . 'px)!important;
filter: blur(' . $value . 'px);!important';*/
}
$injected_css .= '}';
$asset->add_internal_css($injected_css);

Expand Down
4 changes: 3 additions & 1 deletion application/core/CMS_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ public function cms_user_is_super_admin()
{
if ($this->cms_user_id() == 1) {
return true;
} elseif (CMS_SUBSITE != '') {
} else if (CMS_SUBSITE != '') {
// get cms table prefix
include APPPATH.'config/main/cms_config.php';
$cms_table_prefix = $config['__cms_table_prefix'];
Expand Down Expand Up @@ -2700,6 +2700,7 @@ public function cms_generate_activation_code($identity, $send_mail = false, $rea
$data = array(
'activation_code' => cms_md5($activation_code, $this->cms_chipper()),
);
// log_message('error', 'Activation code generated : '.$activation_code);
$where = array(
'user_id' => $user_id,
);
Expand Down Expand Up @@ -2821,6 +2822,7 @@ public function cms_send_email($from_address, $from_name, $to_address, $subject,
// if protocol is (not smtp) or (is smtp and able to connect)
if ($config['protocol'] != 'smtp' || ($config['protocol'] == 'smtp' && $this->cms_is_connect($ssl.$config['smtp_host'], $config['smtp_port']))) {
$message = $this->cms_parse_keyword($message);
$subject = $this->cms_parse_keyword($subject);

$this->email->initialize($config);
$this->email->from($from_address, $from_name);
Expand Down
2 changes: 2 additions & 0 deletions application/libraries/Cms_asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ public function minify($content, $mode='css'){
// trim every line
$content = explode(PHP_EOL, $content);
$new_content = '';
// variables for html
$in_pre = FALSE;
$in_text_area = FALSE;
foreach($content as $line){
if($mode == 'html'){
// check pre and textarea status
if(stripos($line, '<pre') !== FALSE){
$in_pre = TRUE;
}else if(stripos($line, '</pre>') !== FALSE){
Expand Down
3 changes: 2 additions & 1 deletion modules/installer/models/Install_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
session_start();
}
class Install_model extends CI_Model{
private $VERSION = '1.0.2';
private $VERSION = '1.0.3';
public $is_subsite = FALSE;
public $subsite = '';
public $subsite_aliases = '';
Expand Down Expand Up @@ -1136,6 +1136,7 @@ protected function insert_all_data($config=NULL){
array('site_background_clip', '', 'Background Clip'),
array('site_background_attachment', '', 'Background Attachment'),
array('site_background_blur', '', 'Background Blur'),
array('site_show_benchmark', 'FALSE', 'Show Benchmark'),
array('site_text_color', '', 'Text Color'),
array('max_menu_depth', '5', 'Depth of menu recursive'),
array('cms_email_reply_address', '{{ admin_email }}', 'Email address'),
Expand Down
43 changes: 0 additions & 43 deletions modules/klik_id/controllers/Login.php

This file was deleted.

43 changes: 0 additions & 43 deletions modules/klik_id/controllers/login.php

This file was deleted.

Loading

0 comments on commit 6e7d17a

Please sign in to comment.