MDL-17135 moving all webservice and external API related admin UI to new directory, I did not expect there would be so many files, sorry for the trouble
This commit is contained in:
@@ -242,9 +242,9 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
|
||||
$temp = new admin_settingpage('externalservices', get_string('externalservices', 'webservice'));
|
||||
$temp->add(new admin_setting_manageexternalservices());
|
||||
$ADMIN->add('webservicesettings', $temp);
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', get_string('externalservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/external_service.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', get_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/external_service_functions.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', get_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/external_service_users.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', get_string('externalservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', get_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', get_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_users.php", 'moodle/site:config', true));
|
||||
$temp = new admin_settingpage('webserviceprotocols', get_string('manageprotocols', 'webservice'));
|
||||
$temp->add(new admin_setting_managewebserviceprotocols());
|
||||
if (empty($CFG->enablewebservices)) {
|
||||
|
||||
@@ -118,7 +118,7 @@ class service_user_selector extends user_selector_base {
|
||||
protected function get_options() {
|
||||
global $CFG;
|
||||
$options = parent::get_options();
|
||||
$options['file'] = '/admin/webservice/lib.php'; //need to be set, otherwise
|
||||
$options['file'] = $CFG->admin.'/webservice/lib.php'; //need to be set, otherwise
|
||||
// the /user/selector/search.php
|
||||
//will fail to find this user_selector class
|
||||
$options['serviceid'] = $this->serviceid;
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once('../config.php');
|
||||
require_once('../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
$PAGE->set_url('admin/webservice_protocols.php', array());
|
||||
$PAGE->set_url('/admin/webservice/protocols.php', array());
|
||||
//TODO: disable the blocks here or better make the page layout default to no blocks!
|
||||
|
||||
require_login();
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
/* This function disable the valid until field of a user into external_service_users.php*/
|
||||
/* This function disable the valid until field of a user into service_users.php*/
|
||||
function disablevaliduntil(event, userid) {
|
||||
var disabled;
|
||||
if (document.getElementById('enablevaliduntil'+userid).checked)
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once('../config.php');
|
||||
require_once('../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once('external_forms.php');
|
||||
require_once('forms.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
@@ -48,8 +48,8 @@ if ($action == 'delete' and confirm_sesskey() and $service and empty($service->c
|
||||
admin_externalpage_print_header();
|
||||
$optionsyes = array('id'=>$id, 'action'=>'delete', 'confirm'=>1, 'sesskey'=>sesskey());
|
||||
$optionsno = array('section'=>'externalservices');
|
||||
$formcontinue = html_form::make_button('external_service.php', $optionsyes, get_string('delete'), 'post');
|
||||
$formcancel = html_form::make_button('settings.php', $optionsno, get_string('cancel'), 'get');
|
||||
$formcontinue = html_form::make_button('service.php', $optionsyes, get_string('delete'), 'post');
|
||||
$formcancel = html_form::make_button("$CFG->wwwroot/$CFG->admin/settings.php", $optionsno, get_string('cancel'), 'get');
|
||||
echo $OUTPUT->confirm(get_string('deleteserviceconfirm', 'webservice', $service->name), $formcontinue, $formcancel);
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
@@ -23,7 +23,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once('../config.php');
|
||||
require_once('../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT);
|
||||
@@ -31,12 +31,12 @@ $fid = optional_param('fid', 0, PARAM_INT);
|
||||
$action = optional_param('action', '', PARAM_ACTION);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
$PAGE->set_url('admin/external_service_functions.php', array('id'=>$id));
|
||||
$PAGE->set_url('admin/websevice/service_functions.php', array('id'=>$id));
|
||||
|
||||
admin_externalpage_setup('externalservicefunctions');
|
||||
|
||||
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=externalservices";
|
||||
$thisurl = "external_service_functions.php?id=$id";
|
||||
$thisurl = "service_functions.php?id=$id";
|
||||
|
||||
$service = $DB->get_record('external_services', array('id'=>$id), '*', MUST_EXIST);
|
||||
|
||||
@@ -46,8 +46,8 @@ if ($action === 'delete' and confirm_sesskey() and $service and empty($service->
|
||||
admin_externalpage_print_header();
|
||||
$optionsyes = array('id'=>$id, 'action'=>'delete', 'confirm'=>1, 'sesskey'=>sesskey(), 'fid'=>$function->id);
|
||||
$optionsno = array('id'=>$id);
|
||||
$formcontinue = html_form::make_button('external_service_functions.php', $optionsyes, get_string('delete'), 'post');
|
||||
$formcancel = html_form::make_button('external_service_functions.php', $optionsno, get_string('cancel'), 'get');
|
||||
$formcontinue = html_form::make_button('service_functions.php', $optionsyes, get_string('delete'), 'post');
|
||||
$formcancel = html_form::make_button('service_functions.php', $optionsno, get_string('cancel'), 'get');
|
||||
echo $OUTPUT->confirm(get_string('removefunctionconfirm', 'webservice', (object)array('service'=>$service->name, 'function'=>$function->name)), $formcontinue, $formcancel);
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
@@ -94,7 +94,7 @@ else if ($action === 'add') {
|
||||
|
||||
// Javascript for the function search/selection fields
|
||||
$PAGE->requires->yui_lib('event');
|
||||
$PAGE->requires->js('admin/webservice/script.js');
|
||||
$PAGE->requires->js($CFG->admin.'/webservice/script.js');
|
||||
$PAGE->requires->js_function_call('capability_service.cap_filter_init', array(get_string('search'))); //TODO generalize javascript
|
||||
|
||||
admin_externalpage_print_header();
|
||||
@@ -105,7 +105,7 @@ else if ($action === 'add') {
|
||||
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter centerpara');
|
||||
//the service form
|
||||
$form = new html_form();
|
||||
$form->url = new moodle_url('/admin/external_service_functions.php', array('id' => $id, 'action' => 'add', 'save' => 1)); // Required
|
||||
$form->url = new moodle_url('service_functions.php', array('id' => $id, 'action' => 'add', 'save' => 1)); // Required
|
||||
$form->button = new html_button();
|
||||
$form->button->id = 'settingssubmit';
|
||||
$form->button->text = get_string('addfunction', 'webservice'); // Required
|
||||
@@ -161,7 +161,7 @@ if (empty($service->component)) {
|
||||
$table->align[] = 'center';
|
||||
}
|
||||
|
||||
$durl = "$CFG->wwwroot/$CFG->admin/external_service_functions.php?sesskey=".sesskey();
|
||||
$durl = "service_functions.php?sesskey=".sesskey();
|
||||
|
||||
foreach ($functions as $function) {
|
||||
//TODO: manage when the description is into a module/plugin lang file
|
||||
@@ -180,7 +180,7 @@ echo $OUTPUT->table($table);
|
||||
// we can edit only custom functions, the build-in would be overridden after each upgrade
|
||||
if (empty($service->component)) {
|
||||
$form = new html_form();
|
||||
$form->url = new moodle_url('external_service_functions.php', array('sesskey'=>sesskey(), 'id'=>$service->id, 'action'=>'add'));
|
||||
$form->url = new moodle_url('service_functions.php', array('sesskey'=>sesskey(), 'id'=>$service->id, 'action'=>'add'));
|
||||
$form->button->text = get_string('add');
|
||||
$form->method = 'get';
|
||||
echo $OUTPUT->button($form);
|
||||
@@ -188,7 +188,7 @@ if (empty($service->component)) {
|
||||
|
||||
// simple back button
|
||||
$form = new html_form();
|
||||
$form->url = new moodle_url('settings.php', array('section'=>'externalservices'));
|
||||
$form->url = new moodle_url('../settings.php', array('section'=>'externalservices'));
|
||||
$form->button->text = get_string('back');
|
||||
$form->method = 'get';
|
||||
echo $OUTPUT->button($form);
|
||||
@@ -23,14 +23,14 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once('../config.php');
|
||||
require_once('../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->dirroot.'/admin/webservice/lib.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT);
|
||||
|
||||
$PAGE->set_url('admin/external_service_users.php', array('id'=>$id));
|
||||
$PAGE->requires->js('admin/webservice/script.js');
|
||||
$PAGE->set_url('admin/webservice/service_users.php', array('id'=>$id));
|
||||
$PAGE->requires->js($CFG->admin.'/webservice/script.js');
|
||||
|
||||
admin_externalpage_setup('externalserviceusers');
|
||||
admin_externalpage_print_header();
|
||||
@@ -50,7 +50,7 @@ $alloweduserselector = new service_user_selector('removeselect', array('servicei
|
||||
$serviceuser->userid = $adduser->id;
|
||||
$serviceuser->timecreated = mktime();
|
||||
$DB->insert_record('external_services_users', $serviceuser);
|
||||
add_to_log(1, 'core', 'assign', 'admin/external_service_users.php?id='.$id, 'add', '', $adduser->id);
|
||||
add_to_log(1, 'core', 'assign', $CFG->admin.'/webservice/service_users.php?id='.$id, 'add', '', $adduser->id);
|
||||
}
|
||||
|
||||
$potentialuserselector->invalidate_selected_users();
|
||||
@@ -65,7 +65,7 @@ $alloweduserselector = new service_user_selector('removeselect', array('servicei
|
||||
|
||||
foreach ($userstoremove as $removeuser) {
|
||||
$DB->delete_records('external_services_users', array('externalserviceid' => $id, 'userid' => $removeuser->id));
|
||||
add_to_log(1, 'core', 'assign', 'admin/external_service_users.php?id='.$id, 'remove', '', $removeuser->id);
|
||||
add_to_log(1, 'core', 'assign', $CFG->admin.'/webservice/service_users.php?id='.$id, 'remove', '', $removeuser->id);
|
||||
}
|
||||
|
||||
$potentialuserselector->invalidate_selected_users();
|
||||
@@ -77,7 +77,7 @@ $alloweduserselector = new service_user_selector('removeselect', array('servicei
|
||||
|
||||
/// display the UI
|
||||
?>
|
||||
<form id="assignform" method="post" action="external_service_users.php?id=<?php echo $id ?>"><div>
|
||||
<form id="assignform" method="post" action="service_users.php?id=<?php echo $id ?>"><div>
|
||||
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
|
||||
|
||||
<table summary="" class="roleassigntable generaltable generalbox boxaligncenter" cellspacing="0">
|
||||
@@ -117,8 +117,7 @@ if (optional_param('updateuser', false, PARAM_BOOL) && confirm_sesskey()) {
|
||||
$enablevaliduntil = optional_param('enablevaliduntil', false, PARAM_INT);
|
||||
if (!empty($fromday) && !empty($frommonth) && !empty($fromyear)) {
|
||||
$validuntil = mktime(23, 59, 59, $frommonth, $fromday, $fromyear);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$validuntil = "";
|
||||
}
|
||||
|
||||
@@ -159,7 +158,7 @@ if (!empty($allowedusers)) {
|
||||
//user settings form
|
||||
$contents = "<div class=\"fcontainer clearfix\">";
|
||||
$form = new html_form();
|
||||
$form->url = new moodle_url('/admin/external_service_users.php', array('id' => $id, 'userid' => $user->id, 'updateuser' => 1, 'serviceuserid' => $user->serviceuserid)); // Required
|
||||
$form->url = new moodle_url('service_users.php', array('id' => $id, 'userid' => $user->id, 'updateuser' => 1, 'serviceuserid' => $user->serviceuserid)); // Required
|
||||
$form->button = new html_button();
|
||||
$form->button->text = get_string('update'); // Required
|
||||
$form->button->disabled = false;
|
||||
+4
-4
@@ -6163,9 +6163,9 @@ class admin_setting_manageexternalservices extends admin_setting {
|
||||
$strusers = get_string('restrictedusers', 'webservice');
|
||||
$strserviceusers = get_string('serviceusers', 'webservice');
|
||||
|
||||
$esurl = "$CFG->wwwroot/$CFG->admin/external_service.php";
|
||||
$efurl = "$CFG->wwwroot/$CFG->admin/external_service_functions.php";
|
||||
$euurl = "$CFG->wwwroot/$CFG->admin/external_service_users.php";
|
||||
$esurl = "$CFG->wwwroot/$CFG->admin/webservice/service.php";
|
||||
$efurl = "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php";
|
||||
$euurl = "$CFG->wwwroot/$CFG->admin/webservice/service_users.php";
|
||||
|
||||
// built in services
|
||||
$return = $OUTPUT->heading(get_string('servicesbuiltin', 'webservice'), 3, 'main');
|
||||
@@ -6362,7 +6362,7 @@ class admin_setting_managewebserviceprotocols extends admin_setting {
|
||||
$table->data = array();
|
||||
|
||||
// iterate through auth plugins and add to the display table
|
||||
$url = "$CFG->wwwroot/$CFG->admin/webservice_protocols.php?sesskey=" . sesskey();
|
||||
$url = "$CFG->wwwroot/$CFG->admin/webservice/protocols.php?sesskey=" . sesskey();
|
||||
foreach ($protocols_available as $protocol => $location) {
|
||||
$name = get_string('pluginname', 'webservice_'.$protocol);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user