diff --git a/src/mibew/libs/classes/Mibew/Controller/Settings/FeaturesController.php b/src/mibew/libs/classes/Mibew/Controller/Settings/FeaturesController.php
index df4cf4e0..84aa2d36 100644
--- a/src/mibew/libs/classes/Mibew/Controller/Settings/FeaturesController.php
+++ b/src/mibew/libs/classes/Mibew/Controller/Settings/FeaturesController.php
@@ -114,6 +114,7 @@ class FeaturesController extends AbstractController
'enablepopupnotification',
'showonlineoperators',
'enablecaptcha',
+ 'trackoperators',
);
}
}
diff --git a/src/mibew/libs/classes/Mibew/Controller/WidgetController.php b/src/mibew/libs/classes/Mibew/Controller/WidgetController.php
index 379b8548..9d123fb5 100644
--- a/src/mibew/libs/classes/Mibew/Controller/WidgetController.php
+++ b/src/mibew/libs/classes/Mibew/Controller/WidgetController.php
@@ -44,7 +44,10 @@ class WidgetController extends AbstractController
'data' => array(),
);
- if (Settings::get('enabletracking') == '1') {
+ $tracking_allowed = (Settings::get('enabletracking') == '1')
+ && (Settings::get('trackoperators') == '1' || !$this->getOperator());
+
+ if ($tracking_allowed) {
$entry = $request->query->get('entry', '');
$referer = $request->server->get('HTTP_REFERER', '');
diff --git a/src/mibew/libs/classes/Mibew/Settings.php b/src/mibew/libs/classes/Mibew/Settings.php
index 15896971..db13f6e2 100644
--- a/src/mibew/libs/classes/Mibew/Settings.php
+++ b/src/mibew/libs/classes/Mibew/Settings.php
@@ -106,6 +106,7 @@ class Settings
'visitors_limit' => 20, /* Number of visitors to look over */
'invitation_lifetime' => 60, /* Lifetime for invitation to chat */
'tracking_lifetime' => 600, /* Time to store tracked old visitors' data */
+ 'trackoperators' => '0',
'cron_key' => DEFAULT_CRON_KEY,
// System values are listed below. They cannot be changed via
// administrative interface. Start names for these values from
diff --git a/src/mibew/styles/pages/default/js/features.js b/src/mibew/styles/pages/default/js/features.js
index 297f4e16..63c8da12 100644
--- a/src/mibew/styles/pages/default/js/features.js
+++ b/src/mibew/styles/pages/default/js/features.js
@@ -31,6 +31,14 @@
}
}
+ function updateTracking() {
+ if ($("#enabletracking").is(":checked")) {
+ $(".undertracking").show();
+ } else {
+ $(".undertracking").hide();
+ }
+ }
+
$(function() {
$("#enablepresurvey").change(function() {
updateSurvey();
@@ -41,8 +49,12 @@
$("#enablegroups").change(function() {
updateGroups();
});
+ $("#enabletracking").change(function() {
+ updateTracking();
+ });
updateSurvey();
updateSSL();
updateGroups();
+ updateTracking();
});
})(jQuery);
\ No newline at end of file
diff --git a/src/mibew/styles/pages/default/templates_src/server_side/settings_features.handlebars b/src/mibew/styles/pages/default/templates_src/server_side/settings_features.handlebars
index 9277c220..f2763939 100644
--- a/src/mibew/styles/pages/default/templates_src/server_side/settings_features.handlebars
+++ b/src/mibew/styles/pages/default/templates_src/server_side/settings_features.handlebars
@@ -94,6 +94,15 @@
+
+