Commit 346ccd5a authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1545374: Form to ignore 'wstoken' value when cancelling



When we click cancel on the form when testing 'token' auth
we don't care if 'wstoken' is set or not so we will ignore trying to
get it via param_alphanum()

Also fixing for wsusername and wspassword when testing 'user' auth

behatnotneeded

Change-Id: I8a690a7497681be27667dec5ec2ce20a5023a37e
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 5a488a7a
......@@ -132,8 +132,8 @@ if (!empty($authtype)) {
}
}
if ($authtype == 'user') {
$username = param_alphanum('wsusername', '');
$password = param_alphanum('wspassword', '');
$username = param_alphanum('cancel_submit', null) ? '' : param_alphanum('wsusername', '');
$password = param_alphanum('cancel_submit', null) ? '' : param_alphanum('wspassword', '');
$elements['wsusername'] = array('title' => 'wsusername', 'type' => 'text', 'value' => $username);
$elements['wspassword'] = array('title' => 'wspassword', 'type' => 'text', 'value' => $password);
if ($username) {
......@@ -144,7 +144,7 @@ if (!empty($authtype)) {
}
}
else {
$wstoken = param_alphanum('wstoken', '');
$wstoken = param_alphanum('cancel_submit', null) ? '' : param_alphanum('wstoken', '');
$elements['wstoken'] = array('title' => 'wstoken', 'type' => 'text', 'value' => $wstoken);
if ($wstoken) {
$params[]= 'wstoken=' . $wstoken;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment