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( !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");
|
die("old browser is used, please update it");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,11 +32,11 @@ if( !isset($_GET['token']) ) {
|
|||||||
die("wrong thread");
|
die("wrong thread");
|
||||||
}
|
}
|
||||||
|
|
||||||
take_thread($thread,$operator);
|
take_thread($thread,$operator);
|
||||||
|
|
||||||
$token = $thread['ltoken'];
|
$token = $thread['ltoken'];
|
||||||
header("Location: $webimroot/operator/agent.php?thread=$threadid&token=$token");
|
header("Location: $webimroot/operator/agent.php?thread=$threadid&token=$token&level=$remote_level");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$token = verifyparam( "token", "/^\d{1,8}$/");
|
$token = verifyparam( "token", "/^\d{1,8}$/");
|
||||||
@ -49,7 +50,6 @@ setup_chatview_for_operator($thread, $operator);
|
|||||||
|
|
||||||
start_html_output();
|
start_html_output();
|
||||||
|
|
||||||
|
|
||||||
require('../view/chat_ajaxed.php');
|
require('../view/chat_ajaxed.php');
|
||||||
|
|
||||||
?>
|
?>
|
@ -20,7 +20,6 @@ $operator = check_login();
|
|||||||
$page = array('agentId' => '');
|
$page = array('agentId' => '');
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
|
|
||||||
if( isset($_POST['login']) && isset($_POST['password']) ) {
|
if( isset($_POST['login']) && isset($_POST['password']) ) {
|
||||||
$agentId = verifyparam( "agentId", "/^(\d{1,9})?$/", "");
|
$agentId = verifyparam( "agentId", "/^(\d{1,9})?$/", "");
|
||||||
$login = getparam('login');
|
$login = getparam('login');
|
||||||
@ -29,7 +28,6 @@ if( isset($_POST['login']) && isset($_POST['password']) ) {
|
|||||||
$localname = getparam('name');
|
$localname = getparam('name');
|
||||||
$commonname = getparam('commonname');
|
$commonname = getparam('commonname');
|
||||||
|
|
||||||
|
|
||||||
if( !$localname )
|
if( !$localname )
|
||||||
$errors[] = no_field("form.field.agent_name");
|
$errors[] = no_field("form.field.agent_name");
|
||||||
|
|
||||||
@ -55,9 +53,9 @@ if( isset($_POST['login']) && isset($_POST['password']) ) {
|
|||||||
|
|
||||||
if( count($errors) == 0 ) {
|
if( count($errors) == 0 ) {
|
||||||
if (!$agentId) {
|
if (!$agentId) {
|
||||||
create_operator($login,$password,$localname,$commonname);
|
create_operator($login,$password,$localname,$commonname);
|
||||||
} else {
|
} else {
|
||||||
update_operator($agentId,$login,$password,$localname,$commonname);
|
update_operator($agentId,$login,$password,$localname,$commonname);
|
||||||
}
|
}
|
||||||
header("Location: $webimroot/operator/operators.php");
|
header("Location: $webimroot/operator/operators.php");
|
||||||
exit;
|
exit;
|
||||||
|
@ -20,7 +20,6 @@ $operator = check_login();
|
|||||||
|
|
||||||
$page = array( 'operator' => topage(get_operator_name($operator)) );
|
$page = array( 'operator' => topage(get_operator_name($operator)) );
|
||||||
|
|
||||||
|
|
||||||
if( isset($_GET['threadid'])) {
|
if( isset($_GET['threadid'])) {
|
||||||
$threadid = verifyparam( "threadid", "/^(\d{1,9})?$/", "");
|
$threadid = verifyparam( "threadid", "/^(\d{1,9})?$/", "");
|
||||||
$lastid = -1;
|
$lastid = -1;
|
||||||
|
@ -71,16 +71,14 @@ function print_pending_threads($since) {
|
|||||||
$query = "select threadid, userName, agentName, unix_timestamp(dtmcreated), userTyping, ".
|
$query = "select threadid, userName, agentName, unix_timestamp(dtmcreated), userTyping, ".
|
||||||
"unix_timestamp(dtmmodified), lrevision, istate, remote ".
|
"unix_timestamp(dtmmodified), lrevision, istate, remote ".
|
||||||
"from chatthread where lrevision > $since ORDER BY threadid";
|
"from chatthread where lrevision > $since ORDER BY threadid";
|
||||||
$result = mysql_query($query,$link) or die(' Query failed: ' .mysql_error().": ".$query);
|
$rows = select_multi_assoc($query, $link);
|
||||||
|
foreach ($rows as $row) {
|
||||||
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
|
|
||||||
$thread = thread_to_xml($row);
|
$thread = thread_to_xml($row);
|
||||||
$output[] = $thread;
|
$output[] = $thread;
|
||||||
if( $row['lrevision'] > $revision )
|
if( $row['lrevision'] > $revision )
|
||||||
$revision = $row['lrevision'];
|
$revision = $row['lrevision'];
|
||||||
}
|
}
|
||||||
|
|
||||||
mysql_free_result($result);
|
|
||||||
mysql_close($link);
|
mysql_close($link);
|
||||||
|
|
||||||
start_xml_output();
|
start_xml_output();
|
||||||
@ -91,8 +89,6 @@ function print_pending_threads($since) {
|
|||||||
echo "</threads>";
|
echo "</threads>";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////
|
|
||||||
|
|
||||||
$since = verifyparam( "since", "/^\d{1,9}$/", 0);
|
$since = verifyparam( "since", "/^\d{1,9}$/", 0);
|
||||||
|
|
||||||
print_pending_threads($since);
|
print_pending_threads($since);
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
require_once('../libs/common.php');
|
require_once('../libs/common.php');
|
||||||
require_once('../libs/operator.php');
|
require_once('../libs/operator.php');
|
||||||
|
|
||||||
|
|
||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
|
|
||||||
notify_operator_alive($operator['operatorid']);
|
notify_operator_alive($operator['operatorid']);
|
||||||
|
Loading…
Reference in New Issue
Block a user