/**
  * Constructor.
  * @throws            Command_Exception.
  */
 public function __construct()
 {
     global $DB, $STANDARD_PLUGIN_TYPES;
     // Getting command description.
     $cmd_name = vmoodle_get_string('cmdpluginsetupname', 'vmoodleadminset_plugins');
     $cmd_desc = vmoodle_get_string('cmdpluginsetupdesc', 'vmoodleadminset_plugins');
     $pm = \plugin_manager::instance();
     $allplugins = $pm->get_plugins();
     $pluginlist = array();
     foreach ($allplugins as $type => $plugins) {
         foreach ($plugins as $p) {
             if (array_key_exists($type, $STANDARD_PLUGIN_TYPES)) {
                 $pluginlist[$type . '/' . $p->name] = $STANDARD_PLUGIN_TYPES[$type] . ' : ' . $p->displayname;
             }
         }
     }
     asort($pluginlist, SORT_STRING);
     $plugin_param = new Command_Parameter('plugin', 'enum', vmoodle_get_string('pluginparamdesc', 'vmoodleadminset_plugins'), null, $pluginlist);
     $states = array();
     $states['enable'] = vmoodle_get_string('enable', 'vmoodleadminset_plugins');
     $states['disable'] = vmoodle_get_string('disable', 'vmoodleadminset_plugins');
     $state_param = new Command_Parameter('state', 'enum', vmoodle_get_string('pluginstateparamdesc', 'vmoodleadminset_plugins'), null, $states);
     // Creating command.
     parent::__construct($cmd_name, $cmd_desc, array($plugin_param, $state_param));
 }
 /**
  * Constructor.
  * @throws Command_Exception.
  */
 public function __construct()
 {
     global $DB;
     // Getting command description.
     $cmd_name = vmoodle_get_string('cmdsynccapabilityname', 'vmoodleadminset_roles');
     $cmd_desc = vmoodle_get_string('cmdsynccapabilitydesc', 'vmoodleadminset_roles');
     // Creating platform parameter.
     $platform_param = new Command_Parameter('platform', 'enum', vmoodle_get_string('platformparamsyncdesc', 'vmoodleadminset_roles'), null, get_available_platforms());
     // Getting role parameter.
     $roles = role_fix_names(get_all_roles(), \context_system::instance(), ROLENAME_ORIGINAL);
     $rolemenu = array();
     foreach ($roles as $r) {
         $rolemenu[$r->shortname] = $r->name;
     }
     $role_param = new Command_Parameter('role', 'enum', vmoodle_get_string('roleparamsyncdesc', 'vmoodleadminset_roles'), null, $rolemenu);
     // Creating capability parameter.
     $records = $DB->get_records('capabilities', null, 'name', 'name');
     $capabilities = array();
     foreach ($records as $record) {
         $capabilities[$record->name] = get_capability_string($record->name);
     }
     asort($capabilities);
     $capability_param = new Command_Parameter('capability', 'enum', vmoodle_get_string('capabilityparamsyncdesc', 'vmoodleadminset_roles'), null, $capabilities);
     // Creating command.
     parent::__construct($cmd_name, $cmd_desc, array($platform_param, $role_param, $capability_param));
 }
 /**
  * Constructor.
  * @throws                Command_Exception.
  */
 public function __construct()
 {
     // Getting command description.
     $cmd_name = vmoodle_get_string('cmdupgradename', 'vmoodleadminset_upgrade');
     $cmd_desc = vmoodle_get_string('cmdupgradedesc', 'vmoodleadminset_upgrade');
     // Creating command.
     parent::__construct($cmd_name, $cmd_desc);
 }
 /**
  * Constructor.
  * @param $name string The category's name.
  * @param $plugin_name string The category's file.
  */
 public function __construct($plugin_name)
 {
     global $CFG;
     // Checking category's name
     $this->name = vmoodle_get_string('pluginname', 'vmoodleadminset_' . $plugin_name);
     // Checking category's plugin name
     if (!is_string($plugin_name) || empty($plugin_name)) {
         throw new Command_Exception('categorywrongpluginname', $name);
     } else {
         $this->plugin_name = $plugin_name;
     }
 }
 /**
  * Constructor.
  * @throws Command_Exception.
  */
 function __construct()
 {
     global $DB;
     // Getting command description.
     $cmd_name = vmoodle_get_string('cmdsyncname', 'vmoodleadminset_plugins');
     $cmd_desc = vmoodle_get_string('cmdsyncdesc', 'vmoodleadminset_plugins');
     // Creating platform parameter. This is the source platform.
     $platform_param = new Command_Parameter('platform', 'enum', vmoodle_get_string('platformparamsyncdesc', 'vmoodleadminset_plugins'), null, get_available_platforms());
     // Creating plugins type parameter. If this parameter has a value,
     // then all plugins in this type will be synchronized
     $plugintypes = get_plugin_types();
     $plugintype_param = new Command_Parameter('plugintype', 'enum', vmoodle_get_string('plugintypeparamsyncdesc', 'vmoodleadminset_plugins'), null, $plugintypes);
     // Creating command.
     parent::__construct($cmd_name, $cmd_desc, array($platform_param, $plugintype_param));
 }
 /**
  * Constructor.
  * @throws Command_Exception.
  */
 public function __construct()
 {
     global $DB;
     // Getting command description
     $cmd_name = vmoodle_get_string('cmdcomparename', 'vmoodleadminset_roles');
     $cmd_desc = vmoodle_get_string('cmdcomparedesc', 'vmoodleadminset_roles');
     // Getting role parameter
     $roles = role_fix_names(get_all_roles(), \context_system::instance(), ROLENAME_ORIGINAL);
     $rolemenu = array();
     foreach ($roles as $r) {
         $rolemenu[$r->shortname] = $r->localname;
     }
     $role_param = new Command_Parameter('role', 'enum', vmoodle_get_string('roleparamcomparedesc', 'vmoodleadminset_roles'), null, $rolemenu);
     // Creating command.
     parent::__construct($cmd_name, $cmd_desc, $role_param);
 }
 /**
  * Constructor.
  * @throws Command_Exception.
  */
 function __construct()
 {
     global $DB;
     // Getting command description.
     $cmd_name = vmoodle_get_string('cmdallowsyncname', 'vmoodleadminset_roles');
     $cmd_desc = vmoodle_get_string('cmdallowsyncdesc', 'vmoodleadminset_roles');
     // Creating platform parameter
     $platform_param = new Command_Parameter('platform', 'enum', vmoodle_get_string('platformparamsyncdesc', 'vmoodleadminset_roles'), null, get_available_platforms());
     // Creating table parameter
     $tables['assign'] = vmoodle_get_string('assigntable', 'vmoodleadminset_roles');
     $tables['override'] = vmoodle_get_string('overridetable', 'vmoodleadminset_roles');
     $tables['switch'] = vmoodle_get_string('switchtable', 'vmoodleadminset_roles');
     $table_param = new Command_Parameter('table', 'enum', vmoodle_get_string('tableparamdesc', 'vmoodleadminset_roles'), null, $tables);
     // Creating role parameter
     $roles = role_fix_names(get_all_roles(), \context_system::instance(), ROLENAME_ORIGINAL);
     $rolemenu = array();
     foreach ($roles as $r) {
         $rolemenu[$r->shortname] = $r->localname;
     }
     $role_param = new Command_Parameter('role', 'enum', vmoodle_get_string('roleparamsyncdesc', 'vmoodleadminset_roles'), null, $rolemenu);
     // Creating command
     parent::__construct($cmd_name, $cmd_desc, array($platform_param, $table_param, $role_param));
 }
