Exemple #1
0
    }
}
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (zen_not_null($action)) {
    $admname = '{' . preg_replace('/[^\\d\\w]/', '*', zen_get_admin_name()) . '[' . (int) $_SESSION['admin_id'] . ']}';
    switch ($action) {
        case 'save':
            if (!$is_ssl_protected && in_array($class, array('paypaldp', 'linkpoint_api', 'authorizenet_aim', 'authorizenet_echeck'))) {
                break;
            }
            while (list($key, $value) = each($_POST['configuration'])) {
                if (is_array($value)) {
                    $value = implode(", ", $value);
                    $value = preg_replace("/, --none--/", "", $value);
                }
                if (function_exists('dbenc_encrypt') && function_exists('dbenc_is_encrypted_value_key') && dbenc_is_encrypted_value_key($key)) {
                    $value = dbenc_encrypt($value);
                }
                $db->Execute("update " . TABLE_CONFIGURATION . "\r\n                        set configuration_value = '" . zen_db_input($value) . "'\r\n                        where configuration_key = '" . zen_db_input($key) . "'");
            }
            $msg = sprintf(TEXT_EMAIL_MESSAGE_ADMIN_SETTINGS_CHANGED, preg_replace('/[^\\d\\w]/', '*', $_GET['module']), $admname);
            zen_record_admin_activity($msg, 'warning');
            zen_mail(STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER_EMAIL_ADDRESS, TEXT_EMAIL_SUBJECT_ADMIN_SETTINGS_CHANGED, $msg, STORE_NAME, EMAIL_FROM, array('EMAIL_MESSAGE_HTML' => $msg), 'admin_settings_changed');
            zen_redirect(zen_href_link(FILENAME_MODULES, 'set=' . $set . ($_GET['module'] != '' ? '&module=' . $_GET['module'] : ''), 'NONSSL'));
            break;
        case 'install':
            $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
            $class = basename($_POST['module']);
            if (!$is_ssl_protected && in_array($class, array('paypaldp', 'linkpoint_api', 'authorizenet_aim', 'authorizenet_echeck'))) {
                break;
            }
Exemple #2
0
function zen_cfg_password_input($value, $key = '')
{
    if (function_exists('dbenc_is_encrypted_value_key') && dbenc_is_encrypted_value_key($key)) {
        $value = dbenc_decrypt($value);
    }
    return zen_draw_password_field('configuration[' . $key . ']', $value);
}