small fix in /libs/operator.php, a few missed db usages, formatting

This commit is contained in:
Evgeny Gryaznov 2010-11-07 13:26:38 +01:00
parent 7cc810c683
commit 1388151bf8
5 changed files with 6 additions and 6 deletions

View File

@ -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) ) {

View File

@ -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";

View File

@ -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;

View File

@ -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;