Jump to content
Latest News: (loading..)

fin_anorak

Members
  • Content count

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. It just for admins, and htaccess is enabled. Should be secure enough. Shouldn't it?
  2. It seems to be working now. Doing it via a database table did not the trick. It feels a little bit like “What was first: The chicken or the egg”. After each page redirection all Session variables - even the database connection - are lost. I resolved this problem by passing the countrycode variable via the URL. Adding a lit bit code to the “HTML href link wrapper function” did the trick: if ( strpos($link, '?') !== false ) { $link .= '&DB='. $countrycode; }else{ $link .= '?DB='. $countrycode; } return $link; This way the countrycode value is application-wide available. Thanks again.
  3. Hi Phil thank you for the post, but this doesn't help me. I need this information from the option field to access exactly these databases you mentioned. The administrator can choose, which databases he want to administrate. I need a possibility to save this informations temporarily, so that they are available during the logon process in the admin area. Cookies are not possible, because these values are just available after a reload of the page. Session is not possible because they destroy and recreate them during the logon process. So What's left?
  4. Tank’s Guys for your interesting response, I understand. Storing this information in a Session param, is what I initially want to do. But during the logon process this information are gonna lost. How can I approach this problem correctly? How can I store something in a session, so that the information are persistent? Thanks in advanced
  5. I have an option field. Write the result into a tmp file, and redirect then to the selected database in application_top.php according of the result in the option field. Here are my index.php and application_top.php: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ //Check if OK button is clicked if (isset($_POST['submit']) || (isset($_COOKIE['osCAdminID']))){ if(!empty($_POST['DB'])) { $content = json_encode($_POST['DB']); file_put_contents('tmp/db.tmp', $content); //write the result of the option field for later use in application_top.php } require('includes/application_top.php'); $languages = tep_get_languages(); $languages_array = array(); $languages_selected = DEFAULT_LANGUAGE; for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $languages_array[] = array('id' => $languages[$i]['code'], 'text' => $languages[$i]['name']); if ($languages[$i]['directory'] == $language) { $languages_selected = $languages[$i]['code']; } } require(DIR_WS_INCLUDES . 'template_top.php'); ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2" height="40"> <tr> <td class="pageHeading"><?php echo STORE_NAME; ?></td> <?php if (sizeof($languages_array) > 1) { ?> <td class="pageHeading" align="right"><?php echo tep_draw_form('adminlanguage', FILENAME_DEFAULT, '', 'get') . tep_draw_pull_down_menu('language', $languages_array, $languages_selected, 'onchange="this.form.submit();"') . tep_hide_session_id() . '</form>'; ?></td> <?php } ?> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php if ( defined('MODULE_ADMIN_DASHBOARD_INSTALLED') && tep_not_null(MODULE_ADMIN_DASHBOARD_INSTALLED) ) { $adm_array = explode(';', MODULE_ADMIN_DASHBOARD_INSTALLED); $col = 0; for ( $i=0, $n=sizeof($adm_array); $i<$n; $i++ ) { $adm = $adm_array[$i]; $class = substr($adm, 0, strrpos($adm, '.')); if ( !class_exists($class) ) { include(DIR_WS_LANGUAGES . $language . '/modules/dashboard/' . $adm); include(DIR_WS_MODULES . 'dashboard/' . $class . '.php'); } $ad = new $class(); if ( $ad->isEnabled() ) { if ($col < 1) { echo ' <tr>' . "\n"; } $col++; if ($col <= 2) { echo ' <td width="50%" valign="top">' . "\n"; } echo $ad->getOutput(); if ($col <= 2) { echo ' </td>' . "\n"; } if ( !isset($adm_array[$i+1]) || ($col == 2) ) { if ( !isset($adm_array[$i+1]) && ($col == 1) ) { echo ' <td width="50%" valign="top">&nbsp;</td>' . "\n"; } $col = 0; echo ' </tr>' . "\n"; } } } } ?> </table></td> </tr> </table> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> <?php exit; } // End of database check ****if (isset($_POST['submitDB']))*** ?> <style> #chooseDB{ width: 150px; } #DB{ width: 150px; margin: 0 auto; padding-top: 200px; } </style> <form action='' method="POST" id="DB"> Select a database:<br> <select name="DB" id="chooseDB"> <option value="us">US</option> <option value="global">Global</option> </select> <br><br> <input id="submit" type="submit" name="submit" value="Ok"> </form> </body></html> And here the application_top.php snippet: // Get database from the tmp file $countrycode = json_decode(file_get_contents('tmp/db.tmp'), TRUE); //Check if a databes has been selected. if(!$countrycode){ echo("No database selected!"); exit; } // load server configuration parameters if (file_exists('includes/local/database/' . $countrycode . '/configure.php')) { // for developers include('includes/local/database/' . $countrycode . '/configure.php'); } else { include('includes/database/' . $countrycode . '/configure.php'); }
  6. Hi all I have one shop with tow database on the same server. In the admin area you can choose, to which database you want to log in. For example: DB1 is for American conditions DB2 is for European conditions When I’m logged in, in the admin area to e.g. DB1 everything works as expected. Now, a second one logged in to the same database (DB1), I’m automatically swished to db2, without any message ore error message. I'm not logged off. I’m just suddenly notice that I’m on DB2. Absolutely wired. Do I need different database credintals for each database? Or a different STORE_SESSION? Here are my both configure.php: DB1: <?php define('HTTP_SERVER', 'http://www.shop1.com'); define('HTTPS_SERVER', 'http://www.shop1.com'); define('ENABLE_SSL', false); define('HTTP_COOKIE_DOMAIN', ''); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', '/catalog/admin'); define('HTTPS_COOKIE_PATH', '/catalog/admin/'); define('HTTP_CATALOG_SERVER', 'http://www.shop1.com'); define('HTTPS_CATALOG_SERVER', 'http://www.shop1.com'); define('ENABLE_SSL_CATALOG', 'false'); define('DIR_FS_DOCUMENT_ROOT', '/var/customers/webs/web33/shop1/catalog/'); define('DIR_WS_ADMIN', '/catalog/admin/'); define('DIR_WS_HTTPS_ADMIN', '/catalog/admin/'); define('DIR_FS_ADMIN', '/var/customers/webs/web33/shop1/catalog/admin/'); define('DIR_WS_CATALOG', '/catalog/'); define('DIR_WS_HTTPS_CATALOG', '/catalog/'); define('DIR_FS_CATALOG', '/var/customers/webs/web33/shop1/catalog/'); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/'); define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/'); define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', 'web33sql1'); define('DB_SERVER_PASSWORD', '123456'); define('DB_DATABASE', 'web33sql1'); //<-db1 define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', 'mysql'); define('CFG_TIME_ZONE', 'America/New_York'); ?> Db2: <?php define('HTTP_SERVER', 'http://www.shop1.com'); define('HTTPS_SERVER', 'http://www.shop1.com'); define('ENABLE_SSL', false); define('HTTP_COOKIE_DOMAIN', ''); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', '/catalog/admin'); define('HTTPS_COOKIE_PATH', '/catalog/admin/'); define('HTTP_CATALOG_SERVER', 'http://www.shop1.com'); define('HTTPS_CATALOG_SERVER', 'http://www.shop1.com'); define('ENABLE_SSL_CATALOG', 'false'); define('DIR_FS_DOCUMENT_ROOT', '/var/customers/webs/web33/shop1/catalog/'); define('DIR_WS_ADMIN', '/catalog/admin/'); define('DIR_WS_HTTPS_ADMIN', '/catalog/admin/'); define('DIR_FS_ADMIN', '/var/customers/webs/web33/shop1/catalog/admin/'); define('DIR_WS_CATALOG', '/catalog/'); define('DIR_WS_HTTPS_CATALOG', '/catalog/'); define('DIR_FS_CATALOG', '/var/customers/webs/web33/shop1/catalog/'); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/'); define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/'); define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', 'web33sql1'); define('DB_SERVER_PASSWORD', '123456'); define('DB_DATABASE', 'web33sql2'); //<-db2 define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', 'mysql'); define('CFG_TIME_ZONE', 'America/New_York'); ?> Thanks in advanced for any help
  7. fin_anorak

    Can't install shipping module

    Thanks Jim for your quick response. That did the trick. The brocken module was mzmt.php. Regards fin
  8. In the admin area, when I click the shipping module, it shows 7 Modules to install. (see pics) When I click the buttonto install a module, only the already installed modules are displayed. I'm missing the "Install modules area" which should shows me the module which i can istall. The file directory /admin/includes/modules/shipping is "loaded" (see pics) I have no idea what’s wrong here? Any help is highly appreciated. shipping_module.pdf
×