function inform($actData, $login, $act) { global $tpl; global $_file_; $url = SERV_PATH . '/' . $_file_ . '?pid=' . ($actData->pid[0] ? $actData->pid[0] : $actData->rid[0]); $tpl->assign('BODY', "{$act} <BR>Изменения внес: {$login} <BR>" . "Подробная информация доступна по адресу <A HREF=\"{$url}\">{$url}</A>"); $tpl->parse('EMAIL', 'email'); $headers = OUSER_MAILFROM . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=windows-1251"; trigger_error('Inform data (pid/rid, saprname, curator): ' . $actData->pid[0] . '/' . $actData->rid[0] . ' ' . $actData->saprname[0] . ', ' . $login); if (isset($actData->saprname[0]) && $actData->saprname[0] != $login) { $user = new User($actData->saprname[0]); $user->send('Статус заявки изменен', "\r\n" . $tpl->get_assigned('EMAIL'), $headers); } if ($actData->username[0] != $login && $actData->username[0] != $actData->saprname[0]) { $user = new User($actData->username[0]); $user->send('Статус заявки изменен', "\r\n" . $tpl->get_assigned('EMAIL'), $headers); } if ($actData->pid[0]) { $reqRoot = new Request5($actData->pid[0]); if ($reqRoot->curator[0] != $login && $reqRoot->curator[0] != $actData->saprname[0] && $reqRoot->curator[0] != $actData->username[0]) { $user = new User($reqRoot->curator[0]); $user->send('Статус заявки изменен', "\r\n" . $tpl->get_assigned('EMAIL'), $headers); } } else { if ($actData->targetname[0] != $login && $actData->targetname[0] != $actData->saprname[0] && $actData->targetname[0] != $actData->username[0] && $actData->targetname[0] != $actDAta->curator[0]) { $user = new User($reqRoot->targetname[0]); $user->send('Статус заявки изменен', "\r\n" . $tpl->get_assigned('EMAIL'), $headers); } } }
function accept($socket, $ssl = false) { $new = stream_socket_accept($socket, 0); if ($ssl) { stream_socket_enable_crypto($new, true, STREAM_CRYPTO_METHOD_TLS_SERVER); if (!$new) { $this->debug("Closing connection: unknown (broken pipe)."); return false; } $client = new User($new, true); } else { $client = new User($new); } stream_set_blocking($new, 0); if (count($this->_clients) >= $this->config['ircd']['maxusers']) { $client->send('ERROR: Maximum clients reached. Please use a different server.'); $this->quit($client, 'Error: Server Full'); return false; } $client->send(':' . $this->servname . ' NOTICE AUTH :*** Looking up your hostname...'); $this->debug("new client: {$client->ip}"); $hn = gethostbyaddr($client->ip); if ($hn == $client->ip) { $client->address = $client->ip; $client->send(':' . $this->servname . ' NOTICE AUTH :*** Can\'t resolve your hotsname, using your IP instead.'); } else { $client->address = $hn; $client->send(':' . $this->servname . ' NOTICE AUTH :*** Found your hostname.'); } $client->id = $this->client_num++; $this->_clients[$client->id] = $client; return true; }
$validation = $validate->check($_POST, array('ddlMyAccounts' => array('name' => "Saját számla", 'required' => true), 'ddlAccountTypes' => array('name' => "Tipus", 'required' => true), 'amount' => array('name' => 'Összeg', 'required' => true, 'min' => 1), 'description' => array('name' => 'Leírás', 'required' => true, 'min' => 7))); if ($validation->passed()) { if (Input::get('amount') <= $user->getAccAmount(Input::get('ddlMyAccounts'))) { $transactionid = $user->getTranByAccID(Input::get('ddlMyAccounts')); if (Input::get('ddlAccountTypes') == "accountid") { $toaccid = $user->getAccByCode(Input::get('accountid')); $totranid = $user->getTranByAccID($toaccid->ID); } else { if (Input::get('ddlAccountTypes') == "contact") { $toaccid = $user->getAccByCode(Input::get('ddlContacts')); $totranid = $user->getTranByAccID($toaccid->ID); } } $senderaccid = Input::get('ddlMyAccounts'); if ($toaccid != 0) { $user->send(array('Transaction_ID' => $transactionid->ID, 'Account_ID' => $toaccid->ID, 'When' => date(DATE_ATOM), 'Amount' => Input::get('amount'), 'IsIncome' => 0, 'Description' => Input::get('description'))); $user->send(array('Transaction_ID' => $totranid->ID, 'Account_ID' => Input::get('ddlMyAccounts'), 'When' => date(DATE_ATOM), 'Amount' => Input::get('amount'), 'IsIncome' => 1, 'Description' => Input::get('description'))); Session::flash('home', 'Tranzakció sikeresen végrehajtva !'); Redirect::to('index.php'); } else { echo 'Tranzakció sikertelen! Ellenőrizze a megadott információkat!'; } } else { echo 'Nincs elég pénz a számláján!!!'; } } else { foreach ($validation->errors() as $error) { echo $error, '<br>'; } } }
$socket = $server->accept(); $user = new User($socket, $socket->getAddress(), $socket->getPort()); $index->socket[$user->socketid] =& $user; $util = new ClassContainer(); $util->index =& $index; $util->HeaderManager =& $headermanager; $util->RSA =& $rsa; $util->Database =& $database; $util->Cache =& $cache; $util->Config =& $config; $util->RoomManager =& $roommanager; $service->execute(function () use($user, $events, $util) { ob_implicit_flush(true); while ($buffer = $user->socketInput->read(4096)) { if ($buffer == "<policy-file-request/>" . chr(0)) { $user->send(Util::Crossdomain()); continue; } $buffer = String::decode($buffer, 'ISO-8859-1'); if ($user->rc4initialized) { $buffer = $user->rc4client->Parse($buffer); } foreach (BufferManager::Parser($buffer) as $packet) { $packet = new PacketParser($packet); $header = $packet->getHeader(); if (isset($events[$header])) { eval($events[$header]["parent"] . '::' . $events[$header]["method"] . '($user, $packet, $util);'); Console::WriteLine("- Executed event for " . $header . " (" . $events[$header]["parent"] . '::' . $events[$header]["method"] . ") "); } else { Console::WriteLine("- Not found event for " . $header . " : " . $packet->getFullPacket()); }