if (!$addition) { $account = findAccount($_SESSION["acct_official"]); if ($account === false) { $id = createAccount(); addAccountUsername($id, $_SESSION["acct_official"], $_SESSION["acct_username"]); setAccountDetails($id, $sreg); if (isset($_COOKIE["pbguid"])) { setAccountGUID($id, $_COOKIE["pbguid"]); } setAccountAPIKey($id, makeApiKey()); $account = findAccount($_SESSION["acct_official"]); } else { pg_Exec($DB, "UPDATE accounts SET last_login=now() WHERE id=" . $account['id']); } $_SESSION["acct_id"] = $account['id']; $_SESSION["acct_sreg"] = $account; $_SESSION["kvp"] = findAccountKVP($account['id']); } else { pageHeader(_("new OpenID associated")); pageSidebar(); makeSection(_("your new OpenID has been associated")); print '<p>Thank you! Your new OpenID username has been associated with this account. You may now <a href="/settings.php">continue with more settings</a>.</p>'; pageFooter(); exit; } } else { print "Sorry, there was a general authentication failure.. <a href=\"/login.php\">Please try again.</a>"; exit; } } }
$cache2->pconnect('localhost', '11212'); $dur = new Duration(); $cs1 = $cache1->getStats(); $cs2 = $cache2->getStats(); makeSection(_('cache statistics')); print '<table style="text-align:left"><tr><th>Statistic</th><th>Cache 1</th><th>Cache 2</th>'; print '<tr><th>Uptime</th><td>' . $dur->AgeAsString($cs1['uptime']) . '</td><td>' . $dur->AgeAsString($cs2['uptime']) . '</td></tr>'; print '<tr><th>Item Count</th><td>' . number_format($cs1['curr_items'], 0) . '</td><td>' . number_format($cs2['curr_items'], 0) . '</td></tr>'; print '<tr><th>Utilization</th><td>' . sprintf("%0.01f", $cs1['bytes'] / $cs1['limit_maxbytes'] * 100.0) . '%</td><td>' . sprintf("%0.01f", $cs2['bytes'] / $cs2['limit_maxbytes'] * 100.0) . '%</td></tr>'; print '<tr><th>Hit Efficiency</th><td>' . sprintf("%0.01f", $cs1['get_hits'] / $cs1['get_misses']) . " to 1 (" . sprintf("%0.02f", ($cs1['cmd_get'] + $cs1['cmd_set']) / $cs1['uptime']) . " req/s)</td><td>" . sprintf("%0.01f", $cs2['get_hits'] / $cs2['get_misses']) . ' to 1 (' . sprintf("%0.02f", ($cs2['cmd_get'] + $cs2['cmd_set']) / $cs2['uptime']) . ' req/s)</td></tr>'; print '<tr><th>Byte Efficiency</th><td>' . sprintf("%0.01f", $cs1['bytes_written'] / $cs1['bytes_read']) . " to 1</td><td>" . sprintf("%0.01f", $cs2['bytes_written'] / $cs2['bytes_read']) . ' to 1</td></tr>'; print '<tr><th>Average Object Size</th><td>' . number_format($cs1['bytes'] / $cs1['curr_items'], 0) . ' bytes</td><td>' . number_format($cs2['bytes'] / $cs2['curr_items'], 0) . ' bytes</td></tr>'; print '</table>'; $res = cache_pg_Exec($db, "SELECT COUNT(*) AS count,MAX(period) AS max_period,AVG(period) AS avg_period,SUM(hits) AS hits,MAX(hits) AS max_hits FROM spammers", 60); $res = $res[0]; makeSection(_('spammer statistics')); print '<table style="text-align:left">'; print '<tr><th>Active Spammer Count:</th><td>' . number_format($res['count']) . '</td></tr>'; print '<tr><th>Denied Spammer Requests:</th><td>' . number_format($res['hits']) . '</td></tr>'; print '<tr><th>Highest Single Denied Spammer Count:</th><td>' . number_format($res['max_hits']) . '</td></tr>'; print '<tr><th>Maximum Ban Period:</th><td>' . substr($res['max_period'], 2) . '</td></tr>'; print '<tr><th>Average Ban Period:</th><td>' . substr($res['avg_period'], 2) . '</td></tr>'; print '</table>'; /* [pid] => 8805 [uptime] => 2354 [time] => 1172487043 [version] => 1.1.12 [rusage_user] => 0.188011 [rusage_system] => 0.268016 [curr_items] => 797 [total_items] => 833
<?php /* This file is part of the Pastebin package. Copyright (c) 2003-2008, Stephen Olesen All rights reserved. More information is available at http://pastebin.ca/ */ require "template.php"; pageHeader(_("you are now logged in")); pageSidebar(); makeSection(_("now logged in")); print '<p>' . _('You are now logged in with your account. Thanks!') . '</p>'; pageFooter();
// Begin the OpenID authentication process. $auth_request = $consumer->begin($openid); // Handle failure status return values. if (!$auth_request) { if (!preg_match('/(^[=@$+!]|^http:\\/\\/)/', $_GET["openid_url"])) { $_GET["openid_url"] = 'http://idbin.ca/' . urlencode($_GET["openid_url"]); $openid = $_GET['openid_url']; $auth_request = $consumer->begin($openid); if (!$auth_request) { pageHeader(_("authentication error")); pageSidebar(); makeSection(_("sorry, authentication error stage 2")); print '<p>Sorry, there was a general authentication error. Please go back and check your username for accuracy. It should be a valid OpenID username.</p>'; print '<p>If you need an account, <a href="/oid.php">you can get a new OpenID here</a>.</p>'; pageFooter(); exit(0); } } else { pageHeader(_("authentication error")); pageSidebar(); makeSection(_("sorry, authentication error")); print '<p>Sorry, there was a general authentication error. Please go back and check your username for accuracy. It should be a valid OpenID username.</p>'; print '<p>If you need an account, <a href="/oid.php">you can get a new OpenID here</a>.</p>'; pageFooter(); exit(0); } } // Redirect the user to the OpenID server for authentication. Store // the token for this authentication so we can verify the response. $redirect_url = $auth_request->redirectURL($trust_root, $process_url); header("Location: " . $redirect_url);