]> git.mjollnir.org Git - moodle.git/commitdiff
Clean sweep through all the important changing all include(), include_once()
authormoodler <moodler>
Sun, 5 Jan 2003 14:19:20 +0000 (14:19 +0000)
committermoodler <moodler>
Sun, 5 Jan 2003 14:19:20 +0000 (14:19 +0000)
and require() to require_once()

88 files changed:
admin/admin.php
admin/auth.php
admin/config.php
admin/cron.php
admin/delete.php
admin/index.php
admin/lang.php
admin/site.php
admin/user.php
config-dist.php
course/categories.php
course/delete.php
course/edit.php
course/editsection.php
course/enrol.php
course/grade.php
course/grades.php
course/index.php
course/lib.php
course/log.php
course/loggraph.php
course/loginas.php
course/loglive.php
course/mod.php
course/social.php
course/teacher.php
course/teachers.php
course/topics.php
course/unenrol.php
course/user.php
course/view.php
course/weeks.php
file.php
help.php
index.php
lib/setup.php
login/change_password.php
login/confirm.php
login/forgot_password.php
login/index.php
login/logout.php
login/signup.php
mod/assignment/index.php
mod/assignment/lib.php
mod/assignment/submissions.php
mod/assignment/upload.php
mod/assignment/view.php
mod/choice/index.php
mod/choice/report.php
mod/choice/view.php
mod/forum/delete.php
mod/forum/discuss.php
mod/forum/index.php
mod/forum/lib.php
mod/forum/post.php
mod/forum/rate.php
mod/forum/report.php
mod/forum/search.php
mod/forum/subscribe.php
mod/forum/subscribers.php
mod/forum/view.php
mod/journal/edit.php
mod/journal/index.php
mod/journal/report.php
mod/journal/view.php
mod/quiz/attempt.php
mod/quiz/category.php
mod/quiz/edit.php
mod/quiz/index.php
mod/quiz/mod.html
mod/quiz/question.php
mod/quiz/report.php
mod/quiz/view.php
mod/resource/details.php
mod/resource/index.php
mod/resource/view.php
mod/survey/details.php
mod/survey/download.php
mod/survey/graph.php
mod/survey/index.php
mod/survey/report.php
mod/survey/save.php
mod/survey/view.php
theme/index.php
user/edit.php
user/index.php
user/pix.php
user/view.php

index 106ff89f9ff26cf9365fa81fc9cff389af8cd0d5..59e5403abdd207b7b9266e489cf1e72ad6729b44 100644 (file)
@@ -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'])");
index cf72f160a775046e347a144bd7fc695f3ca09f5f..a62466993d7320e0d38cdac48339088d2df1b367 100644 (file)
 
     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\">";
index cb3430e0eb78d62b5af37c4d3316d1e1aad692c0..db440ce66015ce07226b5e787178b5240b263b7f 100644 (file)
@@ -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") {
index aca529fc1f6cc7347f8025dfdd698a70a8f691dc..bafed380ae5a4ed39905a2a6246983e2982a7cea 100644 (file)
@@ -13,7 +13,7 @@
 
     $FULLME = "cron";
 
-    require("../config.php");
+    require_once("../config.php");
 
     echo "<PRE>\n";
 
index 97af1ea0db80413fabe5be46956169fcf390dfb8..ca1988a3f02127703fd716185b9bcf0873d85e77 100644 (file)
@@ -3,7 +3,7 @@
 // Deletes the moodledata directory, COMPLETELY!!
 // BE VERY CAREFUL USING THIS!
 
-    include("../config.php");
+    require_once("../config.php");
 
     require_login();
 
index 62c9e6efbf1f0eccbbbb142b546398ac48c0ce54..9a1f45d7758751813651ee2b7cc55277abf7f05c 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP // $Id$
 
-    require("../config.php");
+    require_once("../config.php");
 
 
 /// Check that PHP is of a sufficient version
index 2c3b5c66c2a933b09af0593183c947945fdd42f1..65341c63cf22729f329a698607fb2c1c4bcc14c9 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP // $Id$
 
-    require("../config.php");
+    require_once("../config.php");
 
     optional_variable($mode, "");
 
index b1bdc50e0d7b187aa45ba6566fce0c14aec5dd9c..a7271f5a26c67eed169012c4fa9394c965a0d6b0 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP // $Id$
 
