} } } @writeover("../onezdata/creditsettings.php", "<?\n\$outextcredits=" . var_export($outextcredits, true) . "?>"); exit(API_RETURN_SUCCEED); } elseif ($action == 'updatecredit') { //接收积分兑换通知 $credit = intval($get['credit']); $amount = intval($get['amount']); $uid = intval($get['uid']); require_once '../include/common.inc.php'; if (!$db) { include_once ONEZ_ROOT . './include/db_mysql.class.php'; $db = new onez_db(); } $db->query("UPDATE {$tbl}users SET extcredits{$credit}=extcredits{$credit}+{$amount} WHERE uid='{$uid}'"); exit(API_RETURN_SUCCEED); } elseif ($action == 'updateapps') { //应用程序列表 $post = uc_unserialize(file_get_contents('php://input')); $appid = array(); foreach ($post as $id => $v) { if ($id != 'UC_API' && $id != UC_APPID) { $appid[] = $id; } } writeover('../onezdata/apps.php', "<?\n\$apps=" . var_export($post, true) . ";\n\$appid=array(" . implode(',', $appid) . ");\n?>"); exit(API_RETURN_SUCCEED); } else { exit(API_RETURN_SUCCEED); }