mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-64570 user: input field purpose
Do not autocomplete the user fields when editing another user.
This commit is contained in:
parent
4776098fe4
commit
145a10f7a9
@ -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] . '" ';
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user