本文整理汇总了PHP中lc_redirect函数的典型用法代码示例。如果您正苦于以下问题:PHP lc_redirect函数的具体用法?PHP lc_redirect怎么用?PHP lc_redirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lc_redirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
function execute()
{
global $lC_Database, $lC_Session, $lC_NavigationHistory, $lC_Customer;
if (!$lC_Customer->isLoggedOn()) {
$lC_NavigationHistory->setSnapshot();
lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'login', 'SSL'));
return false;
}
$id = false;
foreach ($_GET as $key => $value) {
if ((preg_match('/^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$/', $key) || preg_match('/^[a-zA-Z0-9 -_]*$/', $key)) && $key != $lC_Session->getName()) {
$id = $key;
}
break;
}
if ($id !== false && lC_Product::checkEntry($id)) {
$lC_Product = new lC_Product($id);
$Qcheck = $lC_Database->query('select products_id from :table_products_notifications where customers_id = :customers_id and products_id = :products_id limit 1');
$Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
$Qcheck->bindInt(':customers_id', $lC_Customer->getID());
$Qcheck->bindInt(':products_id', $lC_Product->getID());
$Qcheck->execute();
if ($Qcheck->numberOfRows() > 0) {
$Qn = $lC_Database->query('delete from :table_products_notifications where customers_id = :customers_id and products_id = :products_id');
$Qn->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
$Qn->bindInt(':customers_id', $lC_Customer->getID());
$Qn->bindInt(':products_id', $lC_Product->getID());
$Qn->execute();
}
}
lc_redirect(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('action'))));
}
示例2: _process
protected function _process()
{
global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Vqmod;
require_once $lC_Vqmod->modCheck('includes/classes/account.php');
$Qcheck = $lC_Database->query('select customers_id, customers_firstname, customers_lastname, customers_gender, customers_email_address, customers_password from :table_customers where customers_email_address = :customers_email_address limit 1');
$Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qcheck->bindValue(':customers_email_address', $_POST['email_address']);
$Qcheck->execute();
if ($Qcheck->numberOfRows() === 1) {
$password = lc_create_random_string(ACCOUNT_PASSWORD);
if (lC_Account::savePassword($password, $Qcheck->valueInt('customers_id'))) {
if (ACCOUNT_GENDER > -1) {
if ($data['gender'] == 'm') {
$email_text = sprintf($lC_Language->get('email_addressing_gender_male'), $Qcheck->valueProtected('customers_lastname')) . "\n\n";
} else {
$email_text = sprintf($lC_Language->get('email_addressing_gender_female'), $Qcheck->valueProtected('customers_lastname')) . "\n\n";
}
} else {
$email_text = sprintf($lC_Language->get('email_addressing_gender_unknown'), $Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname')) . "\n\n";
}
$email_text .= sprintf($lC_Language->get('email_password_reminder_body'), getenv('REMOTE_ADDR'), STORE_NAME, $password, STORE_OWNER_EMAIL_ADDRESS);
lc_email($Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname'), $Qcheck->valueProtected('customers_email_address'), sprintf($lC_Language->get('email_password_reminder_subject'), STORE_NAME), $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'login&success=' . urlencode($lC_Language->get('success_password_forgotten_sent')), 'SSL'));
} else {
$lC_MessageStack->add('password_forgotten', $lC_Language->get('error_password_forgotten_no_email_address_found'));
}
}
示例3: _process
protected function _process()
{
global $lC_Database, $lC_Session, $lC_Language, $lC_ShoppingCart, $lC_MessageStack, $lC_Customer, $lC_NavigationHistory, $lC_Vqmod;
require $lC_Vqmod->modCheck('includes/classes/account.php');
if (lC_Account::checkEntry($_POST['email_address'])) {
if (lC_Account::checkPassword($_POST['password'], $_POST['email_address'])) {
if (SERVICE_SESSION_REGENERATE_ID == '1') {
$lC_Session->recreate();
}
$lC_Customer->setCustomerData(lC_Account::getID($_POST['email_address']));
$Qupdate = $lC_Database->query('update :table_customers set date_last_logon = :date_last_logon, number_of_logons = number_of_logons+1 where customers_id = :customers_id');
$Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qupdate->bindRaw(':date_last_logon', 'now()');
$Qupdate->bindInt(':customers_id', $lC_Customer->getID());
$Qupdate->execute();
if ($lC_ShoppingCart->hasContents() === true) {
$lC_ShoppingCart->synchronizeWithDatabase();
}
$lC_NavigationHistory->removeCurrentPage();
lC_Cache::clearAll();
if ($lC_NavigationHistory->hasSnapshot()) {
$lC_NavigationHistory->redirectToSnapshot();
} else {
lc_redirect(lc_href_link(FILENAME_DEFAULT, null, 'AUTO'));
}
} else {
$lC_MessageStack->add('login', $lC_Language->get('error_login_no_match'));
}
} else {
$lC_MessageStack->add('login', $lC_Language->get('error_login_no_match'));
}
}
示例4: _process
protected function _process()
{
global $lC_Language, $lC_MessageStack, $lC_Product;
if (empty($_POST['from_name'])) {
$lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_customers_name_empty'));
}
if (!lc_validate_email_address($_POST['from_email_address'])) {
$lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_invalid_customers_email_address'));
}
if (empty($_POST['to_name'])) {
$lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_friends_name_empty'));
}
if (!lc_validate_email_address($_POST['to_email_address'])) {
$lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_invalid_friends_email_address'));
}
if ($lC_MessageStack->size('tell_a_friend') < 1) {
$email_subject = sprintf($lC_Language->get('email_tell_a_friend_subject'), lc_sanitize_string($_POST['from_name']), STORE_NAME);
$email_body = sprintf($lC_Language->get('email_tell_a_friend_intro'), lc_sanitize_string($_POST['to_name']), lc_sanitize_string($_POST['from_name']), $lC_Product->getTitle(), STORE_NAME) . "\n\n";
if (!empty($_POST['message'])) {
$email_body .= lc_sanitize_string($_POST['message']) . "\n\n";
}
$email_body .= sprintf($lC_Language->get('email_tell_a_friend_link'), lc_href_link(HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCTS, $lC_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf($lC_Language->get('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
lc_email(lc_sanitize_string($_POST['to_name']), lc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, lc_sanitize_string($_POST['from_name']), lc_sanitize_string($_POST['from_email_address']));
lc_redirect(lc_href_link(FILENAME_PRODUCTS, 'tell_a_friend&' . $lC_Product->getID() . '&success=' . urlencode(sprintf($lC_Language->get('success_tell_a_friend_email_sent'), $lC_Product->getTitle(), lc_output_string_protected($_POST['to_name'])))));
}
}
示例5: execute
function execute()
{
global $lC_Session, $lC_ShoppingCart;
if (is_numeric($_GET['item'])) {
$lC_ShoppingCart->remove($_GET['item']);
}
lc_redirect(lc_href_link(FILENAME_CHECKOUT));
}
示例6: _process
protected function _process()
{
global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Customer, $lC_Vqmod;
require_once $lC_Vqmod->modCheck('includes/classes/account.php');
$data = array();
if (ACCOUNT_GENDER >= 0) {
if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) {
$data['gender'] = $_POST['gender'];
} else {
$lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_gender_error'));
}
}
if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) {
$data['firstname'] = $_POST['firstname'];
} else {
$lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_first_name_error'), ACCOUNT_FIRST_NAME));
}
if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) >= ACCOUNT_LAST_NAME) {
$data['lastname'] = $_POST['lastname'];
} else {
$lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_last_name_error'), ACCOUNT_LAST_NAME));
}
if (ACCOUNT_DATE_OF_BIRTH == '1') {
$dateParts = explode("/", $_POST['dob']);
if (isset($_POST['dob']) && checkdate($dateParts[0], $dateParts[1], $dateParts[2])) {
$data['dob'] = @mktime(0, 0, 0, $dateParts[0], $dateParts[1], $dateParts[2]);
} else {
$lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_date_of_birth_error'));
}
}
if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) {
if (lc_validate_email_address($_POST['email_address'])) {
if (lC_Account::checkDuplicateEntry($_POST['email_address']) === false) {
$data['email_address'] = $_POST['email_address'];
} else {
$lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_email_address_exists_error'));
}
} else {
$lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_email_address_check_error'));
}
} else {
$lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
}
if ($lC_MessageStack->size('account_edit') === 0) {
if (lC_Account::saveEntry($data)) {
// reset the session variables
if (ACCOUNT_GENDER > -1) {
$lC_Customer->setGender($data['gender']);
}
$lC_Customer->setFirstName(trim($data['firstname']));
$lC_Customer->setLastName(trim($data['lastname']));
$lC_Customer->setEmailAddress($data['email_address']);
$lC_MessageStack->add('account', $lC_Language->get('success_account_updated'), 'success');
}
lc_redirect(lc_href_link(FILENAME_ACCOUNT, null, 'SSL'));
}
}
示例7: _process
protected function _process()
{
global $lC_Language, $lC_MessageStack;
$name = lc_sanitize_string($_POST['name']);
$email_address = lc_sanitize_string($_POST['email']);
$inquiry = lc_sanitize_string($_POST['inquiry']);
if (lc_validate_email_address($email_address)) {
lc_email(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $lC_Language->get('contact_email_subject'), $inquiry, $name, $email_address);
lc_redirect(lc_href_link(FILENAME_INFO, 'contact&success=' . urlencode($lC_Language->get('contact_email_sent_successfully')), 'AUTO'));
} else {
$lC_MessageStack->add('contact', $lC_Language->get('field_customer_email_address_check_error'));
}
}
示例8: __construct
public function __construct()
{
global $lC_Language, $lC_Database, $lC_MessageStack;
if (!isset($_GET['set'])) {
$_GET['set'] = 'members';
}
$action = isset($_GET['gid']) && !empty($_GET['gid']) ? 'edit' : 'insert';
switch ($_GET['set']) {
case 'groups':
$this->_page_title = $lC_Language->get('heading_title_groups');
$this->_page_name = 'groups';
$this->_page_contents = 'groups.php';
if (isset($_GET['process'])) {
$result = array();
switch (strtolower($_GET['process'])) {
case 'edit':
$result = lC_Administrators_Admin::saveGroup($_GET['gid'], $_POST);
break;
default:
$result = lC_Administrators_Admin::saveGroup(NULL, $_POST);
}
if ($result['rpcStatus'] != 1 || $lC_Database->isError()) {
if ($lC_Database->isError()) {
$lC_MessageStack->add($this->_module, $lC_Database->getError(), 'error');
} else {
$lC_MessageStack->add($this->_module, $lC_Language->get('ms_error_action_not_performed'), 'error');
}
}
$_SESSION['messageToStack'] = $lC_MessageStack->getAll();
lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '&set=groups'));
}
break;
case 'access':
if ($action == 'insert' && (int) $_SESSION['admin']['access'][$this->_module] < 2) {
lc_redirect(lc_href_link_admin(FILENAME_DEFAULT, 'error_pages&set=no_access'));
}
if ($action != 'insert' && (int) $_SESSION['admin']['access'][$this->_module] < 3) {
lc_redirect(lc_href_link_admin(FILENAME_DEFAULT, 'error_pages&set=no_access'));
}
$this->_page_title = $action == 'insert' ? $lC_Language->get('heading_title_new_group') : $lC_Language->get('heading_title_edit_group');
$this->_page_name = 'access';
$this->_page_contents = 'access.php';
break;
case 'members':
default:
$this->_page_title = $lC_Language->get('heading_title');
$this->_page_name = 'members';
$this->_page_contents = 'main.php';
break;
}
}
示例9: execute
function execute()
{
global $lC_Database, $lC_Session, $lC_NavigationHistory, $lC_Customer;
if (!$lC_Customer->isLoggedOn()) {
$lC_NavigationHistory->setSnapshot();
lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'login', 'SSL'));
return false;
}
$notifications = array();
if (isset($_GET['products']) && !empty($_GET['products'])) {
$products_array = explode(';', $_GET['products']);
foreach ($products_array as $product_id) {
if (is_numeric($product_id) && !in_array($product_id, $notifications)) {
$notifications[] = $product_id;
}
}
} else {
$id = false;
foreach ($_GET as $key => $value) {
if ((preg_match('/^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$/', $key) || preg_match('/^[a-zA-Z0-9 -_]*$/', $key)) && $key != $lC_Session->getName()) {
$id = $key;
}
break;
}
if ($id !== false && lC_Product::checkEntry($id)) {
$lC_Product = new lC_Product($id);
$notifications[] = $lC_Product->getID();
}
}
if (!empty($notifications)) {
foreach ($notifications as $product_id) {
$Qcheck = $lC_Database->query('select products_id from :table_products_notifications where customers_id = :customers_id and products_id = :products_id limit 1');
$Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
$Qcheck->bindInt(':customers_id', $lC_Customer->getID());
$Qcheck->bindInt(':products_id', $product_id);
$Qcheck->execute();
if ($Qcheck->numberOfRows() < 1) {
$Qn = $lC_Database->query('insert into :table_products_notifications (products_id, customers_id, date_added) values (:products_id, :customers_id, :date_added)');
$Qn->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
$Qn->bindInt(':products_id', $product_id);
$Qn->bindInt(':customers_id', $lC_Customer->getID());
$Qn->bindRaw(':date_added', 'now()');
$Qn->execute();
}
}
}
lc_redirect(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('action'))));
}
示例10: execute
function execute()
{
global $lC_Session, $lC_ShoppingCart, $lC_Product, $lC_Language, $lC_Customer;
if (!isset($lC_Product)) {
$id = false;
foreach ($_GET as $key => $value) {
if ((is_numeric($key) || preg_match('/^[a-zA-Z0-9 -_]*$/', $key)) && $key != $lC_Session->getName()) {
$id = $key;
}
break;
}
if ($id !== false && lC_Product::checkEntry($id)) {
$lC_Product = new lC_Product($id);
}
}
if (isset($lC_Product)) {
// VQMOD-hookpoint; DO NOT MODIFY OR REMOVE THE LINE BELOW
$quantity = isset($_POST['quantity']) && !empty($_POST['quantity']) ? (int) $_POST['quantity'] : 1;
if ($lC_Product->hasVariants()) {
if (isset($_POST['variants']) && is_array($_POST['variants']) && !empty($_POST['variants'])) {
if ($lC_Product->variantExists($_POST['variants'])) {
$lC_ShoppingCart->add($lC_Product->getProductVariantID($_POST['variants']), $quantity);
} else {
lc_redirect(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword() . '&error=' . urlencode($lC_Language->get('variant_combo_not_available'))));
return false;
}
} else {
lc_redirect(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()));
return false;
}
} else {
if (isset($_GET['info']) && $_GET['info'] == '1') {
} else {
if ($lC_Product->hasSubProducts($lC_Product->getID()) || $lC_Product->hasSimpleOptions()) {
lc_redirect(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()));
}
}
if (isset($_POST['quantity']) && is_array($_POST['quantity'])) {
foreach ($_POST['quantity'] as $product_id => $quantity) {
$lC_ShoppingCart->add((int) $product_id, (int) $quantity);
}
} else {
$lC_ShoppingCart->add($lC_Product->getID(), $quantity);
}
}
}
lc_redirect(lc_href_link(FILENAME_CHECKOUT));
}
示例11: _process
function _process()
{
$notify_string = '';
$products_array = isset($_POST['notify']) ? $_POST['notify'] : array();
if (!is_array($products_array)) {
$products_array = array($products_array);
}
$notifications = array();
foreach ($products_array as $product_id) {
if (is_numeric($product_id) && !in_array($product_id, $notifications)) {
$notifications[] = $product_id;
}
}
if (!empty($notifications)) {
$notify_string = 'action=notify_add&products=' . implode(';', $notifications);
}
lc_redirect(lc_href_link(FILENAME_DEFAULT, $notify_string, 'AUTO'));
}
示例12: lC_Account_Orders
public function lC_Account_Orders()
{
global $lC_Services, $lC_Language, $lC_Customer, $lC_Breadcrumb, $lC_Vqmod;
require $lC_Vqmod->modCheck('includes/classes/order.php');
$this->_page_title = $lC_Language->get('orders_heading');
$lC_Language->load('order');
if ($lC_Services->isStarted('breadcrumb')) {
$lC_Breadcrumb->add($lC_Language->get('breadcrumb_my_orders'), lc_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
if (is_numeric($_GET[$this->_module])) {
$lC_Breadcrumb->add(sprintf($lC_Language->get('breadcrumb_order_information'), $_GET[$this->_module]), lc_href_link(FILENAME_ACCOUNT, $this->_module . '=' . $_GET[$this->_module], 'SSL'));
}
}
if (is_numeric($_GET[$this->_module])) {
if (lC_Order::getCustomerID($_GET[$this->_module]) !== $lC_Customer->getID()) {
lc_redirect(lc_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
}
$this->_page_title = sprintf($lC_Language->get('order_information_heading'), $_GET[$this->_module]);
$this->_page_contents = 'account_history_info.php';
}
}
示例13: _process
protected function _process()
{
global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Customer, $Qnewsletter;
if (isset($_POST['newsletter_general']) && is_numeric($_POST['newsletter_general'])) {
$newsletter_general = $_POST['newsletter_general'];
} else {
$newsletter_general = '0';
}
if ($newsletter_general != $Qnewsletter->valueInt('customers_newsletter')) {
$newsletter_general = $Qnewsletter->value('customers_newsletter') == '1' ? '0' : '1';
$Qupdate = $lC_Database->query('update :table_customers set customers_newsletter = :customers_newsletter where customers_id = :customers_id');
$Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qupdate->bindInt(':customers_newsletter', $newsletter_general);
$Qupdate->bindInt(':customers_id', $lC_Customer->getID());
$Qupdate->execute();
if ($Qupdate->affectedRows() === 1) {
$lC_MessageStack->add('account', $lC_Language->get('success_newsletter_updated'), 'success');
}
}
lc_redirect(lc_href_link(FILENAME_ACCOUNT, null, 'SSL'));
}
示例14: execute
function execute()
{
global $lC_ShoppingCart;
// update cart qty
if (isset($_POST['products']) && is_array($_POST['products']) && !empty($_POST['products'])) {
foreach ($_POST['products'] as $item_id => $quantity) {
if (!is_numeric($item_id) || !is_numeric($quantity)) {
return false;
}
$lC_ShoppingCart->update($item_id, $quantity);
}
}
// remove cart items
if (isset($_POST['delete']) && is_array($_POST['delete']) && !empty($_POST['delete'])) {
foreach ($_POST['delete'] as $item_id => $confirm) {
if (!is_numeric($item_id)) {
return false;
}
$lC_ShoppingCart->remove($item_id);
}
}
lc_redirect(lc_href_link(FILENAME_CHECKOUT));
}
示例15: _process
protected function _process()
{
global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Vqmod;
require_once $lC_Vqmod->modCheck('includes/classes/account.php');
if (!isset($_POST['password_current']) || strlen(trim($_POST['password_current'])) < ACCOUNT_PASSWORD) {
$lC_MessageStack->add('account_password', sprintf($lC_Language->get('field_customer_password_current_error'), ACCOUNT_PASSWORD));
} elseif (!isset($_POST['password_new']) || strlen(trim($_POST['password_new'])) < ACCOUNT_PASSWORD) {
$lC_MessageStack->add('account_password', sprintf($lC_Language->get('field_customer_password_new_error'), ACCOUNT_PASSWORD));
} elseif (!isset($_POST['password_confirmation']) || trim($_POST['password_new']) != trim($_POST['password_confirmation'])) {
$lC_MessageStack->add('account_password', $lC_Language->get('field_customer_password_new_mismatch_with_confirmation_error'));
}
if ($lC_MessageStack->size('account_password') === 0) {
if (lC_Account::checkPassword(trim($_POST['password_current']))) {
if (lC_Account::savePassword(trim($_POST['password_new']))) {
lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'success=' . urlencode($lC_Language->get('success_password_updated')), 'SSL'));
} else {
$lC_MessageStack->add('account_password', sprintf($lC_Language->get('field_customer_password_new_error'), ACCOUNT_PASSWORD));
}
} else {
$lC_MessageStack->add('account_password', $lC_Language->get('error_current_password_not_matching'));
}
}
}