function print_index() { global $gbl, $sgbl, $ghtml, $login; ob_start(); print_time('index'); $cgi_clientname = $ghtml->frm_clientname; Htmllib::checkForScript($cgi_clientname); $cgi_class = $ghtml->frm_class; if (!$cgi_class) { $cgi_class = getClassFromName($cgi_clientname); } $cgi_password = $ghtml->frm_password; $cgi_forgotpwd = $ghtml->frm_forgotpwd; $cgi_email = $ghtml->frm_email; $cgi_key = $ghtml->frm_login_key; if (!$cgi_password || !$cgi_clientname) { $ghtml->print_redirect("/login/?frm_emessage=login_error"); } $cgi_classname = 'client'; if ($cgi_class) { $cgi_classname = $cgi_class; } if ($cgi_clientname == "" || $cgi_password == "" && $cgi_key == "") { $cgi_forgotpwd = $ghtml->frm_forgotpwd; return; } $ip = $_SERVER['REMOTE_ADDR']; if (!check_login_success($cgi_classname, $cgi_clientname, $cgi_password, $cgi_key)) { return; } log_log("login_success", "Successful Login to {$cgi_clientname} from " . $_SERVER['REMOTE_ADDR']); /* try { $att = $gbl->g->getFromList("loginattempt", $ip); $att->delete(); } catch (Exception $e) { } */ if (check_disable_admin($cgi_clientname)) { $ghtml->print_redirect("/login/?frm_emessage=login_error"); exit; } if (get_login($cgi_classname, $cgi_clientname)) { do_login($cgi_classname, $cgi_clientname); $login->was(); check_blocked_ip(); $ghtml->print_redirect("/"); } else { $ghtml->cgiset("frm_emessage", "login_error"); } $cgi_forgotpwd = $ghtml->frm_forgotpwd; }
function collectquota_main() { global $gbl, $sgbl, $login, $ghtml; //ob_end_flush(); try { print_time('collect'); $login->collectQuota(); $login->metadbaction = 'writeonly'; $login->was(); print_time('collect', 'Time Taken To Collect Quota'); } catch (Exception $e) { print "Caught Execption\n"; print $e->getMessage(); print "\n"; print "\n"; print "\n"; } }
function checkPort() { global $gbl, $sgbl, $login, $ghtml; $num = $this->portnumber; $sname = $this->getParentO()->servername; dprint("Checking Port {$sname}: {$num}\n"); print_time("checkprot"); $sip = gethostbyname($sname); if (validate_ipaddress($sip)) { $res = fsockopen($sip, $num, $erno, $erstr, 10); } else { $res = null; $erno = 1; $erstr = "Dns failed"; } print_time("checkprot", "Fsockopen"); $name = $sgbl->thisserver . "___" . $this->nname; $obj = new PortStatus(null, "localhost", $name); $obj->initThisDef(); if (!$res) { $obj->portstatus = 'off'; $obj->errornumber = $erno; $obj->errorstring = $erstr; } else { fclose($res); $obj->portstatus = 'on'; } $obj->portnname = $this->nname; $obj->servername = $sgbl->thisserver; $obj->updatetime = time(); $obj->setUpdateSubaction(); return $obj; }
function updateform($subaction, $param) { global $gbl, $sgbl, $login, $ghtml; $progname = $sgbl->__var_program_name; $parent = $this->getParentO(); $tree = createTreeObject('name', null, null, null, null, null, null); $gbl->__var_restore_tree = $tree; if ($this->rm_username) { $this->rm_username = fix_meta_character($this->rm_username); } switch ($subaction) { case "backup": if (trim($this->ftp_server)) { $vlist['ftp_server'] = array('M', null); $vlist['rm_username'] = array('M', null); $vlist['rm_password'] = array('M', '***'); $vlist['upload_to_ftp'] = array('M', null); } else { $vlist['upload_to_ftp'] = array('M', "Ftp Server Not Set"); } if (!$this->getParentO()->checkIfLockedForAction('backup')) { if ($this->backupstage === 'doing') { $this->backupstage = 'program_interrupted'; } } $this->backupstage = fix_nname_to_be_variable($this->backupstage); $vlist['backupstage'] = array('M', null); $vlist['backup_to_file_f'] = null; $parent->backupExtraVar($vlist); $vlist['__v_button'] = 'Backup Now'; return $vlist; case "restore_confirm": $gbl->__var_tmp_disabled_flag = false; if ($param) { $this->backupcheckForConsistency($tree, $param); } $vlist['__v_childheir'] = '__var_backup'; $vlist['__v_showcheckboxflag'] = true; if ($sgbl->isDebug()) { $vlist['__v_resourcefunc'] = "getBackupChildList"; } else { $vlist['__v_resourcefunc'] = "getDisplayBackupChildList"; } $vlist['__v_param'] = $param; $vlist['__v_button'] = 'Restore Now'; print_time("restore_process", "Restore Processing Took"); return $vlist; case "restore_confirm_confirm": $gbl->__var_tmp_disabled_flag = true; print_time("restore_process"); if ($param) { $this->backupcheckForConsistency($tree, $param); } $vlist['__v_childheir'] = '__var_backup'; if ($sgbl->isDebug()) { $vlist['__v_resourcefunc'] = "getBackupChildList"; } else { $vlist['__v_resourcefunc'] = "getDisplayBackupChildList"; } $vlist['__v_showcheckboxflag'] = true; $vlist['__v_param'] = $param; $vlist['__v_button'] = 'Restore Now'; print_time("restore_process", "Restore Processing Took"); return $vlist; case "schedule_conf": if ($parent->isSimpleBackup()) { $sched = array('disabled', 'weekly', 'monthly'); } else { $sched = array('disabled', 'daily', 'weekly', 'monthly'); } if (!$this->backupschedule_type) { $this->backupschedule_type = 'disabled'; } if ($this->priv->isOn('backupschedule_flag')) { $vlist['backupschedule_type'] = array('s', $sched); } else { $vlist['backupschedule_type'] = array('M', 'Disabled'); } $vlist['rm_last_number'] = null; $vlist['__v_updateall_button'] = array(); break; case "ftp_conf": $vlist['ftp_server'] = null; $vlist['rm_username'] = null; $vlist['rm_password'] = array('m', get_star_password()); $vlist['rm_directory'] = null; $vlist['upload_to_ftp'] = null; $vlist['upload_type'] = array('M', 'ftp'); $vlist['no_local_copy_flag'] = null; $vlist['dont_verify_ftp_f'] = null; $vlist['__v_updateall_button'] = array(); break; case "restore_from_ftp": if (!$this->ftp_server) { $vlist['ftp_server'] = array("M", "Ftp Server is Not Set"); break; } $vlist['ftp_server'] = array('M', null); $vlist['rm_username'] = array('M', null); $vlist['rm_password'] = array('M', "****"); $vlist['backup_ftp_file_f'] = null; $vlist['__v_next'] = 'restore_confirm'; $vlist['__v_button'] = 'Continue'; break; case "restore_from_file": if (!$this->getParentO()->checkIfLockedForAction('restore')) { if ($this->restorestage === 'doing') { $this->restorestage = 'program_interrupted'; } } $vlist['restorestage'] = array('M', null); $vlist['backup_from_file_f'] = array('L', "/"); $vlist['__v_next'] = 'restore_confirm'; $vlist['__v_button'] = 'Start Restore Process'; break; } return $vlist; }
$result = Co::wait([curl('/rest', ['id' => 1, 'sleep' => 7]), function () { // Wait 4 sec print_r((yield [curl('/rest', ['id' => 2, 'sleep' => 3]), curl('/rest', ['id' => 3, 'sleep' => 4])])); print_time(); // Wait 2 sec print_r((yield [function () { // Wait 1 sec echo (yield curl('/rest', ['id' => 4, 'sleep' => 1])), "\n"; print_time(); return curl('/rest', ['id' => 5, 'sleep' => 1]); }, function () { // Wait 0 sec echo unwrap((yield CO::SAFE => curl('/invalid'))), "\n"; print_time(); try { // Wait 0 sec (yield curl('/invalid')); } catch (CURLException $e) { echo unwrap($e), "\n"; print_time(); } return ['x' => ['y' => function () { return (yield curl('/rest', ['id' => 6, 'sleep' => 2])); }]]; }])); print_time(); return curl('/rest', ['id' => 7, 'sleep' => 1]); }]); print_r($result); print_time();
function printSelectObjectTable($name_list, $parent, $class, $blist = array(), $display = null) { global $gbl, $sgbl, $login, $ghtml; print_time("{$class}.objecttable"); if ($this->frm_accountselect !== null) { $sellist = explode(',', $this->frm_accountselect); } else { $sellist = null; } $classdesc = $this->get_class_description($class, $display); $unique_name = trim($parent->nname) . trim($class) . trim($display) . trim($classdesc[2]); $unique_name = fix_nname_to_be_variable($unique_name); $filtername = $parent->getFilterVariableForThis($class); $fil = $this->frm_hpfilter; $sortdir = null; $sortby = null; if (isset($fil[$filtername]['sortby'])) { $sortby = $fil[$filtername]['sortby']; } if (isset($fil[$filtername]['sortdir'])) { $sortdir = $fil[$filtername]['sortdir']; } $pagesize = '99999'; $iconpath = get_image_path() . "/button"; $nlcount = count($name_list) + 1; $imgheadleft = $login->getSkinDir() . "/top_lt.gif"; $imgheadleft2 = $login->getSkinDir() . "/top_lt.gif"; $imgheadright = $login->getSkinDir() . "/top_rt.gif"; $imgheadbg = $login->getSkinDir() . "/top_bg.gif"; $imgbtnbg = $login->getSkinDir() . "/btn_bg.gif"; $imgtablerowhead = $login->getSkinDir() . "/tablerow_head.gif"; $imgtablerowheadselect = $login->getSkinDir() . "/top_line_medium.gif"; $imgbtncrv = $login->getSkinDir() . "/btn_crv.gif"; $imgtopline = $login->getSkinDir() . "/top_line.gif"; $classdesc = $this->get_class_description($class); $unique_name = trim($parent->nname) . trim($class) . trim($classdesc[2]); $unique_name = fix_nname_to_be_variable($unique_name); //dprint("-- ".$unique_name. " --", 2); ?> <br /> <script> var ckcount<?php echo $unique_name; ?> ; </script> <?php $tsortby = $sortby; if (!$sortby) { $tsortby = exec_class_method($class, "defaultSort"); } if (!$sortdir) { $sortdir = exec_class_method($class, "defaultSortDir"); } //print_time("objecttable"); $obj_list = $parent->getVirtualList($class, $total_num, $tsortby, $sortdir); //print_time("objecttable", 'objecttable'); if (!$sellist) { //$total_num = $this->display_count($obj_list, $display) ; } ?> <table width=100%> <tr> <td align=center> <table cellspacing=2 cellpadding=2 width=97% align=center> <tr><td class=rowpoint></td><td colspan= <?php echo $nlcount; ?> > <table cellpadding=0 cellspacing=0 border=0 width=100%> <tr><td valign=bottom ></td> <td> <?php if (isset($ghtml->__http_vars['frm_hpfilter'][$filtername]['pagenum'])) { $cgi_pagenum = $ghtml->__http_vars['frm_hpfilter'][$filtername]['pagenum']; } else { $cgi_pagenum = 1; } if (!$sellist) { $this->print_next_previous($parent, $class, "top", $cgi_pagenum, $total_num, $pagesize); } ?> </td> <td align=right valign=bottom > <?php if (!$sellist) { ?> <table cellpadding="0" cellspacing="0" border="0" height="27" > <tr><td><img src="<?php echo $imgheadleft; ?> "></td><td nowrap valign=middle background="<?php echo $imgheadbg; ?> "><b><font color="#ffffff"><?php echo get_plural($classdesc[2]); ?> under <?php echo $parent->display("nname"); ?> </b> <?php echo $this->print_machine($parent); ?> <b> (<?php echo $total_num; ?> )</b></font></td><td><img src="<?php echo $imgheadright; ?> "></td></tr> </table> </td> </tr> <tr><td colspan=3><table cellpadding=0 cellspacing=0 border=0 width=100% height=35 background="<?php echo $imgbtnbg; ?> "> <tr><td><img src="<?php echo $imgbtncrv; ?> "></td><td width=80% align=left > <table width=100% cellpadding=0 cellspacing=0 border=0><tr><td valign=bottom><?php $this->print_list_submit($class, $blist, $unique_name); ?> </td></tr></table></td><td width=15% align=right><b><font color="#ffffff"><?php $this->print_search($parent, $class); ?> </font></b></td></tr> </table> </td></tr> </td></tr><tr><td height=2 colspan=2></td></tr></table> <?php } else { $descr = $this->getActionDescr($_SERVER['PHP_SELF'], $this->__http_vars, $class, $var, $identity); ?> <table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td width=70% valign=bottom><table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td width=100% height=2 background="<?php echo $imgtopline; ?> "></td></tr></table></td><td align=right><table cellpadding=0 cellspacing=0 border=0 width=100% ><tr><td><img src="<?php echo $imgheadleft; ?> "></td><td nowrap width=100% background="<?php echo $imgheadbg; ?> " ><b><font color="#ffffff"> Confirm <?php echo $descr[1]; ?> : </b><?php echo get_plural($classdesc[2]); ?> from <?php echo $parent->display("nname"); ?> </font></td><td><img src="<?php echo $imgheadright; ?> "></td></tr></table></td></tr></table> </td></tr><tr><td height=0 colspan=2></td></tr></table> <?php } ?> <!-- </td></tr><tr><td height=2 colspan=2></td></tr></table> --> <tr><td bgcolor="#ffffff"></td> <?php $imguparrow = get_general_image_path() . "/button/uparrow.gif"; $imgdownarrow = get_general_image_path() . "/button/downarrow.gif"; foreach ($name_list as $name => $width) { $desc = "__desc_{$name}"; $descr[$name] = get_classvar_description($class, $desc); if (!$descr[$name]) { print "Cannot access static variable {$class}::{$desc}"; exit(0); } if (csa($descr[$name][2], ':')) { $_tlist = explode(':', $descr[$name][2]); $descr[$name][2] = $_tlist[0]; } foreach ($descr[$name] as &$d) { if ($this->is_special_url($d)) { continue; } if (strstr($d, "%v") !== false) { $d = str_replace("[%v]", $classdesc[2], $d); } } if ($width === "100%") { $wrapstr = "wrap"; } else { $wrapstr = "nowrap"; } if ($sortby && $sortby === $name) { $wrapstr .= " background={$imgtablerowheadselect}"; print "<td width={$width} {$wrapstr} ><table cellpadding=0 cellspacing=0 border=0> <tr> <td rowspan=2 {$wrapstr}>"; } else { $wrapstr .= " background={$imgtablerowhead}"; print "<td width={$width} {$wrapstr} class=col>"; } ?> <b><?php $this->print_sortby($parent, $class, $unique_name, $name, $descr[$name]); ?> </b></font> <?php $imgarrow = $sortdir === "desc" ? $imgdownarrow : $imguparrow; if ($sortby && $sortby === $name) { print "</td> <td width=15><img src=" . $imgarrow . " ></td><td ></td></tr></table>"; } ?> </td> <?php } $count = 0; $rowcount = 0; ?> <td width=10 background=<?php echo $imgtablerowhead; ?> > <form name="formselectall<?php echo $unique_name; ?> " value=hello> <input type=checkbox name="selectall<?php echo $unique_name; ?> " value=on <?php if ($sellist) { echo "checked disabled"; } ?> onclick="javascript:calljselectall<?php echo $unique_name; ?> ()"></form> </td> <?php print "</tr> "; print_time('loop'); $n = 1; foreach ((array) $obj_list as $okey => $obj) { $checked = ''; // Fix This. if ($sellist) { $checked = "checked disabled"; if (!array_search_bool($obj->nname, $sellist)) { continue; } } $imgpointer = get_general_image_path() . "/button/pointer.gif"; $imgblank = get_general_image_path() . "/button/blank.gif"; ?> <script> loadImage('<?php echo $imgpointer; ?> ') </script> <script> loadImage('<?php echo $imgblank; ?> ') </script> <tr id=tr<?php echo $unique_name . $rowcount; ?> class=tablerow<?php echo $count; ?> onmouseover=" swapImage('imgpoint<?php echo $rowcount; ?> ','','<?php echo $imgpointer; ?> ',1);" onmouseout="swapImgRestore();"> <td id=td<?php echo $unique_name . $rowcount; ?> width=5 class=rowpoint><img name=imgpoint<?php echo $rowcount; ?> src="<?php echo $imgblank; ?> "></td> <?php $colcount = 1; foreach ($name_list as $name => $width) { $this->printObjectElement($parent, $class, $classdesc, $obj, $name, $width, $descr, $colcount . "_" . $rowcount); $colcount++; } $basename = basename($obj->nname); $selectshowbase = $this->frm_selectshowbase; // issue #609 // $ret = strfrom($parent->nname, $selectshowbase); $ret = str_replace('//', '/', strfrom($parent->nname, $selectshowbase)); print " <td width=10 >"; print "<a class=button href=\"javascript:callSetSelectFolder('/{$ret}/{$basename}')\">"; print " Select </a>"; print "</tr> "; if ($count === 0) { $count = 1; } else { $count = 0; } $rowcount++; if (!$sellist) { if ($n === $pagesize * $cgi_pagenum) { break; } } $n++; } print_time('loop', "loop{$n}"); print "<tr><td></td><td colspan={$nlcount}>"; if (!$rowcount) { if ($ghtml->frm_searchstring) { ?> <table width=95%> <tr align=center> <td width=100%> <b> No Matches Found </b> </td> </tr> </table> <?php } else { ?> <table width=95%> <tr align=center> <td width=100%> <b> No <?php echo get_plural($classdesc[2]); ?> under <?php echo $parent->nname; ?> </b> </td> </tr> </table> <?php } } print "</td></tr>"; print "<tr><td class=rowpoint></td><td colspan=" . $nlcount . " >\n <table cellpadding=0 cellspacing=0 border=0 width=100%>\n <tr height=1 style='background:url({$imgtopline})'><td></td></tr>\n <tr><td>"; ?> <script>ckcount<?php echo $unique_name; ?> = <?php echo $rowcount . "; "; ?> function calljselectall<?php echo $unique_name; ?> (){ jselectall(document.formselectall<?php echo $unique_name; ?> .selectall<?php echo $unique_name; ?> ,ckcount<?php echo $unique_name; ?> ,'<?php echo $unique_name; ?> ') } </script> <?php print "<table> <tr> <td >"; print "<a class=button href=\"javascript:window.close()\"> Cancel </a> "; print "</td> <td width=30> </td> <td >"; print "</td> </tr> </table> "; print "</td></tr></table></tr></table></td> </tr> </table>"; //else { // // $this->print_list_submit($blist); // } //print_time("$class.objecttable", "$class.objecttable"); /// Important. This is to make sure that the session saving etc doesn't take place. We just need a plain and clean window without any saving. If this happens the current url gets added to the sessiona and redirection will screw up. exit; }
return; } $diff = round($now - $last[$var], 7); $now = round($now, 7); $last[$var] = $now; if (!$mess) { return; } $diff = round($diff, 2); if ($dbg <= -1) { } else { dprint("{$mess}: {$diff} <br> \n", $dbg); } return "{$mess}: {$diff} seconds"; } print_time('full'); function windowsOs() { if (getOs() == "Windows") { return true; } return false; } function getOs() { return substr(php_uname(), 0, 7) == "Windows" ? "Windows" : "Linux"; } if (!isset($_SERVER['DOCUMENT_ROOT'])) { if (isset($_SERVER['SCRIPT_NAME'])) { $n = $_SERVER['SCRIPT_NAME']; $f = ereg_replace('\\\\', '/', $_SERVER['SCRIPT_FILENAME']);
if (check_port_status($result['address'], $result['port'], 2) == TRUE) { // res image is the up arrow pretty much $res_img = 'Online'; // Get the server population $population = $CDB_EXTRA->count("SELECT COUNT(*) FROM `characters` WHERE online=1"); // Get the server uptime $start_time = $DB->selectCell("SELECT `starttime` FROM `uptime` WHERE `realmid`='" . $realm_num . "' ORDER BY `starttime` DESC LIMIT 1"); $uptime = time() - $start_time; } else { // Get the result image arrow $res_img = 'Offline'; $population = 0; $uptime = 0; } // Convert uptime into a days / hours / minutes format if ($uptime != 0) { $uptime = print_time(parse_time($uptime)); } else { $uptime = "N/A"; } // Setup this realm in the array $Realm[$i]['res_color'] = $res_color; $Realm[$i]['status'] = $res_img; $Realm[$i]['name'] = $result['name']; $Realm[$i]['type'] = $realm_type; $Realm[$i]['population'] = $population; $Realm[$i]['uptime'] = $uptime; // Unset the realms DB Connections unset($WDB_EXTRA); unset($CDB_EXTRA); }
function remote_main() { global $gbl, $sgbl, $login, $ghtml, $g_dbf; global $argv; ob_start(); $args = parse_opt($argv); $gbl->is_master = false; $gbl->is_slave = false; if (isset($args['install-type']) && $args['install-type'] === 'master') { $login = new Client(null, null, 'master'); $gbl->is_master = true; $login->get(); } else { $login = new Client(null, null, 'slave'); //$login->initThisDef(); $gbl->is_slave = true; $rmt = unserialize(lfile_get_contents("__path_slave_db")); $login->password = $rmt->password; } $login->cttype = 'admin'; // This is to prevent the socket already used error. If use a strict single interface, the socket operations happen through our own functions, and we can set the reuse option. $rmt = unserialize(base64_decode($ghtml->frm_rmt)); $res = do_remote($rmt); print_time('full', 'timing'); $res->message = ob_get_contents(); $val = base64_encode(serialize($res)); while (@ob_end_clean()) { } print $val; exit; }
$toFill[] = $key; } } $rez = GetFromAnyExternal($toFill, $users); foreach ($toFill as $key) { //$slot->addTag(Cacher_Tag::create('SmplTag', $User)); // Создаем и сразуже добавляем новый тег к слоту перед сохрананеием в кеш //$slot->addTag(Cacher_Tag::create('SmplTag1', $User)); // Создаем и сразуже добавляем новый тег к слоту перед сохрананеием в кеш //echo "<hr>setTag: ", Cacher_Tag::create('SmplTag', $key)->getKey(); //$slots[$key]->addTag( Cacher_Tag::create('SmplTag', $key) ); //sleep(1);// hard data $val = $rez[$key]; echo "<br><font color=blue>to cache({$key})</font><br>"; $slots[$key]->set($val); $CacheData[$key] = $val; } //Cacher_Tag::create('SmplTag', 50)->clear(); //$slots[10]->del(); echo "<hr><pre>"; var_export($slots); echo '</pre><hr>'; //$slot->del(); //Cacher_Tag::create('SmplTag',$User)->clear(); //Cacher::newTag('SmplTag1',$User)->clear(); //Cacher::newTag('AniTagData2',AniTagDataObj1)->clear() // Очищаем кеш тега //echo '<hr>Cached data:<pre>';var_export($CacheData);echo '</pre><hr>'; ################################################################################ echo '<br>'; echo '<hr>memory usage: ' . (memory_get_usage() / 1024 - $memory_get_usage_start) . 'Kb<br>'; echo '<hr>memory peak_usage: ' . (memory_get_peak_usage() / 1024 - $memory_get_usage_start) . 'Kb<br>'; print_time('end script work');
function send_to_some_http_server($raddress, $socket_type, $port, $var) { global $gbl, $sgbl, $login, $ghtml; print_time('server'); $ch = curl_init("http://{$raddress}:{$port}/lbin/remote.php"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_POSTFIELDS, "frm_rmt={$var}&"); $totalout = curl_exec($ch); dprint(curl_error($ch)); $totalout = trim($totalout); return $totalout; }
function do_updateform($object, $subaction) { global $gbl, $sgbl, $login, $ghtml; $class = lget_class($object); $parent = $object->getParentO(); $qparent = $parent; $_tsubaction = null; if ($subaction) { $_tsubaction = "_" . $subaction; } $udesc = get_classvar_description($class, "__acdesc_update" . $_tsubaction); $title = null; if ($udesc) { $title = $udesc[2]; } $gbl->setSessionV("lx_update_return_url", "/display.php?" . $ghtml->get_get_from_current_post(null)); $param = $ghtml->createCurrentParam($class); if ($ghtml->frm_accountselect) { $list = explode(",", $ghtml->frm_accountselect); $param['_accountselect'] = $list; } $vlist = $object->updateform($subaction, $param); $tparam = null; if (isset($vlist['__v_param'])) { $tparam = $vlist['__v_param']; } if (isset($vlist['__v_childheir'])) { if ($vlist['__v_childheir']) { $var = $vlist['__v_childheir']; $o = $object->{$var}; } else { $o = $object; } /// Hack mega hack.. Adding tparam to the http_vars variable so that do_resource will get them. if ($tparam) { foreach ($tparam as $k => $v) { $param["frm_" . $class . "_c_" . $k] = $v; $ghtml->__http_vars["frm_{$class}_c_{$k}"] = $v; } } $ghtml->do_resource($gbl->__var_restore_tree, $o, 0, false, $vlist['__v_resourcefunc'], true, false); if ($vlist['__v_showcheckboxflag']) { print_time('full', "Page Generation Took"); return; } } // Hack Hack Hack... Cannot handle file permissions neatly now... Just calling the whole thing.. if (isset($vlist['file_permission_f'])) { $ghtml->print_file_permissions($object); return; } $string[] = $ghtml->object_variable_startblock($object, null, $title); $string[] = $ghtml->object_inherit_classpath(); $ret['variable'] = $vlist; if (isset($vlist['__v_next'])) { $ret['action'] = 'updateform'; $ret['subaction'] = $vlist['__v_next']; } else { $ret['action'] = "update"; $ret['subaction'] = $subaction; } $param = null; if ($tparam) { foreach ($tparam as $k => $v) { $param["frm_{$class}_c_{$k}"] = $v; } $string[] = $ghtml->object_variable_hiddenlist($param); } $string[] = create_xml($qparent, $object, $ret); $pre = $post = null; if (isset($vlist['__m_message_pre'])) { $pre = $vlist['__m_message_pre']; } if (isset($vlist['__m_message_post'])) { $post = $vlist['__m_message_post']; } $ghtml->print_information('pre', 'updateform', $class, $subaction, $pre); $ghtml->xml_print_page($string); $ghtml->print_information('post', 'updateform', $class, $subaction, $post); }
function print_time2($date_string, $date_format, $date_format_2) { global $user; $data = ''; $date_string = trim($date_string); if (preg_match("/UT\$/", $date_string)) { $date_string .= 'C'; } if (!$date_format) { $data .= '<span title="' . $user->htmlsafe(date('r', strtotime($date_string))) . '">'; $data .= print_time(strtotime($user->htmlsafe($date_string)), $date_string) . '</span>'; } else { $data .= '<span title="' . print_time(strtotime($user->htmlsafe($date_string)), $date_string) . '">'; $data .= $user->htmlsafe(date($date_format, strtotime($date_string))); if ($date_format_2) { $data .= ' ' . $user->htmlsafe(date($date_format_2, strtotime($date_string))); } $data .= '</span>'; } return $data; }
<?php $v = 0; include_once 'htmllib/coredisplaylib.php'; sleep($v); //setcookie("XDEBUG_SESSION", "sess", time () + 36000); //setcookie("XDEBUG_SESSION", "sess"); print_time("start"); display_init(); print_time("start", "Start"); //dprint($gbl->__c_object->username); //$list = $gbl->__c_object->getList('domaintemplate'); //$gbl->__c_object->__parent_o = null; //dprintr($gbl->__c_object->ls); //dprintr($gbl->__c_object->priv); display_exec(); echo '<br />';
$planet = new SMR_PLANET($db->f("sector_id"), SmrSession::$game_id); $planet_sector = new SMR_SECTOR($db->f("sector_id"), SmrSession::$game_id, SmrSession::$old_account_id); $planet_owner = new SMR_PLAYER($planet->owner_id, SmrSession::$game_id); $planet->build(); print "<tr>"; print "<td>{$planet->planet_name}</td>"; print "<td>{$planet_owner->player_name}</td>"; print "<td align=\"center\">{$planet->sector_id}</td>"; print "<td align=\"center\">{$planet_sector->galaxy_name}</td>"; print "<td align=\"center\">" . $planet->construction[1] . "</td>"; print "<td align=\"center\">" . $planet->construction[2] . "</td>"; print "<td align=\"center\">" . $planet->construction[3] . "</td>"; print "<td align=\"center\">"; if ($planet->build()) { print "{$planet->current_building_name}<br>"; print print_time($planet->time_left); } else { print "Nothing"; } print "</td>"; print "<td align=\"center\">{$planet->shields}</td>"; print "<td align=\"center\">{$planet->drones}</td>"; print "<td align=\"left\">"; $supply = false; foreach ($planet->stockpile as $id => $amount) { if ($amount > 0) { $db2->query("SELECT * FROM good WHERE good_id = {$id}"); if ($db2->next_record()) { print $db2->f("good_name") . ": {$amount}<br>"; } $supply = true;
function run_rsnapshot($bs, $vps) { $machine = $vps->truehostname; $corerootdir = $bs->snapshotdir; $vmtype = $vps->ttype; $template = $vps->ostemplate; $vmname = $vps->nname; $ssh_port_for_slave = $vps->__var_ssh_port_for_slave; $remotedir = $vps->__var_remotedir; $backup_ssh_port_string = $bs->ssh_port_string; $backupserver = $bs->nname; if (!$remotedir) { print "Critical Error, no remotedir set for {$vmname}\n"; return; } print_time('rsnapshot'); if (!lxfile_exists("../file/rsnapshot.conf")) { lxfile_cp("../file/rsnapshot.conf.dist", "../file/rsnapshot.conf"); } $string = lfile_get_contents("../file/rsnapshot.conf"); $string .= "\n"; $string .= "ssh_args\t-p {$ssh_port_for_slave}\n"; $string .= "interval\tdaily\t{$bs->backup_num}\n"; $string .= "logfile\t{$corerootdir}/rsnapshot.log\n"; $string .= "lockfile\t{$corerootdir}/rsnapshot.pid\n"; $string .= "snapshot_root\t{$corerootdir}/vps/{$vmtype}/{$vmname}\n"; $string .= "backup\troot@{$machine}:{$remotedir}/*\t./\n"; $cmd = "ssh {$backup_ssh_port_string} {$backupserver} '(tmpnm=/tmp/rsnapshot_config.\$\$ ; cat > \$tmpnm ; sh ./lxvpsbackupserver.sh {$corerootdir} {$vmtype} {$template} {$vmname} \$tmpnm ; )'"; $cmd = "echo '{$string}' | {$cmd}"; print "Execing rsnapshot\n"; exec($cmd, $output, $returnvalue); $msg = print_time("rsnapshot", "Rsnaphost of {$machine} {$remotedir} took:", -1); print "\n{$msg}\n"; log_log("centralbackup", $msg); log_log("rsnapshot_log", implode("\n", $output)); }
<br/> ' . _("Bytes totales por día") . ': ' . $globals['media_max_bytes_per_day'] . '<br/> </fieldset>'; echo ' <fieldset id="formulas"> <legend>' . _('fórmulas') . '</legend> ' . _("El «depublish» ocurre cuando la suma del karma de los votantes de negativos > suma del karma de los votantes de positivos o que la suma de los votantes negativos > (karma de la historia / 2)") . '<br/> <br/> ' . _("Para el «depublish» también debe cumplirse que la suma del karma de los votantes de negativos > (karma del envío / 6) o que el núm. de votos negativos > (núm. de votos positivos / 6)") . '<br/> <br/> ' . _("Para que sean contados en las sumas de karma del cálculo de un «depublish», los usuarios que voten positivo deben tener karma > ") . $globals['depublish_positive_karma'] . _(" y los que voten negativo karma > ") . $globals['depublish_negative_karma'] . '<br/> <br/> ' . _("Se considera «nuevo usuario» a los usuarios que no hayan enviado ningún meneo o se hayan registrado hace menos de ") . print_time($globals['new_user_time']) . '<br/> <br/>'; if ($globals['min_user_votes']) { $total_links = (int) $db->get_var("select count(*) from links where link_date > date_sub(now(), interval 24 hour) and link_status = 'queued'"); echo ' ' . _("Un «nuevo usuario» con karma < ") . $globals['new_user_karma'] . _(" y sin envíos deberá votar ") . $globals['min_user_votes'] . _(" meneos antes de poder enviar") . '<br/> <br/> ' . _("Un «nuevo usuario» con karma < ") . $globals['new_user_karma'] . _(" y con envíos deberá votar (cifra dinámica) ") . min(4, intval($total_links / 20)) . _(" * (1 + nº de envíos del usuario en las últimas 24 h. que no estén en estado «discard») meneos para poder enviar") . '<br/> <br/>'; } echo ' ' . _("Un «nuevo usuario» solo podrá enviar ") . $globals['new_user_links_limit'] . ' ' . _("historias cada") . ' ' . print_time($globals['new_user_links_interval']) . ' (' . _('debes esperar, ya se enviaron varias con el mismo usuario o dirección IP') . ')<br/> <br/> ' . _("Un «nuevo usuario» con envíos recientes") . ' ( < ' . print_time($globals['new_user_links_interval']) . ') ' . _("y karma") . ' < ' . $globals['karma_propaganda'] . _(" no podrá enviar si esos envíos han tenido más de 10 negativos y los negativos") . ' > (positivos * 1,5)<br/> </fieldset>'; echo ' </div>'; do_footer_menu(); do_footer();
function exit_program() { global $gbl, $sgbl, $login, $ghtml; print_time('full', "Page Generation Took: "); exit_programlib(); }
function top_level_simple_backup() { global $gbl, $sgbl, $login, $ghtml; $progname = $sgbl->__var_program_name; $dir = dirname($this->main->__var_bc_filename); $name = basename($this->main->__var_bc_filename); $firstname = strtil($name, "-"); lxfile_mkdir($dir); $list = lscandir_without_dot($dir); $bc = $this->do_backup(); $tmpdir = createTempDir("{$sgbl->__path_tmp}", "backupfile"); lfile_put_contents("{$tmpdir}/{$progname}.file", $this->main->__var_bc_metafile); lfile_put_contents("{$tmpdir}/{$progname}.metadata", $this->main->__var_bc_metadata); $newarray = lx_array_merge(array($bc[1], array("{$tmpdir}/{$progname}.file", "{$tmpdir}/{$progname}.metadata"))); if ($this->main->getZiptype() === 'zip') { lxshell_zip($bc[0], $this->main->__var_bc_filename, $newarray); } else { if ($this->main->getZiptype() === 'tar') { lxshell_tar($bc[0], $this->main->__var_bc_filename, $newarray); } else { lxshell_tgz($bc[0], $this->main->__var_bc_filename, $newarray); } } print_time("cpzip", "Copy and Zip"); lxfile_tmp_rm_rec("{$tmpdir}"); $this->do_backup_cleanup($bc); }
<?php write_metalborder_header(); ?> <table cellpadding="3" cellspacing="0" width="100%"> <tbody> <tr> <td class="rankingHeader" align="left" nowrap="nowrap" width="53"><div align="center"><?php echo $lang['status'];?></div></td> <td align="left" nowrap="nowrap" class="rankingHeader"><div align="center"><?php echo $lang['uptime'];?></div></td> <td align="left" nowrap="nowrap" class="rankingHeader"><?php echo $lang['realm_name'];?></td> <td class="rankingHeader" align="center" nowrap="nowrap" width="120"><?php echo $lang['si_type'];?></td> <td class="rankingHeader" align="center" nowrap="nowrap" width="120"><?php echo $lang['si_pop'];?></td> </tr> <tr> <td colspan="6" style="background: url('<?php echo $currtmp; ?>/images/shadow.gif');"> <img src="<?php echo $currtmp; ?>/images/pixel.gif" height="1" width="1" alt=""/> </td> </tr> <?php foreach($items as $item): ?> <tr> <td class="serverStatus<?php echo $item['res_color'] ?>" align="center"><img src="<?php echo $item['img']; ?>" height='18' width='18' alt=""/></td> <td width="168" class="serverStatus<?php echo $item['res_color'] ?>"><div align="center"> <?php if($item['uptime'] != 0) { print_time(parse_time($item['uptime'])); } ?> </div></td> <td width="802" class="serverStatus<?php echo $item['res_color'] ?>"><b style='color: rgb(35, 67, 3);'><?php echo $item['name']; ?></b></td> <td class="serverStatus<?php echo $item['res_color'] ?>" align="center"><b style='color: rgb(102, 13, 2);'><?php echo $item['type']; ?></b></td> <td class="serverStatus<?php echo $item['res_color'] ?>" align="center"><b style='color: rgb(35, 67, 3);'><?php echo $item['pop']." (".population_view($item['pop']).")"; ?></b></td> </tr> <?php endforeach; ?> </tbody> </table> <?php write_metalborder_footer(); ?> <?php builddiv_end() ?>
function lxshell_zip_core($updateflag, $dir, $zipname, $filelist) { $dir = expand_real_root($dir); foreach ($filelist as &$__f) { $__f = expand_real_root($__f); } $zipname = expand_real_root($zipname); $files = null; if ($filelist) { foreach ($filelist as &$__nf) { $__nf = "'{$__nf}'"; } $files = implode(" ", $filelist); } if ($updateflag === 'zipadd') { $command = "zip -y -rq -u"; } else { if ($updateflag === 'zip') { $command = "zip -y -rq"; } else { if ($updateflag === 'tar') { $command = "tar -cf"; } else { $command = "tar -czf"; } } } if ($zipname[0] !== '/') { $fullpath = getcwd() . "/{$zipname}"; } else { $fullpath = $zipname; } if (!$files) { lxfile_touch("{$dir}/lxblank_file"); $files = "'lxblank_file'"; } print_time("zipfile"); $fcmd = "{$command} {$fullpath} {$files}"; $fcmd = str_replace(";", "", $fcmd); do_exec_system("__system__", $dir, "nice -n 15 {$fcmd}", $out, $err, $ret, null); print_time("zipfile", "Ziptook"); return $ret; }
<?php $path = __FILE__; $dir = dirname(dirname(dirname($path))); include_once "{$dir}/htmllib/lib/includecore.php"; print_time("include"); include_once "htmllib/phplib/lib/lxclass.php"; include_once "htmllib/lib/commonfslib.php"; include_once "htmllib/lib/objectactionlib.php"; include_once "htmllib/lib/commandlinelib.php"; include_once "lib/sgbl.php"; include_once "lib/gbl.php"; include_once "htmllib/lib/lib.php"; include_once "htmllib/phplib/lxlib.php"; include_once "htmllib/phplib/common.inc"; include_once "htmllib/lib/remotelib.php"; include_once "htmllib/phplib/lib/lxdb.php"; include_once "lib/define.php"; include_once "lib/driver_define.php"; include_once "lib/sgbl.php"; include_once "lib/common.inc"; //include_once "htmllib/lib/xmlinclude.php"; // This is the program specific common lib. There is no need dump everything htmllib/lib/lib.php which has become too large. include_once "lib/programlib.php"; if (lxfile_exists("../etc/classdefine")) { $list = lscandir_without_dot("../etc/classdefine"); foreach ($list as $l) { if (cse($l, "phps")) { include_once "../etc/classdefine/{$l}"; } }
while ($row = mysql_fetch_assoc($query_top)) { $lvl = $row['lvl_id']; ?> <div class="widget-header"> <h3> <?php $query_lvl = mysql_query("SELECT * FROM year_level_t WHERE lvl_id='{$lvl}'") or die(mysql_error()); $row_lvl = mysql_fetch_assoc($query_lvl); //echo ucfirst($row_lvl['lvl_name']); ?> </h3> <div class="pull-right"> <h3> <?php $total_units = get_total_units($lvl); $total_time = print_time($total_units); //echo "Total Units: ".$total_units." / ".$total_time." hrs"; ?> </h3> </div> </div> <table width="100%" style="border:1px solid black;"> <tr> <td bgcolor="#999999" style="background-color:#999999">Lis of Subjects (<?php echo ucfirst($row_lvl['lvl_name']); ?> )</td> </tr> <tr> <td>
function ah_time_left($exp_time) { global $current_time; global $lang; $time_left = $exp_time - $current_time; if($time_left > 0) { print_time(parse_time($time_left)); } else echo "<font class='expired'>" . $lang['ah_expired'] . "</font>"; }
function do_resource($tree, $object, $depth, $alistflag, $func, $complex = true, $showurlflag = true) { global $gbl, $sgbl, $login, $ghtml; static $scriptdone; if (!$scriptdone && $complex) { print "<link href=/htmllib/js/tree/dtree.css rel=stylesheet type=text/css>\n"; $ghtml->print_jscript_source("/htmllib/js/tree/dtree.js"); $scriptdone = true; } $treename = "_" . fix_nname_to_be_variable($object->nname); ?> <table width=90% cellpadding=0 cellspacing=0 valign=top> <tr> <td valign=top align=left> <?php if ($complex) { print "<div class='dtree'>"; print "<script>"; print "{$treename} = new dTree('{$treename}');"; print "</script>"; } $val = -1; if (!$tree) { $tree = $this->print_resource(null, $object, $ghtml->frm_o_o, $object, $depth, $alistflag, $func, false, $showurlflag); } if ($complex) { print "<script>"; if (isset($gbl->__tmp_checkbox_value)) { print "var __treecheckboxcount = {$gbl->__tmp_checkbox_value};"; } } $total = -1; print_time('tree'); $this->print_tree($treename, $tree, $total, $val, $complex); if ($complex) { print "document.write({$treename});"; print "</script>"; print "</div>"; } print_time('tree', "Tree", 2); ?> </td> </tr> </table> <form name=__treeForm id=__treeForm method=<?php echo "get"; ?> action="/display.php"> <input type=hidden name=frm_accountselect value=""> <?php $this->print_current_input_vars(array('frm_action', 'frm_subaction')); if (cse($ghtml->frm_subaction, "confirm_confirm")) { $this->print_input("hidden", "frm_action", "update"); $sub = $this->frm_subaction; $actionimg = "finish.gif"; } else { $this->print_input("hidden", "frm_action", "updateform"); $sub = $this->frm_subaction . "_confirm"; $actionimg = "next.gif"; } $this->print_input("hidden", "frm_subaction", "{$sub}"); if (isset($gbl->__tmp_checkbox_value)) { print "<a href=javascript:treeStoreValue()> <img src=/img/general/button/{$actionimg}> </a>"; } print "</form>"; }
<a class="result_item" onclick="show_thread('<?php echo $album; ?> ', '<?php echo $asset; ?> ', <?php echo $thread['timecode']; ?> , '<?php echo $thread_id; ?> ', '')"> <span class="timecode green2">(<?php print_time($thread['timecode']); ?> ) </span><?php echo $thread['title']; ?> </a> <div class="result_detail" id="result_thread_detail_<?php echo $thread_id; ?> "> <div class="bookmark_info thread" onclick="show_thread('<?php echo $album; ?> ', '<?php echo $asset; ?>
?> <div class="tip"><b class="green-title">®Replace® :</b> <?php if ($_SESSION['target'] == 'official') { $personal_bookmark = toc_asset_bookmark_get($bookmark['album'], $bookmark['asset'], $bookmark['timecode']); } else { $personal_bookmark = user_prefs_asset_bookmark_get($_SESSION['user_login'], $bookmark['album'], $bookmark['asset'], $bookmark['timecode']); } ?> <div style="padding: 5px 0px;"><?php print_bookmark_title($personal_bookmark['title']); ?> (<?php print_time($personal_bookmark['timecode']); ?> )</div> <div style="border-top:1px dotted #cccccc; width: 400px; padding-top: 8px"> <b>®Description®: </b><?php print_info($personal_bookmark['description']); ?> <br/> <b>®Keywords®: </b><?php print_info($personal_bookmark['keywords']); ?> </div> </div></a> </div> <?php } else {
echo $index; ?> ', 'result', $(this));"></a></span> <a class="result_item" href="javascript:show_asset_bookmark('<?php echo $bookmark['album']; ?> ', '<?php echo $bookmark['asset']; ?> ', '<?php echo $bookmark['timecode']; ?> ')"> <span class="timecode">(<?php print_time($bookmark['timecode']); ?> ) </span><?php print_bookmark_title($bookmark['title']); ?> </a> <div class="result_detail" id="result_detail_<?php echo $index; ?> "> <div class="bookmark_info"> <div class="blue-title">®Description® :</div> <?php print_info($bookmark['description']); ?> <div class="blue-title" style="margin-top: 6px;">®Keywords® : </div>
<?php include_once "htmllib/lib/include.php"; debug_for_backend(); print_time("gettraffic"); gettraffic_main(); $val = print_time("gettraffic", "Get Traffic "); log_log("get_traffic", $val); function gettraffic_main() { global $argc, $argv; $list = parse_opt($argv); if (isset($list['delete-table']) && $list['delete-table'] === 'yes') { print "clearing Traffic Table\n"; clearTrafficTable(); filltraffictable(); } else { filltraffictable(); } } //testFunc(); function clearTrafficTable() { $sql = new Sqlite(null, "vpstraffic"); $sql->rawquery("delete from vpstraffic;"); } function filltraffictable() { global $gbl, $login, $ghtml; initProgram('admin'); $t = "";
function print_part_headers() { global $page_id; global $max_header_length; global $sticky_url; $data = '<simple-' . $page_id . '><tr><td><br /></td></tr></simple-' . $page_id . '>' . do_display_hook('message_part_headers_top') . '<complex-' . $page_id . '>'; $rows = ''; foreach ($this->pd['message_part_headers'] as $i => $vals) { $name = $this->user->htmlsafe($vals[0], $this->pd['charset'], true); $val = $this->user->htmlsafe($vals[1], $this->pd['charset'], true); if ($this->pd['full_part_header'] == $i) { $val .= '  <a href="' . preg_replace('/\\&full_part_header\\=\\d+/', '', $sticky_url) . '">' . $this->user->str[522] . '</a>'; } elseif (htmlstrlen($val) > $max_header_length) { $val = trim_htmlstr($val, $max_header_length) . '  <a href="' . preg_replace('/\\&full_part_header\\=\\d+/', '', $sticky_url) . '&full_part_header=' . $i . '">' . $this->user->str[521] . '</a>'; } $rows .= '<tr><th>' . $name . ': </th><td '; if (strtolower($vals[0]) == 'subject') { $rows .= 'class="subject_cell" '; } if (strtolower($vals[0]) == 'date' && $vals[1] && !$this->pd['show_full_headers']) { $rows .= '>' . date('r', strtotime(trim($val))); $rows .= '    (' . print_time(strtotime($vals[1]), $vals[1]) . ')'; } else { $rows .= '>' . $val; } $rows .= '<br /></td></tr>'; } if ($rows) { $data .= '<table width="100%" cellpadding="0" cellspacing="0">' . $rows . '</table>'; } if (isset($this->pd['part_nav_list']) && count($this->pd['part_nav_list']) > 1) { $data .= '<div id="prev_next_part">' . $this->print_message_prev_next_part() . '</div>'; } $data .= do_display_hook('message_part_headers_bottom') . '</complex-' . $page_id . '>'; return $data; }