|
|
|
@@ -14,10 +14,13 @@ class webservice_test_client_form extends moodleform {
|
|
|
|
|
|
|
|
|
|
$authmethod = array('simple' => 'simple', 'token' => 'token');
|
|
|
|
|
$mform->addElement('select', 'authmethod', get_string('authmethod', 'webservice'), $authmethod);
|
|
|
|
|
$mform->setType('simple', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('select', 'protocol', get_string('protocol', 'webservice'), $protocols);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('select', 'function', get_string('function', 'webservice'), $functions);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$this->add_action_buttons(false, get_string('select'));
|
|
|
|
|
}
|
|
|
|
@@ -38,9 +41,12 @@ class moodle_user_create_users_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
@@ -48,19 +54,26 @@ class moodle_user_create_users_form extends moodleform {
|
|
|
|
|
|
|
|
|
|
/// specific to the create users function
|
|
|
|
|
$mform->addElement('text', 'username', 'username');
|
|
|
|
|
$mform->setType('username', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'password', 'password');
|
|
|
|
|
$mform->setType('password', PARAM_RAW);
|
|
|
|
|
$mform->addElement('text', 'firstname', 'firstname');
|
|
|
|
|
$mform->setType('firstname', PARAM_RAW);
|
|
|
|
|
$mform->addElement('text', 'lastname', 'lastname');
|
|
|
|
|
$mform->setType('lastname', PARAM_RAW);
|
|
|
|
|
$mform->addElement('text', 'email', 'email');
|
|
|
|
|
$mform->setType('email', PARAM_EMAIL);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('text', 'customfieldtype', 'customfieldtype');
|
|
|
|
|
$mform->setType('customfieldtype', PARAM_RAW);
|
|
|
|
|
$mform->addElement('text', 'customfieldvalue', 'customfieldvalue');
|
|
|
|
|
$mform->setType('customfieldvalue', PARAM_RAW);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -112,32 +125,43 @@ class moodle_user_update_users_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
/// specific to the create users function
|
|
|
|
|
$mform->addElement('text', 'id', 'id');
|
|
|
|
|
$mform->addRule('id', get_string('required'), 'required', null, 'client');
|
|
|
|
|
$mform->setType('id', PARAM_INT);
|
|
|
|
|
$mform->addElement('text', 'username', 'username');
|
|
|
|
|
$mform->setType('username', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'password', 'password');
|
|
|
|
|
$mform->setType('password', PARAM_RAW);
|
|
|
|
|
$mform->addElement('text', 'firstname', 'firstname');
|
|
|
|
|
$mform->setType('firstname', PARAM_RAW);
|
|
|
|
|
$mform->addElement('text', 'lastname', 'lastname');
|
|
|
|
|
$mform->setType('lastname', PARAM_RAW);
|
|
|
|
|
$mform->addElement('text', 'email', 'email');
|
|
|
|
|
$mform->setType('email', PARAM_EMAIL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$mform->addElement('text', 'customfieldtype', 'customfieldtype');
|
|
|
|
|
$mform->setType('customfieldtype', PARAM_RAW);
|
|
|
|
|
$mform->addElement('text', 'customfieldvalue', 'customfieldvalue');
|
|
|
|
|
$mform->setType('customfieldvalue', PARAM_RAW);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -195,28 +219,30 @@ class moodle_user_delete_users_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
/// beginning of specific code to the create users function
|
|
|
|
|
$mform->addElement('text', 'userids[0]', 'userids[0]');
|
|
|
|
|
$mform->addElement('text', 'userids[1]', 'userids[1]');
|
|
|
|
|
$mform->addElement('text', 'userids[2]', 'userids[2]');
|
|
|
|
|
$mform->addElement('text', 'userids[3]', 'userids[3]');
|
|
|
|
|
$mform->setType('userids', PARAM_INT);
|
|
|
|
|
/// end of specific code to the create users function
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('static', 'warning', '', get_string('executewarnign', 'webservice'));
|
|
|
|
|
|
|
|
|
@@ -265,26 +291,30 @@ class moodle_user_get_users_by_id_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
/// beginning of specific code to the create users function
|
|
|
|
|
$mform->addElement('text', 'userids[0]', 'userids[0]');
|
|
|
|
|
$mform->addElement('text', 'userids[1]', 'userids[1]');
|
|
|
|
|
$mform->addElement('text', 'userids[2]', 'userids[2]');
|
|
|
|
|
$mform->addElement('text', 'userids[3]', 'userids[3]');
|
|
|
|
|
$mform->setType('userids', PARAM_INT);
|
|
|
|
|
/// end of specific code to the create users function
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -334,24 +364,31 @@ class moodle_group_create_groups_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('text', 'courseid', 'courseid');
|
|
|
|
|
$mform->setType('courseid', PARAM_INT);
|
|
|
|
|
$mform->addElement('text', 'name', 'name');
|
|
|
|
|
$mform->setType('name', PARAM_TEXT);
|
|
|
|
|
$mform->addElement('text', 'description', 'description');
|
|
|
|
|
$mform->setType('description', PARAM_TEXT);
|
|
|
|
|
$mform->addElement('text', 'enrolmentkey', 'enrolmentkey');
|
|
|
|
|
$mform->setType('enrolmentkey', PARAM_RAW);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -393,23 +430,27 @@ class moodle_group_get_groups_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
$mform->addElement('text', 'groupids[0]', 'groupids[0]');
|
|
|
|
|
$mform->addElement('text', 'groupids[1]', 'groupids[1]');
|
|
|
|
|
$mform->addElement('text', 'groupids[2]', 'groupids[2]');
|
|
|
|
|
$mform->addElement('text', 'groupids[3]', 'groupids[3]');
|
|
|
|
|
$mform->setType('groupids', PARAM_INT);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$this->add_action_buttons(true, get_string('execute', 'webservice'));
|
|
|
|
|
}
|
|
|
|
@@ -452,20 +493,23 @@ class moodle_group_get_course_groups_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
$mform->addElement('text', 'courseid', 'courseid');
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$this->add_action_buttons(true, get_string('execute', 'webservice'));
|
|
|
|
|
}
|
|
|
|
@@ -502,23 +546,27 @@ class moodle_group_delete_groups_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
$mform->addElement('text', 'groupids[0]', 'groupids[0]');
|
|
|
|
|
$mform->addElement('text', 'groupids[1]', 'groupids[1]');
|
|
|
|
|
$mform->addElement('text', 'groupids[2]', 'groupids[2]');
|
|
|
|
|
$mform->addElement('text', 'groupids[3]', 'groupids[3]');
|
|
|
|
|
$mform->setType('groupids', PARAM_INT);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('static', 'warning', '', get_string('executewarnign', 'webservice'));
|
|
|
|
|
|
|
|
|
@@ -563,23 +611,27 @@ class moodle_group_get_groupmembers_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
$mform->addElement('text', 'groupids[0]', 'groupids[0]');
|
|
|
|
|
$mform->addElement('text', 'groupids[1]', 'groupids[1]');
|
|
|
|
|
$mform->addElement('text', 'groupids[2]', 'groupids[2]');
|
|
|
|
|
$mform->addElement('text', 'groupids[3]', 'groupids[3]');
|
|
|
|
|
$mform->setType('groupids', PARAM_INT);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$this->add_action_buttons(true, get_string('execute', 'webservice'));
|
|
|
|
|
}
|
|
|
|
@@ -622,9 +674,12 @@ class moodle_group_add_groupmembers_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
@@ -633,12 +688,14 @@ class moodle_group_add_groupmembers_form extends moodleform {
|
|
|
|
|
$mform->addElement('text', 'groupid[0]', 'groupid[0]');
|
|
|
|
|
$mform->addElement('text', 'userid[1]', 'userid[1]');
|
|
|
|
|
$mform->addElement('text', 'groupid[1]', 'groupid[1]');
|
|
|
|
|
$mform->setType('userid', PARAM_INT);
|
|
|
|
|
$mform->setType('groupids', PARAM_INT);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$this->add_action_buttons(true, get_string('execute', 'webservice'));
|
|
|
|
|
}
|
|
|
|
@@ -681,23 +738,28 @@ class moodle_group_delete_groupmembers_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
$mform->addElement('text', 'userid[0]', 'userid[0]');
|
|
|
|
|
$mform->addElement('text', 'groupid[0]', 'groupid[0]');
|
|
|
|
|
$mform->addElement('text', 'userid[1]', 'userid[1]');
|
|
|
|
|
$mform->addElement('text', 'groupid[1]', 'groupid[1]');
|
|
|
|
|
$mform->setType('userid', PARAM_INT);
|
|
|
|
|
$mform->setType('groupids', PARAM_INT);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$this->add_action_buttons(true, get_string('execute', 'webservice'));
|
|
|
|
|
}
|
|
|
|
@@ -750,13 +812,16 @@ class core_course_create_categories_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
$mform->addElement('text', 'name[0]', 'name[0]');
|
|
|
|
|
$mform->addElement('text', 'parent[0]', 'parent[0]');
|
|
|
|
|
$mform->addElement('text', 'idnumber[0]', 'idnumber[0]');
|
|
|
|
@@ -765,12 +830,16 @@ class core_course_create_categories_form extends moodleform {
|
|
|
|
|
$mform->addElement('text', 'parent[1]', 'parent[1]');
|
|
|
|
|
$mform->addElement('text', 'idnumber[1]', 'idnumber[1]');
|
|
|
|
|
$mform->addElement('text', 'description[1]', 'description[1]');
|
|
|
|
|
$mform->setType('name', PARAM_TEXT);
|
|
|
|
|
$mform->setType('parent', PARAM_INT);
|
|
|
|
|
$mform->setType('idnumber', PARAM_RAW);
|
|
|
|
|
$mform->setType('description', PARAM_TEXT);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$this->add_action_buttons(true, get_string('execute', 'webservice'));
|
|
|
|
|
}
|
|
|
|
@@ -827,25 +896,31 @@ class core_course_delete_categories_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
$mform->addElement('text', 'id[0]', 'id[0]');
|
|
|
|
|
$mform->addElement('text', 'newparent[0]', 'newparent[0]');
|
|
|
|
|
$mform->addElement('text', 'recursive[0]', 'recursive[0]');
|
|
|
|
|
$mform->addElement('text', 'id[1]', 'id[1]');
|
|
|
|
|
$mform->addElement('text', 'newparent[1]', 'newparent[1]');
|
|
|
|
|
$mform->addElement('text', 'recursive[1]', 'recursive[1]');
|
|
|
|
|
$mform->setType('id', PARAM_INT);
|
|
|
|
|
$mform->setType('newparent', PARAM_INT);
|
|
|
|
|
$mform->setType('recursive', PARAM_BOOL);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$this->add_action_buttons(true, get_string('execute', 'webservice'));
|
|
|
|
|
}
|
|
|
|
@@ -909,13 +984,16 @@ class core_course_update_categories_form extends moodleform {
|
|
|
|
|
$data = $this->_customdata;
|
|
|
|
|
if ($data['authmethod'] == 'simple') {
|
|
|
|
|
$mform->addElement('text', 'wsusername', 'wsusername');
|
|
|
|
|
$mform->setType('wsusername', PARAM_USERNAME);
|
|
|
|
|
$mform->addElement('text', 'wspassword', 'wspassword');
|
|
|
|
|
$mform->setType('wspassword', PARAM_RAW);
|
|
|
|
|
} else if ($data['authmethod'] == 'token') {
|
|
|
|
|
$mform->addElement('text', 'token', 'token');
|
|
|
|
|
$mform->setType('token', PARAM_RAW_TRIMMED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'authmethod', $data['authmethod']);
|
|
|
|
|
$mform->setType('authmethod', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('authmethod', PARAM_ALPHA);
|
|
|
|
|
$mform->addElement('text', 'id[0]', 'id[0]');
|
|
|
|
|
$mform->addElement('text', 'name[0]', 'name[0]');
|
|
|
|
|
$mform->addElement('text', 'parent[0]', 'parent[0]');
|
|
|
|
@@ -926,12 +1004,17 @@ class core_course_update_categories_form extends moodleform {
|
|
|
|
|
$mform->addElement('text', 'parent[1]', 'parent[1]');
|
|
|
|
|
$mform->addElement('text', 'idnumber[1]', 'idnumber[1]');
|
|
|
|
|
$mform->addElement('text', 'description[1]', 'description[1]');
|
|
|
|
|
$mform->setType('id', PARAM_INT);
|
|
|
|
|
$mform->setType('name', PARAM_TEXT);
|
|
|
|
|
$mform->setType('parent', PARAM_INT);
|
|
|
|
|
$mform->setType('idnumber', PARAM_RAW);
|
|
|
|
|
$mform->setType('description', PARAM_TEXT);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'function');
|
|
|
|
|
$mform->setType('function', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('function', PARAM_PLUGIN);
|
|
|
|
|
|
|
|
|
|
$mform->addElement('hidden', 'protocol');
|
|
|
|
|
$mform->setType('protocol', PARAM_SAFEDIR);
|
|
|
|
|
$mform->setType('protocol', PARAM_ALPHA);
|
|
|
|
|
|
|
|
|
|
$this->add_action_buttons(true, get_string('execute', 'webservice'));
|
|
|
|
|
}
|
|
|
|
|