function plug_rssin($u) { req('pop,art,tri,spe'); Head::add('jslink', '/prog/utils.js'); if ($_GET['rssurl']) { foreach ($_GET as $k => $v) { if ($k == "rssurl") { $u = $v; } else { $u .= '&' . $k . '=' . $v; } } } $u = str_replace('http://', '', $u); if ($u) { $alx = alx(); $rss = load_xml('http://' . $u, 1); $ret .= bal('h1', lkt('', 'http://' . $u, preplink($u))); $ret .= lkt("", '/?plug=rssin&rssurl=' . $u, picto('url')); foreach ($rss as $k => $v) { if ($v[1]) { $ret .= pane_base($v[1], $v[0], "", rss_date($v[2]), "", $v[3], $alx); } } } return $ret; }
<td width="100%" style="border-style: none; border-width: medium" align=left colspan=1> <font face=Arial size=2 color=#CC0000><b>TERMINAL ACCESS</b></font> </td> </tr> </table> <br> <table class="reporttable" width=100% cellpadding="4" cellspacing="1"> <tr> <td class="reportheader" >Service</td> <td class="reportheader" >IP Address / Hostname</td> <td class="reportheader" >Service Type</td> <td class="reportheader" >Terminal</td> </tr> <?php $url = $base_url . "/api/terminal_access.php?key={$API_KEY}&username={$username}"; $terminal_list = load_xml($url); if (count($terminal_list) > 0) { $j = 1; for ($i = 0; $i < count($terminal_list); $i++) { if ($j % 2 == 1) { $row_color = "#EDEDE4"; } else { $row_color = "#FFFFFF"; } $hostname = $terminal_list->terminal[$i]->url; $service = $terminal_list->terminal[$i]->servicename; $serviceuser = $terminal_list->terminal[$i]->serviceusername; $servicetype = $terminal_list->terminal[$i]->servicetype; if (strlen($hostname) > 0) { echo "<tr bgcolor={$row_color}>"; echo "<td class='reportdata'>" . $service . "</td>";
function GetServiceInfo() { global $soap; $soap = TRUE; return array("GetServiceInfoResult" => load_xml("xml/serviceInfo.xml")); }
// Récupère les attrib de chaque server pour le merge... + simplifie (root du array) $arr_attributes = $arr_attributes[1]; $arr_attributes = $arr_attributes['server']; $updated = $arr_attributes_master['mktime']; $players_online = $arr_attributes_master['players']; $xml_age = mktime() - $updated; } // // Load the XML and check if the data are fresh... if not, refresh them. Age is in Seconds // load_xml(); if ($xml_age >= 60) { // Force Refresh the data $output = exec('python querymaster.py'); // Load it again load_xml(); } // // Manually merge the two arrays (infos & attributes) // $x = 0; $array_result = array(); foreach ($arr_attributes as $server) { // This server is not responding, so structure will differ if ($server['responding'] == 0) { // Add important parsing field... $server['version'] = ''; $server['servername'] = ''; } $array_result[] = $server; $x++;
<?php echo " Install Products, UE and Modules...\n"; $xml = load_xml(BASE . "system/install/data/{$dataset}/Modules-X.xml"); $total = $xml->produit->count(); $i = 0; foreach ($xml->produit as $produit) { $model = new \Models\Produit(); $model->setId($produit['id']); $model->setName($produit['name']); $model->setReferentiel($produit['referentiel']); $model->setDate(DateTime::createFromFormat($format, $produit['date'])); $em->persist($model); $em->flush(); $u = 0; $total += $produit->ue->count(); foreach ($produit->ue as $ue) { $submodel = new \Models\UE(); $submodel->setCode($ue['id']); $submodel->setName($ue['name']); $submodel->setAxePeda($ue['axePeda']); $submodel->setEcts(intval($ue['ects'])); $submodel->setProduct($model); $em->persist($submodel); $em->flush(); /*$m = 0; foreach ($ue->module as $module) { $nmodel = new \Models\Module(); $nmodel->setName($module['name']);
<?php $url = $base_url . "/api/tkt_count_by_staff_new.php?key={$API_KEY}&start_date={$start_date}&end_date={$end_date}"; $current = load_xml($url); ?> <table class="reporttable" width=100% cellspacing=1 cellpadding=2> <tr> <td class='reportdata' width=100%><b>Ticket Assignment By Staff</td> </tr> </table> <table class="reporttable" width=100% cellspacing=1 cellpadding=2> <tr> <td class="reportheader">Staff Name</td> <td class="reportheader" width=80>Open Tickets</td> <td class="reportheader" width=100>Tickets Closed On-site</td> <td class="reportheader" width=100>Tickets Closed Remotely</td> <td class="reportheader" width=80>Count</td> <td class="reportheader" width=100>Avg. Response Time</td> <td class="reportheader" width=100>Avg. Closure Time</td> <td class="reportheader" width=80>SLA Non-Compliance</td> <td class="reportheader" width=80>Avg. Staff Rating</td> <td class="reportheader" width=50>Time Spent</td> </td> </tr> <?php $current_count_staff = 0; $current_openticket_staff = 0; $current_sla_breached_staff = 0; $current_closeticket_local = 0; $current_closeticket_remote = 0; $time_spent = 0;
<?php $url = $base_url . "/api/tkt_list_by_helptopics.php?key={$API_KEY}&topic=Scheduled Activity&status=all&start_date={$start_date}&end_date={$end_date}"; $query = load_xml("{$url}"); ?> <table class="reporttable" width=100% cellspacing=1 cellpadding=2> <tr> <td class='reportdata' width=100%><b>Scheduled Activities</td> </tr> </table> <table class="reporttable" width=100% cellspacing=1 cellpadding=2> <tr> <td class="reportheader" width=200>Date</td> <td class="reportheader" width=300>Activity</td> <td class="reportheader">Comments</td> </td> </tr> <?php $current_count = 0; for ($i = 0; $i < count($query); $i++) { echo "<tr bgcolor=#F0F0F0>"; echo "<td class='reportdata' style='text-align: left;'>" . $query->ticket[$i]->created . "</td>"; echo "<td class='reportdata' style='text-align: left;'>" . $query->ticket[$i]->subject . "</td>"; $note = str_replace('||', "<br>", $query->ticket[$i]->note); echo "<td class='reportdata' style='text-align: left;'>" . $note . "</td>"; echo "</tr>"; } ?> </table>
/** * Fetches the data for a given OfDB id * * @author Chinamann <*****@*****.**> * @param int OfDB id * @return array Result data */ function ofdbData($id) { global $CLIENTERROR; global $cache; global $ofdbServer; global $ofdbGW; global $ofdbIdPrefix; // Languages $map_laguages = array('arabisch' => 'arabic', 'bulgarisch' => 'bulgarian', 'chinesisch' => 'chinese', 'tschechisch' => 'czech', 'dänisch' => 'danish', 'holländisch' => 'dutch', 'englisch' => 'english', 'französisch' => 'french', 'deutsch' => 'german', 'griechisch' => 'greek', 'ungarisch' => 'hungarian', 'isländisch' => 'icelandic', 'indisch' => 'indian', 'israelisch' => 'israeli', 'italienisch' => 'italian', 'japanisch' => 'japanese', 'koreanisch' => 'korean', 'norwegisch' => 'norwegian', 'polnisch' => 'polish', 'portugisisch' => 'portuguese', 'rumänisch' => 'romanian', 'russisch' => 'russian', 'serbisch' => 'serbian', 'spanisch' => 'spanish', 'schwedisch' => 'swedish', 'thailändisch' => 'thai', 'türkisch' => 'turkish', 'vietnamesisch' => 'vietnamese', 'kantonesisch' => 'cantonese', 'katalanisch' => 'catalan', 'zypriotisch' => 'cypriot', 'zyprisch' => 'cypriot', 'esperanto' => 'esperanto', 'gälisch' => 'gaelic', 'hebräisch' => 'hebrew', 'hindi' => 'hindi', 'jüdisch' => 'jewish', 'lateinisch' => 'latin', 'mandarin' => 'mandarin', 'serbokroatisch' => 'serbo-croatian', 'somalisch' => 'somali'); // Genres $map_genres = array('Amateur' => '', 'Eastern' => '', 'Experimentalfilm' => '', 'Mondo' => '', 'Kampfsport' => 'Sport', 'Biographie' => 'Biography', 'Katastrophen' => 'Thriller', 'Krimi' => 'Crime', 'Science-Fiction' => 'Sci-Fi', 'Kinder-/Familienfilm' => 'Family', 'Dokumentation' => 'Documentary', 'Action' => 'Action', 'Drama' => 'Drama', 'Abenteuer' => 'Adventure', 'Historienfilm' => 'History', 'Kurzfilm' => 'Short', 'Liebe/Romantik' => 'Romance', 'Heimatfilm' => 'Romance', 'Grusel' => 'Horror', 'Horror' => 'Horror', 'Erotik' => 'Adult', 'Hardcore' => 'Adult', 'Sex' => 'Adult', 'Musikfilm' => 'Musical', 'Animation' => 'Animation', 'Fantasy' => 'Fantasy', 'Trash' => 'Horror', 'Komödie' => 'Comedy', 'Krieg' => 'War', 'Mystery' => 'Mystery', 'Thriller' => 'Thriller', 'Tierfilm' => 'Documentary', 'Western' => 'Western', 'TV-Serie' => '', 'TV-Mini-Serie' => '', 'Sportfilm' => 'Sport', 'Splatter' => 'Horror', 'Manga/Anime' => 'Animation'); $data = array(); $data['encoding'] = 'utf-8'; $data['imdbID'] = $id; $id = preg_replace('/^' . $ofdbIdPrefix . '/', '', $id); list($id, $vid) = explode("-", $id, 2); $url = $ofdbGW . '/movie/' . $id; # dump($url); $resp = httpClient($url, $cache); if (!$resp['success']) { $CLIENTERROR .= $resp['error'] . "\n"; return false; } $xml = load_xml($resp['data']); # dump($xml); if ((int) $xml->status->rcode > 0) { // prevent caching bad data if ($cache) { $cache_file = cache_get_filename($url, CACHE_HTML); @unlink($cache_file); } $CLIENTERROR .= (string) $xml->status->rcodedesc . "\n"; return false; } // set root $item = $xml->resultat; // Title $data['title'] = (string) $item->titel; $data['orgtitle'] = (string) $item->alternativ; list($data['title'], $data['subtitle']) = explode(" - ", $data['title'], 2); // Year $data['year'] = (string) $item->jahr; // Cover url for image lookup $data['coverurl'] = (string) $item->bild; // Plot $data['plot'] = (string) $item->beschreibung; if (!$data['plot']) { $data['plot'] = (string) $item->kurzbeschreibung; } // Rating $data['rating'] = round((double) $item->bewertung->note); // Cast foreach ($item->besetzung->person as $cast) { $data['cast'] .= "\n"; $data['cast'] .= (string) $cast->name; if ((string) $cast->rolle) { $data['cast'] .= '::' . (string) $cast->rolle; } if ((string) $cast->id) { $data['cast'] .= '::' . (string) $cast->id; } } // Director foreach ($item->regie->person as $director) { if ($data['director']) { $data['director'] .= ', '; } $data['director'] .= (string) $director->name; } // Country foreach ($item->produktionsland as $country) { if ($data['country']) { $data['country'] .= ', '; } $data['country'] .= (string) $country->name; } // Genre $data['genres'] = array(); foreach ($item->genre->titel as $genre) { $genre = (string) $genre; // mapping if ($map_genres[$genre]) { $data['genres'][] = $map_genres[$genre]; } } // Fetch first VID if none already selected if (!$vid) { foreach ($item->fassungen->titel as $fassung) { $vid = (string) $fassung->id; // 1545;210858 break; } if ($vid) { // IMDB ID $data['imdbID'] = $ofdbIdPrefix . preg_replace('/;/', '-', $vid); } } # dump($data); return $data; /* $data = array(); //result $ary = array(); //temp $ary2 = array(); //temp2 // Fetch Mainpage $resp = httpClient(ofdbContentUrl($id), $cache); if (!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; // add encoding $data['encoding'] = get_response_encoding($resp); // add engine ID -> important for non edit.php refetch $data['imdbID'] = $ofdbIdPrefix.$id; $resp['data'] = preg_replace('/[\r\n\t]/',' ', $resp['data']); // Titles / Year preg_match('/<title>(.*?)<\/title>/i', $resp['data'], $ary); $ary[1] = preg_replace('/^OFDb[\s-]*!!!!!!!!!!!/', '', $ary[1]); $ary[1] = preg_replace('/\[.*\]/', ' ', $ary[1]); if (preg_match('/\(([0-9]*)\)/i',$ary[1],$ary2)) { $data['year'] = trim($ary2[1]); } $ary[1] = preg_replace('/\([0-9]*\)/', ' ', $ary[1]); $ary[1] = preg_replace('/\s{2,}/s', ' ', $ary[1]); // check if there is a comma sperated article at the end if (preg_match('#(.*),\s*(A|The|Der|Die|Das|Ein|Eine|Einer)\s*$#i',$ary[1],$subRes)) { $ary[1] = $subRes[2].' '.$subRes[1]; } list($t,$s) = explode(" - ",trim($ary[1]),2); $data['title'] = trim($t); $data['subtitle'] = trim($s); // Original Title if (preg_match('/Originaltitel.*?<b>(.*?)</i', $resp['data'], $ary)) { $data['orgtitle'] .= trim($ary[1]); } // Country if (preg_match('/>Herstellungsland:.*?<b><a.*?>(.*?)<\/a>/i', $resp['data'], $ary)) { $data['country'] .= trim($ary[1]); } // Rating if (preg_match('/<br>Note:\s*([0-9\.]+)/', $resp['data'], $ary)) { $data['rating'] = $ary[1]; } // Cover URL if (preg_match('#<img src="(http://img.ofdb.de/film/.*?\.jpg)"#i', $resp['data'], $ary)) { $data['coverurl'] = trim($ary[1]); } // Fetch first VID if none already selected if (!$vid) { if (preg_match_all('/view\.php\?page=fassung&fid='.$id.'&vid=([0-9]+)".*?class="Klein">(.*?)</i', $resp['data'], $ary, PREG_SET_ORDER)) { foreach($ary as $row) { if (trim($row[2]) == "K" || trim($row[2]) == "KV") // Check if there is a good result { $vid=$row[1]; break; } } if (!$vid) // Still empty -> Take the first one { $vid=$ary[1][1]; } } } // IMDB ID $data['imdbID'] = $ofdbIdPrefix."$id-$vid"; // Fetch Plot if (preg_match('#href="(plot/[^"]+)"#i', $resp['data'], $ary)) { $subresp = httpClient($ofdbServer.'/'.$ary[1], $cache); if (!$resp['success']) $CLIENTERROR .= $subresp['error']."\n"; $subresp['data'] = preg_replace('/[\r\n\t]/',' ', $subresp['data']); if (preg_match('#</b><br><br>(.*?)</font></p>#i', $subresp['data'], $ary)) { $ary[1] = preg_replace('/\s{2,}/s', ' ', $ary[1]); $ary[1] = preg_replace('#<(br|p)[ /]*>#i', "\n", $ary[1]); $data['plot'] = trim($ary[1]); //$data['plot'] = "aeääääaaaä"; } } // Fetch Details $resp = httpClient(ofdbDetailUrl($id), $cache); if (!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; $resp['data'] = preg_replace('/[\r\n\t]/',' ', $resp['data']); // Director if (preg_match('/<b><i>Regie<\/i><\/b>.*?<table.*?>(.*?)<\/table>/i', $resp['data'], $ary)) { if (preg_match_all('/class="Daten"><a.*?>(.*?)<\/a>/i',$ary[1],$ary2, PREG_SET_ORDER)) { foreach ($ary2 as $row) { $data['director'] .= trim($row[1]).', '; } $data['director'] = preg_replace('/, $/', '', $data['director']); } } // Cast if (preg_match('/<b><i>Darsteller<\/i><\/b>.*?<table.*?>(.*)<\/table>/', $resp['data'], $ary)) { // dirty workaround for (.*?) failed on very long match groups issue (tested at PHP 5.2.5.5) // e.g.: ofdb:7749-111320 (Angel - Jäger der Finsternis) $ary[1] = preg_replace('#</table.*#','',$ary[1]); if (preg_match_all('/class="Daten"><a(.*?)">(.*?)<\/a>.*?<\/td> <td.*?<\/td> <td[^>]*>(.*?)<\/td>/i',$ary[1],$ary2, PREG_SET_ORDER)) { foreach ($ary2 as $row) { $actor = trim(strip_tags($row[2])); $actorid = ""; if (!empty($row[1])) { if (preg_match('#href="view.php\?page=person&id=([0-9]*)#i', $row[1], $idAry)) { $actorid = $ofdbIdPrefix.$idAry[1]; } } $character = ""; if (!empty($row[3])) { if (preg_match('#class="Normal">... ([^<]*)<#i', $row[3], $charAry)) { $character = trim(strip_tags($charAry[1])); } } $data['cast'] .= "$actor::$character::$actorid\n"; } } } if (preg_match('/>Genre\(s\)\:.*?<b>(.*?)<\/b>/i', $resp['data'], $ary)) { if (preg_match_all('/<a.*?>(.*?)<\/a>/i',$ary[1],$ary2, PREG_SET_ORDER)) { foreach($ary2 as $row) { $genre = trim(html_entity_decode($row[1])); $genre = strip_tags($genre); if (!$genre) continue; if (isset($map_genres[$genre])) $data['genres'][] = $map_genres[$genre]; } } } // Fetch Version $resp = httpClient(ofdbVersionUrl($id, $vid), $cache); if (!$resp['success']) $CLIENTERROR .= $resp['error']."\n"; $resp['data'] = preg_replace('/[\r\n\t]/',' ', $resp['data']); // FSK $fsks = array( 'FSK o.A.' => '0', 'FSK 6' => '6', 'FSK 12' => '12', 'FSK 16' => '16', 'FSK 18' => '18', 'Keine Jugendfreigabe' => '18', 'SPIO/JK' => '18', 'juristisch geprüft' => '', 'ungeprüft' => '' ); if (preg_match('/>Freigabe:<.*?<b>(.*?)<\/tr>/i', $resp['data'], $ary)) { $fsk = trim(html_entity_decode($ary[1])); $fsk = strip_tags($fsk); if (isset($fsks[$fsk])) $data['fsk'] = $fsks[$fsk]; } $lang_list = array(); if (preg_match('/>Tonformat:(.*?)<\/tr>/i', $resp['data'], $ary) && preg_match_all('/<a.*?>(\w+?)(\s\().*?a>/si', $ary[1], $langs, PREG_PATTERN_ORDER)) { foreach($langs[1] as $language) { $language = trim(strtolower($language)); $language = html_entity_decode(strip_tags($language)); $language = preg_replace('/\s+$/','',$language); if (!$language) continue; if (isset($map_laguages[$language])) $language = $map_laguages[$language]; else continue; if (!$language) continue; $lang_list[] = $language; } $data['language'] = trim(join(', ', array_unique($lang_list))); } // Runtime if (preg_match('/>Laufzeit:<.*?<b>(.*?)\s*Min/i', $resp['data'], $ary)) { $ary[1] = preg_replace('/:.*!!!!!!!/','', $ary[1]); $data['runtime'] = trim($ary[1]); } // EAN-Code if (preg_match('/>EAN\/UPC<\/a>:.*?<b>\s*([0-9]+)\s*<\/b>/i', $resp['data'], $ary)) { $data['barcode'] = $ary[1]; } return $data; */ }
function login_to_server($pseudo = '', $mdp = '', $bpUserId = 0, $returnSession = false, $fbUserId = 0) { global $p_user, $db_name, $directories, $st, $cw; $login_name = mysql_escape_string($pseudo ? $pseudo : (string) $_POST['pseudo']); $agent_hash = hash_user_agent(); /********************** Admin Login *******************/ if ($login_name == "Admin") { $password = mysql_escape_string((string) $_POST['mdp']); db("select * from se_games where admin_pw = '{$password}'"); $games_info = dbr(1); if (empty($games_info)) { //invalid admin login insert_history(1, "Bad login Attempt"); sleep(3); //so as to minimise trouble caused by people trying to guess the pass, and who don't know about the back button. :) exit("Login Failed. Do no pass go, do not collect your new Harvestor Mammoth."); } else { //Admin successfully logged into game $db_name = $games_info['db_name']; $session = create_rand_string(32); SetCookie("login_id", 1, 0); SetCookie("login_name", "Admin", time() + 2592000); SetCookie("session_id", $session, 0); flush(); //send cookies immediatly $expire = time() + SESSION_TIME_LIMIT; insert_history(1, "Successfully logged into {$db_name}"); dbn("update {$db_name}_users set game_login_count = game_login_count + 1 where login_id = '1'"); dbn("update se_games set session_id = '{$session}', session_exp = '{$expire}', user_agent = '{$agent_hash}' where db_name = '{$db_name}'"); echo "<script>self.location='location.php';</script> <noscript>You cannot login without JavaScript. Please enable Javascript, or use a browser that supports it.</noscript>"; exit; } } elseif (preg_match("/^admin\$/i", $login_name)) { //other spelling of admin. sleep(5); exit("Sod off - you can't even spell 'admin' properly can you?"); } /*************************User Login************************/ db("select * from user_accounts where login_name = '{$login_name}'"); $p_user = dbr(1); if (!isset($_POST['enc_pass']) || $mdp) { //user entered pass on login form $enc_pass = md5($mdp ? $mdp : $_POST['mdp']); $pre_enc_pass = 0; } else { //pass coming from being hidden in auth. so set pre_enc to ensure auth is checked. $enc_pass = $_POST['enc_pass']; $pre_enc_pass = 1; } if (empty($p_user)) { //incorrect username print_header($cw['login_problem']); echo "<blockquote>" . sprintf($st[1816], $login_name) . "<br />\r\n\t\t" . $st[1817] . "<p />\r\n\t\t<p /> <a href='inscription.php'>\r\n\t\t" . $cw['sign_up2'] . "</a> <p /> <a href=\"" . URL_PREFIX . "/index.php\">" . $st[1818] . "</a></b></blockquote>"; print_footer(); } elseif ($enc_pass != $p_user['passwd'] && !$bpUserId && !$fbUserId) { //incorrect password print_header($cw['bad_passwd']); echo "<blockquote><b>" . $st[1819] . "<br />" . $st[1820] . "\r\n\t\t<p /><a href=\"javascript:history.back()\">" . $st[1818] . "</a></b><p />" . $st[789] . " ? <a href=change_pass.php?stage_one=1>" . $cw['click_here'] . "</a></blockquote><p />"; insert_history($p_user['login_id'], $cw['bad_login']); print_footer(); } elseif ($p_user['bp_user_id'] && !$bpUserId) { // joueur BP connexion classique print_header("Problème de connexion"); echo "<blockquote><b>Erreur</b><br /><br />Il semble que vous vous soyez inscrit via notre partenaire <a href='http://www.bigpoint.com/' target='_blank'>BigPoint</a>, veuillez utiliser <a href='http://fr.bigpoint.com/games/astravires/' target='_blank'>la fiche jeu Astra Vires</a> sur son portail pour vous connecter.</blockquote><p />"; insert_history($p_user['login_id'], 'Joueur BP connexion classique'); print_footer(); //valid username/pass combination. //But MUST enter a auth code to continue, as pre_enc_pass was set. //or no auth code yet entered, and sendmail is set } elseif ($pre_enc_pass == 1 || $p_user['auth'] != 0 || $bpUserId) { //get user to enter auth code. if ((empty($_POST['auth_code']) || $_POST['auth_code'] != $p_user['auth'] && $p_user['auth'] != 0) && !$bpUserId) { print_header("Authorisation Code Required"); $rs = ""; if (empty($_POST['auth_code'])) { echo "Please enter the Authorisation Code that was sent to your email address:<br /><br />"; } else { echo "Authorisation Code did not match.<br />"; } echo "<form name=get_var_form action={$_SERVER['PHP_SELF']} method=POST>"; echo "<input type=hidden name=l_name value='{$login_name}'><input type=hidden name=enc_pass value='{$enc_pass}'>"; echo "<input type=text name=auth_code value='' size=20> - "; echo "<input type=submit value=Submit></form>"; print_footer(); } elseif ($_POST['auth_code'] == $p_user['auth'] || $bpUserId) { dbn("update user_accounts set auth = '0' where login_id = '{$p_user['login_id']}'"); } else { print_page("hmm", "Something Broke"); } } /*****************User successfully logged in***********************/ if ($p_user['mdp']) { setAutoLoginCookie($p_user['login_id'], $p_user['login_name'], $p_user['mdp']); } $session = create_rand_string(32); SetCookie("login_id", $p_user['login_id'], time() + 2592000); SetCookie("login_name", $p_user['login_name'], time() + 2592000); SetCookie("session_id", $session, 0); $expire = time() + SESSION_TIME_LIMIT; if (!$returnSession) { dbn("update user_accounts set last_login = "******", session_id = '{$session}', session_exp = '{$expire}', last_ip = '" . $_SERVER['REMOTE_ADDR'] . "', login_count = login_count + 1, user_agent = '{$agent_hash}' where login_id = '{$p_user['login_id']}'"); insert_history($p_user['login_id'], "Logged Into GameList"); } else { dbn("update user_accounts set session_id = '{$session}', session_exp = '{$expire}' where login_id = '{$p_user['login_id']}'"); } // update the password in clear to delete the encrypted one in the future dbn("update user_accounts set mdp = '" . $_POST['mdp'] . "' where login_id = '" . $p_user[login_id] . "'"); if ($p_user['last_login'] == 0 && !$returnSession) { //first login. show them the story. print_header("Histoire"); //load story $results = load_xml("{$directories['includes']}/stories.xml"); $story = $results['story']['Histoire']; echo "<a href='game_listing.php'>Continuer</a><br /><br />"; echo "\n<a name=top><center><b>{$story['title']}</b></center></a><br>{$story['content']} <p />Ecrit par <b class=b1>{$story['author']}</b>"; echo "<br /><br /><a href='game_listing.php'>Continuer</a>"; $rs = ''; print_footer(); } if ($returnSession) { return $session; } }
} if ($SNMP == 1) { $sql = "SELECT a.host_id,b.nw_snmp_cpu_status,b.nw_snmp_mem_status,b.cpu_user,b.cpu_system,b.cpu_idle,b.timestamp,b.mem_utilization,b.nw_snmp_dsk_status,b.disk_utilization FROM hosts_master a,hosts_nw_snmp_log b WHERE a.host_id=b.host_id AND a.hostname='{$hostname}' ORDER BY b.record_id DESC LIMIT 1"; $result = mysql_query($sql); $snmp_data_count = mysql_num_rows($result); while ($row = mysql_fetch_object($result)) { $network_snmp_cpu_status = $row->nw_snmp_cpu_status; $network_snmp_mem_status = $row->nw_snmp_mem_status; $network_snmp_dsk_status = $row->nw_snmp_dsk_status; $network_snmp_cpu_usage = $row->cpu_user + $row->cpu_system; $network_snmp_mem_usage = $row->mem_utilization; $network_snmp_dsk_usage = $row->disk_utilization; } } $url = $base_url . "/api/hosts_svc_status.php?key={$API_KEY}&hostname=" . $hostname; $services = load_xml($url); $count = 0; $live = 0; for ($j = 0; $j < count($services); $j++) { $host_id = $services->status[$j]->host_id; if ($host_id > 0) { $status = $services->status[$j]->svc_status; if ($status == 1) { $live++; } $count++; } } echo "<tr bgcolor=#EEEEEE onClick=\"document.location='../nw/show_host_details.php?hostname={$hostname}&desc={$description}&txttime=6'\">"; echo "<td class='reportdata'>" . $description . "</td>"; echo "<td class='reportdata'>" . $hostname . "</td>";
/** * Fetches the data for a given Amazon ID (equals ISBN) * * @author Andreas Goetz <*****@*****.**> * @param int IMDB-ID * @return array Result data */ function amazonawsData($id) { global $amazonAWSUrl, $cache; global $CLIENTERROR; $url = aws_signed_request(array('Operation' => 'ItemLookup', 'ItemId' => $id, 'ResponseGroup' => 'Large')); $resp = httpClient($url, $cache); # dump($resp); if ($resp['success']) { $xml = load_xml($resp['data']); # dump($xml); $data = awsNodeData($xml->Items->Item[0]); # dump($data); } else { $CLIENTERROR .= $resp['error'] . "\n"; } // utf-8 according to HTTP response but simplexml complains? // utf-8 is already forced by load_xml $data['encoding'] = 'utf-8'; return $data; }
echo "<td class='reportdata'>" . $hostname . "</td>"; echo "<td class='reportdata' style='text-align: center;'>" . $platform . "</td>"; $url = $base_url . "/api/hosts_availability.php?key={$API_KEY}&hostname={$hostname}&start_date={$start_date}&end_date={$end_date}"; $host_availability = load_xml($url); $uptime = $host_availability->availability[0]->uptime; $graphuptime[] = $uptime; echo "<td class='reportdata' style='text-align: center;'>" . $uptime . " %</td>"; $downtime = $host_availability->availability[0]->downtime; $downtime_hrs = $host_availability->availability[0]->downtime_hrs; $graphdowntime[] = $downtime_hrs; echo "<td class='reportdata' style='text-align: center;'>" . $downtime_hrs . " Hrs</td>"; $url = $base_url . "/api/hosts_svc_availability.php?key={$API_KEY}&hostname={$hostname}&start_date={$start_date}&end_date={$end_date}"; $host_availability = load_xml($url); $uptime = $host_availability->availability[0]->uptime; echo "<td class='reportdata' style='text-align: center;'>" . $uptime . " %</td>"; $downtime = $host_availability->availability[0]->downtime; echo "<td class='reportdata' style='text-align: center;'>" . $downtime . " %</td>"; // Display Service Information echo "<td colspan=1 class='reportdata'>"; $url = $base_url . "/api/hosts_svc_availability_info.php?key={$API_KEY}&hostname={$hostname}&start_date={$start_date}&end_date={$end_date}"; $service_list = load_xml($url); if (count($service_list) > 0) { for ($j = 0; $j < count($service_list); $j++) { echo $service_list->service_info[$j]->description . " (" . $service_list->service_info[$j]->port . ") " . $service_list->service_info[$j]->uptime . "%<br>"; } } echo "</td></tr>"; } } } echo "</table>";
foreach (glob(BASE . "/system/install/data/{$dataset}/Sessions*.xml") as $file) { // On recupère la racine $racine = substr(substr($file, -6), 0, 2); // Verbose echo "\n Processing {$racine} :"; // On fabrique l'établissement $data = load_xml($file); $etablissement = new Models\Etablissement(); $etablissement->setName($data['name']); $etablissement->setRacineAnalytique($data['racine']); $em->persist($etablissement); $em->flush(); unset($data); // On parcours les années des promotions de ce centre foreach (glob(BASE . "/system/install/data/{$dataset}/{$racine}-*.xml") as $file) { $promo = load_xml($file); echo " {$promo['year']}="; // Compteur d'inscrits $c = 0; // Compteur de sessions $s = 0; // On parcours les sessions foreach ($promo->session as $session) { // On recupère les infos de la session $produit = $session->produit[0]; $team = $session->team[0]; // TODO A gérer !!! $periode = $session->periode[0]; // On cherche le produit de rattachement de cette session $find = $repoProduit->findOneBy(array('id' => $produit['code'])); // On n'a pas trouvé le produit !!
function GetServiceInfo() { global $soap; $soap = true; return ['GetServiceInfoResult' => load_xml('xml/serviceInfo.xml')]; }
function sw_others($result, $num_rows) { global $base_url; global $API_KEY; if ($num_rows > 0) { while ($row = mysql_fetch_array($result)) { $package_name = $row['package_name']; $package_name_new = str_replace('&', '&', $row['package_name_new']); $package_name = html_entity_decode($package_name); $package_name_new = html_entity_decode($package_name_new); $license_purchased = 0; $license_used = 0; $sub_result = mysql_query("SELECT SUM(quantity) AS license_purchased FROM sw_licenses WHERE package_name='{$package_name}'"); $sub_row = mysql_fetch_array($sub_result); $license_purchased = $sub_row['license_purchased']; $sub_result = mysql_query("SELECT distinct system_id FROM sys_sw_software WHERE software_name like '{$package_name}%' group by system_id"); $license_used = mysql_num_rows($sub_result); $sw_a_host = "LIST OF ACTIVE HOSTS FOR {$software_title} : "; $sw_ia_host = "LIST OF IN-ACTIVE HOSTS FOR {$software_title} : "; $active_count = 0; $inactive_count = 0; $sub_result = mysql_query("SELECT distinct a.hostname from system a,sys_sw_software b where a.system_id=b.system_id and b.software_name like '{$package_name}%'"); while ($sub_row = mysql_fetch_array($sub_result)) { $hostname = $sub_row[0]; $sub_url_2 = $base_url . "api/ast_information.php?key={$API_KEY}&hostname={$hostname}"; $sub_query_2 = load_xml($sub_url_2); $status = $sub_query_2->asset[0]->status; if ($status == "Active") { $active_count++; $sw_a_host .= " {$hostname} "; } else { $inactive_count++; $inactive_host_list[$inactive_host_count] = $hostname; $inactive_host_count++; $sw_ia_host .= " {$hostname} "; } } echo "<software>"; echo "<title>" . $package_name_new . "</title>"; echo "<license_purchased>" . $license_purchased . "</license_purchased>"; echo "<software_used>" . $license_used . "</software_used>"; echo "<type>OTHER</type>"; echo "<active_hosts>" . $sw_a_host . "</active_hosts>"; echo "<active_hosts_count>" . $active_count . "</active_hosts_count>"; echo "<inactive_hosts>" . $sw_ia_host . "</inactive_hosts>"; echo "<inactive_hosts_count>" . $inactive_count . "</inactive_hosts_count>"; echo "</software>"; } } }
<td class="reportheader" width=100>Network</td> <td class="reportheader" width=100>Services</td> <?php if ($SNMP == 1) { ?> <td class="reportheader" width=100>CPU</td> <td class="reportheader" width=100>Memory</td> <td class="reportheader" colspan=2 width=100>Disk</td> <?php } ?> </tr> <?php $url = $base_url . "/api/hosts_list.php?key={$API_KEY}"; $host_list = load_xml($url); if (count($host_list) > 0) { for ($i = 0; $i < count($host_list); $i++) { $hostname = $host_list->host[$i]->hostname; if (strlen($hostname) > 0) { $platform = $host_list->host[$i]->platform; $description = $host_list->host[$i]->description; echo "<tr bgcolor=#EEEEEE onClick=\"document.location='../nw/show_host_details.php?hostname={$hostname}&desc={$description}&txttime=6'\">"; echo "<td class='reportdata'>" . $hostname . "</td>"; echo "<td class='reportdata'>" . $description . "</td>"; echo "<td class='reportdata' style='text-align: center;'>" . $platform . "</td>"; $network = get_nw_status($hostname); if ($network == 1) { $bgcolor = "#65C60D"; $text = "UP"; }
<?php $titre_page = "Histoire et récits"; $nomPage = 'histoires'; include 'includes/haut_index.inc.php'; ?> <div id="contenu_public"> <?php $help_type = $cw['game_stories']; $histoire = $_GET['t'] == 'histoire'; //load stories $results = load_xml("{$directories['includes']}/stories.xml"); $header_str = ""; $content_str = ""; //list stories from arrray. foreach ($results['story'] as $key => $stories_array) { if ($key == 'Histoire') { $header_str .= "\n<a href='histoire.html#{$key}'>{$stories_array['title']}</a><br />"; } else { $header_str .= "\n<a href='recits.html#{$key}'>{$stories_array['title']}</a><br />"; } if ($histoire && $key == 'Histoire' || !$histoire && $key != 'Histoire') { $content_str .= "\n<a name='{$key}'><center><b>{$stories_array['title']}</b></center></a><br /><p>{$stories_array['content']}</p>" . $cw['written_by'] . " <b class=b1>{$stories_array['author']}</b> et traduit par Talath"; } } $out_str .= "<h3><b>Récits d'Astra Vires</b></h3><br />" . $header_str . "<br /><br />" . $content_str; echo $out_str; ?> </div>
* Frontend helpers / template functions * @author Peng Wang <*****@*****.**> * @see /ndxz-studio/helper/custom.php */ // procedure //--------------------------------------- // CONSTANTS //--------------------------------------- define('THEMEDIR', DIRNAME . BASENAME . DS . SITEPATH . DS . $rs['obj_theme']); define('THEMEURL', BASEURL . BASEURLNAME . '/site/' . $rs['obj_theme']); define('FULLURL', str_replace('index.php', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])); //--------------------------------------- // GLOBAL RESOURCES //--------------------------------------- require THEMEDIR . '/header.php'; load_xml(SITEPATH . DS . $rs['obj_theme'] . DS . $default['content_xml_filename'], $default['content_xml_namespace']); add_globals($indx['theme_namespace']); // functions //--------------------------------------- // EMAIL //--------------------------------------- function the_email($address, $name = '', $title = '', $class = 'email') { $tag = href(!empty($name) ? $name : $address, 'mailto:' . antispambot($address), (!empty($title) ? 'title="' . $title . '"' : '') . (!empty($class) ? ' class="' . $class . '"' : '')); return $tag; } //--------------------------------------- // PHP -> JAVASCRIPT //--------------------------------------- /** * @global array results
$out_str .= $st[889]; } $out_str .= "</a>"; } //load the server rules from the rules.htm file. } elseif (isset($_GET['server_rules'])) { $help_type = $cw['server_rules']; ob_start(); include_once "rules.htm"; $out_str .= ob_get_contents(); ob_end_clean(); /************ * Help content from the XML file *************/ } else { $help_array = load_xml("{$directories['includes']}/help_fr.xml"); $header_str = ""; $content_str = ""; $page_top = ""; $printable_topic_str = str_replace("_", " ", $topic); $help_type = $printable_topic_str; //user has selected a sub-topic to load if ($sub_topic != "") { //no such help topic if (!isset($help_array[$topic . "_help"][$sub_topic])) { $content_str = "{$st['890']}.{$b_link}"; } else { //selected help topic contents. $printable_sub_str = str_replace("_", " ", $sub_topic); $content_str = "<center><b>{$printable_sub_str}</b></center>" . $help_array[$topic . "_help"][$sub_topic]['content'] . $b_link; }
<?php include_once "config.php"; include_once "../include/load_xml.php"; $api_key = $_REQUEST["key"]; $sitename = $_REQUEST["sitename"]; $siteurl = $_REQUEST["siteurl"]; $ticketid = $_REQUEST["ticketid"]; $base_url = $siteurl . "/api/viewticketdetails.php?key={$api_key}&ticketid={$ticketid}"; $current = load_xml($base_url); ?> <table class="reporttable" width=100% cellspacing=1 cellpadding=2> <tr> <td class='reportdata' width=80% colspan=4><b>AGENCY :</b> <?php echo $sitename; ?> </td> <td class='reportdata' width=20% colspan=4><b>TICKET ID# :</b> <?php echo $ticketid; ?> </td> </tr> </table> <br> <table class="reporttable" width=100% cellpadding=2> <?php if ($j % 2 == 1) { $row_color = "#EDEDE4"; } else { $row_color = "#FFFFFF"; }
/** * Parses PHP documentation * @param phpdocDir string PHP.net documentation directory * @return array Constant information gathered from the PHP.net documentation by parsing XML files */ function parse_phpdoc_constants($phpdocDir) { $constantsDoc = array(); exec("find " . addslashes($phpdocDir) . " -name \"*constants.xml\"", $xml_files); foreach ($xml_files as $xml_file) { $xml = load_xml($xml_file); if (preg_match('@xml:id=["\'](.*?)["\']@', $xml, $match)) { $id = $match[1]; if (preg_match_all('@<term>\\s*<constant>([a-zA-Z_][a-zA-Z0-9_]*)</constant>.*?</term>.*?<listitem>(.*?)</listitem>@s', $xml, $match)) { for ($i = 0; $i < count($match[0]); ++$i) { $constant = $match[1][$i]; $constantsDoc[$constant]['id'] = $id; $constantsDoc[$constant]['doc'] = xml_to_phpdoc($match[2][$i]); } } if (preg_match_all('@<entry>\\s*<constant>([a-zA-Z_][a-zA-Z0-9_]*)</constant>.*?</entry>\\s*<entry>\\d+</entry>\\s*<entry>(.*?)</entry>@s', $xml, $match) || preg_match_all('@<entry>\\s*<constant>([a-zA-Z_][a-zA-Z0-9_]*)</constant>.*?</entry>\\s*<entry>(.*?)</entry>@s', $xml, $match)) { for ($i = 0; $i < count($match[0]); ++$i) { $constant = $match[1][$i]; $constantsDoc[$constant]['id'] = $id; $constantsDoc[$constant]['doc'] = xml_to_phpdoc($match[2][$i]); } } } } return $constantsDoc; }
// To display list of open tickets ?> <table border=0 width=100% cellspacing=0 cellpadding=2> <tr> <td class='reportdata' width=100%><b>TICKETS</td> </tr> </table> <table cellspacing=1 cellpadding=0 border=0 width=100%> <tr> <td width=50%> <table class="reporttable" style="border: 0px;" width=100% height=250px cellspacing=0 cellpadding=0> <?php $url = $base_url . "/api/tkt_count_summary.php?key={$API_KEY}&staff={$username}"; if ($query = load_xml($url)) { for ($i = 0; $i < count($query); $i++) { $open = $query->summary[$i]->open; $low = $query->summary[$i]->low; $normal = $query->summary[$i]->normal; $high = $query->summary[$i]->high; $emergency = $query->summary[$i]->emergency; $exception = $query->summary[$i]->exception; $staff = $query->summary[$i]->staff; $unassigned = $query->summary[$i]->unassigned; } echo "<tr>"; $code_tabs = array(); $bg_color = "#999999"; if ($staff > 0) { $bg_color = "#89B700";
<?php /////////// DEPRECATED echo " Install Etablissements and Sessions...\n"; $RACINES = array(); foreach (glob(BASE . '/system/install/data/Sessions*.xml') as $file) { $codeAnalytique = substr(substr($file, -6), 0, 2); echo " Processing {$codeAnalytique} sessions...\n"; $RACINES[] = $codeAnalytique; $centre = load_xml($file); $model = new Models\Etablissement(); $model->setName($centre['name']); $model->setRacineAnalytique($centre['racine']); $em->persist($model); $em->flush(); foreach ($centre->promo as $promo) { foreach ($promo->session as $session) { $produit = $session->produit[0]; $team = $session->team[0]; // TODO A gérer !!! $periode = $session->periode[0]; // On cherche le produit de rattachement de cette session $find = $repoProduit->findOneBy(array('id' => $produit['code'])); // On n'a pas trouvé le produit !! if (!$find) { echo " Warning: session {$session['codeAnalytique']} cannot be attached to product '{$produit['name']}' ({$produit['code']})\n"; continue; } $submodel = new \Models\Session(); $submodel->setId($session['id']); $submodel->setName("TODO");
function rssin_xml($f) { $rss = load_xml($f); //p($rss); if ($rss) { foreach ($rss as $k => $v) { list($va, $lnk, $dat) = $v; $va = trim(del_n(strip_tags($va))); $va = clean_title($va); //$va=unescape($va); $va=html_entity_decode($va); $lnk = utmsrc($lnk); if ($dat) { $dat = rss_date($dat); } $ret[] = array($va, $lnk, $dat); } } return $ret; }
$extra_txt = mysql_escape_string("Message to <b class='b1'>All Game Forums</b> from <font color='lime'>The Server Operator</font>:<p /> " . $text); } dbn("insert into {$dest['db_name']}_messages (timestamp,sender_name, sender_id, login_id, text) values(" . time() . ",'{$user['login_name']}','{$user['login_id']}','{$dest_id}','{$extra_txt}')"); } } } //empty the error log. } elseif (isset($_REQUEST['empty_log'])) { if (!isset($_POST['sure'])) { get_var('Erase log', "developer.php", "Are you Sure you want to erase the error log?", 'sure', 'yes'); } else { write_to_error_log("", "", 1); } //empty the error log. } elseif (isset($_GET['show_log'])) { $results = load_xml("{$directories['games']}/{$log_name}", 1); $header_str = ""; $content_str = ""; $b_link = "<br /><br /><a href='#top'>Top</a><br />"; //loop through the entries foreach ($results as $key => $content_array) { //contains the time of last emptying. if (isset($content_array[$key]['last_emptied'])) { $header_str = "<a name='top'>Last Emptied: <b>" . $content_array[$key]['last_emptied'] . "</b></a> - <a href='{$_SERVER['PHP_SELF']}?empty_log=1'>Empty Now</a><p />\n"; //must be an error report then } else { //state username is undefined if none was taken. if (!isset($content_array['']['user'])) { $content_array['']['user'] = "******"; } //get the time that the error was logged.
<tr> <td class='reportdata' style='color:red' width=100%><b>Systems reporting, but not mapped to physical assets</td> </tr> </table> <table class="reporttable" width=100% cellspacing=1 cellpadding=2> <tr> <td class="reportheader">Hostname</td> <td class="reportheader">Operating System</td> <td class="reportheader">Last Audited</td> </td> </tr> <?php $sub_url_1 = $base_url . "/api/oa_audited_list.php?key={$API_KEY}"; $sub_query_1 = load_xml($sub_url_1); $sl_no = 0; for ($i = 0; $i < count($sub_query_1); $i++) { $hostname = $sub_query_1->host[$i]->hostname; $system_id = $sub_query_1->host[$i]->system_id; $os = $sub_query_1->host[$i]->os; $last_seen = $sub_query_1->host[$i]->last_seen; $last_seen = $last_seen + 0; $sub_sql = "select * from asset where hostname='{$hostname}'"; $sub_result = mysql_query($sub_sql); $count = mysql_num_rows($sub_result); if ($count == 0) { $sl_no++; echo "<tr>"; echo "<td class='reportdata'><a target=_blank href='../OA2/index.php/main/system_display/{$system_id}'>{$hostname}</a></td>"; echo "<td class='reportdata'> {$os}</td>";
<?php echo " Install Students...\n"; $xml = load_xml(BASE . "system/install/data/{$dataset}/Students.xml"); $repoStudent = $em->getRepository('\\Models\\Etudiant'); $s = 0; $c = 0; $total = $xml->student->count(); foreach ($xml->student as $student) { $etatCivil = $student->etatCivil[0]; $contacts = $student->contacts[0]; if ($repoStudent->findOneBy(array('emailViacesi' => $contacts['viacesiMail']))) { // Doublon progressBar($c++, $total); continue; } $model = new \Models\Etudiant(); $model->setId($student['id']); $model->setCivilite($etatCivil['civilite']); $model->setFirstName($etatCivil['firstName']); $model->setLastName($etatCivil['lastName']); $date = DateTime::createFromFormat($format, $etatCivil['birthday']); $model->setBirthDay($date ? $date : null); $model->setBirthPlace($etatCivil['birthplace']); $model->setNationality($etatCivil['nationality']); $model->setEmail($contacts['email']); $model->setEmailViacesi($contacts['viacesiMail']); $model->setPhoneNumber($contacts['phone']); $model->setCellNumber($contacts['cell']); $model->setAddressCity($contacts['city']); $model->setAddressPostalCode($contacts['postalCode']);