<?php

header('Content-Type: application/x-javascript');
require_once '../../../../../config.php';
require_once $CFG->dirroot . '/local/vmoodle/lib.php';
echo 'var vmoodle_pluginlib_notinstalled = "' . vmoodle_get_string('notinstalled', 'vmoodleadminset_plugins') . '"; ';
echo 'var vmoodle_pluginlib_nosrcpltfrm = "' . vmoodle_get_string('nosrcpltfrm', 'vmoodleadminset_plugins') . '"; ';
echo 'var vmoodle_pluginlib_nosyncpltfrm = "' . vmoodle_get_string('nosyncpltfrm', 'vmoodleadminset_plugins') . '"; ';
echo 'var vmoodle_pluginlib_confirmpluginvisibilitysync = "' . vmoodle_get_string('confirmpluginvisibilitysync', 'vmoodleadminset_plugins') . '"; ';
Exemplo n.º 9
0
$param1 = new Command_Parameter('parameter1', 'ltext', 'The free long text without default value');
$cmd = new Command_Sql('Command 9', 'Command with free long text without default value.', 'SELECT [[?parameter1]] FROM bb', $param1);
$category->addCommand($cmd);
/*****************************************/
$param1 = new Command_Parameter('parameter1', 'ltext', 'The free long text with default value', 'default value');
$cmd = new Command_Sql('Command 10', 'Command with free long text with default value.', 'SELECT [[?parameter1]] FROM bb', $param1);
$category->addCommand($cmd);
/*****************************/
$param1 = new Command_Parameter('parameter1', 'boolean', 'A boolean selected by default', true);
$param2 = new Command_Parameter('parameter2', 'enum', 'The enum choice values 2 by default', 'value2', array('value1' => vmoodle_get_string('value1', 'vmoodleadminset_test'), 'value2' => vmoodle_get_string('value2', 'vmoodleadminset_test'), 'value3' => vmoodle_get_string('value3', 'vmoodleadminset_test')));
$param3 = new Command_Parameter('parameter3', 'text', 'The free text with default value', 'the default value');
$cmd = new Command_Sql('Command 11', 'Command which combine different fields.', 'SELECT [[?parameter1]], [[?parameter2]], [[?parameter3]] FROM bb', array($param1, $param2, $param3));
$category->addCommand($cmd);
/*********************************/
$param1 = new Command_Parameter('parameter1', 'boolean', 'The boolean selected by default', true);
$param2 = new Command_Parameter('parameter2', 'enum', 'The enum choice values 2 by default', 'value2', array('value1' => vmoodle_get_string('value1', 'vmoodleadminset_test'), 'value2' => vmoodle_get_string('value2', 'vmoodleadminset_test'), 'value3' => vmoodle_get_string('value3', 'vmoodleadminset_test')));
$param3 = new Command_Parameter_Internal('parameter3', 'explode', array('[[?parameter1]]', '[[?parameter2]]', '[[bibi]]', 'ba[[?parameter1:tot]]be[[prefix]]bi', true, 'aa'));
$cmd = new Command_Sql('Command 12', 'Command with a boolean parameter selected and an internal parameter.', 'SELECT [[?parameter1]],[[?parameter2]],[[?parameter3]] FROM bb', array($param1, $param2, $param3));
$category->addCommand($cmd);
$cmd = new Command_Sql('Command 13', 'Command to  try error handling.', 'SELECT [[?parameter1]] FROM bb', new Command_Parameter_Internal('parameter1', 'vmoodleadminset_test\\CommandWrapper::myTestFunction'));
$category->addCommand($cmd);
$test_rpcommad = new Command_Sql('Command 14', 'Command with a retrieve platforms command.', 'UPDATE bb SET value = \'aa\' WHERE name = \'cc\'', null);
$param1 = new Command_Parameter('param', 'text', 'Name of config directive', 'local_vmoodle_host_source');
$param2 = new Command_Parameter('value', 'text', 'Value of config directive', 'vmoodle');
$cmd = new Command_Sql('Retrieve platforms command', 'Command used to retrieve platforms from their original value.', 'SELECT id FROM {config} WHERE name = [[?param]] AND value = [[?value]] ', array($param1, $param2));
$test_rpcommad->attachRPCommand($cmd);
$category->addCommand($test_rpcommad);
$category->addCommand(new Command_Role_Sync());
$category->addCommand(new Command_Role_Capability_Sync());
$category->addCommand(new Command_Role_Compare());
$category->addCommand(new Command_Upgrade());
 /**
  * Process the plugin comparison.
  * @throws Commmand_Exception.
  */
 private function _process()
 {
     global $CFG, $DB, $OUTPUT, $STANDARD_PLUGIN_TYPES, $PAGE;
     $renderer = $PAGE->get_renderer('local_vmoodle');
     // Checking if command has been runned.
     if (!$this->isRunned()) {
         throw new Command_Exception('commandnotrun');
     }
     // Getting examined plugintype.
     $plugintype = $this->getParameter('plugintype')->getValue();
     // Getting hosts.
     $hosts = array_keys($this->plugins);
     $host_labels = get_available_platforms();
     // Getting local plugin info.
     $pm = \plugin_manager::instance();
     $localplugins = $pm->get_plugins();
     $localtypeplugins = $localplugins[$plugintype];
     /*
      * Creating html report.
      */
     // Creating header.
     $this->report = '<link href="' . $CFG->wwwroot . '/local/vmoodle/plugins/plugins/theme/styles.css" rel="stylesheet" type="text/css">';
     $this->report .= '<h3>' . vmoodle_get_string('compareplugins', 'vmoodleadminset_plugins', $STANDARD_PLUGIN_TYPES[$plugintype]) . '</h3>';
     // Adding link to plugin management
     /* $this->report.= '<center><p>'.$OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/admin/roles/define.php', array('roleid' => $role->id, 'action' => 'edit')), get_string('editrole', 'vmoodleadminset_roles'), 'get').'</p></center>'; */
     // Creation form
     $this->report .= '<form action="' . $CFG->wwwroot . '/local/vmoodle/plugins/plugins/controller.pluginlib.sadmin.php?what=syncplugins" method="post" onsubmit="return validate_syncplugins()">';
     $this->report .= '<input id="id_plugin" type="hidden" name="plugin" value=""/>';
     $this->report .= '<input id="source_platform" type="hidden" name="source_platform" value=""/>';
     // Creating table.
     $this->report .= '<table id="plugincompare" cellspacing="1" cellpadding="5" class="generaltable boxaligncenter" style="min-width: 75%;">';
     $this->report .= '<tbody>';
     // Creating header.
     $this->report .= '<tr><th scope="col" class="header c0" style="vertical-align: bottom; text-align: left;">&nbsp</th>';
     $col = 1;
     foreach ($hosts as $host) {
         $this->report .= '<th id="plug_' . $col . '" scope="col" class="header c' . $col . '" style="vertical-align: bottom; text-align: center;">';
         $this->report .= '<label for="platform_' . $col . '"><img src="' . $CFG->wwwroot . '/local/vmoodle/plugins/plugins/draw_platformname.php?caption=' . urlencode($host_labels[$host]) . '" alt="' . $host_labels[$host] . '"/></label><br/>';
         $this->report .= '<input id="platform_' . $col . '" type="checkbox" name="platforms[]" value="' . $host . '" disabled="disabled"/></th>';
         $col++;
     }
     $this->report .= '</tr>';
     // Initializing variables.
     $row = 0;
     // Creating table data.
     foreach ($localtypeplugins as $plugin) {
         $col = 1;
         $this->report .= '<tr class="r' . $row % 2 . '">';
         $this->report .= '<td id="plug_0_' . $row . '" class="cell c0" style="vertical-align: middle; text-align: left;" onClic="setPLugin(' . $col . ',' . $row . ',\'' . $plugin->name . '\',\'' . $host . '\')">';
         $this->report .= $plugin->displayname;
         $this->report .= '</td>';
         foreach ($hosts as $host) {
             $extra_class = false;
             $title = $plugin->displayname . ' | ' . $host_labels[$host];
             if (array_key_exists($host, $this->plugins) && property_exists($this->plugins[$host], $plugin->name)) {
                 $remote_plugin = $this->plugins[$host]->{$plugin->name};
                 if (is_null($remote_plugin)) {
                     $cell = '<img src="' . $renderer->pix_url('notinstalled', 'vmoodleadminset_plugins') . ' alt="Not installed" title="' . $title . '" />';
                 } else {
                     if ($remote_plugin->enabled) {
                         $cell = '<img src="' . $renderer->pix_url('enabled', 'vmoodleadminset_plugins') . '" title="' . $title . '" />';
                     } else {
                         $cell = '<img src="' . $renderer->pix_url('disabled', 'vmoodleadminset_plugins') . '" title="' . $title . '" />';
                     }
                     if ($localtypeplugins[$plugin->name]->versiondb > $remote_plugin->versiondb) {
                         $cell .= '&nbsp;<img src="' . $renderer->pix_url('needsupgrade', 'vmoodleadminset_plugins') . '" title="' . $title . '" />';
                     }
                     if ($remote_plugin->versiondisk > $remote_plugin->versiondb) {
                         $cell .= '&nbsp;<img src="' . $renderer->pix_url('needslocalupgrade', 'vmoodleadminset_plugins') . '" title="' . $title . '" />';
                     }
                 }
             } else {
                 $cell = '<img src="' . $renderer->pix_url('notinstalled', 'vmoodleadminset_plugins') . '" alt="Not installed" title="' . $title . '"/>';
             }
             $this->report .= '<td id="plug_' . $col . '_' . $row . '" class="cell c' . $col . ($extra_class ? ' ' . $extra_class : '') . '" style="vertical-align: middle; text-align: center;" onmouseout="cellOut(' . $col . ',' . $row . ');" onmouseover="cellOver(' . $col . ',' . $row . ');">' . $cell . '</td>';
             $col++;
         }
         $this->report .= '</tr>';
         $row++;
     }
     // Closing table
     $this->report .= '</tboby></table><br/><center><input type="submit" value="' . get_string('synchronize', 'vmoodleadminset_plugins') . '"/><div id="plugincompare_validation_message"></div></center></form><br/><br/>';
 }
