<?php /** * ********************************************************* * * @author cluries * @link http://cdbit.com * @version 1.0 * @copyright 2012 http://cdbit.com All rights reserved * * ********************************************************* */ if (islocked('sina')) { $takedToken = Encryption::unserializeFromFile(tmpDir('sina.oauth')); if (!($takedToken['auth_timestamp'] + $takedToken['expires_in'] < time() - 10)) { display(_er('E_LOCKED', 'sina', 'sina'), 0); } } import('/library/saetv2.ex.class.php'); global $cfg_sina; $o = new SaeTOAuthV2($cfg_sina['key'], $cfg_sina['secret']); if (!isset($_REQUEST['code'])) { display('sina认证失败'); } $keys = array(); $keys['code'] = $_REQUEST['code']; $keys['redirect_uri'] = callbackUrl('sina'); $token = false; try { $token = $o->getAccessToken('code', $keys); } catch (OAuthException $e) {
exit; } if (isset($_GET["changeSpool"])) { changeSpool(); exit; } if (isset($_GET["stats-var-spool"])) { stats_var_spool(); exit; } if (isset($_GET["CertificateConfigFile"])) { CertificateConfigFile(); exit; } if (isset($_GET["islocked"])) { islocked(); exit; } if (isset($_GET["RemovePostfixInterface"])) { islocked_enable(); exit; } if (isset($_GET["EnablePostfixInterface"])) { islocked_disable(); exit; } if (isset($_GET["happroxy"])) { happroxy(); exit; } while (list($num, $line) = each($_GET)) {
<?php /** * ********************************************************* * * @author cluries * @link http://cdbit.com * @version 1.0 * @copyright 2012 http://cdbit.com All rights reserved * * ********************************************************* */ if (islocked('douban')) { display(_er('E_LOCKED', 'douban', 'douban'), 0); } if (empty($_REQUEST['oauth_token'])) { display(_er('E_404'), 0); } if ($_SESSION['douban_token'] != $_REQUEST['oauth_token']) { retry(); } import('/library/OAuth.php'); import('/library/doubanoauth.php'); global $cfg_douban; $o = new DoubanOAuth($cfg_douban['key'], $cfg_douban['secret'], $_SESSION['douban_token'], $_SESSION['douban_token_secret']); $token = $o->getAccessToken(); if (!empty($token['oauth_token_secret']) && !empty($token['oauth_token'])) { Encryption::serializeToFile($token, tmpDir('douban.oauth')); lockit('douban'); display('douban认证成功'); }
function locked_some() { $srcs = array('twitter', 'sina', 'tencent', 'renren', 'fanfou', 'douban'); foreach ($srcs as $key => $value) { if (!islocked($value)) { unset($srcs[$key]); } } return implode(',', $srcs); }
} //Check if authorization pin has been inputted correctly if ($inputAuthPin == $authPin && $act) { if ($act == "cashOut") { $txfee = 0; if ($settings->getsetting("sitetxfee") > 0) { $txfee = $settings->getsetting("sitetxfee"); } //Get user's balance and send it to set address; //Does user have any money in their balance if ($currentBalance > $txfee) { //Send $currentBalance to $paymentAddress //Validate that a $paymentAddress has been set & is valid before sending $isValidAddress = $bitcoinController->validateaddress($paymentAddress); if ($isValidAddress) { if (!islocked("money")) { //Subtract TX fee, site percentage and donation percentage. $sitepercent = $settings->getsetting("sitepercent"); $currentBalance = $currentBalance * (1 - $sitepercent / 100) * (1 - $donatePercent / 100) - $txfee; //Send money// try { $paid = 0; $result = mysql_query("SELECT IFNULL(paid,'0') as paid FROM accountBalance WHERE userId=" . $userId); if ($resultrow = mysql_fetch_object($result)) { $paid = $resultrow->paid + $currentBalance; } lock("money"); mysql_query("BEGIN"); //Reduce balance amount to zero mysql_query("UPDATE accountBalance SET balance = '0', paid = '{$paid}' WHERE userId = {$userId}"); if ($bitcoinController->sendtoaddress($paymentAddress, $currentBalance)) {
<?php /** * ********************************************************* * * @author cluries * @link http://cdbit.com * @version 1.0 * @copyright 2012 http://cdbit.com All rights reserved * * ********************************************************* */ import('/library/OAuth.php'); import('/library/twitteroauth.php'); if (islocked('twitter')) { display(_er('E_LOCKED', 'twitter', 'twitter'), 0); } if (isset($_REQUEST['oauth_token']) && $_SESSION['oauth_token'] != $_REQUEST['oauth_token']) { retry(); } global $cfg_source; $connection = new TwitterOAuth($cfg_source['key'], $cfg_source['secret'], $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']); $access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']); $_SESSION['access_token'] = $access_token; unset($_SESSION['oauth_token']); unset($_SESSION['oauth_token_secret']); if (200 == $connection->http_code) { $_SESSION['status'] = 'verified'; //updateOauth ( $access_token ); Encryption::serializeToFile($access_token, tmpDir('twitter.oauth')); lockit('twitter');
file_put_contents($dropbox_sync_hash, $hash); $our_hash = -1; } else { $our_hash = file_get_contents($dropbox_sync_hash); } # - - - - - - - - - - - - - # look to see if the hash has changed # echo $hash."\r".$our_hash; if($hash === $our_hash) { $output = "="; # no update needed } else { if(islocked($lockfile)) { # is this process running already? die("!"); # abort! abort! } else { # there's an update lock($lockfile); # prevent clashes by locking file_put_contents($dropbox_sync_hash, $hash); $files = $dropbox->GetFiles($sync_directory, true); } } # - - - - - - - - - - - - -
<?php /** * ********************************************************* * * @author cluries * @link http://cdbit.com * @version 1.0 * @copyright 2012 http://cdbit.com All rights reserved * * ********************************************************* */ if (islocked('renren')) { display(_er('E_LOCKED', 'renren', 'renren'), 0); } if (empty($_REQUEST['code'])) { display(_er('E_404'), 0); } global $cfg_renren; import('/library/renrenoauth.php'); $keys = array(); $keys['code'] = $_REQUEST['code']; $keys['redirect_uri'] = callbackUrl('renren'); try { $o = new RenrenOAuth($cfg_renren['key'], $cfg_renren['secret']); $token = $o->getAccessToken($_REQUEST['code'], callbackUrl('renren')); Encryption::serializeToFile($token, tmpDir('renren.oauth')); lockit('renren'); display('renren认证成功'); } catch (OAuthException $e) { display('renren认证失败', 0);
<?php /** * ********************************************************* * * @author cluries * @link http://cdbit.com * @version 1.0 * @copyright 2012 http://cdbit.com All rights reserved * * ********************************************************* */ if (islocked('tencent')) { display(_er('E_LOCKED', 'tencent', 'tencent'), 0); } empty($_SESSION['tencent_keys']) && display('SESSION中没找到对应的KEY', 0); import('/library/OAuth.php'); import('/library/tencentoauth.php'); global $cfg_tencent; $o = new MBOpenTOAuth($cfg_tencent['key'], $cfg_tencent['secret'], $_SESSION['tencent_keys']['oauth_token'], $_SESSION['tencent_keys']['oauth_token_secret']); unset($_SESSION['tencent_keys']); $last_key = $o->getAccessToken($_REQUEST['oauth_verifier']); if (!empty($last_key['oauth_token']) && !empty($last_key['oauth_token_secret'])) { Encryption::serializeToFile($last_key, tmpDir('tencent.oauth')); lockit('tencent'); display('Tencent认证成功'); } else { display('Tencent认证失败', 0); }
<?php /** * ********************************************************* * * @author cluries * @link http://cdbit.com * @version 1.0 * @copyright 2012 http://cdbit.com All rights reserved * * ********************************************************* */ $type = getVar('type'); if (islocked($type)) { display(_er('E_LOCKED', $type, $type), 0); } $callfunc = "{$type}JMP__"; if (!function_exists($callfunc)) { display(_er('E_404'), 0); } call_user_func($callfunc); function twitterJMP__() { import('/library/OAuth.php'); import('/library/twitteroauth.php'); $type = 'twitter'; global $cfg_twitter; $connection = new TwitterOAuth($cfg_twitter['key'], $cfg_twitter['secret']); $request_token = $connection->getRequestToken(callbackUrl($type)); $_SESSION['oauth_token'] = $token = $request_token['oauth_token']; $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];