summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 443144f)
raw | patch | inline | side by side (parent: 443144f)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 20 Dec 2006 07:23:06 +0000 (07:23 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 20 Dec 2006 07:23:06 +0000 (07:23 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5441 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/users/class_divListUsers.inc | patch | blob | history |
diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc
index 1ebc98664fa79f78675918a86324f6d297c21008..b9bcd3d7ea93d94991757766f7e4511c359b24c9 100644 (file)
END :: Variable init
********************/
- /* Get Configuration for goFon DB (if it is set), to connect to the asterisk tables.
- * Read Sip Table for specified account (for each user with phoneAccount).
- * Check the attributes ip port and regseconds.
- * If regseconds is set and >0 , the phone is logged in.
- * Else the phone is currently not logged.
- * If we can't read any Data from the DB or there is no goFon DB specified
- * show old style without status icons.
- */
- $r_db =false;
- $r_con =false;
- if (isset($_SESSION['config']->data['SERVERS']['FON'][0])){
- $a_SETUP= $_SESSION['config']->data['SERVERS']['FON'][0];
- $r_con = false;
- $r_db = false;
- if(is_callable("mysql_pconnect")){
- $r_con= @mysql_pconnect($a_SETUP['SERVER'],$a_SETUP['LOGIN'],$a_SETUP['PASSWORD']);
- // Check if we are connected correctly
- if($r_con){
- $r_db = @mysql_select_db($a_SETUP['DB'],$r_con);
- }
- }
- }
-
/********************
Append entries to divlist
}
/* Create phonaccopunt informationm, if conencted && is phoneAccount */
- $connected = ""; // This string represents timestamp or offline status
- $ip_port = ""; // String that will represent ip : port of the connected phone
if((in_array("goFonAccount" ,$val['objectClass']))){
/* Set defaults */
$fonac = preg_replace("/%KEY%/", "$key", $fonac);
$fonac = preg_replace("/%title%/", "", $fonac);
- /* Database connection is ok ?*/
- if(($r_db)&&(is_callable("mysql_query"))){
- $res= @mysql_query("SELECT regseconds,name,port,ipaddr FROM ".$a_SETUP['SIP_TABLE']." WHERE (name='".$val['uid'][0]."')");
- $mysql_entry = @mysql_fetch_row($res);
- if(is_array($mysql_entry)){
- if((isset($mysql_entry[0]))&&($mysql_entry[0]>1)){
- $connected = " | "._("Online")." : ".gmdate("d.m.Y H:i:s",($mysql_entry[0]+(60*60)));
- $fonac = preg_replace("/%image%/", "select_phone_connected.png", $fonimg);
- $fonac = preg_replace("/%KEY%/", "$key", $fonac);
- $fonac = preg_replace("/%title%/", $connected, $fonac);
- #$ip_port= " - ".$mysql_entry[3].":".$mysql_entry[2];
- }
- if((isset($mysql_entry[0]))&&($mysql_entry[0]==0)){
- $connected = " | "._("Offline");
- $fonac = preg_replace("/%image%/", "select_phone.png", $fonimg);
- $fonac = preg_replace("/%KEY%/", "$key", $fonac);
- $fonac = preg_replace("/%title%/", $connected, $fonac);
- }
- }
- }
}else{
$fonac=$empty;
}
/* Create each field */
$field1 = array("string" => sprintf($tpl,$val['dn']), "attach" => "style='text-align:center;width:20px;'");
- $field2 = array("string" => sprintf($editlink,$key,$display).$ip_port, "attach" => "style='' title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'");
+ $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'");
$field3 = array("string" => $UseImg, "attach" => "style='width:152px;'");
$field4 = array("string" => $s_img_create_from_template.preg_replace("/%KEY%/", "$key", $action),
"attach" => "style='width:".$action_col_size."px;border-right:0px; text-align:right;'");
}
}
- /* close database connection, if it was opened */
- if(isset($r_con)){
- if((is_callable("mysql_close"))&&($r_con)){
- @mysql_close($r_con);
- }
- }
-
}
function Save()