recompute message kinds, move option "Max connections from one host" to performance page

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@614 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2009-08-10 13:50:25 +00:00
parent b249edd0e1
commit 59903ce11a
6 changed files with 25 additions and 18 deletions

View File

@ -1,6 +1,7 @@
chat.came.from chat.came.from
chat.client.changename chat.client.changename
chat.client.name chat.client.name
chat.client.visited.page
chat.default.username chat.default.username
chat.error_page.close chat.error_page.close
chat.error_page.head chat.error_page.head
@ -36,6 +37,7 @@ chat.window.toolbar.mail_history
chat.window.toolbar.redirect_user chat.window.toolbar.redirect_user
chat.window.toolbar.refresh chat.window.toolbar.refresh
company.title company.title
errors.captcha
errors.required errors.required
errors.wrong_field errors.wrong_field
form.field.email form.field.email
@ -53,6 +55,7 @@ leavemessage.perform
leavemessage.sent.message leavemessage.sent.message
leavemessage.sent.title leavemessage.sent.title
leavemessage.title leavemessage.title
license.title
localeid localeid
mail.user.history.body mail.user.history.body
mail.user.history.subject mail.user.history.subject

View File

@ -23,6 +23,7 @@ cannededit.no_such
cannededit.title cannededit.title
cannednew.descr cannednew.descr
cannednew.title cannednew.title
char.redirect.operator.away_suff
char.redirect.operator.online_suff char.redirect.operator.online_suff
chat.client.spam.prefix chat.client.spam.prefix
chat.redirect.back chat.redirect.back
@ -119,6 +120,8 @@ page_search.intro
pending.menu.hide pending.menu.hide
pending.menu.show pending.menu.show
pending.popup_notification pending.popup_notification
pending.status.setaway
pending.status.setonline
pending.table.ban pending.table.ban
pending.table.head.contactid pending.table.head.contactid
pending.table.head.etc pending.table.head.etc

View File

