diff --git a/src/mibew/locales/en/properties b/src/mibew/locales/en/properties index 151dbe4e..a75a20b1 100644 --- a/src/mibew/locales/en/properties +++ b/src/mibew/locales/en/properties @@ -552,8 +552,12 @@ settings.invitationstyle.description=A preview for invitation style is available settings.invitationstyle=Select a style for your invitation settings.leavemessage_captcha.description=Protection against automated spam (captcha) settings.leavemessage_captcha=Force visitor to enter a verification code when leaving message +settings.leftmessageslocale.description=Language of the messages that could be left by visitors when operators aren't available +settings.leftmessageslocale=Language of the messages left by visitors settings.logo.description=Enter http address of your company logo settings.logo=Your company logo +settings.maxuploadedfilesize.description=The upper limit of uploaded files (avatars) in bytes. Default is 100000 bytes. +settings.maxuploadedfilesize=Maximum size of uploaded files 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 diff --git a/src/mibew/operator/performance.php b/src/mibew/operator/performance.php index 4ed261d4..052794b0 100644 --- a/src/mibew/operator/performance.php +++ b/src/mibew/operator/performance.php @@ -41,6 +41,7 @@ $options = array( 'tracking_lifetime', 'thread_lifetime', 'statistics_aggregation_interval', + 'max_uploaded_file_size', ); $params = array(); @@ -102,6 +103,11 @@ if (isset($_POST['onlinetimeout'])) { } } + $params['max_uploaded_file_size'] = get_param('maxuploadedfilesize'); + if (!is_numeric($params['max_uploaded_file_size'])) { + $page['errors'][] = wrong_field("settings.maxuploadedfilesize"); + } + if (count($page['errors']) == 0) { foreach ($options as $opt) { Settings::set($opt, $params[$opt]); @@ -127,6 +133,8 @@ if (Settings::get('enabletracking')) { $page['formtrackinglifetime'] = $params['tracking_lifetime']; } +$page['formmaxuploadedfilesize'] = $params['max_uploaded_file_size']; + $page['enabletracking'] = Settings::get('enabletracking'); $page['stored'] = isset($_GET['stored']); diff --git a/src/mibew/operator/settings.php b/src/mibew/operator/settings.php index a097cd47..dc2124ec 100644 --- a/src/mibew/operator/settings.php +++ b/src/mibew/operator/settings.php @@ -45,6 +45,7 @@ $options = array( 'geolinkparams', 'sendmessagekey', 'cron_key', + 'left_messages_locale', ); $params = array(); @@ -66,6 +67,8 @@ if (Settings::get('enabletracking')) { $invitation_style_list = InvitationStyle::getAvailableStyles(); } +$locales_list = get_available_locales(); + if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) { $params['email'] = get_param('email'); $params['title'] = get_param('title'); @@ -78,6 +81,11 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) { $params['sendmessagekey'] = verify_param('sendmessagekey', "/^c?enter$/"); $params['cron_key'] = get_param('cronkey'); + $params['left_messages_locale'] = verify_param("leftmessageslocale", "/^[\w-]{2,5}$/", $params['left_messages_locale']); + if (!in_array($params['left_messages_locale'], $locales_list)) { + $params['left_messages_locale'] = HOME_LOCALE; + } + $styles_params['chat_style'] = verify_param("chat_style", "/^\w+$/", $styles_params['chat_style']); if (!in_array($styles_params['chat_style'], $chat_style_list)) { $styles_params['chat_style'] = $chat_style_list[0]; @@ -142,6 +150,8 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) { } $page['formemail'] = $params['email']; +$page['formleftmessageslocale'] = $params['left_messages_locale']; +$page['availableLocales'] = $locales_list; $page['formtitle'] = $params['title']; $page['formlogo'] = $params['logo']; $page['formhosturl'] = $params['hosturl']; diff --git a/src/mibew/styles/pages/default/templates_src/server_side/performance.handlebars b/src/mibew/styles/pages/default/templates_src/server_side/performance.handlebars index 00b47d60..15d82ff4 100644 --- a/src/mibew/styles/pages/default/templates_src/server_side/performance.handlebars +++ b/src/mibew/styles/pages/default/templates_src/server_side/performance.handlebars @@ -118,6 +118,15 @@ {{/if}} +
+ +
+ +
+ +
+
+
diff --git a/src/mibew/styles/pages/default/templates_src/server_side/settings.handlebars b/src/mibew/styles/pages/default/templates_src/server_side/settings.handlebars index ff8c8995..f60681e2 100644 --- a/src/mibew/styles/pages/default/templates_src/server_side/settings.handlebars +++ b/src/mibew/styles/pages/default/templates_src/server_side/settings.handlebars @@ -36,6 +36,19 @@
+
+ +
+ +
+ +
+
+