Skip to content
Browse files

Merge branch 'MDL-31429_paypal_messages_22' of git://github.com/andyj…

…davis/moodle into MOODLE_22_STABLE
  • Loading branch information...
2 parents 839e233 + 923ea45 commit b5907a8674c7a56358346084509204944e2ab018 Sam Hemelryk committed Apr 30, 2012
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,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2011112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->version = 2011112901; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2011112900; // Requires this Moodle version
$plugin->component = 'enrol_authorize'; // Full name of the plugin (used for diagnostics)
$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
@@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2011112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->version = 2011112901; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2011112900; // Requires this Moodle version
$plugin->component = 'enrol_flatfile'; // Full name of the plugin (used for diagnostics)
$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
@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2011112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->version = 2011112901; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2011112900; // Requires this Moodle version
$plugin->component = 'enrol_imsenterprise'; // Full name of the plugin (used for diagnostics)
$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
1 enrol/paypal/lang/en/enrol_paypal.php
@@ -44,6 +44,7 @@
$string['mailadmins'] = 'Notify admin';
$string['mailstudents'] = 'Notify students';
$string['mailteachers'] = 'Notify teachers';
+$string['messageprovider:paypal_enrolment'] = 'PayPal enrolment messages';
$string['nocost'] = 'There is no cost associated with enrolling in this course!';
$string['paypal:config'] = 'Configure PayPal enrol instances';
$string['paypal:manage'] = 'Manage enrolled users';
View
2 enrol/paypal/version.php
@@ -26,6 +26,6 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2011112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->version = 2011112901; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2011112900; // Requires this Moodle version
$plugin->component = 'enrol_paypal'; // Full name of the plugin (used for diagnostics)
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;
+ }
}
}

0 comments on commit b5907a8

Please sign in to comment.
Something went wrong with that request. Please try again.