Exemplo n.º 11
0
function mnetadmin_rpc_upgrade($user, $json_response = true)
{
    global $CFG, $USER;
    // Invoke local user and check his rights
    if ($auth_response = invoke_local_user((array) $user)) {
        if ($json_response) {
            return $auth_response;
        } else {
            return json_decode($auth_response);
        }
    }
    // Creating response
    $response = new stdclass();
    $response->status = RPC_SUCCESS;
    require "{$CFG->dirroot}/version.php";
    // defines $version, $release, $branch and $maturity
    $CFG->target_release = $release;
    // used during installation and upgrades
    if ($version < $CFG->version) {
        $response->status = RPC_FAILURE_RUN;
        $response->error = get_string('downgradedcore', 'error');
        $response->errors[] = get_string('downgradedcore', 'error');
        if ($json_response) {
            return json_encode($response);
        } else {
            return $response;
        }
    }
    $oldversion = "{$CFG->release} ({$CFG->version})";
    $newversion = "{$release} ({$version})";
    if (!moodle_needs_upgrading()) {
        $response->message = get_string('cliupgradenoneed', 'core_admin', $newversion);
        if ($json_response) {
            return json_encode($response);
        } else {
            return $response;
        }
    }
    // debug_trace('Remote Upgrade : Environment check');
    list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_NEWER);
    if (!$envstatus) {
        $response->status = RPC_FAILURE_RUN;
        $response->error = vmoodle_get_string('environmentissues', 'vmoodleadminset_upgrade');
        $response->errors[] = vmoodle_get_string('environmentissues', 'vmoodleadminset_upgrade');
        $response->detail = $environment_results;
        if ($json_response) {
            return json_encode($response);
        } else {
            return $response;
        }
    }
    // Test plugin dependencies.
    // debug_trace('Remote Upgrade : Plugins check');
    $failed = array();
    if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
        $response->status = RPC_FAILURE_RUN;
        $response->error = get_string('pluginschecktodo', 'admin');
        $response->errors[] = get_string('pluginschecktodo', 'admin');
        if ($json_response) {
            return json_encode($response);
        } else {
            return $response;
        }
    }
    ob_start();
    // debug_trace('Remote Upgrade : Upgrade core');
    if ($version > $CFG->version) {
        upgrade_core($version, false);
    }
    set_config('release', $release);
    set_config('branch', $branch);
    // unconditionally upgrade
    // debug_trace('Remote Upgrade : Upgrade other');
    upgrade_noncore(false);
    // log in as admin - we need doanything permission when applying defaults
    // debug_trace('Remote Upgrade : Turning ADMIN ');
    session_set_user(get_admin());
    // apply all default settings, just in case do it twice to fill all defaults
    // debug_trace('Remote Upgrade : Applying settings ');
    admin_apply_default_settings(NULL, false);
    admin_apply_default_settings(NULL, false);
    ob_end_clean();
    $response->message = vmoodle_get_string('upgradecomplete', 'vmoodleadminset_upgrade', $newversion);
    if ($json_response) {
        return json_encode($response);
    } else {
        return $response;
    }
}
Exemplo n.º 12
0
 function action($action)
 {
     global $DB;
     if (!($block = $DB->get_record('block', array('name' => $this->plugin)))) {
         return vmoodle_get_string('errorblockdoesnotexit', 'vmoodleadminset_plugins', $this->plugin);
     }
     switch ($action) {
         case 'enable':
             $DB->set_field('block', 'visible', '1', array('id' => $block->id));
             // Show block
             break;
         case 'disable':
             $DB->set_field('block', 'visible', '0', array('id' => $block->id));
             // Hide block
             break;
     }
     return 0;
 }
 /**
  * Constructor with localized message.
  * @param string $identifier The key identifier for the localized string.
  * @param mixed $a An object, string or number that can be used (optional).
  */
 public function __construct($identifier, $a = null)
 {
     parent::__construct(vmoodle_get_string($identifier, 'vmoodleadminset_generic', $a));
 }
 /**
  * Process the role comparision.
  * @throws Commmand_Exception.
  */
 private function _process()
 {
     global $CFG, $DB, $OUTPUT;
     // Checking if command has been runned.
     if (!$this->isRunned()) {
         throw new Command_Exception('commandnotrun');
     }
     // Getting table name.
     $table = $this->getParameter('table')->getValue();
     // Getting hosts.
     $hosts = array_keys($this->capabilities);
     $host_labels = get_available_platforms();
     // Getting local roles.
     $roles = $DB->get_records('role', null, '', 'sortorder');
     /*
      * processing results
      */
     // Creating header.
     $this->report = '<h3>' . get_string('allowcompare', 'vmoodleadminset_roles', vmoodle_get_string($table . 'table', 'vmoodleadminset_roles')) . help_button_vml('rolelib', 'allowcompare', 'vmoodleadminset_roles') . '</h3>';
     // Adding edit role link
     $this->report .= '<center><p>' . $OUTPUT->single_button(new moodle_url($CFG->wwwroot . '/admin/roles/allow.php?mode=' . $table, array('roleid' => $role->id, 'action' => 'edit')), vmoodle_get_string('editallowtable', 'vmoodleadminset_roles'), 'get') . '</p></center>';
     // Creation form.
     $this->report .= '<form action="' . $CFG->wwwroot . '/local/vmoodle/plugins/roles/controller.rolelib.sadmin.php?what=syncallow" method="post" onsubmit="return validate_syncrole()">';
     $this->report .= '<input id="target" type="hidden" name="target" value=""/>';
     $this->report .= '<input id="role" type="hidden" name="role" value=""/>';
     $this->report .= '<input id="source_platform" type="hidden" name="source_platform" value=""/>';
     // Creating table.
     $this->report .= '<table id="allowcompare" cellspacing="1" cellpadding="5" class="generaltable boxaligncenter" style="min-width: 75%;"><tbody>';
     // Creating header.
     $this->report .= '<tr><th scope="col" class="header c0" style="vertical-align: bottom; text-align: left;">&nbsp</th>';
     $col = 1;
     foreach ($hosts as $host) {
         $this->report .= '<th id="cap_' . $col . '" scope="col" class="header c' . $col . '" style="vertical-align: bottom; text-align: center;"><label for="platform_' . $col . '"><img src="' . $CFG->wwwroot . '/local/vmoodle/plugins/roles/draw_platformname.php?caption=' . urlencode($host_labels[$host]) . '" alt="' . $host_labels[$host] . '"/></label><br/><input id="platform_' . $col . '" type="checkbox" name="platforms[]" value="' . $host . '" disabled="disabled"/></th>';
         $col++;
     }
     $this->report .= '</tr>';
     // Initializing variables.
     $row = 0;
     // Creating table data.
     foreach ($allroles as $rolename => $role) {
         $localrole = $DB->get_field('role', 'name', array('shortname' => $rolename));
         $displayrole = $localrole ? $localrole : '--' . $rolename . '--';
         $this->report .= "<tr valign='top'>{$displayrole}</td>";
         $row++;
     }
     // Closing table.
     $this->report .= '</tboby></table><br/>';
     $this->report .= '<center><input type="submit" value="' . vmoodle_get_string('synchronize', 'vmoodleadminset_roles') . '"/><div id="allowcompare_validation_message"></div></center></form><br/><br/>';
 }
