YePix Posted May 15, 2022 Posted May 15, 2022 This post is only for users of the following version: https://www.oscommerce.com/forums/topic/497129-w3-oscommerce-wip/ If someone runs the standard version and is interested in a corresponding solution, just let me know. ############################################################################# Anyone who has installed the master password and uses the following settings: -- phpMyAdmin SQL Dump -- version 5.1.3 -- -- Server-Version: 8.0.29 -- PHP-Version: 7.4.28 should check if it still works. if not, 3 changes are necessary in the database and the following files. in the database (configuration) delete: MASTER_PASS_UPD further in (configuration) configuration_key = MASTER_PASS change configuration_group_id to '6' import the following sql: CREATE TABLE `master_pass` ( `pass_id` int NOT NULL, `master_password` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; INSERT INTO `master_pass` (`pass_id`, `master_password`) VALUES (1, '$P$DUtaalZRAg5bys3.I/flCi4YeQ3TNI0'); catalog/admin/master_password.php <?php require('includes/application_top.php'); require('includes/functions/' . 'password_funcs.php'); $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'save': if (isset($_GET['mPID'])) $pass_id = tep_db_prepare_input($_GET['mPID']); $master_password = tep_db_prepare_input($_POST['master_password']); $sql_data_array = array( 'master_password' => tep_encrypt_password($master_password)); if ($action == 'save') { $sql_data_array = $sql_data_array; if (empty($master_password)){ function gennewPassword ( $passwordlength = 8, $numNonAlpha = 0, $numNumberChars = 0, $useCapitalLetter = false ) { $numberChars = '123456789'; $specialChars = '!$%&=?*-:;.,+~@_'; $secureChars = 'abcdefghjkmnpqrstuvwxyz'; $stack = ''; $stack = $secureChars; if ( $useCapitalLetter == true ) $stack .= strtoupper ( $secureChars ); $count = $passwordlength - $numNonAlpha - $numNumberChars; $temp = str_shuffle ( $stack ); $stack = substr ( $temp , 0 , $count ); if ( $numNonAlpha > 0 ) { $temp = str_shuffle ( $specialChars ); $stack .= substr ( $temp , 0 , $numNonAlpha ); } if ( $numNumberChars > 0 ) { $temp = str_shuffle ( $numberChars ); $stack .= substr ( $temp , 0 , $numNumberChars ); } $stack = str_shuffle ( $stack ); return $stack; } $passwd = gennewPassword ( 8, 2, 2, true ); tep_db_query("update master_pass set master_password = '" . tep_encrypt_password($passwd) . "' where pass_id = '" . (int)$pass_id . "'"); tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_encrypt_password($passwd) . "' where configuration_key = 'MASTER_PASS'"); }else{ tep_db_perform('master_pass', $sql_data_array, 'update', "pass_id = '" . (int)$pass_id . "'"); tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_encrypt_password($master_password) . "' where configuration_key = 'MASTER_PASS'"); } } if (USE_CACHE == 'true') { tep_reset_cache_block('pass_labels'); } tep_redirect(tep_href_link('master_password.php', (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'mPID=' . $pass_id)); break; } } require('includes/template_top.php'); ?> <div class="w3-padding"> <h1 class="pageHeading"><?php echo MASTER_PASSWORT_HEADING_TITLE; ?></h1> <div class="d-flex flex-column flex-sm-row mb-3"> <div class="flex-grow-1"> <table class="w3-table w3-border w3-bordered w3-hoverable"> <thead class="w3-hover-none"> <tr class="w3-theme"> <th scope="col"><?php echo MASTER_PASSWORT_HEADING_TITLE; ?></th> </tr> </thead> <tbody> <?php $masterpass_query_raw = "select pass_id, master_password from master_pass order by pass_id"; $masterpass_query = tep_db_query($masterpass_query_raw); while ($masterpass = tep_db_fetch_array($masterpass_query)) { $masterpass_id = $masterpass['pass_id']; if ((!isset($_GET['mPID']) || (isset($_GET['mPID']) && ($_GET['mPID'] == $masterpass['pass_id']))) && !isset($mpInfo) && (substr($action, 0, 3) != 'new')) { $mpInfo = new objectInfo($masterpass); } if (isset($mpInfo) && is_object($mpInfo) && ($masterpass['pass_id'] == $mpInfo->pass_id)) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link('master_password.php', '&mPID=' . $masterpass['pass_id'] . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link('master_password.php', '&mPID=' . $masterpass['pass_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"> <?php echo MASTER_PASSWORT_TEXT_SECURE; ?></td> </tr> <?php } ?> </tbody> </table> </div> <?php $heading = ''; $contents = ''; switch ($action) { case 'edit': $heading = MASTER_PASSWORT_HEADING_TITLE . ' ' . TEXT_MASTER_PASSWORT_TITLE_EDIT; $contents = tep_draw_form('pass_labels', 'master_password.php', '&mPID=' . $mpInfo->pass_id . '&action=save', 'post', 'enctype="multipart/form-data"'); $contents .= '<tr><td>' . MASTER_PASSWORT_TEXT_EDIT_INTRO; $contents .= '<div class="mt-2 mb-3">' . tep_draw_input_field('master_password', '', 'required aria-required="true" class="w3-input w3-border"') . '</div>'; $contents .= '<hr class="hr-gr mt-2 mb-2"><div class="mb-3 mt-3">' . tep_draw_w3_button(IMAGE_SAVE, 'disk', null, 'primary', null, 'class="w3-button w3-large w3-block w3-teal"') . '</div><div class="mb-3">' . tep_draw_w3_button(IMAGE_CANCEL, 'close', tep_href_link('master_password.php', '&mPID=' . $mpInfo->pass_id), null, null, 'class="w3-button w3-large w3-block w3-theme-light"') . '</div>'; $contents .= '</td></tr>'; $contents .= '</form>'; break; default: if (isset($mpInfo) && is_object($mpInfo)) { // $heading[] = array('align' => 'center', 'text' => ' <strong>' . $mpInfo->master_password . '</strong>'); $heading = TEXT_MASTER_PASSWORT_TITLE_EDIT; $contents = '<tr><td>' . tep_draw_w3_button(IMAGE_EDIT, 'document', tep_href_link('master_password.php', '&mPID=' . $mpInfo->pass_id . '&action=edit'), null, null, 'class="w3-button w3-large w3-block w3-black mb-3"'); $contents .= '<div class="clearfix"></div>'; $contents .= '</td></tr>'; } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo '<div class="w3-quarter ms-sm-2">' . "\n" . ' <table class="w3-table w3-border w3-border-black w3-light-gray">' . ' <thead>' . ' <tr class="w3-theme">' . ' <th scope="col">'. $heading . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>' . $contents . '</tbody>' . ' </table>' . '</div>' . "\n"; } ?> </div> </div> <?php require('includes/template_bottom.php'); require('includes/application_bottom.php'); ?> catalog/admin/includes/languages/master_password.php <?php define('MASTER_PASSWORT_HEADING_TITLE', 'Masterpasswort'); define('TEXT_MASTER_PASSWORT_TITLE_EDIT', 'bearbeiten'); define('MASTER_PASSWORT_TEXT_SECURE', '** Passwort verschlüsselt **'); define('MASTER_PASSWORT_TEXT_EDIT_INTRO', 'Vergeben Sie hier das neue Masterpasswort, mit dem Sie sich, über die Shopseite, in jedes Kundenkonto einloggen können.'); ?> catalog/admin/includes/boxes/configuration.php array( 'code' => 'master_password.php', 'title' => BOX_CONFIGURATION_MASTER_PASSWORD, 'link' => tep_href_link('master_password.php') ), catalog/admin/includes/languages/german.php - or your file define('BOX_CONFIGURATION_MASTER_PASSWORD', 'Masterpasswort'); delete: catalog/admin/includes/sew_actions/encrypt_var.php catalog/admin/includes/boxes/master_password.php catalog/admin/includes/languages/modules/boxes/master_password.php
YePix Posted May 15, 2022 Author Posted May 15, 2022 file for Bootstrap frozen 2.3.4.1 catalog/admin/master_password.php is on work
YePix Posted May 15, 2022 Author Posted May 15, 2022 file for Bootstrap frozen 2.3.4.1 catalog/admin/master_password.php <?php require('includes/application_top.php'); require('includes/functions/' . 'password_funcs.php'); $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'save': if (isset($_GET['mPID'])) $pass_id = tep_db_prepare_input($_GET['mPID']); $master_password = tep_db_prepare_input($_POST['master_password']); $sql_data_array = array( 'master_password' => tep_encrypt_password($master_password)); if ($action == 'save') { $sql_data_array = $sql_data_array; if (empty($master_password)){ function gennewPassword ( $passwordlength = 8, $numNonAlpha = 0, $numNumberChars = 0, $useCapitalLetter = false ) { $numberChars = '123456789'; $specialChars = '!$%&=?*-:;.,+~@_'; $secureChars = 'abcdefghjkmnpqrstuvwxyz'; $stack = ''; $stack = $secureChars; if ( $useCapitalLetter == true ) $stack .= strtoupper ( $secureChars ); $count = $passwordlength - $numNonAlpha - $numNumberChars; $temp = str_shuffle ( $stack ); $stack = substr ( $temp , 0 , $count ); if ( $numNonAlpha > 0 ) { $temp = str_shuffle ( $specialChars ); $stack .= substr ( $temp , 0 , $numNonAlpha ); } if ( $numNumberChars > 0 ) { $temp = str_shuffle ( $numberChars ); $stack .= substr ( $temp , 0 , $numNumberChars ); } $stack = str_shuffle ( $stack ); return $stack; } $passwd = gennewPassword ( 8, 2, 2, true ); tep_db_query("update master_pass set master_password = '" . tep_encrypt_password($passwd) . "' where pass_id = '" . (int)$pass_id . "'"); tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_encrypt_password($passwd) . "' where configuration_key = 'MASTER_PASS'"); }else{ tep_db_perform('master_pass', $sql_data_array, 'update', "pass_id = '" . (int)$pass_id . "'"); tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_encrypt_password($master_password) . "' where configuration_key = 'MASTER_PASS'"); } } if (USE_CACHE == 'true') { tep_reset_cache_block('pass_labels'); } tep_redirect(tep_href_link('master_password.php', (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'mPID=' . $pass_id)); break; } } require('includes/template_top.php'); ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><h1><?php echo MASTER_PASSWORT_HEADING_TITLE; ?></h1></td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"><?php echo MASTER_PASSWORT_HEADING_TITLE; ?></td> <td class="dataTableHeadingContent" align="right"></td> </tr> <?php $masterpass_query_raw = "select pass_id, master_password from master_pass order by pass_id"; $masterpass_query = tep_db_query($masterpass_query_raw); while ($masterpass = tep_db_fetch_array($masterpass_query)) { $masterpass_id = $masterpass['pass_id']; if ((!isset($_GET['mPID']) || (isset($_GET['mPID']) && ($_GET['mPID'] == $masterpass['pass_id']))) && !isset($mpInfo) && (substr($action, 0, 3) != 'new')) { $mpInfo = new objectInfo($masterpass); } if (isset($mpInfo) && is_object($mpInfo) && ($masterpass['pass_id'] == $mpInfo->pass_id)) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link('master_password.php', '&mPID=' . $masterpass['pass_id'] . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link('master_password.php', '&mPID=' . $masterpass['pass_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"> <?php echo MASTER_PASSWORT_TEXT_SECURE; ?></td> <td class="dataTableContent" align="right"> </td> </tr> <?php } ?> <tr> <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"></td> <td class="smallText" align="right"></td> </tr> </table></td> <tr> <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <td colspan="4" class="smallText" align="right"></td> </tr> </table></td> <?php $heading = array(); $contents = array(); switch ($action) { case 'edit': $heading[] = array('text' => MASTER_PASSWORT_HEADING_TITLE . ' ' . TEXT_MASTER_PASSWORT_TITLE_EDIT); $contents = array('form' => tep_draw_form('pass_labels', 'master_password.php', '&mPID=' . $mpInfo->pass_id . '&action=save', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => MASTER_PASSWORT_TEXT_EDIT_INTRO); $contents[] = array('text' => '<br />' . tep_draw_input_field('master_password', '', 'required aria-required="true"')); $contents[] = array('align' => 'center', 'text' => '<br />' . tep_draw_button(IMAGE_SAVE, 'plus', null, 'primary')); $contents[] = array('align' => 'center', 'text' => '<br />' . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link('master_password.php', '&mPID=' . $mpInfo->pass_id))); break; default: if (isset($mpInfo) && is_object($mpInfo)) { $heading[] = array('align' => 'center', 'text' => TEXT_MASTER_PASSWORT_TITLE_EDIT); $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link('master_password.php', '&mPID=' . $mpInfo->pass_id . '&action=edit'))); } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' <td width="25%" valign="top">' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } ?> </tr> </table></td> </tr> </table> <?php require('includes/template_bottom.php'); require('includes/application_bottom.php'); ?>
YePix Posted May 18, 2022 Author Posted May 18, 2022 I uploaded it to the apps but it is not published. I have no idea what's happening with oscommerce but unfortunately nothing has changed for the better lately.
♥14steve14 Posted June 15, 2022 Posted June 15, 2022 On 5/18/2022 at 11:21 AM, YePix said: I uploaded it to the apps but it is not published. I have no idea what's happening with oscommerce but unfortunately nothing has changed for the better lately. I think you will find that lots of the developers are based in Ukraine, or where, and they have other things on their mind at the moment. REMEMBER BACKUP, BACKUP AND BACKUP
YePix Posted July 23, 2022 Author Posted July 23, 2022 Am 15.6.2022 um 13:47 schrieb 14steve14: I think you will find that lots of the developers are based in Ukraine, or where, and they have other things on their mind at the moment. And do you still think so?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.