forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-22787 MDL-21993 New mnetservice plugin type
This commit introduces new plugin type called mnetservice. Once the MNet framework is redesigned, this plugin will define the service itself, the strings for it and the the client tools for administrator. The server side is implemented mainly in enrol_mnet plugin which publishes xml-rpc methods. AMOS BEGIN MOV [remoteenrolhosts_desc,core_mnet],[clientname_help,mnetservice_enrol] AMOS END
- Loading branch information
Showing
12 changed files
with
283 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Displays the list of remote peers we can enrol our users to | ||
* | ||
* @package mnetservice | ||
* @subpackage enrol | ||
* @copyright 2010 David Mudrak <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
require(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php'); | ||
require_once($CFG->libdir.'/adminlib.php'); | ||
require_once($CFG->dirroot.'/mnet/service/enrol/locallib.php'); | ||
|
||
admin_externalpage_setup('mnetenrol'); | ||
$service = mnetservice_enrol::get_instance(); | ||
|
||
echo $OUTPUT->header(); | ||
echo $OUTPUT->heading_with_help(get_string('clientname', 'mnetservice_enrol'), 'clientname', 'mnetservice_enrol'); | ||
|
||
if (!$service->is_available()) { | ||
echo $OUTPUT->box(get_string('mnetdisabled','mnet'), 'noticebox'); | ||
echo $OUTPUT->footer(); | ||
die(); | ||
} | ||
|
||
// remote hosts that may publish remote enrolment service and we are subscribed to it | ||
$hosts = $service->get_remote_publishers(); | ||
|
||
if (empty($hosts)) { | ||
echo $OUTPUT->box(get_string('nopublishers', 'mnetservice_enrol'), 'noticebox'); | ||
echo $OUTPUT->footer(); | ||
die(); | ||
} | ||
|
||
$table = new html_table(); | ||
$table->attributes['class'] = 'generaltable remotehosts'; | ||
$table->head = array( | ||
get_string('hostappname', 'mnetservice_enrol'), | ||
get_string('hostname', 'mnetservice_enrol'), | ||
get_string('hosturl', 'mnetservice_enrol'), | ||
get_string('action') | ||
); | ||
foreach ($hosts as $host) { | ||
$hostlink = html_writer::link(new moodle_url($host->hosturl), s($host->hosturl)); | ||
$editlink = html_writer::link(new moodle_url('/mnet/service/enrol/host.php', array('id'=>$host->id)), | ||
get_string('editenrolments', 'mnetservice_enrol')); | ||
$table->data[] = array(s($host->appname), s($host->hostname), $hostlink, $editlink); | ||
} | ||
echo html_writer::table($table); | ||
|
||
echo $OUTPUT->footer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* @package mnetservice | ||
* @subpackage enrolment | ||
* @copyright 2010 David Mudrak <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
$string['clientname'] = 'Remote enrolments client'; | ||
$string['clientname_help'] = 'This tool allows you to enrol and unenrol your local users on remote hosts that allow you to do so via the \'MNet remote enrolments\' plugin.'; | ||
$string['editenrolments'] = 'Edit enrolments'; | ||
$string['hostappname'] = 'Application'; | ||
$string['hostname'] = 'Host name'; | ||
$string['hosturl'] = 'Remote host URL'; | ||
$string['nopublishers'] = 'No remote peers available.'; | ||
$string['pluginname'] = 'Remote enrolment service'; |
Oops, something went wrong.