Hallo!
Bin soeben wieder einmal in das Backes Forum gefallen....
Dabei hab ich den Beitrag über das Masterpasswort gelesen. Klappt ja so wie angegeben, nur steht da ein PW für Zugang auf Kindendaten im Klartext dort. Wehe dem, der da an böse Buben denkt, oder an einen Fehlkonfigurierten Server, der die php Dateien hergibt......
Besser wäre eine Abfrage im xtc konformen Stil des Admin PW, das als Alternativpasswort zur Verfügung steht, um als Admin in den Kundenaccount einsteigen zu können.
Folgender Code in der login.php machts möglich:
if (isset ($_GET['action']) && ($_GET['action'] == 'process')) {
$email_address = xtc_db_prepare_input($_POST['email_address']);
$password = xtc_db_prepare_input($_POST['password']);
// Check if email exists
$check_customer_query = xtc_db_query("select customers_id, customers_vat_id, customers_firstname,customers_lastname, customers_gender, customers_password, customers_email_address, customers_default_address_id from ".TABLE_CUSTOMERS." where customers_email_address = '".xtc_db_input($email_address)."' or ( customers_id = '".xtc_db_input($email_address)."' and account_type = '0')");
// Check for Admins Password to access all customers accounts with admins PW
$check_admins_pw_query = xtc_db_query("select customers_password from ".TABLE_CUSTOMERS." where customers_id = '1'");
$check_admins_pw = xtc_db_fetch_array($check_admins_pw_query);
if (!xtc_db_num_rows($check_customer_query)) {
$_GET['login'] = 'fail';
$info_message = TEXT_NO_EMAIL_ADDRESS_FOUND;
} else {
$check_customer = xtc_db_fetch_array($check_customer_query);
// Check that password is good or is admins pw
if ((!xtc_validate_password($password, $check_customer['customers_password'])) && (!xtc_validate_password($password, $check_admins_pw['customers_password']))) {
$_GET['login'] = 'fail';
$info_message = TEXT_LOGIN_ERROR;
} else {
if (SESSION_RECREATE == 'True') {
xtc_session_recreate();
}
Lg, Chris