コード例 #1
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_PDO = Registry::get('PDO');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $Qcheck = $OSCOM_PDO->prepare('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->bindValue(':customers_email_address', $_POST['email_address']);
     $Qcheck->execute();
     if ($Qcheck->fetch() !== false) {
         $password = Hash::getRandomString(ACCOUNT_PASSWORD);
         if (Account::savePassword($password, $Qcheck->valueInt('customers_id'))) {
             if (ACCOUNT_GENDER > -1) {
                 if ($Qcheck->value('customers_gender') == 'm') {
                     $email_text = sprintf(OSCOM::getDef('email_addressing_gender_male'), $Qcheck->valueProtected('customers_lastname')) . "\n\n";
                 } else {
                     $email_text = sprintf(OSCOM::getDef('email_addressing_gender_female'), $Qcheck->valueProtected('customers_lastname')) . "\n\n";
                 }
             } else {
                 $email_text = sprintf(OSCOM::getDef('email_addressing_gender_unknown'), $Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname')) . "\n\n";
             }
             $email_text .= sprintf(OSCOM::getDef('email_password_reminder_body'), OSCOM::getIPAddress(), STORE_NAME, $password, STORE_OWNER_EMAIL_ADDRESS);
             $pEmail = new Mail($Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname'), $Qcheck->valueProtected('customers_email_address'), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, sprintf(OSCOM::getDef('email_password_reminder_subject'), STORE_NAME));
             $pEmail->setBodyPlain($email_text);
             $pEmail->send();
             $OSCOM_MessageStack->add('LogIn', OSCOM::getDef('success_password_forgotten_sent'), 'success');
         }
         OSCOM::redirect(OSCOM::getLink(null, null, 'LogIn', 'SSL'));
     } else {
         $OSCOM_MessageStack->add('PasswordForgotten', OSCOM::getDef('error_password_forgotten_no_email_address_found'));
     }
 }
コード例 #2
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $application->setPageTitle(sprintf(OSCOM::getDef('index_heading'), STORE_NAME));
     $application->setPageContent('product_listing.php');
     if (is_numeric($_GET['Manufacturers'])) {
         Registry::set('Manufacturer', new Manufacturer($_GET['Manufacturers']));
         $OSCOM_Manufacturer = Registry::get('Manufacturer');
         $application->setPageTitle($OSCOM_Manufacturer->getTitle());
         // HPDL        $application->setPageImage('manufacturers/' . $OSCOM_Manufacturer->getImage());
         if ($OSCOM_Service->isStarted('Breadcrumb')) {
             $OSCOM_Breadcrumb->add($OSCOM_Manufacturer->getTitle(), OSCOM::getLink());
         }
         Registry::set('Products', new Products());
         $OSCOM_Products = Registry::get('Products');
         $OSCOM_Products->setManufacturer($OSCOM_Manufacturer->getID());
         if (isset($_GET['filter']) && is_numeric($_GET['filter']) && $_GET['filter'] > 0) {
             $OSCOM_Products->setCategory($_GET['filter']);
         }
         if (isset($_GET['sort']) && !empty($_GET['sort'])) {
             if (strpos($_GET['sort'], '|d') !== false) {
                 $OSCOM_Products->setSortBy(substr($_GET['sort'], 0, -2), '-');
             } else {
                 $OSCOM_Products->setSortBy($_GET['sort']);
             }
         }
     } else {
         OSCOM::redirect(OSCOM::getLink(OSCOM::getDefaultSite(), OSCOM::getDefaultSiteApplication()));
     }
 }
コード例 #3
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_PaymentModule = Registry::get('PaymentModule');
     $OSCOM_PaymentModule->process();
     OSCOM::redirect(OSCOM::getLink(null, null, 'Success', 'SSL'));
 }
コード例 #4
0
ファイル: Add.php プロジェクト: digitaldevelopers/oscommerce
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $requested_product = null;
     if (count($_GET) > 2) {
         $requested_product = basename(key(array_slice($_GET, 2, 1, true)));
         if ($requested_product == 'Add') {
             unset($requested_product);
             if (count($_GET) > 3) {
                 $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (Product::checkEntry($requested_product)) {
             $OSCOM_Product = new Product($requested_product);
             if ($OSCOM_Product->isTypeActionAllowed('AddToShoppingCart')) {
                 if ($OSCOM_Product->hasVariants()) {
                     if (isset($_POST['variants']) && is_array($_POST['variants']) && !empty($_POST['variants'])) {
                         if ($OSCOM_Product->variantExists($_POST['variants'])) {
                             $OSCOM_ShoppingCart->add($OSCOM_Product->getProductVariantID($_POST['variants']));
                         } else {
                             OSCOM::redirect(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword()));
                         }
                     } else {
                         OSCOM::redirect(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword()));
                     }
                 } else {
                     $OSCOM_ShoppingCart->add($OSCOM_Product->getID());
                 }
             }
         }
     }
     OSCOM::redirect(OSCOM::getLink(null, 'Cart'));
 }
