示例#1
0
 *File: company.php  
 *Date: 2011-9-5
 *======================================
 *TODO 
 *@param @type @var  @note
 */
require '../include/init.php';
$method = $_GET['method'];
global $view_file;
if (empty($method)) {
    $lang_method = $_LANG['ADD'];
    $method = 'select';
}
if ($method === 'update') {
    $method = 'update';
    contactUpdate();
    $lang_method = $_LANG['UPDATE'];
    $view_file = "contact.tpl";
}
if ($method === 'delete') {
    delete();
    $lang_method = $_LANG['ADD'];
}
if ($method === 'add') {
    add();
    $lang_method = $_LANG['ADD'];
    $view_file = "contact.tpl";
}
if ($method === 'addForward') {
    $lang_method = $_LANG['ADD'];
    $method = 'add';
 /**
  * Implements DrupalTelegramInterface::renameContact()
  */
 public function renameContact($peer, $first_name, $last_name)
 {
     if ($contact = $this->getContactByName($peer)) {
         $name = trim($first_name) . '_' . trim($last_name);
         return contactUpdate($contact, array('peer' => $peer, 'first_name' => $first_name, 'last_name' => $last_name));
     }
 }
示例#3
0
function wsOnClose($clientID, $status)
{
    global $Server;
    $client = $Server->wsClients[$clientID];
    $ip = long2ip($client[6]);
    $Server->log("{$clientID}[{$ip}] has disconnected.");
    //Send a user left notice to everyone in the room
    foreach (array_keys($Server->wsClients) as $id) {
        if (isset($client[12]) && $client[12] != '') {
            contactUpdate($id, $clientID, 'offline');
            sendMess($id, array('System', "{$client[13]} вышел из чата.", '000'), $client[15]);
        }
    }
}