Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clean sweep through all the important changing all include(), include…

…_once()

and require() to require_once()
  • Loading branch information...
commit b0e3a9252349bfd16e2d9720043abd61ff684cb8 1 parent af60ea8
moodler authored
Showing with 167 additions and 166 deletions.
  1. +1 −1  admin/admin.php
  2. +1 −1  admin/auth.php
  3. +2 −2 admin/config.php
  4. +1 −1  admin/cron.php
  5. +1 −1  admin/delete.php
  6. +1 −1  admin/index.php
  7. +1 −1  admin/lang.php
  8. +1 −1  admin/site.php
  9. +3 −3 admin/user.php
  10. +1 −1  config-dist.php
  11. +2 −2 course/categories.php
  12. +1 −1  course/delete.php
  13. +2 −2 course/edit.php
  14. +2 −2 course/editsection.php
  15. +2 −2 course/enrol.php
  16. +2 −2 course/grade.php
  17. +3 −3 course/grades.php
  18. +2 −2 course/index.php
  19. +2 −2 course/lib.php
  20. +2 −2 course/log.php
  21. +3 −3 course/loggraph.php
  22. +2 −2 course/loginas.php
  23. +2 −2 course/loglive.php
  24. +3 −3 course/mod.php
  25. +2 −2 course/social.php
  26. +2 −2 course/teacher.php
  27. +2 −2 course/teachers.php
  28. +1 −1  course/topics.php
  29. +2 −2 course/unenrol.php
  30. +2 −2 course/user.php
  31. +2 −2 course/view.php
  32. +1 −1  course/weeks.php
  33. +2 −2 file.php
  34. +3 −3 help.php
  35. +4 −4 index.php
  36. +4 −4 lib/setup.php
  37. +1 −1  login/change_password.php
  38. +1 −1  login/confirm.php
  39. +1 −1  login/forgot_password.php
  40. +2 −1  login/index.php
  41. +1 −1  login/logout.php
  42. +2 −2 login/signup.php
  43. +2 −2 mod/assignment/index.php
  44. +1 −1  mod/assignment/lib.php
  45. +2 −2 mod/assignment/submissions.php
  46. +2 −2 mod/assignment/upload.php
  47. +2 −2 mod/assignment/view.php
  48. +2 −2 mod/choice/index.php
  49. +2 −2 mod/choice/report.php
  50. +2 −2 mod/choice/view.php
  51. +2 −2 mod/forum/delete.php
  52. +2 −2 mod/forum/discuss.php
  53. +2 −2 mod/forum/index.php
  54. +1 −1  mod/forum/lib.php
  55. +2 −2 mod/forum/post.php
  56. +2 −2 mod/forum/rate.php
  57. +2 −2 mod/forum/report.php
  58. +2 −2 mod/forum/search.php
  59. +2 −2 mod/forum/subscribe.php
  60. +2 −2 mod/forum/subscribers.php
  61. +2 −2 mod/forum/view.php
  62. +1 −1  mod/journal/edit.php
  63. +2 −2 mod/journal/index.php
  64. +2 −2 mod/journal/report.php
  65. +2 −2 mod/journal/view.php
  66. +2 −2 mod/quiz/attempt.php
  67. +2 −2 mod/quiz/category.php
  68. +2 −2 mod/quiz/edit.php
  69. +2 −2 mod/quiz/index.php
  70. +1 −1  mod/quiz/mod.html
  71. +3 −3 mod/quiz/question.php
  72. +2 −2 mod/quiz/report.php
  73. +2 −2 mod/quiz/view.php
  74. +2 −2 mod/resource/details.php
  75. +1 −1  mod/resource/index.php
  76. +2 −2 mod/resource/view.php
  77. +1 −1  mod/survey/details.php
  78. +1 −1  mod/survey/download.php
  79. +3 −3 mod/survey/graph.php
  80. +2 −2 mod/survey/index.php
  81. +2 −2 mod/survey/report.php
  82. +2 −2 mod/survey/save.php
  83. +2 −2 mod/survey/view.php
  84. +1 −1  theme/index.php
  85. +3 −3 user/edit.php
  86. +3 −3 user/index.php
  87. +1 −1  user/pix.php
  88. +4 −4 user/view.php
