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 @@ -
- lang->line('config_statistics'), 'statistics', array('class' => 'control-label col-xs-2')); ?> -
- 'statistics', - 'id' => 'statistics', - 'value' => 'statistics', - 'checked' => $this->config->item('statistics'))); ?> -   - -
-
-
lang->line('config_show_office_group'), 'show_office_group', array('class' => 'control-label col-xs-2')); ?>
diff --git a/application/views/partial/header.php b/application/views/partial/header.php index 931d8d1fb..a6eb52b2b 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -59,7 +59,6 @@ - @@ -76,7 +75,7 @@ - + diff --git a/application/views/partial/header_js.php b/application/views/partial/header_js.php index fb68ef46a..025cd157e 100644 --- a/application/views/partial/header_js.php +++ b/application/views/partial/header_js.php @@ -51,6 +51,4 @@ submit.apply(this, arguments); }; - session_sha1 = 'session->userdata('session_sha1'); ?>'; - diff --git a/bower.json b/bower.json index 244e7b6d5..d53a90476 100644 --- a/bower.json +++ b/bower.json @@ -43,7 +43,6 @@ "chartist-plugin-barlabels": "https://github.com/mtgibbs/chartist-plugin-barlabels.git#~0.0.5", "remarkable-bootstrap-notify": "~3.1.3", "js-cookie": "~2.1.4", - "blockUI": "*", "bootstrap-tagsinput": "~0.8.0" }, "overrides": { diff --git a/composer.json b/composer.json index 793dec201..122db3aba 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,6 @@ "require": { "php": "^5.5 || ^7.0", "codeigniter/framework": "^3.1", - "ins0/google-measurement-php-client": "dev-master#2b3aef2375837339f5b2bfe88e76994481f86264", "dompdf/dompdf": "^0.7", "tamtamchik/namecase": "^1.0", "paragonie/random_compat": "^2.0" diff --git a/composer.lock b/composer.lock index 4290238cf..a77b234a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "14aea6777107125b76e9ba27959c6714", - "content-hash": "3d6b117b193c8f3190ffdc414667fdd1", + "hash": "b2409bf432f1299f214a189451e901bc", + "content-hash": "f6ad939a9d4ea5cb3f83d213ea2a299b", "packages": [ { "name": "codeigniter/framework", @@ -101,59 +101,6 @@ "homepage": "https://github.com/dompdf/dompdf", "time": "2016-05-11 00:36:29" }, - { - "name": "ins0/google-measurement-php-client", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/ins0/google-measurement-php-client.git", - "reference": "2b3aef2375837339f5b2bfe88e76994481f86264" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ins0/google-measurement-php-client/zipball/415cabca0c6d83cd0bd6a8ed6fb695b35f892018", - "reference": "2b3aef2375837339f5b2bfe88e76994481f86264", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpmd/phpmd": "~2.1", - "phpunit/phpunit": "4.0.*", - "squizlabs/php_codesniffer": "~2.0.0@RC" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "autoload": { - "psr-0": { - "Racecore\\GATracking": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Marco Rieger", - "email": "rieger@racecore.de" - } - ], - "description": "Server-Side PHP Client to communicate to Google Analytics over the Google Measurement Protocol", - "homepage": "http://www.racecore.de/", - "keywords": [ - "analytics", - "client", - "google", - "measurement" - ], - "time": "2016-09-07 19:39:27" - }, { "name": "paragonie/random_compat", "version": "v2.0.11", @@ -412,9 +359,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "ins0/google-measurement-php-client": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/database/database.sql b/database/database.sql index 48e6a15d4..ef62555f5 100644 --- a/database/database.sql +++ b/database/database.sql @@ -96,7 +96,6 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('receipt_template', 'receipt_default'), ('theme', 'flatly'), ('customer_sales_tax_support', '0'), -('statistics', '1'), ('language', 'english'), ('language_code', 'en-US'), ('date_or_time_format', ''), diff --git a/database/migrate_phppos_dist.sql b/database/migrate_phppos_dist.sql index 045d82f66..92406c936 100644 --- a/database/migrate_phppos_dist.sql +++ b/database/migrate_phppos_dist.sql @@ -96,7 +96,6 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('receipt_template', 'receipt_default'), ('theme', 'flatly'), ('customer_sales_tax_support', '0'), -('statistics', '1'), ('language', 'english'), ('language_code', 'en-US'), ('date_or_time_format', ''), diff --git a/database/tables.sql b/database/tables.sql index 825167621..51bff19c3 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -96,7 +96,6 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('receipt_template', 'receipt_default'), ('theme', 'flatly'), ('customer_sales_tax_support', '0'), -('statistics', '1'), ('language', 'english'), ('language_code', 'en-US'), ('date_or_time_format', ''), diff --git a/public/js/manage_tables.js b/public/js/manage_tables.js index 91558f5a8..4a12ea76a 100644 --- a/public/js/manage_tables.js +++ b/public/js/manage_tables.js @@ -382,14 +382,6 @@ })(window.form_support = window.form_support || {}, jQuery); -$(document).ready(function() { - var footer_text = $("#footer strong").text(); - var footer_sha1 = footer_text.split("- ")[1]; - if (session_sha1 != footer_sha1 || !footer_text.match(/Open Source Point Of Sale/)) { - $(window).block({ message: '' }); - } -}); - function number_sorter(a, b) { a = +a.replace(/[^\-0-9\.]+/g,""); diff --git a/public/license/composer.LICENSES b/public/license/composer.LICENSES index 6d8cdfb16..6edd87f04 100644 --- a/public/license/composer.LICENSES +++ b/public/license/composer.LICENSES @@ -6,7 +6,7 @@ ], "dependencies": { "codeigniter/framework": { - "version": "3.1.6", + "version": "3.1.7", "license": [ "MIT" ] @@ -17,12 +17,6 @@ "LGPL-2.1" ] }, - "ins0/google-measurement-php-client": { - "version": "dev-master 2b3aef2", - "license": [ - "BSD-3-Clause" - ] - }, "mikey179/vfsStream": { "version": "v1.1.0", "license": [