Removed dependency on Moodle 31
This commit is contained in:
parent
c1624f7d05
commit
9ec87b0e87
2 changed files with 12 additions and 12 deletions
8
auth.php
8
auth.php
|
@ -603,14 +603,14 @@ class auth_plugin_userkey extends auth_plugin_base {
|
||||||
|
|
||||||
$mappingfield = $this->get_mapping_field();
|
$mappingfield = $this->get_mapping_field();
|
||||||
if ($this->should_create_user() || $this->should_update_user()) {
|
if ($this->should_create_user() || $this->should_update_user()) {
|
||||||
$parameters['firstname'] = new external_value(core_user::get_property_type('firstname'), 'The first name(s) of the user', VALUE_OPTIONAL);
|
$parameters['firstname'] = new external_value(PARAM_NOTAGS, 'The first name(s) of the user', VALUE_OPTIONAL);
|
||||||
$parameters['lastname'] = new external_value(core_user::get_property_type('lastname'), 'The family name of the user', VALUE_OPTIONAL);
|
$parameters['lastname'] = new external_value(PARAM_NOTAGS, 'The family name of the user', VALUE_OPTIONAL);
|
||||||
|
|
||||||
if ($mappingfield != 'email') {
|
if ($mappingfield != 'email') {
|
||||||
$parameters['email'] = new external_value(core_user::get_property_type('email'), 'A valid and unique email address', VALUE_OPTIONAL);
|
$parameters['email'] = new external_value(PARAM_RAW_TRIMMED, 'A valid and unique email address', VALUE_OPTIONAL);
|
||||||
}
|
}
|
||||||
if ($mappingfield != 'username') {
|
if ($mappingfield != 'username') {
|
||||||
$parameters['username'] = new external_value(core_user::get_property_type('username'), 'A valid and unique username', VALUE_OPTIONAL);
|
$parameters['username'] = new external_value(PARAM_USERNAME, 'A valid and unique username', VALUE_OPTIONAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -599,10 +599,10 @@ class auth_plugin_userkey_testcase extends advanced_testcase {
|
||||||
$this->auth = new auth_plugin_userkey();
|
$this->auth = new auth_plugin_userkey();
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'ip' => new external_value(PARAM_HOST, 'User IP address'),
|
'ip' => new external_value(PARAM_HOST, 'User IP address'),
|
||||||
'firstname' => new external_value(core_user::get_property_type('firstname'), 'The first name(s) of the user', VALUE_OPTIONAL),
|
'firstname' => new external_value(PARAM_NOTAGS, 'The first name(s) of the user', VALUE_OPTIONAL),
|
||||||
'lastname' => new external_value(core_user::get_property_type('lastname'), 'The family name of the user', VALUE_OPTIONAL),
|
'lastname' => new external_value(PARAM_NOTAGS, 'The family name of the user', VALUE_OPTIONAL),
|
||||||
'email' => new external_value(core_user::get_property_type('email'), 'A valid and unique email address', VALUE_OPTIONAL),
|
'email' => new external_value(PARAM_RAW_TRIMMED, 'A valid and unique email address', VALUE_OPTIONAL),
|
||||||
'username' => new external_value(core_user::get_property_type('username'), 'A valid and unique username', VALUE_OPTIONAL),
|
'username' => new external_value(PARAM_USERNAME, 'A valid and unique username', VALUE_OPTIONAL),
|
||||||
);
|
);
|
||||||
$actual = $this->auth->get_request_login_url_user_parameters();
|
$actual = $this->auth->get_request_login_url_user_parameters();
|
||||||
$this->assertEquals($expected, $actual);
|
$this->assertEquals($expected, $actual);
|
||||||
|
@ -613,10 +613,10 @@ class auth_plugin_userkey_testcase extends advanced_testcase {
|
||||||
$this->auth = new auth_plugin_userkey();
|
$this->auth = new auth_plugin_userkey();
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'ip' => new external_value(PARAM_HOST, 'User IP address'),
|
'ip' => new external_value(PARAM_HOST, 'User IP address'),
|
||||||
'firstname' => new external_value(core_user::get_property_type('firstname'), 'The first name(s) of the user', VALUE_OPTIONAL),
|
'firstname' => new external_value(PARAM_NOTAGS, 'The first name(s) of the user', VALUE_OPTIONAL),
|
||||||
'lastname' => new external_value(core_user::get_property_type('lastname'), 'The family name of the user', VALUE_OPTIONAL),
|
'lastname' => new external_value(PARAM_NOTAGS, 'The family name of the user', VALUE_OPTIONAL),
|
||||||
'email' => new external_value(core_user::get_property_type('email'), 'A valid and unique email address', VALUE_OPTIONAL),
|
'email' => new external_value(PARAM_RAW_TRIMMED, 'A valid and unique email address', VALUE_OPTIONAL),
|
||||||
'username' => new external_value(core_user::get_property_type('username'), 'A valid and unique username', VALUE_OPTIONAL),
|
'username' => new external_value(PARAM_USERNAME, 'A valid and unique username', VALUE_OPTIONAL),
|
||||||
);
|
);
|
||||||
$actual = $this->auth->get_request_login_url_user_parameters();
|
$actual = $this->auth->get_request_login_url_user_parameters();
|
||||||
$this->assertEquals($expected, $actual);
|
$this->assertEquals($expected, $actual);
|
||||||
|
|
Loading…
Reference in a new issue