mirror of
https://github.com/Mibew/i18n.git
synced 2025-01-22 21:40:28 +03:00
minor: spaces and tabs, use select_multi_assoc
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@114 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
eb1692f556
commit
883df2bd0b
@ -22,7 +22,8 @@ $threadid = verifyparam( "thread", "/^\d{1,8}$/");
|
||||
|
||||
if( !isset($_GET['token']) ) {
|
||||
|
||||
if( get_remote_level($_SERVER['HTTP_USER_AGENT']) != "ajaxed" ) {
|
||||
$remote_level = get_remote_level($_SERVER['HTTP_USER_AGENT']);
|
||||
if( $remote_level != "ajaxed" ) {
|
||||
die("old browser is used, please update it");
|
||||
}
|
||||
|
||||
@ -31,11 +32,11 @@ if( !isset($_GET['token']) ) {
|
||||
die("wrong thread");
|
||||
}
|
||||
|
||||
take_thread($thread,$operator);
|
||||
take_thread($thread,$operator);
|
||||
|
||||
$token = $thread['ltoken'];
|
||||
header("Location: $webimroot/operator/agent.php?thread=$threadid&token=$token");
|
||||
exit;
|
||||
$token = $thread['ltoken'];
|
||||
header("Location: $webimroot/operator/agent.php?thread=$threadid&token=$token&level=$remote_level");
|
||||
exit;
|
||||
}
|
||||
|
||||
$token = verifyparam( "token", "/^\d{1,8}$/");
|
||||
@ -49,7 +50,6 @@ setup_chatview_for_operator($thread, $operator);
|
||||
|
||||
start_html_output();
|
||||
|
||||
|
||||
require('../view/chat_ajaxed.php');
|
||||
|
||||
?>
|
@ -20,7 +20,6 @@ $operator = check_login();
|
||||
$page = array('agentId' => '');
|
||||
$errors = array();
|
||||
|
||||
|
||||
if( isset($_POST['login']) && isset($_POST['password']) ) {
|
||||
$agentId = verifyparam( "agentId", "/^(\d{1,9})?$/", "");
|
||||
$login = getparam('login');
|
||||
@ -29,7 +28,6 @@ if( isset($_POST['login']) && isset($_POST['password']) ) {
|
||||
$localname = getparam('name');
|
||||
$commonname = getparam('commonname');
|
||||
|
||||
|
||||
if( !$localname )
|
||||
$errors[] = no_field("form.field.agent_name");
|
||||
|
||||
@ -55,9 +53,9 @@ if( isset($_POST['login']) && isset($_POST['password']) ) {
|
||||
|
||||
if( count($errors) == 0 ) {
|
||||
if (!$agentId) {
|
||||
create_operator($login,$password,$localname,$commonname);
|
||||
create_operator($login,$password,$localname,$commonname);
|
||||
} else {
|
||||
update_operator($agentId,$login,$password,$localname,$commonname);
|
||||
update_operator($agentId,$login,$password,$localname,$commonname);
|
||||
}
|
||||
header("Location: $webimroot/operator/operators.php");
|
||||
exit;
|
||||
|
@ -20,7 +20,6 @@ $operator = check_login();
|
||||
|
||||
$page = array( 'operator' => topage(get_operator_name($operator)) );
|
||||
|
||||
|
||||
if( isset($_GET['threadid'])) {
|
||||
$threadid = verifyparam( "threadid", "/^(\d{1,9})?$/", "");
|
||||
$lastid = -1;
|
||||
|
@ -71,16 +71,14 @@ function print_pending_threads($since) {
|
||||
$query = "select threadid, userName, agentName, unix_timestamp(dtmcreated), userTyping, ".
|
||||
"unix_timestamp(dtmmodified), lrevision, istate, remote ".
|
||||
"from chatthread where lrevision > $since ORDER BY threadid";
|
||||
$result = mysql_query($query,$link) or die(' Query failed: ' .mysql_error().": ".$query);
|
||||
|
||||
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
|
||||
$rows = select_multi_assoc($query, $link);
|
||||
foreach ($rows as $row) {
|
||||
$thread = thread_to_xml($row);
|
||||
$output[] = $thread;
|
||||
if( $row['lrevision'] > $revision )
|
||||
$revision = $row['lrevision'];
|
||||
}
|
||||
|
||||
mysql_free_result($result);
|
||||
mysql_close($link);
|
||||
|
||||
start_xml_output();
|
||||
@ -91,8 +89,6 @@ function print_pending_threads($since) {
|
||||
echo "</threads>";
|
||||
}
|
||||
|
||||
////////
|
||||
|
||||
$since = verifyparam( "since", "/^\d{1,9}$/", 0);
|
||||
|
||||
print_pending_threads($since);
|
||||
|
@ -15,7 +15,6 @@
|
||||
require_once('../libs/common.php');
|
||||
require_once('../libs/operator.php');
|
||||
|
||||
|
||||
$operator = check_login();
|
||||
|
||||
notify_operator_alive($operator['operatorid']);
|
||||
|
Loading…
Reference in New Issue
Block a user