Merge branch 'issue22'

This commit is contained in:
Dmitriy Simushev 2014-05-20 09:33:03 +00:00
commit 6bd729e859
5 changed files with 44 additions and 0 deletions

View File

@ -552,8 +552,12 @@ settings.invitationstyle.description=A preview for invitation style is available
settings.invitationstyle=Select a style for your invitation settings.invitationstyle=Select a style for your invitation
settings.leavemessage_captcha.description=Protection against automated spam (captcha) settings.leavemessage_captcha.description=Protection against automated spam (captcha)
settings.leavemessage_captcha=Force visitor to enter a verification code when leaving message 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.description=Enter http address of your company logo
settings.logo=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.no.title=Please enter your company title
settings.onehostconnections.description=0 allows any number of connections settings.onehostconnections.description=0 allows any number of connections
settings.onehostconnections=Max number of threads from one address settings.onehostconnections=Max number of threads from one address

View File

@ -41,6 +41,7 @@ $options = array(
'tracking_lifetime', 'tracking_lifetime',
'thread_lifetime', 'thread_lifetime',
'statistics_aggregation_interval', 'statistics_aggregation_interval',
'max_uploaded_file_size',
); );
$params = array(); $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) { if (count($page['errors']) == 0) {
foreach ($options as $opt) { foreach ($options as $opt) {
Settings::set($opt, $params[$opt]); Settings::set($opt, $params[$opt]);
@ -127,6 +133,8 @@ if (Settings::get('enabletracking')) {
$page['formtrackinglifetime'] = $params['tracking_lifetime']; $page['formtrackinglifetime'] = $params['tracking_lifetime'];
} }
$page['formmaxuploadedfilesize'] = $params['max_uploaded_file_size'];
$page['enabletracking'] = Settings::get('enabletracking'); $page['enabletracking'] = Settings::get('enabletracking');
$page['stored'] = isset($_GET['stored']); $page['stored'] = isset($_GET['stored']);

View File

@ -45,6 +45,7 @@ $options = array(
'geolinkparams', 'geolinkparams',
'sendmessagekey', 'sendmessagekey',
'cron_key', 'cron_key',
'left_messages_locale',
); );
$params = array(); $params = array();
@ -66,6 +67,8 @@ if (Settings::get('enabletracking')) {
$invitation_style_list = InvitationStyle::getAvailableStyles(); $invitation_style_list = InvitationStyle::getAvailableStyles();
} }
$locales_list = get_available_locales();
if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) { if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) {
$params['email'] = get_param('email'); $params['email'] = get_param('email');
$params['title'] = get_param('title'); $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['sendmessagekey'] = verify_param('sendmessagekey', "/^c?enter$/");
$params['cron_key'] = get_param('cronkey'); $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']); $styles_params['chat_style'] = verify_param("chat_style", "/^\w+$/", $styles_params['chat_style']);
if (!in_array($styles_params['chat_style'], $chat_style_list)) { if (!in_array($styles_params['chat_style'], $chat_style_list)) {
$styles_params['chat_style'] = $chat_style_list[0]; $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['formemail'] = $params['email'];
$page['formleftmessageslocale'] = $params['left_messages_locale'];
$page['availableLocales'] = $locales_list;
$page['formtitle'] = $params['title']; $page['formtitle'] = $params['title'];
$page['formlogo'] = $params['logo']; $page['formlogo'] = $params['logo'];
$page['formhosturl'] = $params['hosturl']; $page['formhosturl'] = $params['hosturl'];

View File

@ -118,6 +118,15 @@
</div> </div>
{{/if}} {{/if}}
<div class="field">
<label for="maxuploadedfilesize" class="flabel">{{l10n "settings.maxuploadedfilesize"}}</label>
<div class="fvalue">
<input id="maxuploadedfilesize" type="text" name="maxuploadedfilesize" size="40" value="{{formmaxuploadedfilesize}}" class="formauth"/>
</div>
<label for="maxuploadedfilesize" class="fdescr"> &mdash; {{l10n "settings.maxuploadedfilesize.description"}}</label>
<br clear="all"/>
</div>
<div class="fbutton"> <div class="fbutton">
<input type="image" name="save" value="" src="{{mibewRoot}}{{l10n "image.button.save"}}" alt="{{l10n "button.save"}}"/> <input type="image" name="save" value="" src="{{mibewRoot}}{{l10n "image.button.save"}}" alt="{{l10n "button.save"}}"/>
</div> </div>

View File

@ -36,6 +36,19 @@
<br clear="all"/> <br clear="all"/>
</div> </div>
<div class="field">
<label for="leftmessageslocale" class="flabel">{{l10n "settings.leftmessageslocale"}}</label>
<div class="fvalue">
<select id="leftmessageslocale" name="leftmessageslocale">
{{#each availableLocales}}
<option value="{{this}}"{{#ifEqual this ../formleftmessageslocale}} selected="selected"{{/ifEqual}}>{{this}}</option>
{{/each}}
</select>
</div>
<label for="leftmessageslocale" class="fdescr"> &mdash; {{l10n "settings.leftmessageslocale.description"}}</label>
<br clear="all"/>
</div>
<div class="field"> <div class="field">
<label for="titlefield" class="flabel">{{l10n "settings.company.title"}}</label> <label for="titlefield" class="flabel">{{l10n "settings.company.title"}}</label>
<div class="fvalue"> <div class="fvalue">