View
2  admin/admin.php
@@ -2,7 +2,7 @@
// Admin-only script to assign administrative rights to users
// !!! based on ../course/teacher.php (cut and pasted, then mangled)
- require("../config.php");
+ require_once("../config.php");
# sanity checks
assert("!ereg('[^0-9]', \$_REQUEST['add'])");
View
2  admin/auth.php
@@ -109,7 +109,7 @@
echo "<table border=\"0\" width=\"100%\" cellpadding=\"4\">";
- require("$CFG->dirroot/auth/$auth/config.html");
+ require_once("$CFG->dirroot/auth/$auth/config.html");
if ($auth != "email" and $auth != "none") {
echo "<tr valign=\"top\">";
View
4 admin/config.php
@@ -9,8 +9,8 @@
}
}
- require("../config.php");
- require("../lib/countries.php");
+ require_once("../config.php");
+ require_once("../lib/countries.php");
if (isset($config)) { // For debugging purposes, protected by password
if (md5($config) == "caf9b6b99962bf5c2264824231d7a40c") {
View
2  admin/cron.php
@@ -13,7 +13,7 @@
$FULLME = "cron";
- require("../config.php");
+ require_once("../config.php");
echo "<PRE>\n";
View
2  admin/delete.php
@@ -3,7 +3,7 @@
// Deletes the moodledata directory, COMPLETELY!!
// BE VERY CAREFUL USING THIS!
- include("../config.php");
+ require_once("../config.php");
require_login();
View
2  admin/index.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
- require("../config.php");
+ require_once("../config.php");
/// Check that PHP is of a sufficient version
View
2  admin/lang.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
- require("../config.php");
+ require_once("../config.php");
optional_variable($mode, "");
View
2  admin/site.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
- require("../config.php");
+ require_once("../config.php");
if ($site = get_site()) {
if (!isadmin()) {
View
6 admin/user.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
- require("../config.php");
- require("../user/lib.php");
- require("../lib/countries.php");
+ require_once("../config.php");
+ require_once("../user/lib.php");
+ require_once("../lib/countries.php");
$recordsperpage = 30;
View
2  config-dist.php
@@ -99,7 +99,7 @@
$CFG->libdir = "$CFG->dirroot/lib"; // Do not change this
-require("$CFG->libdir/setup.php"); // Do not change this
+require_once("$CFG->libdir/setup.php"); // Do not change this
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
View
4 course/categories.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Allows the admin to create, delete and rename course categories
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
if (!isadmin()) {
error("Only administrators can use this course!");
View
2  course/delete.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
// Admin-only code to delete a course utterly
- require("../config.php");
+ require_once("../config.php");
optional_variable($id); // course id
optional_variable($delete); // delete confirmation
View
4 course/edit.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Edit course settings
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
optional_variable($id, 0); // course id
View
4 course/editsection.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Edit the introduction of a section
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // Week ID
View
4 course/enrol.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Asks for a course pass key, once only, and enrols that user
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_login();
require_variable($id);
View
4 course/grade.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Displays all grades for a student in a course
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // course id
View
6 course/grades.php
@@ -1,9 +1,9 @@
<?PHP // $Id$
// Displays all grades for a course
- require("../config.php");
- require("lib.php");
- require("../lib/psxlsgen.php");
+ require_once("../config.php");
+ require_once("lib.php");
+ require_once("../lib/psxlsgen.php");
require_variable($id); // course id
optional_variable($download, ""); // to download data
View
4 course/index.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Display list of all courses
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
optional_variable($category, "");
View
4 course/lib.php
@@ -594,7 +594,7 @@ function print_side_block_end() {
function print_admin_links ($siteid, $width=180) {
- global $THEME, $CFG;
+ global $CFG;
$icon = "<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/config.php\">".get_string("configvariables")."</A>";
@@ -639,7 +639,7 @@ function print_admin_links ($siteid, $width=180) {
}
function print_course_admin_links($course, $width=180) {
- global $USER, $THEME, $CFG;
+ global $USER, $CFG;
if (isteacher($course->id)) {
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
View
4 course/log.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Displays different views of the logs.
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // Course ID
optional_variable($user, 0); // User to display
View
6 course/loggraph.php
@@ -1,9 +1,9 @@
<?PHP // $Id$
// Produces a graph of log accesses
- require("../config.php");
- require("lib.php");
- require("$CFG->libdir/graphlib.php");
+ require_once("../config.php");
+ require_once("lib.php");
+ require_once("$CFG->libdir/graphlib.php");
require_variable($id); // Course ID
require_variable($type); // Graph Type
View
4 course/loginas.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Allows a teacher/admin to login as another user (in stealth mode)
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // course id
optional_variable($user); // login as this user
View
4 course/loglive.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Displays live view of recent logs
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_login($id);
View
6 course/mod.php
@@ -35,7 +35,7 @@
$modlib = "../mod/$mod->modulename/lib.php";
if (file_exists($modlib)) {
- include($modlib);
+ include_once($modlib);
} else {
error("This module is missing important code! ($modlib)");
}
@@ -163,7 +163,7 @@
$form->fullmodulename = $fullmodulename;
$form->instancename = $instance->name;
- include("mod_delete.html");
+ include_once("mod_delete.html");
exit;
@@ -284,7 +284,7 @@
print_heading($pageheading);
print_simple_box_start("center", "", "$THEME->cellheading");
- include($modform);
+ include_once($modform);
print_simple_box_end();
} else {
View
4 course/social.php
@@ -2,8 +2,8 @@
// social.php - course format featuring social forum
// included from view.php
- include_once("$CFG->dirroot/mod/forum/lib.php");
- include_once("$CFG->dirroot/mod/resource/lib.php");
+ require_once("$CFG->dirroot/mod/forum/lib.php");
+ require_once("$CFG->dirroot/mod/resource/lib.php");
$leftwidth = 210;
?>
View
4 course/teacher.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Admin-only script to assign teachers to courses
- require("../config.php");
- require("../user/lib.php");
+ require_once("../config.php");
+ require_once("../user/lib.php");
optional_variable($id); // course id
View
4 course/teachers.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Allows a teacher to edit teacher order and roles for a course
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // course id
View
2  course/topics.php
@@ -6,7 +6,7 @@
// courses that aren't so rigidly defined by time.
// Included from "view.php"
- include_once("$CFG->dirroot/mod/forum/lib.php");
+ require_once("$CFG->dirroot/mod/forum/lib.php");
if (isset($topic)) {
if ($topic == "all") {
View
4 course/unenrol.php
@@ -5,8 +5,8 @@
// but will remove them from the student list and prevent
// any course email being sent to them.
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); //course
optional_variable($user, $USER->id); //user
View
4 course/user.php
@@ -2,8 +2,8 @@
// Display user activity reports for a course
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // course id
require_variable($user); // user id
View
4 course/view.php
@@ -2,8 +2,8 @@
// Display the course home page.
- include_once("../config.php");
- include_once("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
optional_variable($id);
optional_variable($name);
View
2  course/weeks.php
@@ -2,7 +2,7 @@
// Display the whole course as "weeks" made of of modules
// Included from "view.php"
- include_once("$CFG->dirroot/mod/forum/lib.php");
+ require_once("$CFG->dirroot/mod/forum/lib.php");
if (isset($week)) {
View
4 file.php
@@ -2,8 +2,8 @@
// This function fetches files from the data directory
// Syntax: file.php/courseid/dir/.../dir/filename.ext
- require("config.php");
- require("files/mimetypes.php");
+ require_once("config.php");
+ require_once("files/mimetypes.php");
$lifetime = 86400;
View
6 help.php
@@ -4,7 +4,7 @@
/// Usually this will appear in a popup
/// See helpbutton() in lib/moodlelib.php
- include("config.php");
+ require_once("config.php");
optional_variable($file, "");
optional_variable($text, "No text to display");
@@ -26,7 +26,7 @@
}
if (file_exists("$filepath")) {
- include("$filepath"); // Chosen language
+ require_once("$filepath"); // Chosen language
} else { // Fall back to English
if ($module == "moodle") {
@@ -36,7 +36,7 @@
}
if (file_exists("$filepath")) {
- include("$filepath");
+ require_once("$filepath");
} else {
notify("Can not find the specified help file");
die;
View
8 index.php
@@ -1,10 +1,10 @@
<?PHP // $Id$
// index.php - the front page.
- require("config.php");
- require("course/lib.php");
- require("mod/resource/lib.php");
- require("mod/forum/lib.php");
+ require_once("config.php");
+ require_once("course/lib.php");
+ require_once("mod/resource/lib.php");
+ require_once("mod/forum/lib.php");
if (! $site = get_site()) {
redirect("$CFG->wwwroot/admin/index.php");
View
8 lib/setup.php
@@ -15,7 +15,7 @@
/// Connect to the database using adodb
- require("$CFG->libdir/adodb/adodb.inc.php"); // Database access functions
+ require_once("$CFG->libdir/adodb/adodb.inc.php"); // Database access functions
$db = &ADONewConnection($CFG->dbtype);
@@ -33,9 +33,9 @@
/// Load up standard libraries
- require("$CFG->libdir/weblib.php"); // Functions for producing HTML
- require("$CFG->libdir/datalib.php"); // Functions for accessing databases
- require("$CFG->libdir/moodlelib.php"); // Other general-purpose functions
+ require_once("$CFG->libdir/weblib.php"); // Functions for producing HTML
+ require_once("$CFG->libdir/datalib.php"); // Functions for accessing databases
+ require_once("$CFG->libdir/moodlelib.php"); // Other general-purpose functions
/// Load up any configuration from the config table
View
2  login/change_password.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
- include("../config.php");
+ require_once("../config.php");
optional_variable($id);
View
2  login/confirm.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
- require("../config.php");
+ require_once("../config.php");
if ( isset($p) && isset($s) ) { # p = user.secret s = user.username
View
2  login/forgot_password.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
- include("../config.php");
+ require_once("../config.php");
if ($frm = data_submitted()) {
View
3  login/index.php
@@ -1,5 +1,6 @@
<?PHP // $Id$
- require("../config.php");
+
+ require_once("../config.php");
// Check if the guest user exists. If not, create one.
if (! record_exists("user", "username", "guest")) {
View
2  login/logout.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
// Logs the user out and sends them to the home page
- require("../config.php");
+ require_once("../config.php");
$USER = NULL;
$SESSION = NULL;
View
4 login/signup.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../config.php");
- require("../lib/countries.php");
+ require_once("../config.php");
+ require_once("../lib/countries.php");
if ($user = data_submitted()) {
View
4 mod/assignment/index.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // course
View
2  mod/assignment/lib.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
-include_once("$CFG->dirroot/files/mimetypes.php");
+require_once("$CFG->dirroot/files/mimetypes.php");
define("OFFLINE", "0");
define("UPLOADSINGLE", "1");
View
4 mod/assignment/submissions.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // Assignment
View
4 mod/assignment/upload.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // Assignment ID
View
4 mod/assignment/view.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
optional_variable($id); // Course Module ID
optional_variable($a); // Assignment ID
View
4 mod/choice/index.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // course
View
4 mod/choice/report.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // course module
View
4 mod/choice/view.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // Course Module ID
View
4 mod/forum/delete.php
@@ -2,8 +2,8 @@
// Deletes a forum entirely.
- require("../../config.php");
- require("mod.php");
+ require_once("../../config.php");
+ require_once("mod.php");
require_variable($f); // The forum to delete.
View
4 mod/forum/discuss.php
@@ -3,8 +3,8 @@
// Displays a post, and all the posts below it.
// If no post is given, displays all posts in a discussion
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($d); // Discussion ID
optional_variable($parent); // If set, then display this post and all children.
View
4 mod/forum/index.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
optional_variable($id); // course
View
2  mod/forum/lib.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
-include_once("$CFG->dirroot/files/mimetypes.php");
+require_once("$CFG->dirroot/files/mimetypes.php");
/// CONSTANTS ///////////////////////////////////////////////////////////
View
4 mod/forum/post.php
@@ -3,8 +3,8 @@
// Edit and save a new post to a discussion
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
if (isguest()) {
error(get_string("noguestpost", "forum"), $_SERVER["HTTP_REFERER"]);
View
4 mod/forum/rate.php
@@ -3,8 +3,8 @@
// Collect ratings, store them, then return to where we came from
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
if (isguest()) {
error("Guests are not allowed to rate posts.", $_SERVER["HTTP_REFERER"]);
View
4 mod/forum/report.php
@@ -2,8 +2,8 @@
// For a given post, shows a report of all the ratings it has
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id);
View
4 mod/forum/search.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // course id
optional_variable($search, ""); // search string
View
4 mod/forum/subscribe.php
@@ -2,8 +2,8 @@
// Subscribe to or unsubscribe from a forum.
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // The forum to subscribe or unsubscribe to
optional_variable($force); // Force everyone to be subscribed to this forum?
View
4 mod/forum/subscribers.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // forum
View
4 mod/forum/view.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
optional_variable($id); // Course Module ID
optional_variable($f); // Forum ID
View
2  mod/journal/edit.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
- require("../../config.php");
+ require_once("../../config.php");
require_variable($id); // Course Module ID
View
4 mod/journal/index.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // course
View
4 mod/journal/report.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // course module
View
4 mod/journal/view.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // Course Module ID
View
4 mod/quiz/attempt.php
@@ -2,8 +2,8 @@
// This page prints a particular instance of quiz
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
optional_variable($id); // Course Module ID, or
optional_variable($q); // quiz ID
View
4 mod/quiz/category.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Allows a teacher to create, edit and delete categories
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // course
View
4 mod/quiz/edit.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_login();
View
4 mod/quiz/index.php
@@ -2,8 +2,8 @@
// This page lists all the instances of quiz in a particular course
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // course
View
2  mod/quiz/mod.html
@@ -2,7 +2,7 @@
<!-- It is used from /course/mod.php. The whole instance is available as $form. -->
<?PHP
- include_once("$CFG->dirroot/mod/quiz/lib.php");
+ require_once("$CFG->dirroot/mod/quiz/lib.php");
if (empty($form->name)) {
$form->name = "";
View
6 mod/quiz/question.php
@@ -1,9 +1,9 @@
<?PHP // $Id$
/// For creating and editing quiz questions.
- require("../../config.php");
- require("lib.php");
- require("../../files/mimetypes.php");
+ require_once("../../config.php");
+ require_once("lib.php");
+ require_once("../../files/mimetypes.php");
optional_variable($id);
View
4 mod/quiz/report.php
@@ -2,8 +2,8 @@
// This page prints a particular instance of quiz
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
optional_variable($id); // Course Module ID, or
optional_variable($q); // quiz ID
View
4 mod/quiz/view.php
@@ -2,8 +2,8 @@
// This page prints a particular instance of quiz
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
optional_variable($id); // Course Module ID, or
optional_variable($q); // quiz ID
View
4 mod/resource/details.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_login();
View
2  mod/resource/index.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
- require("../../config.php");
+ require_once("../../config.php");
require_variable($id); // course
View
4 mod/resource/view.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // Course Module ID
View
2  mod/survey/details.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
- require("../../config.php");
+ require_once("../../config.php");
if ($form = data_submitted($destination)) {
View
2  mod/survey/download.php
@@ -109,7 +109,7 @@
// Output the file as a valid Excel spreadsheet if required
if ($type == "xls") {
- include( "$CFG->libdir/psxlsgen.php" );
+ require_once( "$CFG->libdir/psxlsgen.php" );
$myxls = new PhpSimpleXlsGen();
View
6 mod/survey/graph.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
- require("../../config.php");
- require("$CFG->libdir/graphlib.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("$CFG->libdir/graphlib.php");
+ require_once("lib.php");
require_variable($id); // Course Module ID
require_variable($type); // Graph Type
View
4 mod/survey/index.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require("../../config.php");
- require("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // course
View
4 mod/survey/report.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- include("../../config.php");
- include("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
// Check that all the parameters have been provided.
View
4 mod/survey/save.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- require('../../config.php');
- require('lib.php');
+ require_once('../../config.php');
+ require_once('lib.php');
// Make sure this is a legitimate posting
View
4 mod/survey/view.php
@@ -1,7 +1,7 @@
<?PHP // $Id$
- include("../../config.php");
- include("lib.php");
+ require_once("../../config.php");
+ require_once("lib.php");
require_variable($id); // Course Module ID
View
2  theme/index.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
- require("../config.php");
+ require_once("../config.php");
optional_variable($preview); // which theme to show
optional_variable($choose); // set this theme as default
View
6 user/edit.php
@@ -1,8 +1,8 @@
<?PHP // $Id$
- require("../config.php");
- require("../lib/countries.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("../lib/countries.php");
+ require_once("lib.php");
require_variable($id); // user id
require_variable($course); // course id
View
6 user/index.php
@@ -2,9 +2,9 @@
// Lists all the users within a given course
- require("../config.php");
- require("../lib/countries.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("../lib/countries.php");
+ require_once("lib.php");
require_variable($id); //course
optional_variable($sort, "lastaccess"); //how to sort students
View
2  user/pix.php
@@ -3,7 +3,7 @@
// Syntax: pix.php/userid/f1.jpg or pix.php/userid/f2.jpg
// OR: ?file=userid/f1.jpg or ?file=userid/f2.jpg
- require("../config.php");
+ require_once("../config.php");
$lifetime = 86400;
View
8 user/view.php
@@ -2,10 +2,10 @@
// Display profile for a particular user
- require("../config.php");
- require("../lib/countries.php");
- require("../mod/forum/lib.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("../lib/countries.php");
+ require_once("../mod/forum/lib.php");
+ require_once("lib.php");
require_variable($id);
require_variable($course);
Please sign in to comment.
Something went wrong with that request. Please try again.