• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP osc_sanitize_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中osc_sanitize_string函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_sanitize_string函数的具体用法?PHP osc_sanitize_string怎么用?PHP osc_sanitize_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了osc_sanitize_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Shipping = Registry::get('Shipping');
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     if (!empty($_POST['comments'])) {
         $_SESSION['comments'] = osc_sanitize_string($_POST['comments']);
     }
     if ($OSCOM_Shipping->hasQuotes()) {
         if (isset($_POST['shipping_mod_sel']) && strpos($_POST['shipping_mod_sel'], '_')) {
             list($module, $method) = explode('_', $_POST['shipping_mod_sel']);
             if (Registry::exists('Shipping_' . $module) && Registry::get('Shipping_' . $module)->isEnabled()) {
                 $quote = $OSCOM_Shipping->getQuote($_POST['shipping_mod_sel']);
                 if (isset($quote['error'])) {
                     $OSCOM_ShoppingCart->resetShippingMethod();
                 } else {
                     $OSCOM_ShoppingCart->setShippingMethod($quote);
                     osc_redirect(OSCOM::getLink(null, null, null, 'SSL'));
                 }
             } else {
                 $OSCOM_ShoppingCart->resetShippingMethod();
             }
         }
     } else {
         $OSCOM_ShoppingCart->resetShippingMethod();
         osc_redirect(OSCOM::getLink(null, null, null, 'SSL'));
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:27,代码来源:Process.php


示例2: _process

 function _process()
 {
     global $osC_ShoppingCart, $osC_Shipping;
     if (!empty($_POST['comments'])) {
         $_SESSION['comments'] = osc_sanitize_string($_POST['comments']);
     }
     if ($osC_Shipping->hasQuotes()) {
         if (isset($_POST['shipping_mod_sel']) && strpos($_POST['shipping_mod_sel'], '_')) {
             list($module, $method) = explode('_', $_POST['shipping_mod_sel']);
             $module = 'osC_Shipping_' . $module;
             if (is_object($GLOBALS[$module]) && $GLOBALS[$module]->isEnabled()) {
                 $quote = $osC_Shipping->getQuote($_POST['shipping_mod_sel']);
                 if (isset($quote['error'])) {
                     $osC_ShoppingCart->resetShippingMethod();
                 } else {
                     $osC_ShoppingCart->setShippingMethod($quote);
                     osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'payment', 'SSL'));
                 }
             } else {
                 $osC_ShoppingCart->resetShippingMethod();
             }
         }
     } else {
         $osC_ShoppingCart->resetShippingMethod();
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'payment', 'SSL'));
     }
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:27,代码来源:shipping.php


