From d9d69929f5ae649bd1b062822faf017f46f25ad0 Mon Sep 17 00:00:00 2001 From: ethem Date: Mon, 31 Jul 2006 12:45:34 +0000 Subject: [PATCH] Don't show authorize.net password for security reasons. Merged from 16stable. --- enrol/authorize/config.html | 15 +++++++++++---- enrol/authorize/enrol.php | 28 +++++++++++++++++++++------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/enrol/authorize/config.html b/enrol/authorize/config.html index 5774fec9d8..54ad840b23 100755 --- a/enrol/authorize/config.html +++ b/enrol/authorize/config.html @@ -9,6 +9,7 @@ if (!isset($frm->enrol_mailadmins)) $frm->enrol_mailadmins = ''; if (!isset($frm->an_login)) $frm->an_login = ''; if (!isset($frm->an_tran_key)) $frm->an_tran_key = ''; if (!isset($frm->an_password)) $frm->an_password = ''; +if (!isset($frm->delete_current)) $frm->delete_current = ''; if (!isset($frm->an_referer)) $frm->an_referer = 'http://'; if (!isset($frm->an_avs)) $frm->an_avs = ''; if (!isset($frm->an_test)) $frm->an_test = ''; @@ -84,20 +85,26 @@ if (!isset($frm->acceptccs)) { - #  + # #  an_tran_key: - + #1 an_password: - - + #2 +
() + + + + delete_current: + delete_current)) ?> +

diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index b3652337df..df1c9870c1 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -512,22 +512,36 @@ class enrolment_plugin_authorize set_config('an_emailexpiredteacher', $emailexpiredteacher); set_config('an_sorttype', $sorttype); + // https and openssl library is required + if ((substr($CFG->wwwroot, 0, 5) !== 'https' and empty($CFG->loginhttps)) or + !enrolment_plugin_authorize::check_openssl_loaded()) { + return false; + } + // required fields $loginval = optional_param('an_login', ''); + if (empty($loginval)) { + return false; + } + set_config('an_login', $loginval); + $tranval = optional_param('an_tran_key', ''); $passwordval = optional_param('an_password', ''); + $deletecurrent = optional_param('delete_current', ''); - if ((empty($CFG->loginhttps) and substr($CFG->wwwroot, 0, 5) !== 'https') || - !enrolment_plugin_authorize::check_openssl_loaded() || - empty($loginval) || - (empty($tranval) and empty($passwordval))) { + if (!empty($passwordval)) { // password is changing + set_config('an_password', $passwordval); + } + elseif (!empty($deletecurrent) and !empty($tranval)) { + set_config('an_password', ''); + $CFG->an_password = ''; + } + + if (empty($tranval) and empty($CFG->an_password)) { return false; } - set_config('an_login', $loginval); - set_config('an_password', $passwordval); set_config('an_tran_key', $tranval); - return true; } -- 2.39.5