Commit f048e5b8 authored by lrargerich's avatar lrargerich

added missing lib

parent 74480cb6
......@@ -1969,6 +1969,7 @@ tiki/lib/jpgraph/src/jpgraph_regstat.php -text
tiki/lib/jpgraph/src/jpgraph_scatter.php -text
tiki/lib/jpgraph/src/jpgraph_stock.php -text
tiki/lib/live_support/live-support.js -text svneol=unset#application/octet-stream
tiki/lib/live_support/lsadminlib.php -text
tiki/lib/live_support/lslib.php -text
tiki/lib/mailin/mailinlib.php -text
tiki/lib/md5.js -text
......
<?php
class LsAdminlib extends Tikilib{
function LsAdminlib($db)
{
if(!$db) {
die("Invalid db object passed to LsAdminlib constructor");
}
$this->db = $db;
}
function add_operator($user)
{
$query = "replace into tiki_live_support_operators(user,accepted_requests,status,longest_chat,shortest_chat,average_chat,last_chat,time_online,votes,points,status_since)
values('$user',0,'offline',0,0,0,0,0,0,0,0)";
$this->query($query);
}
function remove_operator($user)
{
$query = "delete from tiki_live_support_operators where user='$user'";
$this->query($query);
}
function is_operator($user)
{
return $this->getOne("select count(*) from tiki_live_support_operators where user='$user'");
}
function get_operators($status)
{
$query = "select * from tiki_live_support_operators where status='$status'";
$result = $this->query($query);
$ret = Array();
$now = date("U");
while($res = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
$res['elapsed']=$now - $res['status_since'];
$ret[] = $res;
}
return $ret;
}
}
$lsadminlib= new LsAdminlib($dbTiki);
?>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment