Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-31429 enrol: added db/messages.php for enrolment plugins and adde…

…d some smarts to messaging so it won't display message settings for disabled enrolment plugins
  • Loading branch information...
commit d04cc1ea24562884ee3da0209591a3a8bb4324e4 1 parent 8da0b77
@andyjdavis andyjdavis authored samhemelryk committed
View
29 enrol/authorize/db/messages.php
@@ -0,0 +1,29 @@
+<?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/>.
+
+/**
+ * Defines message providers (types of message sent) for the PayPal enrolment plugin.
+ *
+ * @package enrol_authorize
+ * @copyright 2012 Andrew Davis
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$messageproviders = array(
+ 'authorize_enrolment' => array(),
+);
View
2  enrol/authorize/version.php
@@ -26,6 +26,6 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2010081203;
+$plugin->version = 2010081204;
$plugin->requires = 2010090501;
$plugin->cron = 180;
View
29 enrol/flatfile/db/messages.php
@@ -0,0 +1,29 @@
+<?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/>.
+
+/**
+ * Defines message providers (types of message sent) for the PayPal enrolment plugin.
+ *
+ * @package enrol_flatfile
+ * @copyright 2012 Andrew Davis
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$messageproviders = array(
+ 'flatfile_enrolment' => array(),
+);
View
1  enrol/flatfile/lang/en/enrol_flatfile.php
@@ -30,6 +30,7 @@
$string['mailadmin'] = 'Notify admin by email';
$string['mailstudents'] = 'Notify students by email';
$string['mailteachers'] = 'Notify teachers by email';
+$string['messageprovider:flatfile_enrolment'] = 'Flat file enrolment messages';
$string['mapping'] = 'Flat file mapping';
$string['pluginname'] = 'Flat file (CSV)';
$string['pluginname_desc'] = 'This method will repeatedly check for and process a specially-formatted text file in the location that you specify.
View
2  enrol/flatfile/version.php
@@ -27,5 +27,5 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2010091400;
+$plugin->version = 2010091401;
$plugin->cron = 60;
View
29 enrol/imsenterprise/db/messages.php
@@ -0,0 +1,29 @@
+<?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/>.
+
+/**
+ * Defines message providers (types of message sent) for the PayPal enrolment plugin.
+ *
+ * @package enrol_imsenterprise
+ * @copyright 2012 Andrew Davis
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$messageproviders = array(
+ 'imsenterprise_enrolment' => array(),
+);
View
1  enrol/imsenterprise/lang/en/enrol_imsenterprise.php
@@ -54,6 +54,7 @@
$string['logtolocation'] = 'Log file output location (blank for no logging)';
$string['mailadmins'] = 'Notify admin by email';
$string['mailusers'] = 'Notify users by email';
+$string['messageprovider:imsenterprise_enrolment'] = 'IMS Enterprise enrolment messages';
$string['miscsettings'] = 'Miscellaneous';
$string['processphoto'] = 'Add user photo data to profile';
$string['processphotowarning'] = 'Warning: Image processing is likely to add a significant burden to the server. You are recommended not to activate this option if large numbers of students are expected to be processed.';
View
2  enrol/imsenterprise/version.php
@@ -26,5 +26,5 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2011013000;
+$plugin->version = 2011013001;
$plugin->cron = 60;
View
29 enrol/paypal/db/messages.php
@@ -0,0 +1,29 @@
+<?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/>.
+
+/**
+ * Defines message providers (types of message sent) for the PayPal enrolment plugin.
+ *
+ * @package enrol_paypal
+ * @copyright 2012 Chris Follin
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$messageproviders = array(
+ 'paypal_enrolment' => array(),
+);
View
2  enrol/paypal/version.php
@@ -26,5 +26,5 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2010073100;
+$plugin->version = 2010073101;
$plugin->requires = 2010090501; // Requires this Moodle version
View
12 lib/messagelib.php
@@ -395,11 +395,23 @@ function message_get_providers_for_user($userid) {
if (!empty($provider->capability)) {
if (!has_capability($provider->capability, $systemcontext, $userid)) {
unset($providers[$providerid]); // Not allowed to see this
+ continue;
}
}
+
// Ensure user is not allowed to configure instantmessage if it is globally disabled.
if (!$CFG->messaging && $provider->name == 'instantmessage') {
unset($providers[$providerid]);
+ continue;
+ }
+
+ // If the component is an enrolment plugin, check it is enabled
+ list($type, $name) = normalize_component($provider->component);
+ if ($type == 'enrol') {
+ if (!enrol_is_enabled($name)) {
+ unset($providers[$providerid]);
+ continue;
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.