<?php require dirname(dirname(__FILE__)) . '/includes/bootstrap.php'; if (!($userID = buckys_is_logged_in())) { buckys_redirect('/index.php', MSG_NOT_LOGGED_IN_USER, MSG_TYPE_ERROR); } $bitcoinInfo = BuckysUser::getUserBitcoinInfo($userID); if (!$bitcoinInfo) { $bitcoinInfo = BuckysBitcoin::createWallet($TNB_GLOBALS['user']['userID'], $TNB_GLOBALS['user']['email']); } buckys_enqueue_stylesheet('uploadify.css'); buckys_enqueue_stylesheet('jquery.Jcrop.css'); buckys_enqueue_stylesheet('shop.css'); buckys_enqueue_javascript('uploadify/jquery.uploadify.js'); buckys_enqueue_javascript('jquery.Jcrop.js'); buckys_enqueue_javascript('jquery.color.js'); buckys_enqueue_javascript('shop.js'); buckys_enqueue_javascript('shop-edit.js'); buckys_enqueue_javascript('uploadify/flash_install.js'); $TNB_GLOBALS['content'] = 'shop/additem'; $TNB_GLOBALS['headerType'] = 'shop'; $view = []; $countryIns = new BuckysCountry(); $shopProductIns = new BuckysShopProduct(); $view['category_list'] = BuckysShopCategory::getCategoryList(0); $view['country_list'] = $countryIns->getCountryList(); $view['action_name'] = 'editProduct'; $paramProdID = get_secure_integer($_REQUEST['id']); $paramType = get_secure_string($_REQUEST['type']); $view['product'] = null; switch ($paramType) {
<?php require dirname(__FILE__) . '/includes/bootstrap.php'; //Getting Current User ID if (!buckys_check_user_acl(USER_ACL_REGISTERED)) { buckys_redirect('/register.php'); } $bitcoinClass = new BuckysBitcoin(); //Create Wallet if it is not created $bitcoinInfo = BuckysUser::getUserBitcoinInfo($userID); if (!$bitcoinInfo) { $bitcoinInfo = $bitcoinClass->createWallet($TNB_GLOBALS['user']['userID'], $TNB_GLOBALS['user']['email']); } if (isset($_POST['action']) && $_POST['action'] == 'send-bitcoins') { //Check Token if (!buckys_check_form_token()) { buckys_redirect("/wallet.php", MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } $toAddress = $_POST['receiver']; $amount = doubleval($_POST['amount']); $password = $_POST['password']; $user = BuckysUser::getUserData($TNB_GLOBALS['user']['userID']); $is_error = false; if (!$password || !buckys_validate_password($password, $user['password'])) { buckys_redirect("/wallet.php", MSG_CURRENT_PASSWORD_NOT_CORRECT, MSG_TYPE_ERROR); } if (!$toAddress) { buckys_redirect("/wallet.php", MSG_ENTER_BITCOINS_ADDRESS_OF_RECIPIENT, MSG_TYPE_ERROR); } if (!$amount || $amount <= 0) { buckys_redirect("/wallet.php", MSG_INVALID_BITCOIN_AMOUNT, MSG_TYPE_ERROR);
/** * @param $email * @param $token * @return bool */ public static function verifyAccount($email, $token) { global $db; $query = $db->prepare("SELECT userID FROM " . TABLE_USERS . " WHERE token=%s AND email=%s AND STATUS=0", $token, $email); $userID = $db->getVar($query); if (!$userID) { buckys_add_message(MSG_INVALID_TOKEN, MSG_TYPE_ERROR); return false; } //Verify links $query = $db->prepare("UPDATE " . TABLE_USERS . " SET status=1, token='' WHERE userID=%d", $userID); $db->query($query); buckys_add_message(MSG_ACCOUNT_VERIFIED, MSG_TYPE_SUCCESS); //Make this user to friend with bucky $query = $db->prepare("SELECT userID FROM " . TABLE_USERS . " WHERE email=%s", TNB_ADMIN_EMAIL); $buckysID = $db->getVar($query); //$buckysID = $db->getVar("Select userID FROM " . TABLE_USERS . " WHERE email='*****@*****.**'"); $db->insertFromArray(TABLE_FRIENDS, ['userID' => $buckysID, 'userFriendID' => $userID, 'status' => '1']); $db->insertFromArray(TABLE_FRIENDS, ['userID' => $userID, 'userFriendID' => $buckysID, 'status' => '1']); //Create Bitcoin account BuckysBitcoin::createWallet($userID, $email); //Create Default Ads for the users $classPublisherAds = new BuckysPublisherAds(); $classPublisherAds->createDefaultPublisherAds($userID); return true; }