@ -29,7 +29,8 @@ $page = array('agentId' => '');
$errors = array(); $errors = array();
$options = array( $options = array(
'online_timeout', 'updatefrequency_operator', 'updatefrequency_chat', 'updatefrequency_oldchat'); 'online_timeout', 'updatefrequency_operator', 'updatefrequency_chat',
'updatefrequency_oldchat', 'max_connections_from_one_host');
loadsettings(); loadsettings();
$params = array(); $params = array();
@ -58,6 +59,11 @@ if (isset($_POST['onlinetimeout'])) {
$errors[] = wrong_field("settings.frequencyoldchat"); $errors[] = wrong_field("settings.frequencyoldchat");
} }
$params['max_connections_from_one_host'] = getparam('onehostconnections');
if(!is_numeric($params['max_connections_from_one_host'])) {
$errors[] = getlocal("settings.wrong.onehostconnections");
}
if (count($errors) == 0) { if (count($errors) == 0) {
foreach($options as $opt) { foreach($options as $opt) {
$settings[$opt] = $params[$opt]; $settings[$opt] = $params[$opt];
@ -72,6 +78,7 @@ $page['formonlinetimeout'] = $params['online_timeout'];
$page['formfrequencyoperator'] = $params['updatefrequency_operator']; $page['formfrequencyoperator'] = $params['updatefrequency_operator'];
$page['formfrequencychat'] = $params['updatefrequency_chat']; $page['formfrequencychat'] = $params['updatefrequency_chat'];
$page['formfrequencyoldchat'] = $params['updatefrequency_oldchat']; $page['formfrequencyoldchat'] = $params['updatefrequency_oldchat'];
$page['formonehostconnections'] = $params['max_connections_from_one_host'];
$page['stored'] = isset($_GET['stored']); $page['stored'] = isset($_GET['stored']);
prepare_menu($operator); prepare_menu($operator);

View File

@ -41,7 +41,7 @@ if($handle = opendir($stylesfolder)) {
$options = array( $options = array(
'email', 'title', 'logo', 'hosturl', 'usernamepattern', 'email', 'title', 'logo', 'hosturl', 'usernamepattern',
'chatstyle', 'chattitle', 'geolink', 'geolinkparams', 'max_connections_from_one_host', 'sendmessagekey'); 'chatstyle', 'chattitle', 'geolink', 'geolinkparams', 'sendmessagekey');
loadsettings(); loadsettings();
$params = array(); $params = array();
@ -58,7 +58,6 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) {
$params['chattitle'] = getparam('chattitle'); $params['chattitle'] = getparam('chattitle');
$params['geolink'] = getparam('geolink'); $params['geolink'] = getparam('geolink');
$params['geolinkparams'] = getparam('geolinkparams'); $params['geolinkparams'] = getparam('geolinkparams');
$params['max_connections_from_one_host'] = trim(getparam('onehostconnections'));
$params['sendmessagekey'] = verifyparam('sendmessagekey', "/^c?enter$/"); $params['sendmessagekey'] = verifyparam('sendmessagekey', "/^c?enter$/");
$params['chatstyle'] = verifyparam("chatstyle","/^\w+$/", $params['chatstyle']); $params['chatstyle'] = verifyparam("chatstyle","/^\w+$/", $params['chatstyle']);
@ -70,10 +69,6 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) {
$errors[] = getlocal("settings.wrong.email"); $errors[] = getlocal("settings.wrong.email");
} }
if(!preg_match("/^\d+$/",$params['max_connections_from_one_host'])) {
$errors[] = getlocal("settings.wrong.onehostconnections");
}
if($params['geolinkparams']) { if($params['geolinkparams']) {
foreach(split(",", $params['geolinkparams']) as $oneparam) { foreach(split(",", $params['geolinkparams']) as $oneparam) {
if(!preg_match("/^\s*(toolbar|scrollbars|location|status|menubar|width|height|resizable)=\d{1,4}$/", $oneparam)) { if(!preg_match("/^\s*(toolbar|scrollbars|location|status|menubar|width|height|resizable)=\d{1,4}$/", $oneparam)) {
@ -101,7 +96,6 @@ $page['formgeolinkparams'] = topage($params['geolinkparams']);
$page['formusernamepattern'] = topage($params['usernamepattern']); $page['formusernamepattern'] = topage($params['usernamepattern']);
$page['formchatstyle'] = $params['chatstyle']; $page['formchatstyle'] = $params['chatstyle'];
$page['formchattitle'] = topage($params['chattitle']); $page['formchattitle'] = topage($params['chattitle']);
$page['formonehostconnections'] = $params['max_connections_from_one_host'];
$page['formsendmessagekey'] = $params['sendmessagekey']; $page['formsendmessagekey'] = $params['sendmessagekey'];
$page['availableStyles'] = $stylelist; $page['availableStyles'] = $stylelist;
$page['stored'] = isset($_GET['stored']); $page['stored'] = isset($_GET['stored']);

View File

@ -87,6 +87,15 @@ require_once('inc_errors.php');
<br clear="all"/> <br clear="all"/>
</div> </div>
<div class="field">
<div class="flabel"><?php echo getlocal('settings.onehostconnections') ?></div>
<div class="fvalue">
<input type="text" name="onehostconnections" size="40" value="<?php echo form_value('onehostconnections') ?>" class="formauth"/>
</div>
<div class="fdescr"> &mdash; <?php echo getlocal('settings.onehostconnections.description') ?></div>
<br clear="all"/>
</div>
<div class="fbutton"> <div class="fbutton">
<input type="image" name="save" value="" src='<?php echo $webimroot.getlocal("image.button.save") ?>' alt='<?php echo getlocal("button.save") ?>'/> <input type="image" name="save" value="" src='<?php echo $webimroot.getlocal("image.button.save") ?>' alt='<?php echo getlocal("button.save") ?>'/>
</div> </div>

View File

@ -123,15 +123,6 @@ require_once('inc_errors.php');
<br clear="all"/> <br clear="all"/>
</div> </div>
<div class="field">
<div class="flabel"><?php echo getlocal('settings.onehostconnections') ?></div>
<div class="fvalue">
<input type="text" name="onehostconnections" size="10" value="<?php echo form_value('onehostconnections') ?>" class="formauth"/>
</div>
<div class="fdescr"> &mdash; <?php echo getlocal('settings.onehostconnections.description') ?></div>
<br clear="all"/>
</div>
<div class="field"> <div class="field">
<div class="flabel"><?php echo getlocal('settings.chatstyle') ?></div> <div class="flabel"><?php echo getlocal('settings.chatstyle') ?></div>
<div class="fvalue"> <div class="fvalue">