From 1388151bf8593589bbd18935b62077d8d0b24930 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Sun, 7 Nov 2010 13:26:38 +0100 Subject: [PATCH] small fix in /libs/operator.php, a few missed db usages, formatting --- src/messenger/webim/install/dbperform.php | 2 +- src/messenger/webim/libs/common.php | 1 - src/messenger/webim/libs/config.php | 4 ++-- src/messenger/webim/operator/notification.php | 3 ++- src/messenger/webim/operator/permissions.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/messenger/webim/install/dbperform.php b/src/messenger/webim/install/dbperform.php index 3cb835fb..c3e677bb 100644 --- a/src/messenger/webim/install/dbperform.php +++ b/src/messenger/webim/install/dbperform.php @@ -147,7 +147,7 @@ if ($act == "silentcreateall") { } if( in_array($mysqlprefix . "chatthread.groupid", $absent) ) { - runsql("ALTER TABLE " . $mysqlprefix . "chatthread ADD groupid int references chatgroup(groupid)", $link); + runsql("ALTER TABLE " . $mysqlprefix . "chatthread ADD groupid int references " . $mysqlprefix . "chatgroup(groupid)", $link); } if( in_array($mysqlprefix . "chatthread.userAgent", $absent) ) { diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php index 1707cb8b..d56ff009 100644 --- a/src/messenger/webim/libs/common.php +++ b/src/messenger/webim/libs/common.php @@ -359,7 +359,6 @@ function select_multi_assoc($query, $link) { } function db_build_select($fields, $table, $conditions, $orderandgroup) { - global $mysqlprefix; $condition = count($conditions) > 0 ? " where ".implode(" and ", $conditions) : ""; if($orderandgroup) $orderandgroup = " ".$orderandgroup; return "select $fields from $table$condition$orderandgroup"; diff --git a/src/messenger/webim/libs/config.php b/src/messenger/webim/libs/config.php index 18a822e9..ffd1e265 100644 --- a/src/messenger/webim/libs/config.php +++ b/src/messenger/webim/libs/config.php @@ -50,7 +50,7 @@ $mail_encoding = "utf-8"; /* * Locales */ -$home_locale = "en"; /* native name will be used in this locale */ -$default_locale = "en"; /* if user does not provide known lang */ +$home_locale = "en"; /* native name will be used in this locale */ +$default_locale = "en"; /* if user does not provide known lang */ ?> diff --git a/src/messenger/webim/operator/notification.php b/src/messenger/webim/operator/notification.php index 472f1312..7e7af003 100644 --- a/src/messenger/webim/operator/notification.php +++ b/src/messenger/webim/operator/notification.php @@ -30,9 +30,10 @@ $page = array(); setlocale(LC_TIME, getstring("time.locale")); function notification_info($id) { + global $mysqlprefix; $link = connect(); $notification = select_one_row(db_build_select( - "id, locale, vckind, vcto, unix_timestamp(dtmcreated) as created, vcsubject, tmessage, refoperator", "chatnotification", + "id, locale, vckind, vcto, unix_timestamp(dtmcreated) as created, vcsubject, tmessage, refoperator", $mysqlprefix . "chatnotification", array("id = $id"), ""), $link); mysql_close($link); return $notification; diff --git a/src/messenger/webim/operator/permissions.php b/src/messenger/webim/operator/permissions.php index c007c72c..c717261f 100755 --- a/src/messenger/webim/operator/permissions.php +++ b/src/messenger/webim/operator/permissions.php @@ -63,7 +63,7 @@ if( !$op ) { update_operator_permissions($op['operatorid'],$new_permissions); if ($opId && $_SESSION[$mysqlprefix . 'operator'] && $operator['operatorid'] == $opId) { - $_SESSION[$mysqlprefix . $mysqlprefix . 'operator']['iperm'] = $new_permissions; + $_SESSION[$mysqlprefix . 'operator']['iperm'] = $new_permissions; } header("Location: $webimroot/operator/permissions.php?op=$opId&stored"); exit;