コード例 #5
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_PDO = Registry::get('PDO');
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     if (isset($_POST['newsletter_general']) && is_numeric($_POST['newsletter_general'])) {
         $newsletter_general = (int) $_POST['newsletter_general'];
     } else {
         $newsletter_general = 0;
     }
     // HPDL Should be moved to the customers class!
     $Qnewsletter = $OSCOM_PDO->prepare('select customers_newsletter from :table_customers where customers_id = :customers_id');
     $Qnewsletter->bindInt(':customers_id', $OSCOM_Customer->getID());
     $Qnewsletter->execute();
     if ($newsletter_general !== $Qnewsletter->valueInt('customers_newsletter')) {
         $newsletter_general = $Qnewsletter->value('customers_newsletter') == '1' ? '0' : '1';
         $Qupdate = $OSCOM_PDO->prepare('update :table_customers set customers_newsletter = :customers_newsletter where customers_id = :customers_id');
         $Qupdate->bindInt(':customers_newsletter', $newsletter_general);
         $Qupdate->bindInt(':customers_id', $OSCOM_Customer->getID());
         $Qupdate->execute();
         if ($Qupdate->rowCount() === 1) {
             $OSCOM_MessageStack->add('Account', OSCOM::getDef('success_newsletter_updated'), 'success');
         }
     }
     OSCOM::redirect(OSCOM::getLink(null, null, null, 'SSL'));
 }
コード例 #6
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Shipping = Registry::get('Shipping');
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     if (!empty($_POST['comments'])) {
         $_SESSION['comments'] = HTML::sanitize($_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);
                     OSCOM::redirect(OSCOM::getLink(null, null, null, 'SSL'));
                 }
             } else {
                 $OSCOM_ShoppingCart->resetShippingMethod();
             }
         }
     } else {
         $OSCOM_ShoppingCart->resetShippingMethod();
         OSCOM::redirect(OSCOM::getLink(null, null, null, 'SSL'));
     }
 }
コード例 #7
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $data = array();
     if (DISPLAY_PRIVACY_CONDITIONS == '1') {
         if (isset($_POST['privacy_conditions']) === false || isset($_POST['privacy_conditions']) && $_POST['privacy_conditions'] != '1') {
             $OSCOM_MessageStack->add('Create', OSCOM::getDef('error_privacy_statement_not_accepted'));
         }
     }
     if (ACCOUNT_GENDER >= 0) {
         if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) {
             $data['gender'] = $_POST['gender'];
         } else {
             $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_gender_error'));
         }
     }
     if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) {
         $data['firstname'] = $_POST['firstname'];
     } else {
         $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_first_name_error'), ACCOUNT_FIRST_NAME));
     }
     if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) >= ACCOUNT_LAST_NAME) {
         $data['lastname'] = $_POST['lastname'];
     } else {
         $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_last_name_error'), ACCOUNT_LAST_NAME));
     }
     if (ACCOUNT_DATE_OF_BIRTH == '1') {
         if (isset($_POST['dob_days']) && isset($_POST['dob_months']) && isset($_POST['dob_years']) && checkdate($_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years'])) {
             $data['dob'] = mktime(0, 0, 0, $_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years']);
         } else {
             $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_date_of_birth_error'));
         }
     }
     if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) {
         if (filter_var($_POST['email_address'], FILTER_VALIDATE_EMAIL)) {
             if (Account::checkEntry($_POST['email_address']) === false) {
                 $data['email_address'] = $_POST['email_address'];
             } else {
                 $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_email_address_exists_error'));
             }
         } else {
             $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_email_address_check_error'));
         }
     } else {
         $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
     }
     if (isset($_POST['password']) === false || isset($_POST['password']) && strlen(trim($_POST['password'])) < ACCOUNT_PASSWORD) {
         $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_password_error'), ACCOUNT_PASSWORD));
     } elseif (isset($_POST['confirmation']) === false || isset($_POST['confirmation']) && trim($_POST['password']) != trim($_POST['confirmation'])) {
         $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_password_mismatch_with_confirmation'));
     } else {
         $data['password'] = $_POST['password'];
     }
     if ($OSCOM_MessageStack->size('Create') === 0) {
         if (Account::createEntry($data)) {
             $OSCOM_MessageStack->add('Create', OSCOM::getDef('success_account_updated'), 'success');
         }
         OSCOM::redirect(OSCOM::getLink(null, null, 'Create&Success', 'SSL'));
     }
 }
