include_once dirname(__FILE__) . "/ressources/class.user.inc"; include_once dirname(__FILE__) . "/ressources/class.squid.youtube.inc"; if (isset($_GET["tabs"])) { tabs(); exit; } if (isset($_GET["video"])) { video(); exit; } $users = new usersMenus(); if (!$users->AsWebStatisticsAdministrator) { die; } if (isset($_GET["who"])) { who(); exit; } if (isset($_GET["who-items"])) { who_items(); exit; } js(); function js() { $tpl = new templates(); $page = CurrentPageName(); $q = new mysql_squid_builder(); SEND_CORP_LICENSE_JAVASCRIPT(); $youtubeid = $_GET["youtubeid"]; $sql = "SELECT title FROM youtube_objects WHERE youtubeid='{$youtubeid}'";
function getCorrAsJSON(){ global $DB; global $fp; // mark as read $DB->query("UPDATE corr SET hasbeenread = 1 WHERE torepid = ".$fp['loggedid']." AND fromrepid = ".$fp['torepid']." AND leadid=".$fp['leadid']); $ret = '{corr:['; $sql = "SELECT *, DATE(postdate) as postdate, DATE_FORMAT(postdate, '%l:%i %p') as posttime FROM corr WHERE leadid=".$fp['leadid']." AND (fromrepid = ".$fp['loggedid']." OR torepid = ".$fp['loggedid'].") AND (fromrepid = ".$fp['torepid']." OR torepid = ".$fp['torepid'].") ORDER BY DATE(postdate) DESC, TIME(postdate) DESC"; $res = $DB->query($sql); $e = mysql_error(); $retarr = array(); if(mysql_num_rows($res)){ while($r = $DB->fetchNextObject($res)){ $date = ($r->postdate == date('Y-m-d'))?'':dateFix($r->postdate); $class = ($r->fromrepid == $_SESSION['loggedin'])?"loggedinposts":""; $tofrom = getCopied($r->cccorrid, $r->id); $ccd = (count($tofrom['cc']))?", ".implode(", ",$tofrom['cc']):''; $retarr []= '{"id":"'.$r->id.'", "addclass":"'.$class.'", "message":"'.$r->message.'", "postdate":"'.$date.'", "posttime":"'.$r->posttime.'", "whotowho":"'.who($r->fromrepid).' said to '.$tofrom['to'].$ccd.'", "e":"'.$e.'" }'; } }else{ /**/ $retarr []= '{"id":"0", "addclass":"nomessages", "message":"no messages", "postdate":"", "posttime":"", "whotowho":"", "e":"" }'; } $ret .= implode(",",$retarr); $ret .= ']}'; print $ret; }
<?php include "tts.php"; if (isset($_POST['id'])) { who($_POST['id']); function deleteClient11($x) { // your business logic } } function who($mots) { $song = ""; $mots = explode(" ", $mots); for ($i = 2; isset($mots[$i]); $i++) { @($who .= $mots[$i] . "%20"); } $bing = file_get_contents("https://fr.search.yahoo.com/search;_ylt=AkAGke7ieH5yxJiveruID_VNhJp4?fr=yfp-t-905-s&toggle=1&fp=1&cop=mss&ei=UTF-8&p=qui%20est%20{$who}"); preg_match_all('/<div class="compText" ><p class="">(.*)<a href="http:\\/\\/.*wikipedia/', $bing, $result); @($result = @$result[0][0]); if ($result != NULL) { echo "{$result}"; } else { echo '<p class="text">Je ne sais pas, voulez vous rechercher sur wikipedia <a href="http://fr.wikipedia.org/w/index.php?title=Sp%C3%A9cial%3ARecherche&profile=default&search=$who&fulltext=Search&searchengineselect=mediawiki">Plus de resultats ici</a></p>'; } // echo @$search; }
$sock = socket_create(AF_INET, SOCK_STREAM, 0); socket_bind($sock, 0, 12909) or die('Could not bind to address'); socket_listen($sock); echo "Listening\n"; while(true) { $client = socket_accept($sock); $addr = ""; socket_getpeername($client, $addr); echo "Socket opened: $addr\n"; if(in_array($addr, $conf['white'])) { $resp = array(); $resp['hostname'] = hostname(); $resp['who'] = who(); $resp['uplo'] = array_merge(array("uptime" => uptime()), loadavg()); $resp['ram'] = memory(); $resp['ips'] = ip_addresses(); $reps['disk'] = diskusage(); socket_write($client, json_encode($resp)); } else { socket_write($client, json_encode(array("error" => "Unauthorized"))); } socket_close($client); } socket_close($sock); function hostname() { return trim(file_get_contents("/proc/sys/kernel/hostname"));
<? return who($argv, $argc); function who($argv, $argc) { // if ($_SESSION['status'] == 'ghost') { // throw new Exception('Эта операция доступна только авторизованным пользователям', 403); // } if (!$argc) { return $_SESSION['id'] . ' ' . $_SESSION['nickname'] . ' ' . $_SESSION['status']; } if ($argv[1] == 'am' && $argv[2] == 'i') { return $_SESSION['id'] . ' ' . $_SESSION['nickname'] . ' ' . $_SESSION['status']; /* . $datetimereg . $datetimelogin; ' 2015-10-03 17:56 (:0)' */ } }