diff --git a/admin/dbtransfer/database_export_form.php b/admin/dbtransfer/database_export_form.php
index 87f56144487..4982e9ed6fc 100644
--- a/admin/dbtransfer/database_export_form.php
+++ b/admin/dbtransfer/database_export_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php';
class database_export_form extends moodleform {
diff --git a/admin/dbtransfer/database_transfer_form.php b/admin/dbtransfer/database_transfer_form.php
index 2f42d6b6ab0..ec4c540c21d 100644
--- a/admin/dbtransfer/database_transfer_form.php
+++ b/admin/dbtransfer/database_transfer_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php';
class database_transfer_form extends moodleform {
diff --git a/admin/mnet/profileform.php b/admin/mnet/profileform.php
index a322b5fbe38..4d8bd4f547d 100644
--- a/admin/mnet/profileform.php
+++ b/admin/mnet/profileform.php
@@ -23,6 +23,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir . '/formslib.php');
/**
diff --git a/admin/mnet/services_form.php b/admin/mnet/services_form.php
index 76d2bbe960a..247978499b3 100644
--- a/admin/mnet/services_form.php
+++ b/admin/mnet/services_form.php
@@ -24,6 +24,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir . '/formslib.php');
class mnet_services_form extends moodleform {
diff --git a/admin/uploadpicture_form.php b/admin/uploadpicture_form.php
index a5d10cebaef..d2319ad9590 100644
--- a/admin/uploadpicture_form.php
+++ b/admin/uploadpicture_form.php
@@ -1,28 +1,33 @@
libdir.'/formslib.php';
- class admin_uploadpicture_form extends moodleform {
- function definition (){
- global $CFG, $USER;
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
- $mform =& $this->_form;
+require_once $CFG->libdir.'/formslib.php';
- $this->set_upload_manager(new upload_manager('userpicturesfile', false, false, null, false, 0, true, true, false));
+class admin_uploadpicture_form extends moodleform {
+ function definition (){
+ global $CFG, $USER;
- $mform->addElement('header', 'settingsheader', get_string('upload'));
+ $mform =& $this->_form;
- $mform->addElement('file', 'userpicturesfile', get_string('file'), 'size="40"');
- $mform->addRule('userpicturesfile', null, 'required');
+ $this->set_upload_manager(new upload_manager('userpicturesfile', false, false, null, false, 0, true, true, false));
- $choices =& $this->_customdata;
- $mform->addElement('select', 'userfield', get_string('uploadpicture_userfield', 'admin'), $choices);
- $mform->setType('userfield', PARAM_INT);
+ $mform->addElement('header', 'settingsheader', get_string('upload'));
- $choices = array( 0 => get_string('no'), 1 => get_string('yes') );
- $mform->addElement('select', 'overwritepicture', get_string('uploadpicture_overwrite', 'admin'), $choices);
- $mform->setType('overwritepicture', PARAM_INT);
+ $mform->addElement('file', 'userpicturesfile', get_string('file'), 'size="40"');
+ $mform->addRule('userpicturesfile', null, 'required');
- $this->add_action_buttons(false, get_string('uploadpictures', 'admin'));
- }
+ $choices =& $this->_customdata;
+ $mform->addElement('select', 'userfield', get_string('uploadpicture_userfield', 'admin'), $choices);
+ $mform->setType('userfield', PARAM_INT);
+
+ $choices = array( 0 => get_string('no'), 1 => get_string('yes') );
+ $mform->addElement('select', 'overwritepicture', get_string('uploadpicture_overwrite', 'admin'), $choices);
+ $mform->setType('overwritepicture', PARAM_INT);
+
+ $this->add_action_buttons(false, get_string('uploadpictures', 'admin'));
}
+}
diff --git a/admin/uploaduser_form.php b/admin/uploaduser_form.php
index f1117a4a5ec..d2bd97476c5 100644
--- a/admin/uploaduser_form.php
+++ b/admin/uploaduser_form.php
@@ -1,4 +1,9 @@
libdir.'/formslib.php';
class admin_uploaduser_form1 extends moodleform {
diff --git a/admin/user/user_message_form.php b/admin/user/user_message_form.php
index 50f5a3db6d4..0e8205102bc 100644
--- a/admin/user/user_message_form.php
+++ b/admin/user/user_message_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class user_message_form extends moodleform {
diff --git a/blocks/blog_recent/edit_form.php b/blocks/blog_recent/edit_form.php
index 85f5ecd1313..0278895eead 100644
--- a/blocks/blog_recent/edit_form.php
+++ b/blocks/blog_recent/edit_form.php
@@ -29,6 +29,7 @@
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
class block_blog_recent_edit_form extends block_edit_form {
protected function specific_definition($mform) {
// Fields for editing HTML block title and contents.
diff --git a/blocks/blog_tags/edit_form.php b/blocks/blog_tags/edit_form.php
index 2ea5b22365b..7dd134eeb57 100644
--- a/blocks/blog_tags/edit_form.php
+++ b/blocks/blog_tags/edit_form.php
@@ -64,4 +64,4 @@ class block_blog_tags_edit_form extends block_edit_form {
$mform->addElement('select', 'config_sort', get_string('tagsort', 'blog'), $sort);
$mform->setDefault('config_sort', BLOGDEFAULTSORT);
}
-}
\ No newline at end of file
+}
diff --git a/blocks/edit_form.php b/blocks/edit_form.php
index f8f0aacc323..7ed14d7ea65 100644
--- a/blocks/edit_form.php
+++ b/blocks/edit_form.php
@@ -26,6 +26,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir . '/formslib.php');
/**
diff --git a/blog/edit_form.php b/blog/edit_form.php
index d255be0d0fc..cd181b00c16 100644
--- a/blog/edit_form.php
+++ b/blog/edit_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir.'/formslib.php');
class blog_edit_form extends moodleform {
diff --git a/blog/external_blog_edit_form.php b/blog/external_blog_edit_form.php
index 01cd34dc5ae..14402ab6ce0 100644
--- a/blog/external_blog_edit_form.php
+++ b/blog/external_blog_edit_form.php
@@ -25,6 +25,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir.'/formslib.php');
class blog_edit_external_form extends moodleform {
diff --git a/blog/preferences_form.php b/blog/preferences_form.php
index 4d94ec91fc5..a1fff640c71 100644
--- a/blog/preferences_form.php
+++ b/blog/preferences_form.php
@@ -25,6 +25,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir.'/formslib.php');
class blog_preferences_form extends moodleform {
diff --git a/calendar/event_form.php b/calendar/event_form.php
index 157c0b4c7d2..341b4aafaa8 100644
--- a/calendar/event_form.php
+++ b/calendar/event_form.php
@@ -26,6 +26,10 @@
/**
* Always include formslib
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot.'/lib/formslib.php');
/**
@@ -175,4 +179,4 @@ class event_form extends moodleform {
return $errors;
}
-}
\ No newline at end of file
+}
diff --git a/cohort/edit_form.php b/cohort/edit_form.php
index c81c0c5f131..cc4b571e73e 100644
--- a/cohort/edit_form.php
+++ b/cohort/edit_form.php
@@ -24,6 +24,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot . '/lib/formslib.php');
class cohort_edit_form extends moodleform {
@@ -101,4 +105,4 @@ class cohort_edit_form extends moodleform {
return $options;
}
}
-
\ No newline at end of file
+
diff --git a/course/completion_form.php b/course/completion_form.php
index a28ea4dfbf5..56071703028 100644
--- a/course/completion_form.php
+++ b/course/completion_form.php
@@ -23,6 +23,10 @@
// //
///////////////////////////////////////////////////////////////////////////
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir.'/formslib.php');
class course_completion_form extends moodleform {
diff --git a/course/delete_category_form.php b/course/delete_category_form.php
index 5c02da496c3..7681bffb28e 100644
--- a/course/delete_category_form.php
+++ b/course/delete_category_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
require_once($CFG->libdir.'/questionlib.php');
diff --git a/course/edit_form.php b/course/edit_form.php
index 5a4cb0aca40..4d8ce16030b 100644
--- a/course/edit_form.php
+++ b/course/edit_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class course_edit_form extends moodleform {
diff --git a/course/editcategory_form.php b/course/editcategory_form.php
index 3cc50d40edc..3f86854c85e 100644
--- a/course/editcategory_form.php
+++ b/course/editcategory_form.php
@@ -1,4 +1,8 @@
dirroot.'/course/moodleform_mod.php');
class editcategory_form extends moodleform {
diff --git a/course/editsection_form.php b/course/editsection_form.php
index 0958edbe470..09c20c4687c 100644
--- a/course/editsection_form.php
+++ b/course/editsection_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class editsection_form extends moodleform {
diff --git a/course/import/activities/import_form.php b/course/import/activities/import_form.php
index 745933fece8..8e5a52b42a1 100755
--- a/course/import/activities/import_form.php
+++ b/course/import/activities/import_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class course_import_activities_form_1 extends moodleform {
diff --git a/course/import/groups/import_form.php b/course/import/groups/import_form.php
index 8a15db4787d..c3388f1d3b8 100755
--- a/course/import/groups/import_form.php
+++ b/course/import/groups/import_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class course_import_groups_form extends moodleform {
diff --git a/course/recent_form.php b/course/recent_form.php
index dc76b14e32c..9424263f6b4 100644
--- a/course/recent_form.php
+++ b/course/recent_form.php
@@ -23,6 +23,10 @@
* @package course
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir.'/formslib.php');
class recent_form extends moodleform {
diff --git a/course/request_form.php b/course/request_form.php
index 6ab802aa0a2..ed91bd02e20 100644
--- a/course/request_form.php
+++ b/course/request_form.php
@@ -31,6 +31,10 @@
* @package course
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir.'/formslib.php');
/**
diff --git a/course/reset_form.php b/course/reset_form.php
index 68d8bfb3b44..20e5f546b88 100644
--- a/course/reset_form.php
+++ b/course/reset_form.php
@@ -1,4 +1,8 @@
libdir.'/formslib.php';
class course_reset_form extends moodleform {
diff --git a/enrol/authorize/config_form.php b/enrol/authorize/config_form.php
index d9c244168e3..730654cd8ce 100755
--- a/enrol/authorize/config_form.php
+++ b/enrol/authorize/config_form.php
@@ -1,5 +1,10 @@
enrol_cost)) $frm->enrol_cost = '5';
if (!isset($frm->enrol_currency)) $frm->enrol_currency = 'USD';
if (!isset($frm->enrol_mailstudents)) $frm->enrol_mailstudents = '';
diff --git a/enrol/authorize/enrol_form.php b/enrol/authorize/enrol_form.php
index a27157bafe6..71716fcab3e 100755
--- a/enrol/authorize/enrol_form.php
+++ b/enrol/authorize/enrol_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class enrol_authorize_form extends moodleform
diff --git a/filter/local_settings_form.php b/filter/local_settings_form.php
index 81a182ac221..17aedba47fa 100644
--- a/filter/local_settings_form.php
+++ b/filter/local_settings_form.php
@@ -29,6 +29,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package moodlecore
*//** */
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir . '/formslib.php');
abstract class filter_local_settings_form extends moodleform {
diff --git a/grade/edit/letter/edit_form.php b/grade/edit/letter/edit_form.php
index d8ab832a2d7..7a2ba2b1fdd 100644
--- a/grade/edit/letter/edit_form.php
+++ b/grade/edit/letter/edit_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class edit_letter_form extends moodleform {
diff --git a/grade/edit/outcome/edit_form.php b/grade/edit/outcome/edit_form.php
index 71e93bb9a6e..3b31f089117 100644
--- a/grade/edit/outcome/edit_form.php
+++ b/grade/edit/outcome/edit_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class edit_outcome_form extends moodleform {
diff --git a/grade/edit/outcome/import_outcomes_form.php b/grade/edit/outcome/import_outcomes_form.php
index def8aa6495f..019addc2a63 100644
--- a/grade/edit/outcome/import_outcomes_form.php
+++ b/grade/edit/outcome/import_outcomes_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot.'/lib/formslib.php');
class import_outcomes_form extends moodleform {
diff --git a/grade/edit/scale/edit_form.php b/grade/edit/scale/edit_form.php
index 7879856f04d..109490b1396 100644
--- a/grade/edit/scale/edit_form.php
+++ b/grade/edit/scale/edit_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class edit_scale_form extends moodleform {
diff --git a/grade/edit/settings/form.php b/grade/edit/settings/form.php
index b024a56c5d8..e653755b0b1 100644
--- a/grade/edit/settings/form.php
+++ b/grade/edit/settings/form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir.'/formslib.php');
/**
diff --git a/grade/edit/tree/calculation_form.php b/grade/edit/tree/calculation_form.php
index 2043aaeff52..dd7ff9c7e46 100644
--- a/grade/edit/tree/calculation_form.php
+++ b/grade/edit/tree/calculation_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class edit_calculation_form extends moodleform {
diff --git a/grade/edit/tree/category_form.php b/grade/edit/tree/category_form.php
index 47ec597bb04..f60ca4dbe56 100644
--- a/grade/edit/tree/category_form.php
+++ b/grade/edit/tree/category_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class edit_category_form extends moodleform {
diff --git a/grade/edit/tree/grade_form.php b/grade/edit/tree/grade_form.php
index 63cdd014806..649be5de8df 100755
--- a/grade/edit/tree/grade_form.php
+++ b/grade/edit/tree/grade_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class edit_grade_form extends moodleform {
diff --git a/grade/edit/tree/item_form.php b/grade/edit/tree/item_form.php
index 03b80d4d0ec..df9ef1b122d 100644
--- a/grade/edit/tree/item_form.php
+++ b/grade/edit/tree/item_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class edit_item_form extends moodleform {
diff --git a/grade/edit/tree/outcomeitem_form.php b/grade/edit/tree/outcomeitem_form.php
index bcd9871f609..3a66710f867 100644
--- a/grade/edit/tree/outcomeitem_form.php
+++ b/grade/edit/tree/outcomeitem_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class edit_outcomeitem_form extends moodleform {
diff --git a/grade/export/grade_export_form.php b/grade/export/grade_export_form.php
index 35f80046062..467e9575aa6 100755
--- a/grade/export/grade_export_form.php
+++ b/grade/export/grade_export_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class grade_export_form extends moodleform {
diff --git a/grade/export/key_form.php b/grade/export/key_form.php
index 07a0044d31a..c8580e1dc32 100644
--- a/grade/export/key_form.php
+++ b/grade/export/key_form.php
@@ -23,6 +23,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot.'/lib/formslib.php');
class key_form extends moodleform {
diff --git a/grade/import/grade_import_form.php b/grade/import/grade_import_form.php
index af2e71312ea..6b96573beb8 100755
--- a/grade/import/grade_import_form.php
+++ b/grade/import/grade_import_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
require_once($CFG->libdir.'/gradelib.php');
diff --git a/grade/import/key_form.php b/grade/import/key_form.php
index a5e009ba1d3..a0ca3688ad9 100644
--- a/grade/import/key_form.php
+++ b/grade/import/key_form.php
@@ -23,6 +23,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot.'/lib/formslib.php');
class key_form extends moodleform {
diff --git a/grade/import/xml/grade_import_form.php b/grade/import/xml/grade_import_form.php
index 51929b29126..fd229acdd98 100644
--- a/grade/import/xml/grade_import_form.php
+++ b/grade/import/xml/grade_import_form.php
@@ -15,6 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class grade_import_form extends moodleform {
diff --git a/grade/report/grader/preferences_form.php b/grade/report/grader/preferences_form.php
index 2f5ec29cc80..c5d635a9d66 100644
--- a/grade/report/grader/preferences_form.php
+++ b/grade/report/grader/preferences_form.php
@@ -25,6 +25,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir.'/formslib.php');
/**
diff --git a/group/autogroup_form.php b/group/autogroup_form.php
index ab5ea51cbc3..4ba42a0b71c 100644
--- a/group/autogroup_form.php
+++ b/group/autogroup_form.php
@@ -1,5 +1,9 @@
dirroot.'/lib/formslib.php');
require_once($CFG->dirroot.'/cohort/lib.php');
diff --git a/group/group_form.php b/group/group_form.php
index 348457e9f54..c2f70950f16 100644
--- a/group/group_form.php
+++ b/group/group_form.php
@@ -10,6 +10,10 @@
* @package groups
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot.'/lib/formslib.php');
/// get url variables
diff --git a/group/grouping_form.php b/group/grouping_form.php
index 98d7a947f0b..5842602788d 100644
--- a/group/grouping_form.php
+++ b/group/grouping_form.php
@@ -9,6 +9,10 @@
* @package groups
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot.'/lib/formslib.php');
/// get url variables
diff --git a/login/change_password_form.php b/login/change_password_form.php
index f49a6654cd3..f127c0c2775 100644
--- a/login/change_password_form.php
+++ b/login/change_password_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php';
class login_change_password_form extends moodleform {
diff --git a/login/forgot_password_form.php b/login/forgot_password_form.php
index 0fa990e6938..29f27c3d915 100644
--- a/login/forgot_password_form.php
+++ b/login/forgot_password_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php';
class login_forgot_password_form extends moodleform {
diff --git a/login/restored_password_form.php b/login/restored_password_form.php
index 76ecd5186d4..2e4502d59c4 100644
--- a/login/restored_password_form.php
+++ b/login/restored_password_form.php
@@ -11,6 +11,10 @@
// part of each plugin, but now now. See MDL-20846
// for the rationale for this implementation.
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class login_forgot_password_form extends moodleform {
diff --git a/login/signup_form.php b/login/signup_form.php
index 37eaf9c15f1..ee89ec481a8 100644
--- a/login/signup_form.php
+++ b/login/signup_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
require_once($CFG->dirroot.'/user/profile/lib.php');
diff --git a/message/send_form.php b/message/send_form.php
index e9d12f14f07..5eff71998cf 100644
--- a/message/send_form.php
+++ b/message/send_form.php
@@ -1,5 +1,9 @@
dirroot.'/lib/formslib.php');
class send_form extends moodleform {
@@ -64,4 +68,4 @@ class send_form extends moodleform {
}
-?>
\ No newline at end of file
+?>
diff --git a/mod/assignment/mod_form.php b/mod/assignment/mod_form.php
index caa3df49335..1b5857ae6f5 100644
--- a/mod/assignment/mod_form.php
+++ b/mod/assignment/mod_form.php
@@ -1,4 +1,8 @@
dirroot.'/course/moodleform_mod.php');
class mod_assignment_mod_form extends moodleform_mod {
diff --git a/mod/chat/mod_form.php b/mod/chat/mod_form.php
index ca9477f6104..ee8ce8aaa7f 100644
--- a/mod/chat/mod_form.php
+++ b/mod/chat/mod_form.php
@@ -1,4 +1,8 @@
dirroot.'/course/moodleform_mod.php');
class mod_chat_mod_form extends moodleform_mod {
diff --git a/mod/choice/mod_form.php b/mod/choice/mod_form.php
index e8d6777d583..12ec459077d 100644
--- a/mod/choice/mod_form.php
+++ b/mod/choice/mod_form.php
@@ -1,4 +1,8 @@
dirroot.'/course/moodleform_mod.php');
class mod_choice_mod_form extends moodleform_mod {
diff --git a/mod/data/mod_form.php b/mod/data/mod_form.php
index ded85b726b5..7599ef8f46c 100644
--- a/mod/data/mod_form.php
+++ b/mod/data/mod_form.php
@@ -1,4 +1,8 @@
dirroot.'/course/moodleform_mod.php');
class mod_data_mod_form extends moodleform_mod {
diff --git a/mod/feedback/choose_group_form.php b/mod/feedback/choose_group_form.php
index a8f8574a538..e5e8b3e17ae 100644
--- a/mod/feedback/choose_group_form.php
+++ b/mod/feedback/choose_group_form.php
@@ -7,6 +7,10 @@
* @package feedback
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class feedback_choose_group_form extends moodleform {
diff --git a/mod/feedback/delete_completed_form.php b/mod/feedback/delete_completed_form.php
index 8724dca6bbb..f53197ecfbd 100644
--- a/mod/feedback/delete_completed_form.php
+++ b/mod/feedback/delete_completed_form.php
@@ -7,6 +7,10 @@
* @package feedback
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class mod_feedback_delete_completed_form extends moodleform {
diff --git a/mod/feedback/delete_item_form.php b/mod/feedback/delete_item_form.php
index 911669a39d0..0d0b0d4a3ff 100644
--- a/mod/feedback/delete_item_form.php
+++ b/mod/feedback/delete_item_form.php
@@ -7,6 +7,10 @@
* @package feedback
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class mod_feedback_delete_item_form extends moodleform {
diff --git a/mod/feedback/delete_template_form.php b/mod/feedback/delete_template_form.php
index b8d55f36cb9..fcb07d7a1c4 100644
--- a/mod/feedback/delete_template_form.php
+++ b/mod/feedback/delete_template_form.php
@@ -7,6 +7,10 @@
* @package feedback
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class mod_feedback_delete_template_form extends moodleform {
diff --git a/mod/feedback/edit_form.php b/mod/feedback/edit_form.php
index b5f4714d0ee..f4d995172af 100644
--- a/mod/feedback/edit_form.php
+++ b/mod/feedback/edit_form.php
@@ -7,6 +7,10 @@
* @package feedback
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class feedback_edit_add_question_form extends moodleform {
diff --git a/mod/feedback/import_form.php b/mod/feedback/import_form.php
index 47f60e73ba1..4d773d9fb38 100644
--- a/mod/feedback/import_form.php
+++ b/mod/feedback/import_form.php
@@ -7,6 +7,10 @@
* @package feedback
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class feedback_import_form extends moodleform {
diff --git a/mod/feedback/mod_form.php b/mod/feedback/mod_form.php
index 8f9f0292205..00f1315a91d 100644
--- a/mod/feedback/mod_form.php
+++ b/mod/feedback/mod_form.php
@@ -7,6 +7,10 @@
* @package feedback
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
class mod_feedback_mod_form extends moodleform_mod {
diff --git a/mod/feedback/use_templ_form.php b/mod/feedback/use_templ_form.php
index ad7834cf338..75adb62277e 100644
--- a/mod/feedback/use_templ_form.php
+++ b/mod/feedback/use_templ_form.php
@@ -7,6 +7,10 @@
* @package feedback
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class mod_feedback_use_templ_form extends moodleform {
diff --git a/mod/folder/mod_form.php b/mod/folder/mod_form.php
index a110ea7e367..bd532e2c3a8 100644
--- a/mod/folder/mod_form.php
+++ b/mod/folder/mod_form.php
@@ -23,6 +23,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
class mod_folder_mod_form extends moodleform_mod {
diff --git a/mod/forum/mod_form.php b/mod/forum/mod_form.php
index e324171fbde..bba66775433 100644
--- a/mod/forum/mod_form.php
+++ b/mod/forum/mod_form.php
@@ -21,6 +21,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
class mod_forum_mod_form extends moodleform_mod {
diff --git a/mod/forum/post_form.php b/mod/forum/post_form.php
index 8b60031c905..5dc3a48c460 100644
--- a/mod/forum/post_form.php
+++ b/mod/forum/post_form.php
@@ -21,6 +21,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir.'/formslib.php');
class mod_forum_post_form extends moodleform {
diff --git a/mod/glossary/edit_form.php b/mod/glossary/edit_form.php
index ebfaeb2d3c0..d45e7e26329 100644
--- a/mod/glossary/edit_form.php
+++ b/mod/glossary/edit_form.php
@@ -1,4 +1,8 @@
dirroot.'/lib/formslib.php');
class mod_glossary_entry_form extends moodleform {
diff --git a/mod/glossary/mod_form.php b/mod/glossary/mod_form.php
index 9b5198cba93..c5209c13628 100644
--- a/mod/glossary/mod_form.php
+++ b/mod/glossary/mod_form.php
@@ -1,4 +1,8 @@
dirroot.'/course/moodleform_mod.php');
class mod_glossary_mod_form extends moodleform_mod {
diff --git a/mod/hotpot/mod_form.php b/mod/hotpot/mod_form.php
index aaa108a824a..a8be0305727 100644
--- a/mod/hotpot/mod_form.php
+++ b/mod/hotpot/mod_form.php
@@ -1,4 +1,8 @@
dirroot.'/course/moodleform_mod.php');
require_once ($CFG->dirroot.'/mod/hotpot/lib.php');
diff --git a/mod/imscp/mod_form.php b/mod/imscp/mod_form.php
index 0c6723b9c9c..f49790d3d56 100644
--- a/mod/imscp/mod_form.php
+++ b/mod/imscp/mod_form.php
@@ -23,6 +23,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
require_once($CFG->dirroot.'/mod/resource/locallib.php');
require_once($CFG->libdir.'/filelib.php');
diff --git a/mod/label/mod_form.php b/mod/label/mod_form.php
index 38e4bad6b83..13e60b676c9 100644
--- a/mod/label/mod_form.php
+++ b/mod/label/mod_form.php
@@ -1,4 +1,8 @@
dirroot.'/course/moodleform_mod.php');
class mod_label_mod_form extends moodleform_mod {
diff --git a/mod/lesson/essay_form.php b/mod/lesson/essay_form.php
index 93c4b9c8275..d5fc8d166e5 100644
--- a/mod/lesson/essay_form.php
+++ b/mod/lesson/essay_form.php
@@ -26,6 +26,10 @@
/**
* Include formslib if it has not already been included
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir.'/formslib.php');
/**
@@ -61,4 +65,4 @@ class essay_grading_form extends moodleform {
$this->add_action_buttons(get_string('cancel'), get_string('savechanges'));
}
-}
\ No newline at end of file
+}
diff --git a/mod/lesson/mod_form.php b/mod/lesson/mod_form.php
index 2cddce92d53..6ee478727dd 100644
--- a/mod/lesson/mod_form.php
+++ b/mod/lesson/mod_form.php
@@ -24,6 +24,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or late
**/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot.'/course/moodleform_mod.php');
require_once($CFG->dirroot.'/mod/lesson/locallib.php');
diff --git a/mod/lesson/view_form.php b/mod/lesson/view_form.php
index 510a2825307..7f713fe1a0d 100644
--- a/mod/lesson/view_form.php
+++ b/mod/lesson/view_form.php
@@ -26,6 +26,10 @@
/**
* Include formslib if it has not already been included
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->libdir.'/formslib.php');
/**
@@ -50,4 +54,4 @@ class lesson_page_without_answers extends moodleform {
}
-}
\ No newline at end of file
+}
diff --git a/mod/page/mod_form.php b/mod/page/mod_form.php
index 1e816e77b11..948656b005b 100644
--- a/mod/page/mod_form.php
+++ b/mod/page/mod_form.php
@@ -23,6 +23,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot.'/course/moodleform_mod.php');
require_once($CFG->dirroot.'/mod/page/locallib.php');
require_once($CFG->libdir.'/filelib.php');
diff --git a/mod/quiz/mod_form.php b/mod/quiz/mod_form.php
index cb3af1c0a22..a1cdf87f27a 100644
--- a/mod/quiz/mod_form.php
+++ b/mod/quiz/mod_form.php
@@ -23,6 +23,10 @@
// //
///////////////////////////////////////////////////////////////////////////
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot . '/course/moodleform_mod.php');
require_once($CFG->dirroot . '/mod/quiz/locallib.php');
diff --git a/mod/quiz/override_form.php b/mod/quiz/override_form.php
index 2eb65d369b8..0097a03a540 100644
--- a/mod/quiz/override_form.php
+++ b/mod/quiz/override_form.php
@@ -24,6 +24,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once $CFG->libdir.'/formslib.php';
class quiz_override_form extends moodleform {
diff --git a/mod/resource/mod_form.php b/mod/resource/mod_form.php
index 664f9acdcd3..f40de2dd127 100644
--- a/mod/resource/mod_form.php
+++ b/mod/resource/mod_form.php
@@ -23,6 +23,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot.'/course/moodleform_mod.php');
require_once($CFG->dirroot.'/mod/resource/locallib.php');
require_once($CFG->libdir.'/filelib.php');
diff --git a/mod/scorm/mod_form.php b/mod/scorm/mod_form.php
index fc0fe4731b5..7a4632333ed 100644
--- a/mod/scorm/mod_form.php
+++ b/mod/scorm/mod_form.php
@@ -1,4 +1,8 @@
dirroot.'/course/moodleform_mod.php');
require_once($CFG->dirroot.'/mod/scorm/locallib.php');
diff --git a/mod/scorm/reportsettings_form.php b/mod/scorm/reportsettings_form.php
index ec3387cc791..583ecbdf72b 100644
--- a/mod/scorm/reportsettings_form.php
+++ b/mod/scorm/reportsettings_form.php
@@ -1,4 +1,8 @@
libdir/formslib.php";
class mod_scorm_report_settings extends moodleform {
diff --git a/mod/survey/mod_form.php b/mod/survey/mod_form.php
index ce225dc373d..0650f8c2146 100644
--- a/mod/survey/mod_form.php
+++ b/mod/survey/mod_form.php
@@ -1,4 +1,8 @@
dirroot.'/course/moodleform_mod.php');
class mod_survey_mod_form extends moodleform_mod {
diff --git a/mod/url/mod_form.php b/mod/url/mod_form.php
index e0eff0d0cd6..95572084b1f 100644
--- a/mod/url/mod_form.php
+++ b/mod/url/mod_form.php
@@ -23,6 +23,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
require_once($CFG->dirroot.'/mod/url/locallib.php');
diff --git a/mod/wiki/comments_form.php b/mod/wiki/comments_form.php
index 72c85aa97be..0dc86403b3a 100644
--- a/mod/wiki/comments_form.php
+++ b/mod/wiki/comments_form.php
@@ -1,5 +1,9 @@
dirroot . '/lib/formslib.php');
class mod_wiki_comments_form extends moodleform {
diff --git a/mod/wiki/edit_form.php b/mod/wiki/edit_form.php
index 9867f63cff5..807da65c5bf 100644
--- a/mod/wiki/edit_form.php
+++ b/mod/wiki/edit_form.php
@@ -27,6 +27,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once($CFG->dirroot . "/mod/wiki/editors/wikieditor.php");
require_once($CFG->dirroot . "/mod/wiki/editors/wikifiletable.php");
diff --git a/mod/wiki/mod_form.php b/mod/wiki/mod_form.php
index 2e7ea059dcf..be449f21cc3 100644
--- a/mod/wiki/mod_form.php
+++ b/mod/wiki/mod_form.php
@@ -31,6 +31,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+if (!defined('MOODLE_INTERNAL')) {
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
+}
+
require_once('moodleform_mod.php');
require_once($CFG->dirroot . '/mod/wiki/locallib.php');
require_once($CFG->dirroot . '/lib/datalib.php');
diff --git a/notes/edit_form.php b/notes/edit_form.php
index 2c9f2b0f6d2..8230b422927 100644
--- a/notes/edit_form.php
+++ b/notes/edit_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class note_edit_form extends moodleform {
diff --git a/question/category_form.php b/question/category_form.php
index 1fd9b6e0962..131efd9fb88 100644
--- a/question/category_form.php
+++ b/question/category_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class question_category_edit_form extends moodleform {
diff --git a/question/contextmove_form.php b/question/contextmove_form.php
index d2b412d9543..9a16a9730f7 100644
--- a/question/contextmove_form.php
+++ b/question/contextmove_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class question_context_move_form extends moodleform {
diff --git a/question/contextmoveq_form.php b/question/contextmoveq_form.php
index 945c6afe8c6..e77a627f9bb 100644
--- a/question/contextmoveq_form.php
+++ b/question/contextmoveq_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class question_context_move_question_form extends moodleform {
diff --git a/question/export_form.php b/question/export_form.php
index 68e3ea96cc1..a3c33af2d3f 100644
--- a/question/export_form.php
+++ b/question/export_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class question_export_form extends moodleform {
diff --git a/question/import_form.php b/question/import_form.php
index fc7e52156c9..9e3e7fe0f18 100644
--- a/question/import_form.php
+++ b/question/import_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class question_import_form extends moodleform {
diff --git a/question/move_form.php b/question/move_form.php
index b10f2bc1d13..e5b6a4afcc5 100644
--- a/question/move_form.php
+++ b/question/move_form.php
@@ -1,5 +1,9 @@
libdir.'/formslib.php');
class question_move_form extends moodleform {
diff --git a/question/type/truefalse/edit_truefalse_form.php b/question/type/truefalse/edit_truefalse_form.php
index 1bc8604b053..ad70e66a838 100644
--- a/question/type/truefalse/edit_truefalse_form.php
+++ b/question/type/truefalse/edit_truefalse_form.php
@@ -1,4 +1,8 @@
dirroot.'/question/type/edit_question_form.php');
/**
* Defines the editing form for the thruefalse question type.
diff --git a/tag/edit_form.php b/tag/edit_form.php
index 7d318a66e32..3b618b85200 100644
--- a/tag/edit_form.php
+++ b/tag/edit_form.php
@@ -1,5 +1,9 @@
dirroot.'/lib/formslib.php');
class tag_edit_form extends moodleform {
diff --git a/user/edit_form.php b/user/edit_form.php
index b43d4c98b7d..2e5779745c0 100644
--- a/user/edit_form.php
+++ b/user/edit_form.php
@@ -1,5 +1,9 @@
dirroot.'/lib/formslib.php');
class user_edit_form extends moodleform {
diff --git a/user/editadvanced_form.php b/user/editadvanced_form.php
index ad6d7f1f84a..4e9ac141af8 100644
--- a/user/editadvanced_form.php
+++ b/user/editadvanced_form.php
@@ -1,5 +1,9 @@
dirroot.'/lib/formslib.php');
class user_editadvanced_form extends moodleform {
diff --git a/user/profile/index_category_form.php b/user/profile/index_category_form.php
index 0be8ac99876..ee8acc48770 100644
--- a/user/profile/index_category_form.php
+++ b/user/profile/index_category_form.php
@@ -1,5 +1,9 @@
dirroot.'/lib/formslib.php');
class category_form extends moodleform {
diff --git a/user/profile/index_field_form.php b/user/profile/index_field_form.php
index 751bed5674c..a891504e92f 100644
--- a/user/profile/index_field_form.php
+++ b/user/profile/index_field_form.php
@@ -1,5 +1,9 @@
dirroot.'/lib/formslib.php');
class field_form extends moodleform {