-    require("../config.php");
+    require_once("../config.php");
 
     if ($site = get_site()) {
         if (!isadmin()) {
index 4749cd64f59bf5b728327043d039c6e43ad5b481..c1123bc26deaddb6aacb2563ed01fd3470a320a9 100644 (file)
@@ -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;
 
index a9d68d83978eb6c9ae43eea66dedfedede5ec181..c9e6a4bd1f8929cac11f85d39affe698f677ed21 100644 (file)
@@ -99,7 +99,7 @@ $CFG->buggy_referer = false;
 \r
 \r
 $CFG->libdir    = "$CFG->dirroot/lib";   // Do not change this\r
-require("$CFG->libdir/setup.php");       // Do not change this\r
+require_once("$CFG->libdir/setup.php");       // Do not change this\r
 \r
 // MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES, \r
 // RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.\r
index 07506a07d8dd46a662c89a391b83098cc3304028..63c67635822fc8b17b61a77f6ead022068fa22be 100644 (file)
@@ -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!");
index e81599c369bdbd6e4d0f0cb9595780f88307770b..e8630ad2841f410b9c58826787b92188df2b9bec 100644 (file)
@@ -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
index ce988de87348b9b7d82e5e8f3958b43e13f47b32..2634a981cc6045950c64e69ebe35cc7f0d9e7a4d 100644 (file)
@@ -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
 
index eadcdac5f2dc46eba957c9c482ffdeb7f0e24668..2ddca3cffd85c3de4ef2aff2869c459c472959d3 100644 (file)
@@ -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
 
index 5072a703df91ffad0862ff3ac0918dcc09a5949f..570f1421db5657e91d9df6922176c9c3b9dac144 100644 (file)
@@ -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);
index 31066372ccaf5f4f0691eebe1989350274ceb417..9fb0507758b65d7b7af722e0a17d631b3d7e59e5 100644 (file)
@@ -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
 
index c329a86bed72da8cdfc8b0fc86fbfc341d256c16..926302994c314b130999389bfc392dc1e162eb81 100644 (file)
@@ -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 
index a26cb44f91a408e910ac7f4f1d239212ee1659aa..82ad3ee9870e39daf7f32504508dfd5ddb1439c6 100644 (file)
@@ -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, "");
 
index eec952663e79ee5ac8887939a5d28819050084fe..fe047a7740febb549aca8b11658c2e751789eb73 100644 (file)
@@ -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=\"\">";
index 7176f324530ab2fd46acacfe2bffe43a0ebd47bd..775b3e0f0524ccc37edcc6b9199488fea04dae4d 100644 (file)
@@ -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
index 481b18f6eb6e3eada57e79b0e62e99ce101d1bd1..ca050de71cfa9778f2e5ff292135f286b9a0bda9 100644 (file)
@@ -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
index 134bafa852436dbb0da0e49ece7c6d878a6bc935..9c903ce034162870812463149b66713f365919ea 100644 (file)
@@ -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
index 9a10cebb8a05c3d751e68edd74206e7f0b111bd6..fd9f8191ecb964fcd8291fa36da4e7629f68b48c 100644 (file)
@@ -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);
 
index 3263ecb6da56f8a44a45d686f23f9c68b29df9ce..52994dbaf804d0f969a2a0ec4c70381ca25de65b 100644 (file)
@@ -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)");
         }
         $form->fullmodulename  = $fullmodulename;
         $form->instancename = $instance->name;
 
-        include("mod_delete.html");
+        include_once("mod_delete.html");
 
         exit;
 
 
         print_heading($pageheading);
         print_simple_box_start("center", "", "$THEME->cellheading");
