diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php index 1722f30f..c3504b90 100644 --- a/src/messenger/webim/libs/common.php +++ b/src/messenger/webim/libs/common.php @@ -527,6 +527,7 @@ $settings = array( 'geolinkparams' => 'width=440,height=100,toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1', 'online_timeout' => 30, /* Timeout (in seconds) when online operator becomes offline */ 'max_uploaded_file_size' => 100000, + 'max_connections_from_one_host' => 10, 'email' => '', /* inbox for left messages */ 'left_messages_locale' => $home_locale, diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index 6f7c406e..d73814f5 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -365,6 +365,8 @@ settings.host=URL of your website settings.logo.description=Enter http address of your company logo settings.logo=Your company logo settings.no.title=Please enter your company title +settings.onehostconnections.description=0 allows any number of connections +settings.onehostconnections=Max number of threads from one address settings.saved=Changes saved settings.survey.askgroup.description=Show/hide department selection field in the survey settings.survey.askgroup=Allows visitor to choose department/group @@ -378,6 +380,7 @@ settings.usercanchangename=Allows users to change their names settings.usernamepattern.description=How to build visitor identifying string from {name}, {id} or {addr}. Default: {name} settings.usernamepattern=Visitor's identifier settings.wrong.email=Enter proper email address +settings.wrong.onehostconnections="Max number of threads" field should be number site.title=openwebim.org site.url=http://openwebim.org statistics.dates=Select dates diff --git a/src/messenger/webim/operator/settings.php b/src/messenger/webim/operator/settings.php index 23664a3e..37cb776d 100644 --- a/src/messenger/webim/operator/settings.php +++ b/src/messenger/webim/operator/settings.php @@ -34,7 +34,7 @@ if($handle = opendir($stylesfolder)) { $options = array( 'email', 'title', 'logo', 'hosturl', 'usernamepattern', - 'chatstyle', 'chattitle', 'geolink', 'geolinkparams'); + 'chatstyle', 'chattitle', 'geolink', 'geolinkparams', 'max_connections_from_one_host'); loadsettings(); $params = array(); @@ -51,6 +51,7 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) { $params['chattitle'] = getparam('chattitle'); $params['geolink'] = getparam('geolink'); $params['geolinkparams'] = getparam('geolinkparams'); + $params['max_connections_from_one_host'] = trim(getparam('onehostconnections')); $params['chatstyle'] = verifyparam("chatstyle","/^\w+$/", $params['chatstyle']); if(!in_array($params['chatstyle'], $stylelist)) { @@ -60,6 +61,10 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) { if($params['email'] && !is_valid_email($params['email'])) { $errors[] = getlocal("settings.wrong.email"); } + + if(!preg_match("/^\d+$/",$params['max_connections_from_one_host'])) { + $errors[] = getlocal("settings.wrong.onehostconnections"); + } if($params['geolinkparams']) { foreach(split(",", $params['geolinkparams']) as $oneparam) { @@ -88,6 +93,7 @@ $page['formgeolinkparams'] = topage($params['geolinkparams']); $page['formusernamepattern'] = topage($params['usernamepattern']); $page['formchatstyle'] = $params['chatstyle']; $page['formchattitle'] = topage($params['chattitle']); +$page['formonehostconnections'] = $params['max_connections_from_one_host']; $page['availableStyles'] = $stylelist; $page['stored'] = isset($_GET['stored']); diff --git a/src/messenger/webim/view/settings.php b/src/messenger/webim/view/settings.php index 19dad91e..e12f8d04 100644 --- a/src/messenger/webim/view/settings.php +++ b/src/messenger/webim/view/settings.php @@ -116,6 +116,15 @@ require_once('inc_errors.php');
+
+
+
+ +
+
+
+
+