本文整理汇总了PHP中Link::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Link::redirect方法的具体用法?PHP Link::redirect怎么用?PHP Link::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Link
的用法示例。
在下文中一共展示了Link::redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public static function init()
{
$url = url();
if (!empty($_GET['code'])) {
$link = new Link();
$link->getByCode($_GET['code']);
if (!empty($link->id)) {
$link->countClick();
$link->redirect();
} else {
header("Location: link_not_found.php");
}
exit;
}
}
示例2: elseif
<?php
include '../lib/common.php';
if (User::$info['locked'] == 'Y' || User::$info['deactivated'] == 'Y') {
Link::redirect('settings.php');
} elseif (User::$awaiting_token) {
Link::redirect('verify-token.php');
} elseif (!User::isLoggedIn()) {
Link::redirect('login.php');
}
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=transactions_' . date('Y-m-d') . '.csv');
API::add('Transactions', 'get', array(false, false, false, false, 1, false, false, false, false, false, 1));
$query = API::send();
$transactions = $query['Transactions']['get']['results'][0];
if ($transactions) {
$output = fopen('php://output', 'w');
fputcsv($output, array(' ' . Lang::string('transactions-type') . ' ', ' ' . Lang::string('transactions-time') . ' ', ' ' . Lang::string('transactions-btc') . ' ', ' ' . Lang::string('currency') . ' ', ' ' . Lang::string('transactions-fiat') . ' ', ' ' . Lang::string('transactions-price') . ' ', ' ' . Lang::string('transactions-fee') . ' '));
foreach ($transactions as $transaction) {
fputcsv($output, array(' ' . $transaction['type'] . ' ', ' ' . date('M j, Y, H:i', strtotime($transaction['date']) + $CFG->timezone_offset) . ' UTC ', ' ' . number_format($transaction['btc'], 8) . ' ', ' ' . $transaction['currency'] . ' ', ' ' . number_format($transaction['btc_net'] * $transaction['fiat_price'], 2) . ' ', ' ' . number_format($transaction['fiat_price'], 2) . ' ', ' ' . number_format($transaction['fee'] * $transaction['fiat_price'], 2) . ' '));
}
}
示例3: array
Link::redirect('open-orders.php?message=not-your-order');
} else {
API::add('Orders', 'delete', array($delete_id1));
$query = API::send();
Link::redirect('open-orders.php?message=order-cancelled');
}
}
$delete_all = !empty($_REQUEST['delete_all']);
if ($delete_all && $_SESSION["openorders_uniq"] == $_REQUEST['uniq']) {
API::add('Orders', 'deleteAll');
$query = API::send();
$del_order = $query['Orders']['deleteAll']['results'][0];
if (!$del_order) {
Link::redirect('open-orders.php?message=deleteall-error');
} else {
Link::redirect('open-orders.php?message=deleteall-success');
}
}
if (!empty($_REQUEST['currency']) && array_key_exists(strtoupper($_REQUEST['currency']), $CFG->currencies)) {
$_SESSION['oo_currency'] = $_REQUEST['currency'];
} else {
if (empty($_SESSION['oo_currency']) || $_REQUEST['currency'] == 'All') {
$_SESSION['oo_currency'] = false;
}
}
if (!empty($_REQUEST['order_by'])) {
$_SESSION['oo_order_by'] = preg_replace("/[^a-z]/", "", $_REQUEST['order_by']);
} else {
if (empty($_SESSION['oo_order_by'])) {
$_SESSION['oo_order_by'] = false;
}
示例4: elseif
}
if ($_REQUEST['action'] == 'delete' && !$query['APIKeys']['delete']['results'][0]) {
Link::redirect('api-access.php?error=delete');
}
if (!is_array(Errors::$errors)) {
if ($_REQUEST['action'] == 'edit') {
Link::redirect('api-access.php?message=edit');
} elseif ($_REQUEST['action'] == 'add') {
$secret = $query['APIKeys']['add']['results'][0];
Messages::add(Lang::string('api-add-message'));
$info_message = str_replace('[secret]', $secret, Lang::string('api-add-show-secret'));
API::add('APIKeys', 'get');
$query = API::send();
$api_keys = $query['APIKeys']['get']['results'][0];
} elseif ($_REQUEST['action'] == 'delete') {
Link::redirect('api-access.php?message=delete');
}
} else {
$request_2fa = true;
}
}
}
if (!empty($_REQUEST['message']) && $_REQUEST['message'] == 'edit') {
Messages::add(Lang::string('api-edit-message'));
} elseif (!empty($_REQUEST['message']) && $_REQUEST['message'] == 'delete') {
Messages::add(Lang::string('api-delete-message'));
} elseif (!empty($_REQUEST['error']) && $_REQUEST['error'] == 'delete') {
Errors::add(Lang::string('api-delete-error'));
}
$page_title = Lang::string('api-access-setup');
include 'includes/head.php';
示例5: time
} else {
if ($operations['edit_order'] > 0) {
$uniq_time = time();
$_SESSION["editorder_uniq"][$uniq_time] = md5(uniqid(mt_rand(), true));
if (count($_SESSION["editorder_uniq"]) > 3) {
unset($_SESSION["editorder_uniq"][min(array_keys($_SESSION["editorder_uniq"]))]);
}
Link::redirect('open-orders.php', array('transactions' => $operations['transactions'], 'edit_order' => 1));
exit;
} else {
$uniq_time = time();
$_SESSION["editorder_uniq"][$uniq_time] = md5(uniqid(mt_rand(), true));
if (count($_SESSION["editorder_uniq"]) > 3) {
unset($_SESSION["editorder_uniq"][min(array_keys($_SESSION["editorder_uniq"]))]);
}
Link::redirect('transactions.php', array('transactions' => $operations['transactions']));
exit;
}
}
}
$user_available[$currency1] = $pre_fiat_available;
$user_available[$c_currency_info['currency']] = $pre_btc_available;
$page_title = Lang::string('edit-order');
if (!$bypass) {
$uniq_time = time();
$_SESSION["editorder_uniq"][$uniq_time] = md5(uniqid(mt_rand(), true));
if (count($_SESSION["editorder_uniq"]) > 3) {
unset($_SESSION["editorder_uniq"][min(array_keys($_SESSION["editorder_uniq"]))]);
}
include 'includes/head.php';
?>
示例6: array
$ask_confirm = true;
}
}
} else {
API::add('Gateways', 'processDeposit', array($info));
$query = API::send();
$operations = $query['Gateways']['processDeposit']['results'][0];
if (!empty($operations['error'])) {
Errors::add($operations['error']['message']);
} else {
if ($operations['new_order'] > 0) {
$_SESSION["deposit_uniq"][time()] = md5(uniqid(mt_rand(), true));
if (count($_SESSION["deposit_uniq"]) > 3) {
unset($_SESSION["deposit_uniq"][min(array_keys($_SESSION["deposit_uniq"]))]);
}
Link::redirect('deposit', array('transactions' => $operations['transactions'], 'new_order' => 1));
exit;
}
}
}
}
}
$currency_info = $CFG->currencies[$gateway_currency1];
$page_title = Lang::string('deposit');
if (empty($_REQUEST['bypass'])) {
$_SESSION["deposit_uniq"][time()] = md5(uniqid(mt_rand(), true));
if (count($_SESSION["deposit_uniq"]) > 3) {
unset($_SESSION["deposit_uniq"][min(array_keys($_SESSION["deposit_uniq"]))]);
}
include 'includes/head.php';
?>
示例7: md5
if ($query['error'] == 'security-com-error') {
Errors::add(Lang::string('security-com-error'));
}
if ($query['error'] == 'authy-errors') {
Errors::merge($query['authy_errors']);
}
if ($query['error'] == 'request-expired') {
Errors::add(Lang::string('settings-request-expired'));
}
if ($query['error'] == 'security-incorrect-token') {
Errors::add(Lang::string('security-incorrect-token'));
}
}
if (!is_array(Errors::$errors)) {
$_SESSION["cp_uniq"] = md5(uniqid(mt_rand(), true));
Link::redirect('account.php?message=settings-personal-message');
} else {
$request_2fa = true;
}
}
} else {
$personal->info['pass'] = false;
}
$_SESSION["cp_uniq"] = md5(uniqid(mt_rand(), true));
$page_title = Lang::string('change-password');
include 'includes/head.php';
?>
<div class="page_title">
<div class="container">
<div class="title"><h1><?php
echo $page_title;
示例8: md5
if ($query['error'] == 'security-com-error') {
Errors::add(Lang::string('security-com-error'));
}
if ($query['error'] == 'authy-errors') {
Errors::merge($query['authy_errors']);
}
if ($query['error'] == 'request-expired') {
Errors::add(Lang::string('settings-request-expired'));
}
if ($query['error'] == 'security-incorrect-token') {
Errors::add(Lang::string('security-incorrect-token'));
}
}
if (!is_array(Errors::$errors)) {
$_SESSION["settings_uniq"] = md5(uniqid(mt_rand(), true));
Link::redirect('settings.php?message=settings-account-reactivated');
} else {
$request_2fa = true;
}
}
}
/*
if (!empty($_REQUEST['lock_account'])) {
if (!$email_auth && (empty($_SESSION["settings_uniq"]) || $_SESSION["settings_uniq"] != $_REQUEST['uniq']))
Errors::add('Page expired.');
elseif (!$no_token && !$request_2fa) {
API::settingsChangeId($authcode1);
API::token($token1);
API::add('User','lockAccount');
$query = API::send();
示例9: array
<?php
include '../lib/common.php';
if (!$_REQUEST['log_out']) {
Link::redirect('index.php');
}
API::add('Content', 'getRecord', array('logged-out'));
$query = API::send();
$page_title = Lang::string('log-out');
$content = $query['Content']['getRecord']['results'][0];
include 'includes/head.php';
?>
<div class="page_title">
<div class="container">
<div class="title"><h1><?php
echo $page_title;
?>
</h1></div>
<div class="pagenation"> <a href="index.php"><?php
echo Lang::string('home');
?>
</a> <i>/</i> <a href="news.php"><?php
echo $page_title;
?>
</a></div>
</div>
</div>
<div class="container">
<div class="content_right">
<h2><?php
echo $content['title'];
示例10: array
API::add('User', 'enableAuthy', array($cell1, $country_code1, $authy_id, $using_sms));
API::add('User', 'settingsEmail2fa', array(array('authy' => 1), 1));
$query = API::send();
//$step1 = true;
if ($query['User']['settingsEmail2fa']['results'][0]) {
Link::redirect('security.php?notice=email');
}
}
} else {
if (!is_array(Errors::$errors)) {
API::add('User', 'enableGoogle2fa', array($cell1, $country_code1));
API::add('User', 'settingsEmail2fa', array(array('google' => 1), 1));
$query = API::send();
//$step1 = true;
if ($query['User']['settingsEmail2fa']['results'][0]) {
Link::redirect('security.php?notice=email');
}
}
}
}
}
} elseif (!empty($_REQUEST['step']) && $_REQUEST['step'] == 2) {
if (!($token1 > 0)) {
Errors::add(Lang::string('security-no-token'));
}
if (!is_array(Errors::$errors)) {
API::settingsChangeId($authcode1);
API::token($token1);
API::add('User', 'verifiedAuthy');
$query = API::send();
if (!empty($query['error'])) {
示例11: elseif
<?php
include '../lib/common.php';
if (User::$awaiting_token) {
Link::redirect('verify-token.php');
} elseif (!User::isLoggedIn()) {
Link::redirect('https://support.1btcxe.com/');
}
API::add('User', 'getInfo', array($_SESSION['session_id']));
$query = API::send();
$user_info = $query['User']['getInfo']['results'][0];
$remote_url = preg_replace("/[^a-z0-9\\/-]/", "", $_REQUEST['url']);
if ($remote_url) {
$remote_url = '&redirect_to=' . urlencode('https://support.1btcxe.com/' . $remote_url);
}
Link::redirect('http://support.1btcxe.com/login/sso?name=' . urlencode(!empty($user_info['first_name']) ? $user_info['first_name'] . ' ' . $user_info['last_name'] : $user_info['user']) . '&email=' . urlencode($user_info['email']) . '&timestamp=' . time() . '&hash=' . hash_hmac('md5', $user_info['first_name'] . ' ' . $user_info['last_name'] . $user_info['email'] . time(), $CFG->helpdesk_key) . $remote_url);
示例12: md5
if ($query['error'] == 'authy-errors') {
Errors::merge($query['authy_errors']);
}
if ($query['error'] == 'security-incorrect-token') {
Errors::add(Lang::string('security-incorrect-token'));
}
if (!is_array(Errors::$errors)) {
if (!empty($operations['error'])) {
Errors::add($operations['error']['message']);
} else {
if ($operations['new_order'] > 0) {
$_SESSION["deposit_uniq"] = md5(uniqid(mt_rand(), true));
if ($token1 > 0) {
Link::redirect('withdraw.php?message=withdraw-2fa-success');
} else {
Link::redirect('withdraw.php?message=withdraw-success');
}
}
}
} elseif (!$no_token) {
$request_2fa = true;
}
}
}
}
}
if (!empty($_REQUEST['message'])) {
if ($_REQUEST['message'] == 'withdraw-2fa-success') {
Messages::add(Lang::string('withdraw-2fa-success'));
} elseif ($_REQUEST['message'] == 'withdraw-success') {
Messages::add(Lang::string('withdraw-success'));
示例13: md5
if (!empty($captcha->errors) && is_array($captcha->errors)) {
Errors::add($captcha->errors['recaptcha']);
}
}
if (!is_array(Errors::$errors)) {
$login = User::logIn($user1, $pass1);
if ($login && empty($login['error'])) {
if (!empty($login['message']) && $login['message'] == 'awaiting-token') {
$_SESSION["register_uniq"] = md5(uniqid(mt_rand(), true));
Link::redirect('verify-token.php');
} elseif (!empty($login['message']) && $login['message'] == 'logged-in' && $login['no_logins'] == 'Y') {
$_SESSION["register_uniq"] = md5(uniqid(mt_rand(), true));
Link::redirect('first_login.php');
} elseif (!empty($login['message']) && $login['message'] == 'logged-in') {
$_SESSION["register_uniq"] = md5(uniqid(mt_rand(), true));
Link::redirect('account.php');
}
} elseif (!$login || !empty($login['error'])) {
Errors::add(Lang::string('login-invalid-login-error'));
}
}
}
if (!empty($_REQUEST['message']) && $_REQUEST['message'] == 'registered') {
Messages::add(Lang::string('register-success'));
}
$_SESSION["register_uniq"] = md5(uniqid(mt_rand(), true));
include 'includes/head.php';
?>
<div class="page_title">
<div class="container">
<div class="title"><h1><?php
示例14: foreach
foreach ($register->errors as $key => $error) {
if (stristr($error, 'login-required-error')) {
$errors[] = Lang::string('settings-' . str_replace('_', '-', $key)) . ' ' . Lang::string('login-required-error');
} elseif (strstr($error, '-')) {
$errors[] = Lang::string($error);
} else {
$errors[] = $error;
}
}
}
Errors::$errors = $errors;
} elseif (!empty($_REQUEST['register']) && !is_array($register->errors)) {
API::add('User', 'registerNew', array($register->info));
$query = API::send();
$_SESSION["register_uniq"] = md5(uniqid(mt_rand(), true));
Link::redirect($CFG->baseurl . 'login.php?message=registered');
}
API::add('User', 'getCountries');
$query = API::send();
//$countries = $query['User']['getCountries']['results'][0];
$page_title = Lang::string('home-register');
$_SESSION["register_uniq"] = md5(uniqid(mt_rand(), true));
include 'includes/head.php';
?>
<div class="page_title">
<div class="container">
<div class="title"><h1><?php
echo $page_title;
?>
</h1></div>
<div class="pagenation"> <a href="<?php
示例15: Form
if (!empty(User::$attempts) && User::$attempts > 3 && !empty($CFG->google_recaptch_api_key) && !empty($CFG->google_recaptch_api_secret)) {
$captcha = new Form('captcha');
$captcha->reCaptchaCheck(1);
if (!empty($captcha->errors) && is_array($captcha->errors)) {
Errors::add($captcha->errors['recaptcha']);
}
}
if (!is_array(Errors::$errors)) {
$login = User::logIn($user1, $pass1);
if ($login && empty($login['error'])) {
if (!empty($login['message']) && $login['message'] == 'awaiting-token') {
$_SESSION["register_uniq"] = md5(uniqid(mt_rand(), true));
Link::redirect('verify-token.php?bypass=deposit');
} elseif (!empty($login['message']) && $login['message'] == 'logged-in') {
$_SESSION["register_uniq"] = md5(uniqid(mt_rand(), true));
Link::redirect('merchant-deposit.php?action=logged-in&bypass=deposit&api_key=' . $api_key);
}
} elseif (!$login || !empty($login['error'])) {
Errors::add(Lang::string('login-invalid-login-error'));
}
}
} else {
if ($action == 'process') {
$type = !empty($_REQUEST['process']) ? preg_replace("/[^a-z]/", "", $_REQUEST['process']) : false;
$amount_payed = !empty($_REQUEST['amount_payed']) ? preg_replace("/[^0-9\\.]/", "", $_REQUEST['amount_payed']) : false;
$currency_payed = !empty($_REQUEST['currency_payed']) ? preg_replace("/[^0-9]/", "", $_REQUEST['currency_payed']) : false;
if (!$invoice_id) {
exit;
}
API::add('APIKeys', 'updateInvoice', array($invoice_id, $api_key, $type, $amount_payed, $currency_payed));
$query = API::send();