Exemplo n.º 15
0
<?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/>.
/**
 * This file contains the mnet services for the user_mnet_host plugin
 *
 * @since 2.0
 * @package local
 * @subpackage vmoodle
 * @copyright 2012 Valery Fremaux
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once $CFG->dirroot . '/local/vmoodle/lib.php';
$publishes = array('dataexchange' => array('servicename' => 'dataexchange', 'description' => vmoodle_get_string('dataexchange_name', 'vmoodleadminset_generic'), 'apiversion' => 1, 'classname' => '', 'filename' => 'rpclib.php', 'methods' => array('dataexchange_rpc_fetch_config')), 'mnetadmin' => array('servicename' => 'mnetadmin', 'description' => get_string('mnetadmin_name', 'local_vmoodle'), 'apiversion' => 1, 'classname' => '', 'filename' => 'rpclib.php', 'methods' => array('mnetadmin_rpc_set_config', 'mnetadmin_rpc_set_maintenance', 'mnetadmin_rpc_purge_caches')));
$subscribes = array('dataexchange' => array('dataexchange_rpc_fetch_config' => 'local/vmoodle/plugins/generic/rpclib.php/dataexchange_rpc_fetch_config', 'mnetadmin_rpc_set_maintenance' => 'local/vmoodle/plugins/generic/rpclib.php/mnetadmin_rpc_set_maintenance', 'mnetadmin_rpc_set_config' => 'local/vmoodle/plugins/generic/rpclib.php/mnetadmin_rpc_set_config', 'mnetadmin_rpc_purge_caches' => 'local/vmoodle/plugins/generic/rpclib.php/mnetadmin_rpc_purge_caches'));