Exemplo n.º 1
0
require 'includes/classes/language.php';
$osC_Language = new osC_Language_Admin();
if (isset($_GET['language']) && !empty($_GET['language'])) {
    $osC_Language->set($_GET['language']);
}
$osC_Language->loadIniFile();
header('Content-Type: text/html; charset=' . $osC_Language->getCharacterSet());
osc_setlocale(LC_TIME, explode(',', $osC_Language->getLocale()));
// define our localization functions
require 'includes/functions/localization.php';
// initialize the message stack for output messages
require '../includes/classes/message_stack.php';
$osC_MessageStack = new messageStack();
$osC_MessageStack->loadFromSession();
// entry/item info classes
require 'includes/classes/object_info.php';
// email class
require '../includes/classes/mail.php';
// file uploading class
require 'includes/classes/upload.php';
// check if a default currency is set
if (!defined('DEFAULT_CURRENCY')) {
    $osC_MessageStack->add('header', $osC_Language->get('ms_error_no_default_currency'), 'error');
}
// check if a default language is set
if (!defined('DEFAULT_LANGUAGE')) {
    $osC_MessageStack->add('header', ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
}
if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
    $osC_MessageStack->add('header', $osC_Language->get('ms_warning_uploads_disabled'), 'warning');
}
Exemplo n.º 2
0
    $cPath_array = zen_parse_category_path($cPath);
    $cPath = implode('_', $cPath_array);
    $current_category_id = $cPath_array[sizeof($cPath_array) - 1];
} else {
    $current_category_id = 0;
}
// default open navigation box
if (!$_SESSION['selected_box']) {
    $_SESSION['selected_box'] = 'configuration';
}
if (isset($_GET['selected_box'])) {
    $_SESSION['selected_box'] = $_GET['selected_box'];
}
// check if a default currency is set
if (!defined('DEFAULT_CURRENCY')) {
    $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
}
// check if a default language is set
if (!defined('DEFAULT_LANGUAGE')) {
    $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
}
if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
    $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
}
// set demo message
if (zen_get_configuration_key_value('ADMIN_DEMO') == '1') {
    if (zen_admin_demo()) {
        $messageStack->add(ADMIN_DEMO_ACTIVE, 'warning');
    } else {
        $messageStack->add(ADMIN_DEMO_ACTIVE_EXCLUSION, 'warning');
    }
Exemplo n.º 3
0
// split-page-results
require DIR_WS_CLASSES . 'split_page_results.php';
// entry/item info classes
require DIR_WS_CLASSES . 'object_info.php';
// email classes
require DIR_WS_CLASSES . 'mime.php';
require DIR_WS_CLASSES . 'email.php';
// file uploading class
require DIR_WS_CLASSES . 'upload.php';
// include the language translations
// BOF: [TiM's osC Solutions] Display english for missing language files
if (file_exists(DIR_WS_LANGUAGES . $language . '/core.php')) {
    require_once DIR_WS_LANGUAGES . $language . '/core.php';
} else {
    if (file_exists(DIR_WS_LANGUAGES . $language . '/core.php')) {
        $messageStack->add('Missing language file (' . DIR_WS_LANGUAGES . $language . '/core.php). Using english instead.', 'error');
        require_once DIR_WS_LANGUAGES . $language . '/core.php';
    }
}
$current_page = basename($PHP_SELF);
if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {
    include_once DIR_WS_LANGUAGES . $language . '/' . $current_page;
} else {
    if (file_exists(DIR_WS_LANGUAGES . 'english/' . $current_page)) {
        $messageStack->add('Missing language file (' . DIR_WS_LANGUAGES . $language . '/' . $current_page . '). Using english instead.', 'error');
        include_once DIR_WS_LANGUAGES . 'english/' . $current_page;
    }
}
// EOF: [TiM's osC Solutions] Display english for missing language files
// BOF: [TiM's osC Solutions] ISO-8859-1/UTF-8 dual support
switch (strtolower(CHARSET)) {
Exemplo n.º 4
0
                            unset($htaccess_array[$i]);
                        }
                    }
                    $fp = fopen(DIR_FS_ADMIN . '.htaccess', 'w');
                    fwrite($fp, implode("\n", $htaccess_array));
                    fclose($fp);
                }
            }
            tep_redirect(tep_href_link(FILENAME_ADMINISTRATORS));
            break;
    }
}
$secMessageStack = new messageStack();
if (is_array($htpasswd_array)) {
    if (empty($htpasswd_array)) {
        $secMessageStack->add(sprintf(HTPASSWD_INFO, implode('<br />', $authuserfile_array)), 'error');
    } else {
        $secMessageStack->add(HTPASSWD_SECURED, 'success');
    }
} else {
    $secMessageStack->add(HTPASSWD_PERMISSIONS, 'error');
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html <?php 
echo HTML_PARAMS;
?>
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo CHARSET;
Exemplo n.º 5
0
 case 'welcome':
     if (isset($_POST['license_consent']) && $_POST['license_consent'] == 'disagree') {
         header('location: index.php');
     }
     $include_template = 'template_welcome.php';
     define('PAGE_TITLE', TITLE_WELCOME);
     break;
 case 'inspect':
     // check for decline
     if ($_POST['license'] == 'disagree') {
         header('location: http://www.google.com');
     }
     // start the checks for minimum requirements
     //PHP Version Check
     if (version_compare(PHP_VERSION, '5.2.0', '<')) {
         $error = $messageStack->add(INSTALL_ERROR_PHP_VERSION, 'error');
     }
     // Check Register Globals
     $register_globals = ini_get("register_globals");
     if ($register_globals != '' && $register_globals != '0' && strtoupper($register_globals) != 'OFF') {
         $error = $messageStack->add(INSTALL_ERROR_REGISER_GLOBALS, 'error');
     }
     // SAFE MODE check
     if (ini_get("safe_mode")) {
         $error = $messageStack->add(INSTALL_ERROR_SAFE_MODE, 'error');
     }
     // Support for Sessions check
     if (@(!extension_loaded('session'))) {
         $error = $messageStack->add(INSTALL_ERROR_SESSION_SUPPORT, 'error');
     }
     //Check for OpenSSL support (only relevant for Apache
 * Add products_family field to the products table
 * 
 * @package ZenCart
 * @author Joe McFrederick
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */
if (!class_exists('messageStack')) {
    include '../../classes/message_stack.php';
}
if (!is_object($reloadedStack)) {
    $reloadedStack = new messageStack();
}
//Auto install check
$reloadedRelatedCheck = $db->Execute("SHOW COLUMNS FROM " . TABLE_PRODUCTS . " LIKE 'products_family'");
if (($reloadedRelatedCheck->RecordCount() < 1 or !defined('SHOW_PRODUCT_INFO_COLUMNS_RELATED_PRODUCTS')) and basename($_SERVER['PHP_SELF']) == 'index.php') {
    $reloadedStack->add('Related Products <b>not installed</b><a href="index.php?install_related_products=yes">[Click to Install]</a>');
}
/**
 * Install configuration into database
 * @param none
 */
function reloaded_related_install()
{
    global $db, $reloadedStack;
    // Maintenance to remove old configuration values
    $keys = reloaded_related_keys();
    $db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key IN ('" . implode("', '", $keys) . "')");
    unset($keys);
    // Get Configuration Group ID for Configuration->Product Info
    $configuration_group = $db->Execute("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title='Product Info'");
    if ($configuration_group->RecordCount() > 0) {
$process = false;
if (isset($_POST['action']) && $_POST['action'] == 'process') {
    $process = true;
    $store_name = xtc_db_prepare_input($_POST['STORE_NAME']);
    $email_from = xtc_db_prepare_input($_POST['EMAIL_ADRESS_FROM']);
    $zone_setup = xtc_db_prepare_input($_POST['ZONE_SETUP']);
    $company = xtc_db_prepare_input($_POST['COMPANY']);
    $street_address = xtc_db_prepare_input($_POST['STREET_ADRESS']);
    $postcode = xtc_db_prepare_input($_POST['POST_CODE']);
    $city = xtc_db_prepare_input($_POST['CITY']);
    $country = xtc_db_prepare_input($_POST['COUNTRY']);
    $telephone_number = xtc_db_prepare_input($_POST['TELEPHONE']);
    $error = false;
    if (strlen($store_name) < '3') {
        $error = true;
        $messageStack->add('install_shopinfo_step', ENTRY_STORE_NAME_ERROR);
    }
    if (strlen($company) < '2') {
        $error = true;
        $messageStack->add('install_shopinfo_step', ENTRY_COMPANY_NAME_ERROR);
    }
    if (strlen($email_from) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
        $error = true;
        $messageStack->add('install_shopinfo_step', ENTRY_EMAIL_ADDRESS_FROM_ERROR);
    } elseif (xtc_validate_email($email_from) == false) {
        $error = true;
        $messageStack->add('install_shopinfo_step', ENTRY_EMAIL_ADDRESS_FROM_CHECK_ERROR);
    }
    if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
        $error = true;
        $messageStack->add('install_shopinfo_step', ENTRY_POST_CODE_ERROR);
Exemplo n.º 8
0
    define($Qcfg->value('cfgKey'), $Qcfg->value('cfgValue'));
}
$Qcfg->freeResult();
// include functions
require 'includes/functions/general.php';
require 'includes/functions/html_output.php';
// include and start the services
require 'includes/classes/services.php';
$osC_Services = new osC_Services();
$osC_Services->startServices();
// Maintenance Mode
if (MAINTENANCE_MODE == 1) {
    //login maintenance mode
    if (isset($_GET['maintenance']) && $_GET['maintenance'] == 'login') {
        require 'includes/classes/administrators.php';
        if (toC_Administrators::login($_POST['user_name'], $_POST['user_password']) === false) {
            $messageStack->add('maintenance', $osC_Language->get('error_admin_login_no_match'));
        } else {
            osc_redirect(osc_href_link(FILENAME_DEFAULT));
        }
    }
    //logoff maintenance mode
    if (isset($_GET['maintenance']) && $_GET['maintenance'] == 'logoff') {
        unset($_SESSION['admin']);
        osc_redirect(osc_href_link(FILENAME_DEFAULT));
    }
    if (!isset($_SESSION['admin']) || empty($_SESSION['admin'])) {
        require 'templates/system/offline.php';
        exit;
    }
}
 $firstname = xtc_db_prepare_input($_POST['FIRST_NAME']);
 $lastname = xtc_db_prepare_input($_POST['LAST_NAME']);
 $email_address = xtc_db_prepare_input($_POST['EMAIL_ADRESS']);
 $street_address = xtc_db_prepare_input($_POST['STREET_ADRESS']);
 $postcode = xtc_db_prepare_input($_POST['POST_CODE']);
 $city = xtc_db_prepare_input($_POST['CITY']);
 $zone_id = xtc_db_prepare_input($_POST['zone_id']);
 $state = xtc_db_prepare_input($_POST['STATE']);
 $country = xtc_db_prepare_input($_POST['COUNTRY']);
 $telephone = xtc_db_prepare_input($_POST['TELEPHONE']);
 $password = xtc_db_prepare_input($_POST['PASSWORD']);
 $confirmation = xtc_db_prepare_input($_POST['PASSWORD_CONFIRMATION']);
 $error = false;
 if (!isset($gender)) {
     $error = true;
     $messageStack->add('install_admin_step', ENTRY_GENDER_ERROR);
 }
 if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
     $error = true;
     $messageStack->add('install_admin_step', ENTRY_FIRST_NAME_ERROR);
 }
 if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
     $error = true;
     $messageStack->add('install_admin_step', ENTRY_LAST_NAME_ERROR);
 }
 if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
     $error = true;
     $messageStack->add('install_admin_step', ENTRY_EMAIL_ADDRESS_ERROR);
 } elseif (xtc_validate_email($email_address) == false) {
     $error = true;
     $messageStack->add('install_admin_step', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
Exemplo n.º 10
0
    $selected_box = 'configuration';
}
if (isset($_GET['selected_box'])) {
    $selected_box = $_GET['selected_box'];
}
/*
// the following cache blocks are used in the Tools->Cache section
// ('language' in the filename is automatically replaced by available languages)
  $cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true),
                        array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true),
                        array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true)
                       );
*/
// check if a default currency is set
if (!defined('DEFAULT_CURRENCY')) {
    $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
}
// check if a default language is set
if (!defined('DEFAULT_LANGUAGE')) {
    $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
}
if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
    $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
}
require DIR_FS_FUNCTIONS . 'admins.php';
if (!GetAdminUser()) {
    include DIR_FS_INCLUDES . 'login.php';
    exit;
}
if (!CheckAdminPermission(GetAdminUser(), defined('ADMIN_PERMISSION') ? preg_split('/,/', ADMIN_PERMISSION) : GetAdminFilePermissions(preg_replace('|.*/|', '', $_SERVER['SCRIPT_FILENAME'])))) {
    echo "Access denied for " . GetAdminUser() . "\n";
    if (NOT_USE_AJAX || IS_AJAX_PROCESSING) {
        if (PERIOD_DOWN_FOR_MAINTENANCE != EMPTY_STRING) {
            $ErrorMessage .= ltrim(PERIOD_DOWN_FOR_MAINTENANCE);
        }
        require_once DIR_FS_INC . 'olc_image.inc.php';
        if ($IsAdminFunction or USE_AJAX) {
            global $messageStack;
            if (!is_object($messageStack)) {
                // initialize the message stack for output messages
                if (IS_ADMIN_FUNCTION) {
                    $file = 'table_block';
                } else {
                    $file = 'boxes';
                }
                require_once DIR_WS_CLASSES . $file . PHP;
                require_once DIR_WS_CLASSES . 'message_stack.php';
                $messageStack = new messageStack();
            }
            if ($IsAdminFunction) {
                $messageStack->add($ErrorMessage, 'warning');
            } else {
                $messageStack->add('maintenance', $ErrorMessage, 'warning');
            }
        } else {
            require_once DIR_FS_INC . 'olc_output_warning.inc.php';
            require_once DIR_WS_CLASSES . 'boxes.php';
            olc_output_warning($ErrorMessage, true);
        }
    }
}
//  W. Kaiser EOF: WebMakers.com Added: Down for Maintenance
Exemplo n.º 12
0
    $cPath_array = xos_parse_category_path($cPath);
    $cPath = implode('_', $cPath_array);
    $current_category_id = $current_page_id = $cPath_array[sizeof($cPath_array) - 1];
} else {
    $current_category_id = $current_page_id = 0;
}
// default open navigation box
//  if (!isset($_SESSION['selected_box'])) {
//    $_SESSION['selected_box'] = 'configuration';
//  }
if (isset($_GET['selected_box'])) {
    $_SESSION['selected_box'] = $_GET['selected_box'];
}
// check if a default currency is set
if (!defined('DEFAULT_CURRENCY')) {
    $messageStack->add('header', ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
}
// check if a default language is set
if (!defined('DEFAULT_LANGUAGE')) {
    $messageStack->add('header', ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
}
if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
    $messageStack->add('header', WARNING_FILE_UPLOADS_DISABLED, 'warning');
}
// warn the admin if the site is offline
if (SITE_OFFLINE == 'true') {
    $messageStack->add('header', WARNING_SITE_IS_OFFLINE, 'warning');
}
// check if the 'install' directory exists, and warn of its existence
if (file_exists(DIR_FS_DOCUMENT_ROOT . 'install')) {
    $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
Exemplo n.º 13
0
     $new_qty = 0;
     $adjust_max = 'true';
 } else {
     // adjust quantity if needed
     if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
         $adjust_max = 'true';
         $new_qty = $add_max - $cart_qty;
     }
 }
 if (zen_get_products_quantity_order_max($_POST['products_id']) == 1 and $_SESSION['cart']->in_cart_mixed($_POST['products_id']) == 1) {
     // do not add
 } else {
     // process normally
     // bof: set error message
     if ($the_list != '') {
         $messageStack->add('header', ERROR_CORRECTIONS_HEADING . $the_list, 'error');
     } else {
         // process normally
         // iii 030813 added: File uploading: save uploaded files with unique file names
         $real_ids = $_POST['id'];
         if ($_GET['number_of_uploads'] > 0) {
             require DIR_WS_CLASSES . 'upload.php';
             for ($i = 1, $n = $_GET['number_of_uploads']; $i <= $n; $i++) {
                 if (zen_not_null($_FILES['id']['tmp_name'][TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i]]) and $_FILES['id']['tmp_name'][TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i]] != 'none') {
                     $products_options_file = new upload('id');
                     $products_options_file->set_destination(DIR_FS_UPLOADS);
                     if ($products_options_file->parse(TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i])) {
                         $products_image_extention = substr($products_options_file->filename, strrpos($products_options_file->filename, '.'));
                         if ($_SESSION['customer_id']) {
                             $db->Execute("insert into " . TABLE_FILES_UPLOADED . " (sesskey, customers_id, files_uploaded_name) values('" . zen_session_id() . "', '" . $_SESSION['customer_id'] . "', '" . zen_db_input($products_options_file->filename) . "')");
                         } else {
    $current_category_id = 0;
}
// default open navigation box
if (!isset($_SESSION['selected_box'])) {
    $_SESSION['selected_box'] = 'configuration';
} else {
    if (!empty($_GET['selected_box'])) {
        $_SESSION['selected_box'] = $_GET['selected_box'];
    }
}
// the following cache blocks are used in the Tools->Cache section
// ('language' in the filename is automatically replaced by available languages)
$cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true), array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true), array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true));
// check if a default currency is set
if (!defined('DEFAULT_CURRENCY')) {
    $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
}
// check if a default language is set
if (!defined('DEFAULT_LANGUAGE')) {
    $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
}
// for Customers Status
xtc_get_customers_statuses();
$pagename = strtok($current_page, '.');
if (!isset($_SESSION['customer_id'])) {
    xtc_redirect(xtc_href_link(FILENAME_LOGIN));
}
if (xtc_check_permission($pagename) == '0') {
    xtc_redirect(xtc_href_link(FILENAME_LOGIN));
}
// Include Template Engine
Exemplo n.º 15
0
//set the default timezone
if (defined('STORE_TIME_ZONE') && STORE_TIME_ZONE) {
    if (!date_default_timezone_set(STORE_TIME_ZONE)) {
        date_default_timezone_set('UTC');
    }
}
// include functions
require 'includes/functions/general.php';
require 'includes/functions/html_output.php';
// include and start the services
require 'includes/classes/services.php';
$osC_Services = new osC_Services();
$osC_Services->startServices();
// check database connection
if (!$osC_Database->isConnected()) {
    $messageStack->add('db_error', $osC_Language->get('db_connection_failed'));
}
// Maintenance Mode
if (MAINTENANCE_MODE == 1) {
    //login maintenance mode
    if (isset($_GET['maintenance']) && $_GET['maintenance'] == 'login') {
        require 'includes/classes/administrators.php';
        if (toC_Administrators::login($_POST['user_name'], $_POST['user_password']) === false) {
            $messageStack->add('maintenance', $osC_Language->get('error_admin_login_no_match'));
        } else {
            osc_redirect(osc_href_link(FILENAME_DEFAULT));
        }
    }
    //logoff maintenance mode
    if (isset($_GET['maintenance']) && $_GET['maintenance'] == 'logoff') {
        unset($_SESSION['admin']);
Exemplo n.º 16
0
    $current_store_category_id = 0;
}
// default open navigation box
if (!smn_session_is_registered('selected_box')) {
    smn_session_register('selected_box');
    $selected_box = 'configuration';
}
if (isset($_GET['selected_box'])) {
    $selected_box = $_GET['selected_box'];
}
// the following cache blocks are used in the Tools->Cache section
// ('language' in the filename is automatically replaced by available languages)
$cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true), array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true), array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true));
// check if a default currency is set
if (!defined('DEFAULT_CURRENCY')) {
    $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
}
// check if a default language is set
if (!defined('DEFAULT_LANGUAGE')) {
    $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
}
if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
    $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
}
// set the store_id
if (smn_session_is_registered('login_id')) {
    $store_id_check = smn_db_query("select admin_id, admin_groups_id, store_id  from " . TABLE_ADMIN . " where admin_id = '" . $login_id . "'");
    $check = smn_db_fetch_array($store_id_check);
    $switch_store_id = $check['store_id'];
    if (!smn_session_is_registered('switch_store_id')) {
        smn_session_register('switch_store_id');
Exemplo n.º 17
0
}
$osC_Language->load();
header('Content-Type: text/html; charset=' . CHARSET);
setlocale(LC_TIME, LANGUAGE_LOCALE);
$osC_Language->load(basename($_SERVER['SCRIPT_FILENAME']));
// define our localization functions
require 'includes/functions/localization.php';
// Include validation functions (right now only email address)
require 'includes/functions/validations.php';
// initialize the message stack for output messages
require '../includes/classes/message_stack.php';
$osC_MessageStack = new messageStack();
$osC_MessageStack->loadFromSession();
// entry/item info classes
require 'includes/classes/object_info.php';
// email classes
require 'includes/classes/mime.php';
require 'includes/classes/email.php';
// file uploading class
require 'includes/classes/upload.php';
// check if a default currency is set
if (!defined('DEFAULT_CURRENCY')) {
    $osC_MessageStack->add('header', ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
}
// check if a default language is set
if (!defined('DEFAULT_LANGUAGE')) {
    $osC_MessageStack->add('header', ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
}
if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
    $osC_MessageStack->add('header', WARNING_FILE_UPLOADS_DISABLED, 'warning');
}
Exemplo n.º 18
0
 }
 if (tep_not_null($email)) {
     $email_enquiry .= "\n\n" . ENTRY_CONTACT_US_EMAIL . ' ' . $email;
 }
 if (tep_not_null($phone)) {
     $email_enquiry .= "\n\n" . ENTRY_CONTACT_US_PHONE_NUMBER . ' ' . $phone;
 }
 $email_enquiry .= "\n\n" . ENTRY_CONTACT_US_IP_ADDRESS . ' ' . tep_get_ip_address();
 $captcha_check = false;
 if ((int) $captcha == (int) $captcha_value) {
     $captcha_check = true;
 }
 $is_blacklisted = tep_check_blacklist();
 if ($is_blacklisted) {
     $error = true;
     $messageStack->add('header', strip_tags(ENTRY_BLACKLIST_CONTACT_US_ERROR));
 } elseif ($captcha_check == false) {
     $error = true;
     $messageStack->add('header', ENTRY_CAPTCHA_CHECK_ERROR);
 } elseif (!tep_validate_email($email)) {
     $error = true;
     $messageStack->add('header', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
 }
 if (!$error) {
     $contact_us_subject = ENTRY_CONTACT_US_EMAIL_SUBJECT;
     $contact_us_to_email = STORE_OWNER_EMAIL_ADDRESS;
     if (isset($HTTP_POST_VARS['subject'])) {
         $subjects_check_query = tep_db_query("select count(*) as total from " . TABLE_SUBJECTS . "");
         $subjects_check = tep_db_fetch_array($subjects_check_query);
         if ($subjects_check['total'] > 0) {
             $subject_info_query = tep_db_query("select subjects_name, subjects_email from " . TABLE_SUBJECTS . " where subjects_id = '" . (int) $HTTP_POST_VARS['subject'] . "' and language_id = '" . (int) $languages_id . "' and status = '1'");
Exemplo n.º 19
0
//set the default timezone
if (defined('STORE_TIME_ZONE') && STORE_TIME_ZONE) {
    if (!date_default_timezone_set(STORE_TIME_ZONE)) {
        date_default_timezone_set('UTC');
    }
}
// include functions
require 'includes/functions/general.php';
require 'includes/functions/html_output.php';
// include and start the services
require 'includes/classes/services.php';
$osC_Services = new osC_Services();
$osC_Services->startServices();
// check database connection
if (!$osC_Database->isConnected()) {
    $messageStack->add('db_error', $osC_Language->get('db_connection_failed'));
}
$messageStack->add('db_error', "<b>Info:</b>To login as an admin, please use admin@admin.com and password as password");
// Maintenance Mode
if (MAINTENANCE_MODE == 1) {
    //login maintenance mode
    if (isset($_GET['maintenance']) && $_GET['maintenance'] == 'login') {
        require 'includes/classes/administrators.php';
        if (toC_Administrators::login($_POST['user_name'], $_POST['user_password']) === false) {
            $messageStack->add('maintenance', $osC_Language->get('error_admin_login_no_match'));
        } else {
            osc_redirect(osc_href_link(FILENAME_DEFAULT));
        }
    }
    //logoff maintenance mode
    if (isset($_GET['maintenance']) && $_GET['maintenance'] == 'logoff') {