mirror of
https://github.com/Mibew/i18n.git
synced 2025-01-23 13:50:30 +03:00
ae149896e7
Conflicts: src/messenger/webim/install/dbperform.php src/messenger/webim/js/164/common.js src/messenger/webim/libs/common.php src/messenger/webim/locales/en/properties src/messenger/webim/locales/ru/properties src/messenger/webim/operator/canned.php src/messenger/webim/operator/operator.php src/messenger/webim/operator/operators.php src/messenger/webim/operator/performance.php src/messenger/webim/operator/settings.php src/messenger/webim/operator/translate.php src/messenger/webim/operator/update.php src/messenger/webim/operator/users.php src/messenger/webim/view/agents.php src/messenger/webim/view/performance.php
73 lines
2.1 KiB
PHP
73 lines
2.1 KiB
PHP
<?php
|
|
/*
|
|
* Copyright 2005-2013 the original author or authors.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
require_once('libs/common.php');
|
|
require_once('libs/chat.php');
|
|
require_once('libs/expand.php');
|
|
require_once('libs/groups.php');
|
|
require_once('libs/notify.php');
|
|
|
|
$errors = array();
|
|
$page = array();
|
|
|
|
$token = verifyparam( "token", "/^\d{1,8}$/");
|
|
$threadid = verifyparam( "thread", "/^\d{1,8}$/");
|
|
|
|
$thread = thread_by_id($threadid);
|
|
if( !$thread || !isset($thread['ltoken']) || $token != $thread['ltoken'] ) {
|
|
die("wrong thread");
|
|
}
|
|
|
|
$email = getparam('email');
|
|
$page['email'] = $email;
|
|
$group = is_null($thread['groupid'])?NULL:group_by_id($thread['groupid']);
|
|
if( !$email ) {
|
|
$errors[] = no_field("form.field.email");
|
|
} else if( !is_valid_email($email)) {
|
|
$errors[] = wrong_field("form.field.email");
|
|
}
|
|
|
|
if( count($errors) > 0 ) {
|
|
$page['formemail'] = $email;
|
|
$page['ct.chatThreadId'] = $thread['threadid'];
|
|
$page['ct.token'] = $thread['ltoken'];
|
|
$page['level'] = "";
|
|
setup_logo($group);
|
|
expand("styles/dialogs", getchatstyle(), "mail.tpl");
|
|
exit;
|
|
}
|
|
|
|
$history = "";
|
|
$lastid = -1;
|
|
$output = get_messages( $threadid,"text",true,$lastid );
|
|
foreach( $output as $msg ) {
|
|
$history .= $msg;
|
|
}
|
|
|
|
loadsettings();
|
|
|
|
$subject = getstring("mail.user.history.subject");
|
|
$body = getstring2("mail.user.history.body", array($thread['userName'],$history,$settings['title'],$settings['hosturl']) );
|
|
|
|
$link = connect();
|
|
webim_mail($email, $webim_mailbox, $subject, $body, $link);
|
|
close_connection($link);
|
|
|
|
setup_logo($group);
|
|
expand("styles/dialogs", getchatstyle(), "mailsent.tpl");
|
|
exit;
|
|
?>
|