コード例 #8
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = HTML::sanitize(basename($_GET['code']));
     if (!Services::exists($data) || Services::get($data, 'uninstallable') !== true) {
         OSCOM::redirect(OSCOM::getLink());
     }
 }
コード例 #9
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_MessageStack = Registry::get('MessageStack');
     if (AddressBook::deleteEntry($_GET['Delete'])) {
         $OSCOM_MessageStack->add('AddressBook', OSCOM::getDef('success_address_book_entry_deleted'), 'success');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'AddressBook', 'SSL'));
 }
コード例 #10
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     if (is_numeric($_GET['Delete'])) {
         $OSCOM_ShoppingCart->remove($_GET['Delete']);
     }
     OSCOM::redirect(OSCOM::getLink(null, 'Cart'));
 }
コード例 #11
0
 public static function onFail(Product $OSCOM_Product)
 {
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     if (!isset($_GET['Billing'])) {
         $OSCOM_NavigationHistory->setSnapshot();
         OSCOM::redirect(OSCOM::getLink(null, 'Checkout', 'Billing', 'SSL'));
     }
 }
コード例 #12
0
 public static function execute(ApplicationAbstract $application)
 {
     if (Languages::deleteGroup($_GET['group'])) {
         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');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'id=' . $_GET['id']));
 }
コード例 #13
0
 public static function execute(ApplicationAbstract $application)
 {
     if (ErrorLog::delete()) {
         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');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
コード例 #14
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $OSCOM_Customer = Registry::get('Customer');
     $data = array();
     if (ACCOUNT_GENDER >= 0) {
         if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) {
             $data['gender'] = $_POST['gender'];
         } else {
             $OSCOM_MessageStack->add('Edit', OSCOM::getDef('field_customer_gender_error'));
         }
     }
     if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) {
         $data['firstname'] = $_POST['firstname'];
     } else {
         $OSCOM_MessageStack->add('Edit', sprintf(OSCOM::getDef('field_customer_first_name_error'), ACCOUNT_FIRST_NAME));
     }
     if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) >= ACCOUNT_LAST_NAME) {
         $data['lastname'] = $_POST['lastname'];
     } else {
         $OSCOM_MessageStack->add('Edit', sprintf(OSCOM::getDef('field_customer_last_name_error'), ACCOUNT_LAST_NAME));
     }
     if (ACCOUNT_DATE_OF_BIRTH == '1') {
         if (isset($_POST['dob_days']) && isset($_POST['dob_months']) && isset($_POST['dob_years']) && checkdate($_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years'])) {
             $data['dob'] = mktime(0, 0, 0, $_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years']);
         } else {
             $OSCOM_MessageStack->add('Edit', OSCOM::getDef('field_customer_date_of_birth_error'));
         }
     }
     if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) {
         if (filter_var($_POST['email_address'], FILTER_VALIDATE_EMAIL)) {
             if (Account::checkDuplicateEntry($_POST['email_address']) === false) {
                 $data['email_address'] = $_POST['email_address'];
             } else {
                 $OSCOM_MessageStack->add('Edit', OSCOM::getDef('field_customer_email_address_exists_error'));
             }
         } else {
             $OSCOM_MessageStack->add('Edit', OSCOM::getDef('field_customer_email_address_check_error'));
         }
     } else {
         $OSCOM_MessageStack->add('Edit', sprintf(OSCOM::getDef('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
     }
     if ($OSCOM_MessageStack->size('Edit') === 0) {
         if (Account::saveEntry($data)) {
             // reset the session variables
             if (ACCOUNT_GENDER > -1) {
                 $OSCOM_Customer->setGender($data['gender']);
             }
             $OSCOM_Customer->setFirstName(trim($data['firstname']));
             $OSCOM_Customer->setLastName(trim($data['lastname']));
             $OSCOM_Customer->setEmailAddress($data['email_address']);
             $OSCOM_MessageStack->add('Account', OSCOM::getDef('success_account_updated'), 'success');
         }
         OSCOM::redirect(OSCOM::getLink(null, null, null, 'SSL'));
     }
 }
コード例 #15
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('code' => $_POST['language_import'], 'type' => $_POST['import_type']);
     if (Languages::import($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');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
コード例 #16
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('language_id' => $_GET['id'], 'group' => $_GET['group'], 'definitions' => $_POST['def']);
     if (Languages::updateDefinition($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');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group']));
 }
コード例 #17
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('name' => $_POST['categories_name'], 'image' => isset($_POST['cImageSelected']) ? $_POST['cImageSelected'] : null, 'parent_id' => $_POST['parent_id']);
     if (Categories::save(isset($_GET['id']) && is_numeric($_GET['id']) ? $_GET['id'] : null, $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');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'cid=' . $application->getCurrentCategoryID()));
 }
コード例 #18
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('id' => $_GET['id'], 'name' => $_POST['name'], 'code' => $_POST['code'], 'locale' => $_POST['locale'], 'charset' => $_POST['charset'], 'date_format_short' => $_POST['date_format_short'], 'date_format_long' => $_POST['date_format_long'], 'time_format' => $_POST['time_format'], 'text_direction' => $_POST['text_direction'], 'currencies_id' => $_POST['currencies_id'], 'numeric_separator_decimal' => $_POST['numeric_separator_decimal'], 'numeric_separator_thousands' => $_POST['numeric_separator_thousands'], 'parent_id' => $_POST['parent_id'], 'sort_order' => $_POST['sort_order'], 'set_default' => isset($_POST['default']) && $_POST['default'] == 'on');
     if (Languages::update($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');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
コード例 #19
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('zone_id' => $_POST['tax_zone_id'], 'rate' => $_POST['tax_rate'], 'description' => $_POST['tax_description'], 'priority' => $_POST['tax_priority'], 'rate' => $_POST['tax_rate'], 'tax_class_id' => $_GET['id']);
     if (TaxClasses::saveEntry(isset($_GET['rID']) && is_numeric($_GET['rID']) ? $_GET['rID'] : null, $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');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'id=' . $_GET['id']));
 }
コード例 #20
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = HTML::sanitize(basename($_GET['code']));
     if (PaymentModules::install($data)) {
         OSCOM::redirect(OSCOM::getLink(null, null, 'Save&code=' . $_GET['code']));
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
         OSCOM::redirect(OSCOM::getLink());
     }
 }
コード例 #21
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = HTML::sanitize(basename($_GET['code']));
     if (Services::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');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
コード例 #22
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('name' => $_POST['credit_card_name'], 'pattern' => $_POST['pattern'], 'status' => isset($_POST['credit_card_status']) && $_POST['credit_card_status'] == '1' ? 1 : 0, 'sort_order' => $_POST['sort_order']);
     if (CreditCards::save(isset($_GET['id']) && is_numeric($_GET['id']) ? $_GET['id'] : null, $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');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
コード例 #23
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('name' => $_POST['zone_name'], 'code' => $_POST['zone_code'], 'country_id' => $_GET['id']);
     if (Countries::saveZone(isset($_GET['zID']) && is_numeric($_GET['zID']) ? $_GET['zID'] : null, $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');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'id=' . $_GET['id']));
 }
コード例 #24
0
 public static function execute(ApplicationAbstract $application)
 {
     $parent_id = $application->getTree()->getParentID($_GET['id']);
     if (Categories::delete($_GET['id'])) {
         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');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'cid=' . $parent_id));
 }
コード例 #25
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('configuration' => $_POST['configuration']);
     if (Services::save($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');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
コード例 #26
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('zone_name' => $_POST['zone_name'], 'zone_description' => $_POST['zone_description']);
     if (ZoneGroups::save(isset($_GET['id']) && is_numeric($_GET['id']) ? $_GET['id'] : null, $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');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
コード例 #27
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('key' => key($_POST['configuration']), 'value' => $_POST['configuration'][key($_POST['configuration'])]);
     if (Configuration::saveEntry($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');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'id=' . $_GET['id']));
 }
コード例 #28
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('group' => $_POST['defgroup'], 'key' => $_POST['key'], 'values' => $_POST['value']);
     if (Languages::insertDefinition($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');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'id=' . $_GET['id'] . (isset($_GET['group']) ? '&group=' . $_GET['group'] : '')));
 }
コード例 #29
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('id' => isset($_GET['id']) && is_numeric($_GET['id']) ? $_GET['id'] : null, 'title' => $_POST['title'], 'code' => $_POST['code'], 'symbol_left' => $_POST['symbol_left'], 'symbol_right' => $_POST['symbol_right'], 'decimal_places' => $_POST['decimal_places'], 'value' => $_POST['value'], 'set_default' => isset($_POST['default']) && $_POST['default'] == 'on' || isset($_POST['is_default']) && $_POST['is_default'] == 'true' && $_POST['code'] != DEFAULT_CURRENCY);
     if (Currencies::save($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');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
コード例 #30
0
 protected function initialize()
 {
     $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()) {
         OSCOM::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 (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
                 $OSCOM_Customer->setEmailAddress(trim($_POST['email']));
             } else {
                 $OSCOM_MessageStack->add('Cart', OSCOM::getDef('field_customer_email_address_check_error'));
                 OSCOM::redirect(OSCOM::getLink(null, 'Cart'));
             }
         } else {
             $OSCOM_MessageStack->add('Cart', sprintf(OSCOM::getDef('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
             OSCOM::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'] = HTML::sanitize($_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'));
     }
 }