function startSim($con, $exec_iterator, $exec_count) { addToLog(";--------------------------------\n; SIMULATOR PHASE {$exec_iterator}/{$exec_count}\n;--------------------------------"); print_r("On phase {$exec_iterator}/{$exec_count}\n"); consumerPhase($con); //economicPhase ($con, $nodes); addToLog("\n\n\n\n\n\n\n\n\n\n\n"); }
function htmlProlog($rootFile, $title, $displayLinks = true, $addToHead = "") { echo "<html>\n"; echo "<head>\n"; echo "<title>{$title}</title>\n"; echo "<SCRIPT LANGUAGE=\"JavaScript\">\n"; echo "<!-- Begin\n"; echo "function helpPopup(file,topic) {\n"; echo "ElementWindow = window.open('help.php?file='+file+'&topic='+topic,'NeLToolHelpPopup','width=502,height=350,scrollbars=1')\n"; echo "}\n"; echo "function sqlPopup(sqlText) {\n"; echo "ElementWindow = window.open('sql_connection.php?queries='+sqlText,'NeLToolSqlPopup','width=800,height=350,scrollbars=1')\n"; echo "}\n"; echo "// End -->\n"; echo "</SCRIPT>\n"; echo $addToHead . "\n"; echo "</head>\n"; echo "<style type=\"text/css\">\n"; echo "<!--\n"; echo "body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }\n"; echo "td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }\n"; echo "table { margin: 0px; padding: 0px; border-collapse: collapse; border-spacing: 0;}\n"; echo "th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }\n"; echo "input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }\n"; echo "textarea { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; width:98%; }\n"; echo "a:link { color: #000088; text-decoration: none; }\n"; echo "a:visited { color: #880088; text-decoration: none; }\n"; echo "a:active { color: #000033; text-decoration: none; }\n"; echo "a:hover { color: #8800CC; text-decoration: underline; }\n"; echo "-->\n"; echo "</style>\n"; echo "<body>\n"; global $admcookielogin, $admcookiepassword; addToLog("admcookielogin={$admcookielogin} admcookiepassword={$admcookiepassword}"); addToLog("admlogin={$admcookielogin} admcookiepassword={$admcookiepassword}"); if ($displayLinks) { linkBar($title); } }
<?php session_start(); include "addToLog.php"; addToLog("LOGGED OUT: " . $_SESSION['username'] . " from " . $_SERVER["REMOTE_ADDR"]); unset($_SESSION['username']); $_SESSION = array(); /* if(isset($_COOKIE["id"]) && isset($_COOKIE["user"]) && isset($_COOKIE["pass"])) { setcookie("id", '', strtotime( '-5 days' ), '/'); setcookie("user", '', strtotime( '-5 days' ), '/'); setcookie("pas", '', strtotime( '-5 days' ), '/'); } */ session_destroy(); if (isset($_SESSION['username'])) { // logout failed //header("location: message.php?msg=Error:_Logout_Failed"); } else { //header("location: localhost"); exit; }
$sql = "INSERT INTO board (user,position,song,ison) VALUES (?,?,?,0)"; if ($stmt = mysqli_prepare($con, $sql)) { mysqli_stmt_bind_param($stmt, "iis", $id, $i, $g); mysqli_stmt_execute($stmt); if (mysqli_stmt_error($stmt)) { echo 'SQL Error: ' . mysqli_stmt_error($stmt); } mysqli_stmt_close($stmt); } if ($rowC == 0) { $log = "{$name} added songs: "; } $rowC++; $log .= $g . ", "; if ($rowC == 5) { addToLog($log); $rowC = 0; } // addToLog("$name added song: ".$g); if ($i == 11) { $i++; } $i++; } $t = time(); $sql = "UPDATE users SET boardt = ? WHERE id=?"; if ($stmt = mysqli_prepare($con, $sql)) { mysqli_stmt_bind_param($stmt, "ii", $t, $id); mysqli_stmt_execute($stmt); if (mysqli_stmt_error($stmt)) { echo 'SQL Error: ' . mysqli_stmt_error($stmt);
fclose($createLog); } if (!is_writable($logFile)) { $chPerm = chmod($logFile, 777); if (!$chPerm) { trigger_error("The {$logFile} file is not writable. CHMOD failed. Please manually set the chmod to 777!", E_USER_NOTICE); } } $logContents = file_get_contents($logFile); foreach ($errors as $err) { $logContents .= $err . "\n"; trigger_error($err, E_USER_NOTICE); echo $err . "\n"; } $updateLog = file_put_contents($logFile, $logContents); if (!$updateLog) { trigger_error("Unable to write errors to the log file of {$logFile}", E_USER_NOTICE); } } // Create the database connection $connection = mysql_connect($server, $login, $dbpass); if ($connection) { mysql_select_db($dbName, $connection); } else { $errToLog[] = 'Unable to connect to the EHCP MySQL database using provided credentials! Please update your config.php settings!'; addToLog($errToLog); die('Unable to connect to the EHCP MySQL database using provided credentials! Please update your config.php settings!'); } ?>
if ($stmt = mysqli_prepare($con, $sql)) { mysqli_stmt_bind_param($stmt, "i", $uid); mysqli_stmt_execute($stmt); if (mysqli_stmt_error($stmt)) { echo 'SQL Error: ' . mysqli_stmt_error($stmt); } mysqli_stmt_close($stmt); } addToLog("USER: "******" got a " . $pEarn . " pt bingo from: "); addToLog(" {$s['0']}"); addToLog(" {$s['1']}"); addToLog(" {$s['2']}"); addToLog(" {$s['3']}"); // addToLog(count($s)); if (count($s) == 5) { addToLog(" {$s['4']}"); } } $sql = "DELETE FROM board WHERE user = ?"; if ($stmt = mysqli_prepare($con, $sql)) { mysqli_stmt_bind_param($stmt, "i", $uid); mysqli_stmt_execute($stmt); if (mysqli_stmt_error($stmt)) { echo 'SQL Error: ' . mysqli_stmt_error($stmt); } mysqli_stmt_close($stmt); } $sql = "UPDATE users SET boardt = 0 WHERE id = ?"; if ($stmt = mysqli_prepare($con, $sql)) { mysqli_stmt_bind_param($stmt, "i", $uid); mysqli_stmt_execute($stmt);
public function use_lang($language, $constant) { global $DIR_SKINS; $filename = ''; if ($this->incModePref[0] == "normal") { $filename = $filename . $this->incModePref[1]; $filename = $filename . "language/"; $filename = $filename . $language; $filename = $filename . ".php"; } elseif ($this->incModePref[0] == "skindir") { $filename = $filename . $DIR_SKINS; $filename = $filename . $this->incModePref[1]; $filename = $filename . "language/"; $filename = $filename . $language; $filename = $filename . ".php"; } if (is_file($filename)) { include $filename; } else { addToLog(1, "NP_Text cannot find " . $filename); } if (defined($this->constantPrefix . $constant)) { echo constant($this->constantPrefix . $constant); } else { echo $this->constantPrefix . $constant; if (is_file($filename)) { addToLog(1, "NP_Text cannot find definition for " . $this->constantPrefix . $constant . " in " . $filename); } } return; }
$count = mysql_num_rows($Result); if ($count > 0) { while ($row = mysql_fetch_assoc($Result)) { // Only show custom entries... do not allow to modify EHCP accounts. // domainname field will be NULL for custom FTP entries if (!empty($row['homedir']) && (empty($row['domainname']) || $row['domainname'] === NULL) && (empty($row['status']) || $row['status'] === NULL)) { $countNotNull++; $username = $row['ftpusername']; $dir = $row['homedir']; $users_list .= $username . "\t" . $dir . "/./\n"; } } if ($countNotNull == 0) { $errorCount++; $errors[] = "There are no custom FTP accounts yet in the EHCP database!"; } } else { $errorCount++; $errors[] = "No FTP accounts exist from the ftpaccounts table!"; } } else { $errorCount++; $errors[] = "Error code " . mysql_errno($connection) . ": " . mysql_error($connection); } // Log errors if ($errorCount > 0) { addToLog($errors); } } // Return the user list echo $users_list;
function eraseCookies() { setcookie("admcookielogin"); setcookie("admcookiepassword"); addToLog("cookies reset"); }
} // only needed when updating logs if ($CONF['UsingAdminArea']) { include $DIR_LIBS . 'xmlrpc.inc.php'; // XML-RPC client classes include_once $DIR_LIBS . 'ADMIN.php'; } // connect to database sql_connect(); $SQLCount = 0; // logs sanitized result if need if ($orgRequestURI !== serverVar('REQUEST_URI')) { $msg = "Sanitized [" . serverVar('REMOTE_ADDR') . "] "; $msg .= $orgRequestURI . " -> " . serverVar('REQUEST_URI'); if ($bLoggingSanitizedResult) { addToLog(WARNING, $msg); } if (!$bSanitizeAndContinue) { die(""); } } // makes sure database connection gets closed on script termination register_shutdown_function('sql_disconnect'); // read config getConfig(); // Properly set $CONF['Self'] and others if it's not set... usually when we are access from admin menu if (!isset($CONF['Self'])) { $CONF['Self'] = $CONF['IndexURL']; // strip trailing / if ($CONF['Self'][strlen($CONF['Self']) - 1] == "/") { $CONF['Self'] = substr($CONF['Self'], 0, strlen($CONF['Self']) - 1);
/** * authenticate the client */ function authenticate() { if (!empty($this->SID)) { return $this->SID; } if (is_null($this->soapClient)) { if (!class_exists('SoapClient') || $this->client_type == 'PEAR:SOAP') { include_once 'SOAP/Client.php'; //AddToLog('Using PEAR:SOAP library'); // get the wsdl and cache it $wsdl = new SOAP_WSDL($this->url); //change the encoding style $this->__change_encoding($wsdl); $this->soapClient = $wsdl->getProxy(); } else { //AddtoLog("Using SOAP Extension"); //-- don't use exceptions in PHP 4 $this->soapClient = new SoapClient($this->url, array('exceptions' => 0)); } } if ($this->soapClient != null && !$this->isError($this->soapClient)) { $res = $this->soapClient->Authenticate($this->username, $this->password, $this->gedfile, "", $this->data_type); if (!is_object($res)) { return false; } if (!isset($res->SID)) { return false; } $this->SID = $res->SID; return $this->SID; } else { addToLog("Unable to generate web service proxy from WSDL. " . print_r($this->soapClient, true)); return false; } }
mysqli_stmt_execute($stmt); if (mysqli_stmt_error($stmt)) { echo 'SQL Error: ' . mysqli_stmt_error($stmt); } mysqli_stmt_bind_result($stmt, $boardt); while (mysqli_stmt_fetch($stmt)) { } mysqli_stmt_close($stmt); } if (empty($boardt) == true) { echo "nouser"; exit; } $sql = "SELECT song FROM inputsetlist WHERE t > ?"; if ($stmt = mysqli_prepare($con, $sql)) { mysqli_stmt_bind_param($stmt, "i", $boardt); mysqli_stmt_execute($stmt); if (mysqli_stmt_error($stmt)) { echo 'SQL Error: ' . mysqli_stmt_error($stmt); } mysqli_stmt_bind_result($stmt, $s); while (mysqli_stmt_fetch($stmt)) { if ($s == $song) { echo "found"; addToLog($_SESSION['username'] . " checked off " . $song); exit; } } mysqli_stmt_close($stmt); } echo "notplayed";
header("Location: error.php"); die; } // Now that we've sent the envelope, we need to see if we're going to host an embedded signing session. If so, // we'll need to get a RecipientToken for the signing session. The recipientToken is just a url that will open // a signing session for the specified recipient on the envelope. if ($_SESSION["SigningLocation"] == "Embedded") { $RequestRecipientToken = makeRequestRecipientToken(); try { $RequestRecipientTokenResponse = $api->RequestRecipientToken($RequestRecipientToken); $_SESSION["EmbeddedToken"] = $RequestRecipientTokenResponse->RequestRecipientTokenResult; if (isset($_SESSION["debug"]) && $_SESSION["debug"] === true) { addToLog("RequestRecipientToken Request", xmlpp($api->_lastRequest, true)); addToLog("RequestRecipientToken Response", xmlpp($api->__getLastResponse(), true)); } } catch (SoapFault $fault) { $_SESSION["errorMessage"] = $fault; if (isset($_SESSION["debug"]) && $_SESSION["debug"] === true) { addToLog("CreateAndSendEnvelope Request", xmlpp($api->_lastRequest, true)); addToLog("CreateAndSendEnvelope Response", xmlpp($api->__getLastResponse(), true)); } header("Location: error.php"); die; } $RedirectPage = "embeddedhost.php"; } else { // if we aren't hosting the signing, we'll just display a page to the user informing them of that. $RedirectPage = "remotesign.php"; } header('Location: ' . $RedirectPage); }
mysqli_stmt_close($stmt); } if ($cost <= $points) { // decrement points $sql = "UPDATE users SET points=points-? WHERE id=?"; if ($stmt = mysqli_prepare($con, $sql)) { mysqli_stmt_bind_param($stmt, "ii", $cost, $uid); mysqli_stmt_execute($stmt); if (mysqli_stmt_error($stmt)) { echo 'SQL Error: ' . mysqli_stmt_error($stmt); } mysqli_stmt_close($stmt); } addToLog("{$name} purchased package {$pid}: {$pn} for {$cost} points. " . ($points - $cost) . " left."); // buy $sql = "INSERT INTO buypackages (uid,pid) VALUES (?,?)"; if ($stmt = mysqli_prepare($con, $sql)) { mysqli_stmt_bind_param($stmt, "ii", $uid, $pid); mysqli_stmt_execute($stmt); if (mysqli_stmt_error($stmt)) { echo 'SQL Error: ' . mysqli_stmt_error($stmt); } while (mysqli_stmt_fetch($stmt)) { } mysqli_stmt_close($stmt); } echo "g"; } else { addToLog("{$name}: Not enough points for {$pid}:{$pn} - have {$points} need {$cost}"); echo "nep" . $points; }
function logAdminDeleteReservation($userid, $resid){ $mysqldate = getCurrentMySQLDateTime(); addToLog($userid, "reservation", "User ".$userid." Deleted Reservation ".$resid); }
function displayResult($result, $vardisp, $bounds, $privilege, $condensed = false, $autoDisplay = true) { global $admlogin, $filter_shard, $filter_server, $filter_service, $filter_entity, $current_tid, $listPath, $current_tname, $usersData; global $uid, $REMOTE_ADDR, $shardLockState, $enablelock, $IsNevrax; addToLog($result); $colorKeyWords = array("Offline" => "#FF4422", "Failed" => "#FF4422"); //echo "result=$result<br>\n"; echo "<table border=1>\n"; echo "<tr><th rowspan=2> Filters </th><th>shard</th><th>server</th><th>service</th><th>entity</th><td rowspan=2> <input type=submit name='display_view' value='Display\nView'> </td><td rowspan=2> <input type=submit name='reset_filters' value='Reset\nFilters'> </td></tr>\n"; echo "<tr>\n"; echo "<td><input type=text name=filter_shard value='{$filter_shard}' size=12 maxlength=256></td>\n"; echo "<td><input type=text name=filter_server value='{$filter_server}' size=12 maxlength=256></td>\n"; echo "<td><input type=text name=filter_service value='{$filter_service}' size=12 maxlength=256></td>\n"; echo "<td><input type=text name=filter_entity value='{$filter_entity}' size=28 maxlength=1024></td>\n"; echo "</tr>\n"; echo "</table><br>\n"; unset($maxvarwidth); if (strlen($result) > 0) { $arr = explode(" ", $result); $result =& $arr; $numRes = count($result); $numRows = current($result); if ($numRows < 1) { echo "<b>NeL query returned no answer</b><br>\n"; return; } $numLines = ($numRes - $numRows - 2) / $numRows; //echo "numRes=$numRes, numLines=$numLines, numRows=$numRows<br>\n"; next($result); for ($i = 0; $i < $numRows; ++$i) { $vars[] = current($result); next($result); } unset($lineMap); unset($resultArray); for ($i = 0; $i < $numLines; ++$i) { $shard = '*'; $server = '*'; $service = '*'; unset($entity); $path = ""; foreach ($vars as $var) { $maxvarwidth[$var] = strlen($var); $val = current($result); next($result); if ($val == "???") { unset($val); } if ($var == "shard" || $var == "server" || $var == "service" || $var == "entity") { if ($path != "") { $path .= "."; } $path .= $val; if ($var == "shard") { $shard = $val; $listShard[] = $shard; } if ($var == "server") { $server = $val; } if ($var == "service") { $service = $val; } if ($var == "entity") { $entity = $val; } } else { $line = $lineMap[$path]; if (!isset($line)) { $line = count($resultArray); $lineMap[$path] = $line; $resultArray[$line]["shard"] = $shard; $resultArray[$line]["server"] = $server; $resultArray[$line]["service"] = $service; $resultArray[$line]["_path_"] = $path; $serviceDecomp = explode("/", $service); if (count($serviceDecomp) == 1) { $serviceAlias = $service; $serviceSid = $service; } else { $serviceAlias = $serviceDecomp[0]; $serviceSid = $serviceDecomp[1]; } if (isset($entity)) { $resultArray[$line]["entity"] = $entity; $listPath[] = $shard . "." . $server . "." . $service . "." . $entity; } else { $listPath[] = $shard . "." . $server . "." . $service; } } if (isset($val)) { $resultArray[$line][$var] = $val; } //echo "set resultArray[$line][$var]=$val<br>\n"; } } } //echo "<pre>\n"; //print_r($resultArray); //echo "</pre>\n"; if (count($listShard) > 0) { $listShard = array_unique($listShard); sort($listShard); echo "<table border=1>\n"; echo "<tr><th>Shard</th>"; if ($enablelock) { echo "<th>Locked by</th><th></th>"; } echo "<th>Annotation by</th><th width='500'>Annotation</th><th></th></tr>\n"; foreach ($listShard as $shard) { $annotation =& $shardLockState[$shard]; $hasColor = time() - strtotime($annotation['post_date']) < 120; $lockState = $annotation['lock_state']; echo "<tr" . ($hasColor ? ' bgcolor=#FFBB88' : '') . "><td> {$shard} </td>"; if ($enablelock) { echo "<td><font size=0> " . ($lockState != 0 ? $usersData[$annotation['lock_user']]["login"] . "/" . $annotation['lock_ip'] . " <br> " . $annotation['lock_date'] : "not locked") . " </font></td>"; echo "<td>"; if ($lockState == 0) { echo "<input type=submit name='upd_lock_button_{$shard}' value='Lock'>"; } else { if ($lockState == 1) { echo "<input type=submit name='upd_unlock_button_{$shard}' value='Unlock'>"; } else { echo "<input type=submit name='upd_lock_button_{$shard}' value='Force Lock'>"; } } echo "</td>"; } echo "<td> " . $usersData[$annotation['user_annot']]["login"] . " / " . $annotation['post_date'] . " </td>"; echo "<td> " . ($lockState == 1 ? "<input type=text name='upd_annot_text_{$shard}' value='" . $annotation['annot'] . "' size=90 maxlength=255" . ($hasColor ? " style='background-color: #FFBB88;'" : "") . ">" : $annotation['annot']) . " </td>"; echo "<td>" . ($lockState == 1 ? "<input type=submit name='upd_annot_button_{$shard}' value='Update'>" : "") . "</td>"; echo "</tr>\n"; } echo "</table><br>\n"; } echo "<table border=1>\n"; echo "<tr valign=center>"; foreach ($vars as $var) { $display = isset($vardisp[$var]) ? $vardisp[$var] : "<i>" . $var . "</i>"; if ($var == "shard" || $var == "server" || $var == "service" || $var == "entity" || !$condensed) { echo "<th>{$display}</th>"; } else { break; } } if ($condensed) { echo "<th>Variable</th><th>Value</th>"; } echo "</tr>\n"; if (count($resultArray) > 0) { usort($resultArray, "vcmp"); } $prevShard = ""; $idxShard = 0; $dispUpdateButton = false; if ($condensed) { for ($i = 0; $i < count($resultArray); ++$i) { $shard = '*'; $server = '*'; $service = '*'; unset($entity); $arr =& $resultArray[$i]; if ($arr["shard"] != $prevShard) { if ($prevShard != "") { $idxShard = 1 - $idxShard; } $prevShard = $arr["shard"]; } $bgcolor = $idxShard == 0 ? $i & 1 ? "#DDDDDD" : "#EEEEEE" : ($i & 1 ? "#D0DDDD" : "#E0EEEE"); $first = true; echo "<tr bgcolor={$bgcolor}>"; for ($j = 0; $j < count($vars); ++$j) { $var = $vars[$j]; if ($var != "shard" && $var != "server" && $var != "service" && $var != "entity") { break; } $val = $arr[$var]; $bgcolor2 = strstr($val, "((TIMEOUT))") == FALSE ? $bgcolor : "#FF4422"; if ($var == "shard") { $shard = $val; } if ($var == "server") { $server = $val; } if ($var == "entity" && $val != "") { $entity = $val; } // // parse service name // if ($var == "service") { splitServiceName($val, $serviceAlias, $serviceName, $serviceId); $service = $serviceName; } $vval = $var == "service" ? $serviceName : $val; if ($var == "shard") { $selects = "&filter_shard={$shard}"; } else { if ($var == "server") { $selects = "&filter_shard={$shard}&filter_server={$server}"; } else { if ($var == "service") { $selects = "&filter_shard={$shard}&filter_server={$server}&filter_service={$service}"; } else { if ($var == "entity") { $selects = "&filter_shard={$shard}&filter_server={$server}&filter_service={$service}&filter_entity={$vval}"; } } } } $vval .= ",Default" . ucfirst(strtolower($var == "entity" ? "player" : $var)) . (isset($current_tname) ? ",{$current_tname}" : ""); echo "<td bgcolor={$bgcolor2} nowrap> <a href='" . $_SERVER['PHP_SELF'] . "?select_view={$vval}{$selects}'>{$val}</a>" . (($admlogin == "root" || $IsNevrax) && $var == "service" ? " <a href='commands.php?preselServ={$shard}.{$server}.{$serviceAlias}'><font size=1>[cmd]</font></a>" : "") . "</td>"; } $numprev = $j; for (; $j < count($vars); ++$j) { $var = $vars[$j]; $val = $arr[$var]; if (!isset($val) || $val == "") { continue; } if (!$first) { echo "<tr bgcolor={$bgcolor}>"; for ($k = 0; $k < $numprev; ++$k) { echo "<td bgcolor={$bgcolor}></td>"; } } $first = false; $maxvarwidth[$var] = max($maxvarwidth[$var], strlen($val)); $bound =& $bounds[$var]; $state = 0; if (isset($bound) && $val != "") { $realval = humanReadableToRaw($val); if ($bound[2] == 'gt') { if ($bound[0] != -1 && $realval >= $bound[0]) { $state = 1; } if ($bound[1] != -1 && $realval >= $bound[1]) { $state = 2; } } else { if ($bound[0] != -1 && $realval <= $bound[0]) { $state = 1; } if ($bound[1] != -1 && $realval <= $bound[1]) { $state = 2; } } } $btcolor = $state == 0 ? $bgcolor : ($state == 1 ? "#FFCC88" : "#FF4422"); if (isset($colorKeyWords[$val])) { $btcolor = $colorKeyWords[$val]; } if ($privilege[$var] == 'rw' && $shardLockState[$shard]['lock_state'] == 1) { $valdisp = "<input name='updvar_{$shard}|{$server}|{$serviceAlias}|" . (isset($entity) ? "{$entity}|" : "") . "{$var}' value='{$val}' size=16 maxlength=64 style='background-color: {$btcolor};'><input type=hidden name='prevvar_{$shard}|{$server}|{$serviceAlias}|" . (isset($entity) ? "{$entity}|" : "") . "{$var}' value='{$val}'>"; $dispUpdateButton = true; } else { $valdisp = "{$val}"; } echo "<td>{$var}</td><td bgcolor={$btcolor} nowrap>{$valdisp}</td></tr>\n"; } } } else { for ($i = 0; $i < count($resultArray); ++$i) { $arr =& $resultArray[$i]; foreach ($vars as $var) { $val = $arr[$var]; $maxvarwidth[$var] = max($maxvarwidth[$var], strlen($val)); } } for ($i = 0; $i < count($resultArray); ++$i) { $shard = '*'; $server = '*'; $service = '*'; unset($entity); unset($line); $arr =& $resultArray[$i]; if ($arr["shard"] != $prevShard) { if ($prevShard != "") { $idxShard = 1 - $idxShard; } $prevShard = $arr["shard"]; } $bgcolor = $idxShard == 0 ? $i & 1 ? "#DDDDDD" : "#EEEEEE" : ($i & 1 ? "#D0DDDD" : "#E0EEEE"); foreach ($vars as $var) { $val = $arr[$var]; if ($val == "???") { $val = NULL; } $addlink = false; $bgcolor2 = strstr($val, "((TIMEOUT))") == FALSE ? $bgcolor : "#FF4422"; if ($var == "shard") { $addlink = true; $shard = $val; } if ($var == "server") { $addlink = true; $server = $val; } if ($var == "entity" && $val != "") { $addlink = true; $entity = $val; } // // parse service name // if ($var == "service") { splitServiceName($val, $serviceAlias, $serviceName, $serviceId); $service = $serviceName; $addlink = true; } //$maxvarwidth[$var] = max($maxvarwidth[$var], strlen($val)); $bound =& $bounds[$var]; $state = 0; if (isset($bound) && $val != "") { $realval = humanReadableToRaw($val); if ($bound[2] == 'gt') { if ($bound[0] != -1 && $realval >= $bound[0]) { $state = 1; } if ($bound[1] != -1 && $realval >= $bound[1]) { $state = 2; } } else { if ($bound[0] != -1 && $realval <= $bound[0]) { $state = 1; } if ($bound[1] != -1 && $realval <= $bound[1]) { $state = 2; } } } $btcolor = $state == 0 ? $bgcolor : ($state == 1 ? "#FFCC88" : "#FF4422"); if (isset($colorKeyWords[$val])) { $btcolor = $colorKeyWords[$val]; } if (strstr($val, "((TIMEOUT))") != FALSE) { $btcolor = "#FF4422"; } if ($privilege[$var] == 'rw' && $shardLockState[$shard]['lock_state'] == 1) { $len = max(min($maxvarwidth[$var], 16), 4); $valdisp = "<input name='updvar_{$shard}|{$server}|{$serviceAlias}|" . (isset($entity) ? "{$entity}|" : "") . "{$var}' value='{$val}' size={$len} maxlength=64 style='background-color: {$btcolor};'><input type=hidden name='prevvar_{$shard}|{$server}|{$serviceAlias}|" . (isset($entity) ? "{$entity}|" : "") . "{$var}' value='{$val}'>"; $dispUpdateButton = true; } else { $valdisp = "{$val}"; } if ($addlink) { $vval = $var == "service" ? $serviceName : $val; if ($var == "shard") { $selects = "&filter_shard={$shard}"; } else { if ($var == "server") { $selects = "&filter_shard={$shard}&filter_server={$server}"; } else { if ($var == "service") { $selects = "&filter_shard={$shard}&filter_server={$server}&filter_service={$vval}"; } else { if ($var == "entity") { $selects = "&filter_shard={$shard}&filter_server={$server}&filter_service={$service}&filter_entity={$vval}"; } } } } $vval .= ",Default" . ucfirst(strtolower($var == "entity" ? "player" : $var)) . (isset($current_tname) ? ",{$current_tname}" : ""); $line .= "<td bgcolor={$btcolor} nowrap> <a href='" . $_SERVER['PHP_SELF'] . "?select_view={$vval}{$selects}'>{$valdisp}</a>" . (($admlogin == "root" || $IsNevrax) && $var == "service" ? " <a href='commands.php?preselServ={$shard}.{$server}.{$serviceAlias}'><font size=1>[cmd]</font></a>" : "") . " </td>"; } else { $line .= "<td bgcolor={$btcolor} nowrap> {$valdisp} </td>"; } } echo "<tr bgcolor={$bgcolor}>"; echo $line; echo "</tr>\n"; } } if (!$condensed) { echo "<tr height=5><td colspan=" . (count($vars) + 1) . "></td></tr>"; echo "<tr>"; foreach ($vars as $var) { $len = max(min($maxvarwidth[$var], 16), 4); if ($var != "shard" && $var != "server" && $var != "service" && $var != "entity" && $privilege[$var] == 'rw') { echo "<td> <input name='override_{$var}' size={$len} maxlength=64> </td>"; } else { echo "<td><i> All</i></td>"; } } echo "</tr>\n"; } echo "</table><br>\n"; if ($dispUpdateButton) { echo "<input type=submit name='upd_values' value='Update Values'>\n"; } } else { echo "<b>NeL query returned no answer</b><br>\n"; } }
} else { $api->setCredentials($_SESSION["UserID"], $_SESSION["Password"]); } $RequestStatusesParams = new RequestStatuses(); /* $RequestStatusesParams->EnvelopeStatusFilter->UserInfo->UserName = $_SESSION["UserName"]; $RequestStatusesParams->EnvelopeStatusFilter->UserInfo->Email = $_SESSION["Email"]; $RequestStatusesParams->EnvelopeStatusFilter->AccountId = $_SESSION["AccountID"]; $RequestStatusesParams->EnvelopeStatusFilter->Statuses->Status = "Any"; */ $RequestStatusParams = new RequestStatus(); $RequestStatusParams->EnvelopeID = $_SESSION["EnvelopeID"]; try { $RequestStatusResponse = $api->RequestStatus($RequestStatusParams); addToLog("API Call - RequestStatus Request", '<pre>' . xmlpp($api->_lastRequest, true) . '</pre>'); addToLog("API Call - RequestStatus Response", '<pre>' . xmlpp($api->__getlastResponse(), true) . '</pre>'); } catch (SoapFault $fault) { $_SESSION["errorMessage"] = $fault; $_SESSION["lastRequest"] = $api->_lastRequest; header("Location: error.php"); die; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head> <title>InsuranceCo</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <script type="text/javascript" src="scripts/jquery-1.4.1.min.js"></script> <script type="text/javascript" src="scripts/webservice-status.js"></script>
<?php include "inc/core.php"; include "inc/functions.php"; if (!userFlag(1)) { die("You are not an admin!"); } if (!isset($_GET['sure'])) { die("<a href='reset.php?sure=1'>Are you sure?</a>"); } print "Resetting values to 0..."; $_DB->query("UPDATE Users SET Konto = 0;"); $_DB->query("DELETE FROM MessageLog;"); $_DB->query("DELETE FROM Payed;"); $_DB->query("DELETE FROM Events;"); addToLog("Reset Database to 0", "");
$q->bindParam(":2", $u); $q->execute(); $q->reset(); array_push($attendees, "{$u}+" . $plus[$u]); } $ins = $_DB->prepare("INSERT INTO Events (Title, Payer, Attendees) VALUES (:1, :2, :3);"); $ins->bindParam(":1", $title); $ins->bindParam(":2", $payer); $ins->bindValue(":3", implode(",", $attendees)); $ins->execute(); $event_id = $_DB->lastInsertRowID(); $ins->reset(); $q->bindValue(":1", $total_eff * -1); $q->bindParam(":2", $payer); $q->execute(); $q->reset(); if ($event_id != $eeid) { print "<br><b>Achtung: Die erwartete Event ID entspricht nicht der erhaltenen!<br>Entweder eine Kollision, oder du hast F5 gedrückt.<br>Breche SQLite Transaktion ab.</b>"; $_DB->query("ROLLBACK TRANSACTION"); exit; } $q = $_DB->prepare("INSERT INTO Payed (EventID, UserID, Amount, Reason) VALUES (:1, :2, :3, 'Initial');"); $q->bindParam(":1", $event_id); $q->bindParam(":2", $payer); $q->bindParam(":3", $total_eff); $q->execute(); $q->reset(); addToLog("Added Event", $event_id); $_DB->query("COMMIT TRANSACTION"); print "<b>Event eingetragen!</b>"; include "inc/foot.php";
function payDay($con, $nodes) { addToLog(";--------------------------------\n; PAYDAY\n;--------------------------------"); foreach ($nodes as $node) { $node['money'] += frand(20); } }