diff --git a/application/config/hooks.php b/application/config/hooks.php index d2e43329d..37e9d3ccc 100644 --- a/application/config/hooks.php +++ b/application/config/hooks.php @@ -18,13 +18,6 @@ $hook['post_controller_constructor'][] = array( 'filepath' => 'hooks' ); -$hook['post_controller_constructor'][] = array( - 'class' => '', - 'function' => 'load_stats', - 'filename' => 'load_stats.php', - 'filepath' => 'hooks' - ); - // 'post_controller' indicated execution of hooks after controller is finished $hook['post_controller'] = array( 'class' => '', @@ -41,4 +34,4 @@ $hook['pre_system'] = function() { } catch(Exception $e) { // continue, .env file not present } -}; \ No newline at end of file +}; diff --git a/application/controllers/Config.php b/application/controllers/Config.php index a5650a7aa..8a725265b 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -298,7 +298,6 @@ class Config extends Secure_Controller 'suggestions_third_column' => $this->input->post('suggestions_third_column'), 'giftcard_number' => $this->input->post('giftcard_number'), 'derive_sale_quantity' => $this->input->post('derive_sale_quantity') != NULL, - 'statistics' => $this->input->post('statistics') != NULL, 'custom1_name' => $this->input->post('custom1_name'), 'custom2_name' => $this->input->post('custom2_name'), 'custom3_name' => $this->input->post('custom3_name'), diff --git a/application/controllers/Home.php b/application/controllers/Home.php index 1b8bca464..a9ba0b627 100644 --- a/application/controllers/Home.php +++ b/application/controllers/Home.php @@ -16,8 +16,6 @@ class Home extends Secure_Controller public function logout() { - $this->track_page('logout', 'logout'); - $this->Employee->logout(); } } diff --git a/application/controllers/Login.php b/application/controllers/Login.php index 7e1e55e00..978a585ac 100644 --- a/application/controllers/Login.php +++ b/application/controllers/Login.php @@ -25,18 +25,6 @@ class Login extends CI_Controller } else { - if($this->config->item('statistics')) - { - $this->load->library('tracking_lib'); - - $this->tracking_lib->track_page('login', 'login'); - - $this->tracking_lib->track_event('Stats', 'Theme', $this->config->item('theme')); - $this->tracking_lib->track_event('Stats', 'Language', $this->config->item('language')); - $this->tracking_lib->track_event('Stats', 'Timezone', $this->config->item('timezone')); - $this->tracking_lib->track_event('Stats', 'Currency', $this->config->item('currency_symbol')); - } - redirect('home'); } } @@ -109,10 +97,6 @@ class Login extends CI_Controller error_log('PHP installed extensions: ' . $extensions); error_log('PHP required extensions: ' . implode(', ', $keys)); } - else - { - $result = preg_match('~\b(Copyright|(c)|©|All rights reserved|Developed|Crafted|Implemented|Made|Powered|Code|Design|unblockUI|blockUI|blockOverlay|hide|opacity|NuNu|wMDA|Zhafirah|Zendher|WEDIDIT|websol|wazo|Water|Trulance|Vision|Unlock|United|Total|Coddz|Tormuz|Toko|TIS|Store|Sigma|SECC|Motor|Scooper|Satelit|Infotech|Shop|Computer|Cell|Mina|Mila|Megawheel|Restaurant|Bazar|Farma|Linux|ERP|Jeera|Hotel|eCommerce|Stock)\b~i', file_get_contents(APPPATH . 'views/partial/footer.php')) != TRUE; - } return $result; } diff --git a/application/controllers/Office.php b/application/controllers/Office.php index ec140a731..466bcad6f 100644 --- a/application/controllers/Office.php +++ b/application/controllers/Office.php @@ -16,8 +16,6 @@ class Office extends Secure_Controller public function logout() { - $this->track_page('logout', 'logout'); - $this->Employee->logout(); } } diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index bdb97b22e..d2d6ffaf1 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -17,8 +17,6 @@ class Reports extends Secure_Controller preg_match('/^(.*?)([sy])?$/', array_pop($matches), $matches); $submodule_id = $matches[1] . ((count($matches) > 2) ? $matches[2] : 's'); - $this->track_page('reports/' . $submodule_id, 'reports_' . $submodule_id); - // check access to report submodule if(!$this->Employee->has_grant('reports_' . $submodule_id, $this->Employee->get_logged_in_employee_info()->person_id)) { diff --git a/application/controllers/Secure_Controller.php b/application/controllers/Secure_Controller.php index ef6016baf..38aa061d1 100644 --- a/application/controllers/Secure_Controller.php +++ b/application/controllers/Secure_Controller.php @@ -18,8 +18,6 @@ class Secure_Controller extends CI_Controller redirect('login'); } - $this->track_page($module_id, $module_id); - $logged_in_employee_info = $model->get_logged_in_employee_info(); if(!$model->has_module_grant($module_id, $logged_in_employee_info->person_id) || (isset($submodule_id) && !$model->has_module_grant($submodule_id, $logged_in_employee_info->person_id))) @@ -77,32 +75,6 @@ class Secure_Controller extends CI_Controller } } - protected function track_page($path, $page) - { - if(get_instance()->Appconfig->get('statistics')) - { - $this->load->library('tracking_lib'); - - if(empty($path)) - { - $path = 'home'; - $page = 'home'; - } - - $this->tracking_lib->track_page('controller/' . $path, $page); - } - } - - protected function track_event($category, $action, $label, $value = NULL) - { - if(get_instance()->Appconfig->get('statistics')) - { - $this->load->library('tracking_lib'); - - $this->tracking_lib->track_event($category, $action, $label, $value); - } - } - public function numeric($str) { return parse_decimals($str); @@ -120,7 +92,6 @@ class Secure_Controller extends CI_Controller echo $result !== FALSE ? 'true' : 'false'; } - // this is the basic set of methods most OSPOS Controllers will implement public function index() { return FALSE; } public function search() { return FALSE; } @@ -128,6 +99,5 @@ class Secure_Controller extends CI_Controller public function view($data_item_id = -1) { return FALSE; } public function save($data_item_id = -1) { return FALSE; } public function delete() { return FALSE; } - } ?> diff --git a/application/hooks/load_stats.php b/application/hooks/load_stats.php deleted file mode 100644 index feece32ba..000000000 --- a/application/hooks/load_stats.php +++ /dev/null @@ -1,58 +0,0 @@ -lang->line('common_you_are_using_ospos'); - - if(count($CI->session->userdata('session_sha1')) == 0) - { - $footer_tags = file_get_contents(APPPATH . 'views/partial/footer.php'); - $d = preg_replace('/\$Id:\s.*?\s\$/', '$Id$', $footer_tags); - $session_sha1 = sha1("blob " .strlen( $d ). "\0" . $d); - $CI->session->set_userdata('session_sha1', substr($session_sha1, 0, 7)); - - preg_match('/\$Id:\s(.*?)\s\$/', $footer_tags, $matches); - $needle = 'Open Source Point Of Sale'; - - if(!stristr($line, $needle) || $session_sha1 != $matches[1]) - { - $CI->load->library('tracking_lib'); - - $roguer = $CI->Appconfig->get('company') . ' | ' . $CI->Appconfig->get('address') . ' | ' . $CI->Appconfig->get('email') . ' | ' . $CI->Appconfig->get('website') . ' | ' . $CI->config->item('base_url'); - $CI->tracking_lib->track_page('rogue/roguer', 'roguer', $roguer); - $CI->tracking_lib->track_page('rogue/footer', 'rogue footer', $footer_tags); - - $login_footer = ''; - - if($handle = @fopen(APPPATH . 'views/login.php', 'r')) - { - while(!feof($handle)) - { - $buffer = fgets($handle); - if(strpos($buffer, $needle) !== FALSE) - { - $login_footer = ''; - } - elseif(strpos($buffer, 'form_close') !== FALSE) - { - $login_footer = 'Footer: '; - } - elseif($login_footer != '') - { - $login_footer .= $buffer; - } - } - - fclose($handle); - } - - if($login_footer != '') - { - $CI->tracking_lib->track_page('rogue/login', 'rogue login', $login_footer); - } - } - } -} - -?> diff --git a/application/libraries/Tracking_lib.php b/application/libraries/Tracking_lib.php deleted file mode 100644 index 8c1020452..000000000 --- a/application/libraries/Tracking_lib.php +++ /dev/null @@ -1,102 +0,0 @@ -CI =& get_instance(); - - $clientId = $this->CI->Appconfig->get('client_id'); - - // some old beta-3.0.0 time client IDs are wrong so clean them up - // this statement should be removed eventually - if(!empty($clientId) && strlen($clientId) < 30) - { - $clientId = NULL; - } - - /** - * Setup the class - * optional - */ - $options = array( - 'client_create_random_id' => TRUE, // create a random client id when the class can't fetch the current cliend id or none is provided by "client_id" - 'client_fallback_id' => 555, // fallback client id when cid was not found and random client id is off - 'client_id' => $clientId, // override client id - 'user_id' => NULL, // determine current user id - // adapter options - 'adapter' => array( - 'async' => TRUE, // requests to google are async - don't wait for google server response - 'ssl' => FALSE // use ssl connection to google server - ) - ); - - $this->tracking = new \Racecore\GATracking\GATracking('UA-82359828-2', $options); - - if(empty($clientId)) - { - $clientId = $this->tracking->getClientId(); - - $this->CI->Appconfig->batch_save(array('client_id' => $clientId)); - } - } - - /* - * Track Event function - */ - public function track_event($category, $action, $label = NULL, $value = NULL) - { - try - { - /** @var Tracking/Event $event */ - $event = $this->tracking->createTracking('Event'); - $event->setAsNonInteractionHit(TRUE); - $event->setEventCategory($category); - $event->setEventAction($action); - $event->setEventLabel($label); - $event->setEventValue($value); - - return $this->tracking->sendTracking($event); - } - catch(Exception $e) - { - error_log($e->getMessage()); - } - } - - /* - * Track Page function - */ - public function track_page($path, $title, $description = ' ') - { - try - { - /** @var Tracking/Factory $event */ - $event = $this->tracking->createTracking('Factory', array( - 'an' => 'OSPOS', - 'av' => $this->CI->config->item('application_version') . ' - ' . substr($this->CI->config->item('commit_sha1'), 5, 12), - 'ul' => current_language_code(), - 'dp' => $path, - 'dt' => $title, - 'cd' => $description - )); - - return $this->tracking->sendTracking($event); - } - catch(Exception $e) - { - error_log($e->getMessage()); - } - } -} - -?> diff --git a/application/views/configs/general_config.php b/application/views/configs/general_config.php index 7f550c6a4..f1cbe6713 100644 --- a/application/views/configs/general_config.php +++ b/application/views/configs/general_config.php @@ -187,21 +187,6 @@ -