MDL-64570 user: input field purpose

Do not autocomplete the user fields when editing another user.
This commit is contained in:
Damyon Wiese 2019-02-20 09:42:26 +08:00
parent 4776098fe4
commit 145a10f7a9
2 changed files with 5 additions and 6 deletions

View File

@ -1601,11 +1601,8 @@ function user_edit_map_field_purpose($userid, $fieldname) {
);
$purpose = '';
if (!$currentuser) {
// Do not set a purpose.
$purpose = '';
}
if (isset($validmappings[$fieldname])) {
// Only set a purpose when editing your own user details.
if ($currentuser && isset($validmappings[$fieldname])) {
$purpose = ' autocomplete="' . $validmappings[$fieldname] . '" ';
}

View File

@ -27,6 +27,8 @@
require_once(__DIR__ . '/../../../lib/behat/behat_base.php');
use Behat\Mink\Exception\ExpectationException as ExpectationException;
/**
* Steps definitions for users.
*
@ -83,7 +85,7 @@ class behat_user extends behat_base {
$value = $fld->get_attribute('autocomplete');
if ($value == $purpose) {
throw new ExpectationException('The "' . $field . '" field does have purposea "' . $purpose . '"', $this->getSession());
throw new ExpectationException('The "' . $field . '" field does have purpose "' . $purpose . '"', $this->getSession());
}
}
}