-        include($modform);
+        include_once($modform);
         print_simple_box_end();
 
     } else {
index c6e76577fa9b5de4679a4f087ccc2bd563d310e9..32d50de89db113f3dc8024b50e11bc9fbd8fa687 100644 (file)
@@ -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;
 ?>
index e3172f4b36eafc868c2faa9f4fa2eb8aefa6ad5b..fce25fbd7824d4dd326c02a46b5b15daa50e85ec 100644 (file)
@@ -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
 
index e4e992f5c126cab73e320714d2951033c461a2b8..186552ebc290516f534ef35d6a81c107c1412578 100644 (file)
@@ -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
 
index d423a3a4f46e7ae8844b396673019108bec32ffa..1e7ae735ff99d9212845c54348240f646b04753e 100644 (file)
@@ -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") {
index d5ce56600ade9f73f895e162a742fddad9979015..9c524aa9711ebf7c6bb8641bb05a9dac5c06f0b4 100644 (file)
@@ -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
index 7af2485dac77425723b684331b42bb84c8d42973..7171f7198cfa61b8ff76b4e1f6be559af87b95a4 100644 (file)
@@ -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
index 382c79daf57f3b413fecc2c4c41a366fe8c9b971..04f4ff14fa28ba28912129b5b76147ee647029cb 100644 (file)
@@ -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);
index 99da7560f11378be6b3b07cea4e3e3173778b45e..ecc2d09f7c968c341a249af4b30bc26f6e1bea42 100644 (file)
@@ -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)) {
index 78c3ecf0f4cf03ec177397165a5cd2a8889028e6..4ef1baf4c0d6404450889972e133cea21a9eda1e 100644 (file)
--- a/file.php
+++ b/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;
 
index 18e95bcbc0c44781209ec7c732e148a3dfcec34f..6a112140092f618e82fbb951974da0a0e4633f78 100644 (file)
--- a/help.php
+++ b/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;
index a3de87b78472d0cd9d202444905fb3611db52aee..656b8076a959998b83d39eaac6cdf7696a4559ab 100644 (file)
--- a/index.php
+++ b/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");
index 62d51c86a2cb0bb723c08bfa5e6007161c2b6217..3164742eaf4b1a53a9aee5fbfdb371e07e5e6b8e 100644 (file)
@@ -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
index 27ce2cf7aee975984cbaf70508e1ee2cd6dd93c6..83d382ae65da271a93a1936af4360703ff1789ae 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP // $Id$
 
-       include("../config.php");
+       require_once("../config.php");
 
     optional_variable($id);
 
index 8091d83249964f817b1b54b586cd7e989d3b8df5..7862e7cf6eef1c0f10c6b2da6dbb3c7b18065a40 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP // $Id$
 
-       require("../config.php");
+       require_once("../config.php");
 
        if ( isset($p) && isset($s) ) {     #  p = user.secret   s = user.username
 
index ec5ffc73209b5bd603c343c9ebd7148164b21dd1..d68f9696229323c074d61832bfb5d70be154d756 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP // $Id$
 
-       include("../config.php");
+       require_once("../config.php");
 
        if ($frm = data_submitted()) {
 
index 0455c7c677d1e3c84052bcfaa6bdbf4df8993b05..9c7560382deb305447add41704ea36c1bf50d3a4 100644 (file)
@@ -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")) {
index 686ecebf17c8153294382335253c2c1d53061d1a..0e0dd19a645e9a38d0fee1dab63149f130354cee 100644 (file)
@@ -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;
index f07d3c509bcf0e64091644204e389b8c848b1a35..bd477d0f4ed7a39c88dd01713e6ff13c3703324d 100644 (file)
@@ -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()) {
 
index 76c945ba7d7bceab74dc0b34049c7bba4063ddbd..167082dae40fea14d20df16513ddf4e5beed7180 100644 (file)
@@ -1,7 +1,7 @@
 <?PHP // $Id$
 
-    require("../../config.php");
-    require("lib.php");
+    require_once("../../config.php");
+    require_once("lib.php");
 
     require_variable($id);   // course
 
index ce1806278011b28d3943517bbcc923716d1a39d1..97526afebd10fdafc6cb035aa1ea62dafc3bdb0c 100644 (file)
@@ -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");
index bd3a9d49fb01c557d7467a4568b5e9ec1f1884ac..1654da237be588b1c6fb89a1f8c0c7a793f0cfd8 100644 (file)
@@ -1,7 +1,7 @@
 <?PHP  // $Id$
 
-    require("../../config.php");
-    require("lib.php");
+    require_once("../../config.php");
+    require_once("lib.php");
 
     require_variable($id);    // Assignment
 
index 6109ed23e2490132808ed0844c1c4647f6d8e684..50d3ac6897363896879fc027a70428b7e38063ec 100644 (file)
@@ -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
 
index d34985fc93be23249d2c97661c511edfc617f58b..1893431ed93211ef225361cc2df8b2a3344133ac 100644 (file)
@@ -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
index 35d0a3b9ea7606806f66ff4e23f8f935ad711530..e57303691912bc8a19e1297bfc66730e35729bc7 100644 (file)
@@ -1,7 +1,7 @@
 <?PHP  // $Id$
 
-    require("../../config.php");
-    require("lib.php");
+    require_once("../../config.php");
+    require_once("lib.php");
 
     require_variable($id);   // course
 
index df27b580c609c414c8c351020795589d7a8b1633..250fd222a8975f0506c74192a08eb62bd1363822 100644 (file)
@@ -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
 
index ddc66da931ec4fc167095192a3df793fd284601c..ed8e75075c46b26f07e2e476301bd36a5953d786 100644 (file)
@@ -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
 
index 3eb2b60a0bedde2fee46fadabb8ec2bdc3c4e481..a6cab3ff30b6f57a4a0a7de007858dce8cf0cdac 100644 (file)
@@ -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.
 
index c2b21adf645a88b5bc40bfeef564cf9d63696530..3cf7977a714659ebf6f1738417ac769016b658f3 100644 (file)
@@ -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.
index 672aebf71de7e5e6d9a1b63cb19fddc644a1eafc..93dc634c582432fef06e201d5eaaf5eaf61d9080 100644 (file)
@@ -1,7 +1,7 @@
 <?PHP  // $Id$
 
-    require("../../config.php");
-    require("lib.php");
+    require_once("../../config.php");
+    require_once("lib.php");
 
     optional_variable($id);          // course
 
index 3dd9dda1b5bc2dfeda012d55fe4bb3136834acb8..8170a1cbaf9bec76911effec7f6e9f34ec8c20ba 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP  // $Id$
 
-include_once("$CFG->dirroot/files/mimetypes.php");
+require_once("$CFG->dirroot/files/mimetypes.php");
 
 /// CONSTANTS ///////////////////////////////////////////////////////////
 
index fa38ce0c355f97b73f5b0f715dd2edd569f2c651..4edef6ef88318cd0d0f8e39583b21caf95735c9b 100644 (file)
@@ -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"]);
index 940708c63dbca29f5505e11eda5d4792ae27e836..7ff53c035c6d0d8aa817ae58d9e26db24de07d0c 100644 (file)
@@ -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"]);
index 66fdc43dbdfbcbbb12f306e18dcf194d62252280..799200e67cceac506ee6937a3cfd6fee0dd65492 100644 (file)
@@ -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);
 
index 09314ceaf243f623f20d08476a4c040a23167057..27dffd54a059db6271cc67f041ef96fb5dfa6535 100644 (file)
@@ -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
index 45b389459e67677b9a190464fb8c45c9eddf0d5d..0802b37c0934ecad43461e435c257036fd346664 100644 (file)
@@ -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?
index 519b0612b9851499a7cae1607b48c151fd77d2ca..5688e61d1a406d1567dbb6907e0d6ccc3ee14bb7 100644 (file)
@@ -1,7 +1,7 @@
 <?PHP  // $Id$
 
-    require("../../config.php");
-    require("lib.php");
+    require_once("../../config.php");
+    require_once("lib.php");
 
     require_variable($id);          // forum
 
index 24f6517dad0e6768681fcf3a76de02eebc25e5f5..088faf413ddf48f97b7f162d256ee3670590bad9 100644 (file)
@@ -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
index f27a5986390bfd9713b28471e0e88d5919c4f379..4411957070f243982cbe7df5fd0bbae972f73ca7 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP // $Id$
 
-       require("../../config.php");
+       require_once("../../config.php");
 
     require_variable($id);    // Course Module ID
 
index 0e149569bb5865c719d49e78d3c0e3343a59f53a..ed63bd8763aeef77db311aa9c7ef8b1b7220b75d 100644 (file)
@@ -1,7 +1,7 @@
 <?PHP // $Id$
 
-    require("../../config.php");
-    require("lib.php");
+    require_once("../../config.php");
+    require_once("lib.php");
 
     require_variable($id);   // course
 
index 87d9e38da90be94186f94b118a4fdcbfbc1d4dc1..27280daeec87c86b587818512d7c39b4686a251b 100644 (file)
@@ -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
 
index e800aec7c126800d35456c5719db519001f0c906..7c8e3258e4cb332d32a953fb78ff6b9988881f7e 100644 (file)
@@ -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
 
index e7658b2adceae3a2372d4e200a01279fef2d607d..5fb9188a5b736e1db1e1390e92a49a2efd7ed1e6 100644 (file)
@@ -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
index dcc90386595cef4798a43def95835ff063db91b1..94630fa6cafc998b0054b5fcb5414cf200f7ed95 100644 (file)
@@ -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
 
index 2b979fe3834876ee2ed1fdf59295ecd4b0d856a2..49622409523f3b62072afa88c6d63ae9c3d2700a 100644 (file)
@@ -1,7 +1,7 @@
 <?PHP // $Id$
 
-    require("../../config.php");
-    require("lib.php");
+    require_once("../../config.php");
+    require_once("lib.php");
 
     require_login();
 
index 684fbb50e8e43cee925b4cfd7e55b0d44e41342a..3cd40202315e67d8d15ace02ffdd414dbebd12b0 100644 (file)
@@ -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
 
index b347bca6dbf000d49927cbf1d90228c9d04a0ab1..139311f5c2f0fa0af3dc24f4654968f54aa22edf 100644 (file)
@@ -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 = "";
index 2f765cbf3d4965b8e073853367ec0ef83934c5c5..75ddc40fc7e1505d978db7c5b63736e63acac5f5 100644 (file)
@@ -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);
 
index 3a2364f87dcace4d0805cb62bb6f35a010dc5574..13729e320f59c12ee466d6088de69da19df6768e 100644 (file)
@@ -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
index 7ecb933c5d0e8db81de4348673f2ba413c2b3e51..0744a4bb70c42676c035cd6922c68dc69da8f955 100644 (file)
@@ -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
index a974d1ad3bf721629e53d602ee45b15c8aa553f3..b6f41a310acc4add41b3566516ff3aed5da6bb35 100644 (file)
@@ -1,7 +1,7 @@
 <?PHP // $Id$
 
-    require("../../config.php");
-    require("lib.php");
+    require_once("../../config.php");
+    require_once("lib.php");
 
     require_login();
 
index 0002f398e20cbf901e963d4dc5ad32d3dd8fb720..1fc59cc6a57932974f9d58ff3184f999b0882e4c 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP // $Id$
 
-    require("../../config.php");
+    require_once("../../config.php");
 
     require_variable($id);   // course
 
index ab3c99a4c567ea18de62930c80f6e2a3894ae6cb..7f4a9257334ee8e3d174700103a3b69f8c9dbdfc 100644 (file)
@@ -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
 
index e805c0f9cbff72f3e31a5a6a8b7e0f67583738c7..5cb1ca9a9077d60887de7ae89ed0145effe7cbcc 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP // $Id$
 
-    require("../../config.php");
+    require_once("../../config.php");
 
     if ($form = data_submitted($destination)) { 
 
index c400a17719acad280170350937f1e0859f6af477..45cafd753becd0ff0663e1d512f916e34d518e88 100644 (file)
 // 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();
index fb9b70a470d9516294bd6690630540400547ad08..fed1e359a37424b517ad86830f6c7fe9d7ef848b 100644 (file)
@@ -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
index 66f96773f1c62360cdea758291479cd147d0f15b..12bcfc56ce811502fa48d278d4f238c4defc1330 100644 (file)
@@ -1,7 +1,7 @@
 <?PHP // $Id$
 
-    require("../../config.php");
-    require("lib.php");
+    require_once("../../config.php");
+    require_once("lib.php");
 
     require_variable($id);   // course
 
index c397b587e2b53b8e07d7ca999608bf4180df7c7d..ca3c51eb1ca9a6922295853ddfd8080752198d5d 100644 (file)
@@ -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.
  
index 63536bb5da85172d82fd5e15fbfb6f1e11bdc71c..00dcb7667011e6b0adc164adced47352c71818ef 100644 (file)
@@ -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
index d3c7436c2676ff23bb16810c4629b93d852abf32..12091a6e9c5d15ae706dbaf9fdaeb0fc5e89e262 100644 (file)
@@ -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
 
index 5c4aef8ba95c50e9113a8b5bf10f29b0c811add2..11af3a8e36fe7c7aac8a23a9913e4bf5cae7dcc6 100644 (file)
@@ -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
index bf29f04ab2ccf95c52455090ffccad2d132db399..27a43bee595808fad0bcfed218067187ff1afa4f 100644 (file)
@@ -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
index 90f8d811ed43907ab464be0b92dad094f22a5ef0..44fedb3d024cde17af8e14bd08d756b60db995fd 100644 (file)
@@ -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
index 9a07f13b47a622f26c2cf83a7250dc4211dc4f86..9feff114a01546e19e4cd7949be78f8d59934e96 100644 (file)
@@ -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;
 
index 0a6d88a164ada13ee282c049c8e642692e87577f..369e9d901fe5175715dae5b61071593406e5ec28 100644 (file)
@@ -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);