示例3: _process

 function _process()
 {
     global $osC_Database, $messageStack, $osC_Language;
     $data = array();
     $data['url'] = osc_sanitize_string($_POST['url']);
     if (isset($_POST['title']) && !empty($_POST['title'])) {
         $data['title'] = osc_sanitize_string($_POST['title']);
     } else {
         $messageStack->add('guestbook', $osC_Language->get('field_guestbook_title_error'));
     }
     if (isset($_POST['email']) && !empty($_POST['email']) && osc_validate_email_address($_POST['email'])) {
         $data['email'] = $_POST['email'];
     } else {
         $messageStack->add('guestbook', $osC_Language->get('field_guestbook_email_error'));
     }
     if (isset($_POST['content']) && !empty($_POST['content'])) {
         $data['content'] = osc_sanitize_string($_POST['content']);
     } else {
         $messageStack->add('guestbook', $osC_Language->get('field_guestbook_content_error'));
     }
     if ($_POST['verify_code'] != $_SESSION['verify_code']) {
         $messageStack->add('guestbook', $osC_Language->get('field_guestbook_verify_code_error'));
     }
     if ($messageStack->size('guestbook') === 0) {
         if (toC_Guestbook::saveEntry($data)) {
             $messageStack->add_session('guestbook', $osC_Language->get('success_guestbook_saved'), 'success');
         }
         osc_redirect(osc_href_link(FILENAME_INFO, 'guestbook'));
     }
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:30,代码来源:guestbook.php


示例4: _process

 function _process()
 {
     global $osC_Language, $osC_MessageStack, $osC_Product;
     if (empty($_POST['from_name'])) {
         $osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_customers_name_empty'));
     }
     if (!osc_validate_email_address($_POST['from_email_address'])) {
         $osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_customers_email_address'));
     }
     if (empty($_POST['to_name'])) {
         $osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_friends_name_empty'));
     }
     if (!osc_validate_email_address($_POST['to_email_address'])) {
         $osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_friends_email_address'));
     }
     if ($osC_MessageStack->size('tell_a_friend') < 1) {
         $email_subject = sprintf($osC_Language->get('email_tell_a_friend_subject'), osc_sanitize_string($_POST['from_name']), STORE_NAME);
         $email_body = sprintf($osC_Language->get('email_tell_a_friend_intro'), osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['from_name']), $osC_Product->getTitle(), STORE_NAME) . "\n\n";
         if (!empty($_POST['message'])) {
             $email_body .= osc_sanitize_string($_POST['message']) . "\n\n";
         }
         $email_body .= sprintf($osC_Language->get('email_tell_a_friend_link'), osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf($osC_Language->get('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
         osc_email(osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, osc_sanitize_string($_POST['from_name']), osc_sanitize_string($_POST['from_email_address']));
         $osC_MessageStack->add('header', sprintf($osC_Language->get('success_tell_a_friend_email_sent'), $osC_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
         osc_redirect(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID()));
     }
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:27,代码来源:tell_a_friend.php


示例5: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if (ALLOW_GUEST_TO_TELL_A_FRIEND == '-1' && $OSCOM_Customer->isLoggedOn() === false) {
         $OSCOM_NavigationHistory->setSnapshot();
         osc_redirect(OSCOM::getLink(null, 'Account', 'LogIn', 'SSL'));
     }
     $requested_product = null;
     $product_check = false;
     if (count($_GET) > 3) {
         $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
         if ($requested_product == 'Write') {
             unset($requested_product);
             if (count($_GET) > 4) {
                 $requested_product = basename(key(array_slice($_GET, 4, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (Product::checkEntry($requested_product)) {
             $product_check = true;
         }
     }
     if ($product_check === false) {
         $application->setPageContent('not_found.php');
         return false;
     }
     Registry::set('Product', new Product($requested_product));
     $OSCOM_Product = Registry::get('Product');
     if (empty($_POST['from_name'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_customers_name_empty'));
     }
     if (!osc_validate_email_address($_POST['from_email_address'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_customers_email_address'));
     }
     if (empty($_POST['to_name'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_friends_name_empty'));
     }
     if (!osc_validate_email_address($_POST['to_email_address'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_friends_email_address'));
     }
     if ($OSCOM_MessageStack->size('TellAFriend') < 1) {
         $email_subject = sprintf(OSCOM::getDef('email_tell_a_friend_subject'), osc_sanitize_string($_POST['from_name']), STORE_NAME);
         $email_body = sprintf(OSCOM::getDef('email_tell_a_friend_intro'), osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['from_name']), $OSCOM_Product->getTitle(), STORE_NAME) . "\n\n";
         if (!empty($_POST['message'])) {
             $email_body .= osc_sanitize_string($_POST['message']) . "\n\n";
         }
         $email_body .= sprintf(OSCOM::getDef('email_tell_a_friend_link'), OSCOM::getLink(null, null, $OSCOM_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf(OSCOM::getDef('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
         osc_email(osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, osc_sanitize_string($_POST['from_name']), osc_sanitize_string($_POST['from_email_address']));
         $OSCOM_MessageStack->add('header', sprintf(OSCOM::getDef('success_tell_a_friend_email_sent'), $OSCOM_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
         osc_redirect(OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()));
     }
     $application->setPageTitle($OSCOM_Product->getTitle());
     $application->setPageContent('tell_a_friend.php');
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:59,代码来源:Process.php


示例6: execute

 public static function execute(ApplicationAbstract $application)
 {
     $data = osc_sanitize_string(basename($_GET['code']));
     if (PaymentModules::uninstall($data)) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     osc_redirect_admin(OSCOM::getLink());
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:10,代码来源:Process.php


示例7: __construct

 public function __construct()
 {
     $this->initialize();
     if (isset($_GET['action']) && !empty($_GET['action'])) {
         $action = osc_sanitize_string(basename($_GET['action']));
         if (class_exists('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Action\\' . $action)) {
             call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Action\\' . $action, 'execute'), $this);
         }
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:10,代码来源:ApplicationAbstract.php


示例8: process

 protected function process()
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     // redirect to shopping cart if shopping cart is empty
     if (!$OSCOM_ShoppingCart->hasContents()) {
         osc_redirect(OSCOM::getLink(null, 'Cart'));
     }
     // check for e-mail address
     if (!$OSCOM_Customer->hasEmailAddress()) {
         if (isset($_POST['email']) && strlen(trim($_POST['email'])) >= ACCOUNT_EMAIL_ADDRESS) {
             if (osc_validate_email_address($_POST['email'])) {
                 $OSCOM_Customer->setEmailAddress(trim($_POST['email']));
             } else {
                 $OSCOM_MessageStack->add('Cart', OSCOM::getDef('field_customer_email_address_check_error'));
                 osc_redirect(OSCOM::getLink(null, 'Cart'));
             }
         } else {
             $OSCOM_MessageStack->add('Cart', sprintf(OSCOM::getDef('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
             osc_redirect(OSCOM::getLink(null, 'Cart'));
         }
     }
     // check product type perform_order conditions
     foreach ($OSCOM_ShoppingCart->getProducts() as $product) {
         $OSCOM_Product = new Product($product['id']);
         $OSCOM_Product->isTypeActionAllowed('PerformOrder');
     }
     $OSCOM_Language->load('checkout');
     $OSCOM_Language->load('order');
     $this->_page_title = OSCOM::getDef('confirmation_heading');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_checkout_confirmation'), OSCOM::getLink(null, 'Checkout', null, 'SSL'));
     }
     if (isset($_POST['comments']) && isset($_SESSION['comments']) && empty($_POST['comments'])) {
         unset($_SESSION['comments']);
     } elseif (!empty($_POST['comments'])) {
         $_SESSION['comments'] = osc_sanitize_string($_POST['comments']);
     }
     if (DISPLAY_CONDITIONS_ON_CHECKOUT == '1') {
         if (!isset($_POST['conditions']) || $_POST['conditions'] != '1') {
             $OSCOM_MessageStack->add('Checkout', OSCOM::getDef('error_conditions_not_accepted'), 'error');
         }
     }
     if (Registry::exists('Payment') === false) {
         Registry::set('Payment', new Payment());
     }
     if ($OSCOM_ShoppingCart->hasBillingMethod()) {
         $OSCOM_Payment = Registry::get('Payment');
         $OSCOM_Payment->load($OSCOM_ShoppingCart->getBillingMethod('id'));
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:55,代码来源:Controller.php


示例9: osC_Checkout_Confirmation

 function osC_Checkout_Confirmation()
 {
     global $osC_Session, $osC_Services, $osC_Language, $osC_ShoppingCart, $osC_Customer, $osC_MessageStack, $osC_NavigationHistory, $osC_Breadcrumb, $osC_Payment;
     if ($osC_Customer->isLoggedOn() === false) {
         $osC_NavigationHistory->setSnapshot();
         osc_redirect(osc_href_link(FILENAME_ACCOUNT, 'login', 'SSL'));
     }
     if ($osC_ShoppingCart->hasContents() === false) {
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, null, 'SSL'));
     }
     // if no shipping method has been selected, redirect the customer to the shipping method selection page
     if ($osC_ShoppingCart->hasShippingAddress() == false) {
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'shipping', 'SSL'));
     }
     include 'includes/classes/order.php';
     $this->_page_title = $osC_Language->get('confirmation_heading');
     $osC_Language->load('order');
     if ($osC_Services->isStarted('breadcrumb')) {
         $osC_Breadcrumb->add($osC_Language->get('breadcrumb_checkout_confirmation'), osc_href_link(FILENAME_CHECKOUT, $this->_module, 'SSL'));
     }
     if (isset($_POST['comments']) && isset($_SESSION['comments']) && empty($_POST['comments'])) {
         unset($_SESSION['comments']);
     } elseif (!empty($_POST['comments'])) {
         $_SESSION['comments'] = osc_sanitize_string($_POST['comments']);
     }
     if (DISPLAY_CONDITIONS_ON_CHECKOUT == '1') {
         if (!isset($_POST['conditions']) || $_POST['conditions'] != '1') {
             $osC_MessageStack->add('checkout_payment', $osC_Language->get('error_conditions_not_accepted'), 'error');
         }
     }
     // load the selected payment module
     include 'includes/classes/payment.php';
     $osC_Payment = new osC_Payment(isset($_POST['payment_method']) ? $_POST['payment_method'] : $osC_ShoppingCart->getBillingMethod('id'));
     if (isset($_POST['payment_method'])) {
         $osC_ShoppingCart->setBillingMethod(array('id' => $_POST['payment_method'], 'title' => $GLOBALS['osC_Payment_' . $_POST['payment_method']]->getMethodTitle()));
     }
     if ($osC_Payment->hasActive() && (isset($GLOBALS['osC_Payment_' . $osC_ShoppingCart->getBillingMethod('id')]) === false || isset($GLOBALS['osC_Payment_' . $osC_ShoppingCart->getBillingMethod('id')]) && is_object($GLOBALS['osC_Payment_' . $osC_ShoppingCart->getBillingMethod('id')]) && $GLOBALS['osC_Payment_' . $osC_ShoppingCart->getBillingMethod('id')]->isEnabled() === false)) {
         $osC_MessageStack->add('checkout_payment', $osC_Language->get('error_no_payment_module_selected'), 'error');
     }
     if ($osC_MessageStack->size('checkout_payment') > 0) {
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'payment', 'SSL'));
     }
     if ($osC_Payment->hasActive()) {
         $osC_Payment->pre_confirmation_check();
     }
     // Stock Check
     if (STOCK_CHECK == '1' && STOCK_ALLOW_CHECKOUT == '-1') {
         foreach ($osC_ShoppingCart->getProducts() as $product) {
             if (!$osC_ShoppingCart->isInStock($product['item_id'])) {
                 osc_redirect(osc_href_link(FILENAME_CHECKOUT, null, 'AUTO'));
             }
         }
     }
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:54,代码来源:confirmation.php


示例10: execute

 public static function execute(ApplicationAbstract $application)
 {
     if (isset($_GET['module']) && !empty($_GET['module'])) {
         $module = osc_sanitize_string($_GET['module']);
         if (class_exists('osCommerce\\OM\\Core\\Site\\Shop\\Module\\Payment\\' . $module)) {
             $module = 'osCommerce\\OM\\Core\\Site\\Shop\\Module\\Payment\\' . $module;
             $module = new $module();
             $module->callback();
         }
     }
     exit;
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:12,代码来源:Callback.php


示例11: _process

 function _process()
 {
     global $osC_Language, $osC_MessageStack;
     $name = osc_sanitize_string($_POST['name']);
     $email_address = osc_sanitize_string($_POST['email']);
     $enquiry = osc_sanitize_string($_POST['enquiry']);
     if (osc_validate_email_address($email_address)) {
         osc_email(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $osC_Language->get('contact_email_subject'), $enquiry, $name, $email_address);
         osc_redirect(osc_href_link(FILENAME_INFO, 'contact=success', 'AUTO'));
     } else {
         $osC_MessageStack->add('contact', $osC_Language->get('field_customer_email_address_check_error'));
     }
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:13,代码来源:contact.php


示例12: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $name = osc_sanitize_string($_POST['name']);
     $email_address = osc_sanitize_string($_POST['email']);
     $enquiry = osc_sanitize_string($_POST['enquiry']);
     if (osc_validate_email_address($email_address)) {
         osc_email(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, OSCOM::getDef('contact_email_subject'), $enquiry, $name, $email_address);
         osc_redirect(OSCOM::getLink(null, null, 'Contact&Success'));
     } else {
         $OSCOM_MessageStack->add('Contact', OSCOM::getDef('field_customer_email_address_check_error'));
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:13,代码来源:Process.php


示例13: ucfirst

 function &setup($module)
 {
     $class = 'osC_Application_' . ucfirst($module);
     if (isset($_GET['action']) && !empty($_GET['action'])) {
         $_action = osc_sanitize_string(basename($_GET['action']));
         if (file_exists('includes/applications/' . $module . '/actions/' . $_action . '.php')) {
             include 'includes/applications/' . $module . '/actions/' . $_action . '.php';
             $class = 'osC_Application_' . ucfirst($module) . '_Actions_' . $_action;
         }
     }
     $object = new $class();
     return $object;
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:13,代码来源:template.php


示例14: execute

 public static function execute(ApplicationAbstract $application)
 {
     if (!empty($_GET['shortcut'])) {
         $application = osc_sanitize_string($_GET['shortcut']);
         if (OSCOM::siteApplicationExists($application)) {
             if (Dashboard::deleteShortcut($_SESSION[OSCOM::getSite()]['id'], $application)) {
                 $_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_SESSION[OSCOM::getSite()]['id']);
                 Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_success_shortcut_removed'), 'success');
                 osc_redirect_admin(OSCOM::getLink(null, $application));
             }
         }
     }
     osc_redirect_admin(OSCOM::getLink());
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:14,代码来源:RemoveShortcut.php


示例15: _process

 function _process()
 {
     global $osC_Language, $messageStack;
     if (isset($_POST['department_email']) && !empty($_POST['department_email'])) {
         $department_email = osc_sanitize_string($_POST['department_email']);
         if (!osc_validate_email_address($department_email)) {
             $messageStack->add('contact', $osC_Language->get('field_departments_email_error'));
         }
     } else {
         $department_email = STORE_OWNER_EMAIL_ADDRESS;
     }
     if (isset($_POST['name']) && !empty($_POST['name'])) {
         $name = osc_sanitize_string($_POST['name']);
     } else {
         $messageStack->add('contact', $osC_Language->get('field_customer_name_error'));
     }
     if (isset($_POST['email']) && !empty($_POST['email'])) {
         $email_address = osc_sanitize_string($_POST['email']);
         if (!osc_validate_email_address($email_address)) {
             $messageStack->add('contact', $osC_Language->get('field_customer_concat_email_error'));
         }
     } else {
         $messageStack->add('contact', $osC_Language->get('field_customer_concat_email_error'));
     }
     if (isset($_POST['telephone']) && !empty($_POST['telephone'])) {
         $telephone = osc_sanitize_string($_POST['telephone']);
     }
     if (isset($_POST['enquiry']) && !empty($_POST['enquiry'])) {
         $enquiry = osc_sanitize_string($_POST['enquiry']);
     } else {
         $messageStack->add('contact', $osC_Language->get('field_enquiry_error'));
     }
     if (ACTIVATE_CAPTCHA == '1') {
         if (isset($_POST['captcha_code']) && !empty($_POST['captcha_code'])) {
             $securimage = new Securimage();
             if ($securimage->check($_POST['captcha_code']) == false) {
                 $messageStack->add('contact', $osC_Language->get('field_concat_captcha_check_error'));
             }
         } else {
             $messageStack->add('contact', $osC_Language->get('field_concat_captcha_check_error'));
         }
     }
     if ($messageStack->size('contact') === 0) {
         osc_email(STORE_OWNER, $department_email, $osC_Language->get('contact_email_subject'), $enquiry . '<br /><br /><br />' . $osC_Language->get('contact_telephone_title') . $telephone, $name, $email_address);
         osc_redirect(osc_href_link(FILENAME_INFO, 'contact=success', 'AUTO', true, false));
     }
 }
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:47,代码来源:contact.php


示例16: initialize

 public static function initialize()
 {
     header('Cache-Control: no-cache, must-revalidate');
     header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
     if (empty($_GET)) {
         echo json_encode(array('rpcStatus' => self::STATUS_NO_MODULE));
         exit;
     }
     $site = osc_sanitize_string(basename(key(array_slice($_GET, 1, 1, true))));
     $application = osc_sanitize_string(basename(key(array_slice($_GET, 2, 1, true))));
     if (!OSCOM::siteExists($site)) {
         echo json_encode(array('rpcStatus' => self::STATUS_CLASS_NONEXISTENT));
         exit;
     }
     OSCOM::setSite($site);
     if (!OSCOM::siteApplicationExists($application)) {
         echo json_encode(array('rpcStatus' => self::STATUS_CLASS_NONEXISTENT));
         exit;
     }
     OSCOM::setSiteApplication($application);
     call_user_func(array('osCommerce\\OM\\Core\\Site\\' . $site . '\\Controller', 'initialize'));
     if (!call_user_func(array('osCommerce\\OM\\Core\\Site\\' . $site . '\\Controller', 'hasAccess'), $application)) {
         echo json_encode(array('rpcStatus' => self::STATUS_NO_ACCESS));
         exit;
     }
     if (count($_GET) < 3) {
         echo json_encode(array('rpcStatus' => self::STATUS_NO_ACTION));
         exit;
     }
     $rpc_called = false;
     $rpc = array('RPC');
     for ($i = 3, $n = count($_GET); $i < $n; $i++) {
         $subrpc = osc_sanitize_string(basename(key(array_slice($_GET, $i, 1, true))));
         if (self::siteApplicationRPCExists(implode('\\', $rpc) . '\\' . $subrpc)) {
             call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\' . implode('\\', $rpc) . '\\' . $subrpc, 'execute'));
             $rpc[] = $subrpc;
             $rpc_called = true;
         } else {
             break;
         }
     }
     if ($rpc_called === false) {
         echo json_encode(array('rpcStatus' => self::STATUS_NO_ACTION));
         exit;
     }
     exit;
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:47,代码来源:Controller.php


示例17: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Database = Registry::get('Database');
     if (!empty($_GET['shortcut'])) {
         $application = osc_sanitize_string($_GET['shortcut']);
         if (OSCOM::siteApplicationExists($application)) {
             $Qsc = $OSCOM_Database->query('delete from :table_administrator_shortcuts where administrators_id = :administrators_id and module = :module');
             $Qsc->bindInt(':administrators_id', $_SESSION[OSCOM::getSite()]['id']);
             $Qsc->bindValue(':module', $application);
             $Qsc->execute();
             if (!$OSCOM_Database->isError()) {
                 $_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_SESSION[OSCOM::getSite()]['id']);
                 Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_success_shortcut_removed'), 'success');
                 osc_redirect_admin(OSCOM::getLink(null, $application));
             }
         }
     }
     osc_redirect_admin(OSCOM::getLink());
 }
开发者ID:hakankarar,项目名称:oscommerce,代码行数:19,代码来源:RemoveShortcut.php


示例18: setSiteApplication

 public static function setSiteApplication($application = null)
 {
     if (isset($application)) {
         if (!self::siteApplicationExists($application)) {
             trigger_error('Application \'' . $application . '\' does not exist for Site \'' . self::getSite() . '\', using default \'' . self::getDefaultSiteApplication() . '\'', E_USER_ERROR);
             $application = null;
         }
     } else {
         if (!empty($_GET)) {
             $requested_application = osc_sanitize_string(basename(key(array_slice($_GET, 0, 1, true))));
             if ($requested_application == self::getSite()) {
                 $requested_application = osc_sanitize_string(basename(key(array_slice($_GET, 1, 1, true))));
             }
             if (!empty($requested_application) && self::siteApplicationExists($requested_application)) {
                 $application = $requested_application;
             }
         }
     }
     if (empty($application)) {
         $application = self::getDefaultSiteApplication();
     }
     self::$_application = $application;
 }
开发者ID:hakankarar,项目名称:oscommerce,代码行数:23,代码来源:OSCOM.php


示例19: basename

 /**
  * Setup the template class with the requested page module
  *
  * @param string $module The default page module to setup
  * @return object
  */
 function &setup($module)
 {
     global $osC_Template;
     $group = basename($_SERVER['SCRIPT_FILENAME']);
     if (($pos = strrpos($group, '.')) !== false) {
         $group = substr($group, 0, $pos);
     }
     if (empty($_GET) === false) {
         $first_array = array_slice($_GET, 0, 1);
         $_module = osc_sanitize_string(basename(key($first_array)));
         if (file_exists('includes/content/' . $group . '/' . $_module . '.php')) {
             $module = $_module;
         }
     }
     include 'includes/content/' . $group . '/' . $module . '.php';
     $_page_module_name = 'osC_' . ucfirst($group) . '_' . ucfirst($module);
     $osC_Template = new $_page_module_name();
     $osC_Template->iniModules();
     require 'includes/classes/actions.php';
     osC_Actions::parse();
     return $osC_Template;
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:28,代码来源:template.php


示例20: _process

 function _process()
 {
     global $osC_Language, $messageStack;
     if (isset($_POST['name']) && !empty($_POST['name'])) {
         $name = osc_sanitize_string($_POST['name']);
     } else {
         $messageStack->add('bank_receipt', $osC_Language->get('field_customer_name_error'));
     }
     if (isset($_POST['email']) && !empty($_POST['email'])) {
         $email_address = osc_sanitize_string($_POST['email']);
         if (!osc_validate_email_address($email_address)) {
             $messageStack->add('bank_receipt', $osC_Language->get('field_customer_bank_receipt_email_error'));
         }
     } else {
         $messageStack->add('bank_receipt', $osC_Language->get('field_customer_bank_receipt_email_error'));
     }
     if (isset($_POST['telephone']) && !empty($_POST['telephone'])) {
         $telephone = osc_sanitize_string($_POST['telephone']);
     }
     if (isset($_POST['amount']) && !empty($_POST['amount'])) {
         $amount = osc_sanitize_string($_POST['amount']);
     } else {
         $messageStack->add('bank_receipt', $osC_Language->get('field_bank_receipt_amount_error'));
     }
     if (isset($_POST['bankname']) && !empty($_POST['bankname'])) {
         $bankname = osc_sanitize_string($_POST['bankname']);
     } else {
         $messageStack->add('bank_receipt', $osC_Language->get('field_bank_receipt_bankname_error'));
     }
     if (isset($_POST['receiptnumber']) && !empty($_POST['receiptnumber'])) {
         $receiptnumber = osc_sanitize_string($_POST['receiptnumber']);
     } else {
         $messageStack->add('bank_receipt', $osC_Language->get('field_bank_receipt_receiptnumber_error'));
     }
     if (isset($_POST['receiptdate_days']) && isset($_POST['receiptdate_months']) && isset($_POST['receiptdate_years'])) {
         $receiptdate = $_POST['receiptdate_years'] . '/' . $_POST['receiptdate_months'] . '/' . $_POST['receiptdate_days'];
     }
     if (isset($_POST['ordernumber']) && !empty($_POST['ordernumber'])) {
         $ordernumber = osc_sanitize_string($_POST['ordernumber']);
     } else {
         $messageStack->add('bank_receipt', $osC_Language->get('field_bank_receipt_ordernumber_error'));
     }
     if (isset($_POST['description']) && !empty($_POST['description'])) {
         $description = osc_sanitize_string($_POST['description']);
     }
     if (ACTIVATE_CAPTCHA == '1') {
         if (isset($_POST['captcha_code']) && !empty($_POST['captcha_code'])) {
             $securimage = new Securimage();
             if ($securimage->check($_POST['captcha_code']) == false) {
                 $messageStack->add('bank_receipt', $osC_Language->get('field_bank_receipt_captcha_check_error'));
             }
         } else {
             $messageStack->add('bank_receipt', $osC_Language->get('field_bank_receipt_captcha_check_error'));
         }
     }
     if ($messageStack->size('bank_receipt') === 0) {
         $email_content = "\n\t<center>\n\t<table dir=rtl width=100% height=100% cellpadding=2 cellspacing=1><tr><td style='font-family:tahoma; font-size:12px; ' align=right >\n" . $osC_Language->get('bank_receipt_name_title') . $name . "<br><br>\n" . $osC_Language->get('bank_receipt_telephone_title') . $telephone . "<br><br>\n" . $osC_Language->get('bank_receipt_email_address_title') . $email_address . "<br><br>\n" . $osC_Language->get('bank_receipt_amount_title') . $amount . "<br><br>\n" . $osC_Language->get('bank_receipt_bank_name_title') . $bankname . "<br><br>\n" . $osC_Language->get('bank_receipt_receipt_number_title') . $receiptnumber . "<br><br>\n" . $osC_Language->get('bank_receipt_receipt_date_title') . $receiptdate . "<br><br>\n" . $osC_Language->get('bank_receipt_order_number_title') . $ordernumber . "<br><br>\n" . $osC_Language->get('bank_receipt_description_title') . $description . "<br><br>\n\t</td></tr></table>\n\t</center>\n";
         osc_email(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $osC_Language->get('bank_receipt_email_subject'), $email_content, $name, $email_address);
         osc_redirect(osc_href_link(FILENAME_INFO, 'bank_receipt=success', 'AUTO', true, false));
         $email_content = '';
     }
 }
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:62,代码来源:bank_receipt.php



注:本文中的osc_sanitize_string函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP osc_search_category_id函数代码示例发布时间:2022-05-15
下一篇:
PHP osc_sanitizeString函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap