Drift between CVS and git
authorFrancois Marier <francois@catalyst.net.nz>
Wed, 25 Jun 2008 17:31:23 +0000 (17:31 +0000)
committerFrancois Marier <francois@catalyst.net.nz>
Wed, 25 Jun 2008 17:31:23 +0000 (17:31 +0000)
- large deletions
- lucene updates
- error() => print_error()
- NO_MOODLE_COOKIES define
- various other things

384 files changed:
admin/auth.php
admin/cron.php
admin/enrol.php
admin/mnet/index.php
admin/module.php
auth/cas/cas_ldap_sync_users.php
auth/db/auth_db_sync_users.php
auth/ldap/auth.php
auth/ldap/auth_ldap_sync_users.php
auth/ldap/ntlmsso_magic.php
auth/shibboleth/index.php
auth/shibboleth/login.php
backup/db/mysql.php [deleted file]
backup/db/postgres7.php [deleted file]
blocks/activity_modules/db/mysql.php [deleted file]
blocks/activity_modules/db/postgres7.php [deleted file]
blocks/admin/db/mysql.php [deleted file]
blocks/admin/db/mysql.sql [deleted file]
blocks/admin/db/postgres7.php [deleted file]
blocks/admin/db/postgres7.sql [deleted file]
blocks/admin_bookmarks/create.php
blocks/admin_bookmarks/delete.php
blocks/calendar_month/db/mysql.php [deleted file]
blocks/calendar_month/db/postgres7.php [deleted file]
blocks/calendar_upcoming/db/mysql.php [deleted file]
blocks/calendar_upcoming/db/postgres7.php [deleted file]
blocks/course_list/db/mysql.php [deleted file]
blocks/course_list/db/postgres7.php [deleted file]
blocks/course_summary/db/mysql.php [deleted file]
blocks/course_summary/db/postgres7.php [deleted file]
blocks/db/mysql.php [deleted file]
blocks/db/postgres7.php [deleted file]
blocks/news_items/db/mysql.php [deleted file]
blocks/news_items/db/postgres7.php [deleted file]
blocks/online_users/db/mysql.php [deleted file]
blocks/online_users/db/postgres7.php [deleted file]
blocks/participants/db/mysql.php [deleted file]
blocks/participants/db/postgres7.php [deleted file]
blocks/recent_activity/db/mysql.php [deleted file]
blocks/recent_activity/db/postgres7.php [deleted file]
blocks/rss_client/db/mysql.php [deleted file]
blocks/rss_client/db/postgres7.php [deleted file]
blocks/search/block_search.php
blocks/search/db/install.xml
blocks/search_forums/db/mysql.php [deleted file]
blocks/search_forums/db/postgres7.php [deleted file]
blocks/section_links/db/mysql.php [deleted file]
blocks/section_links/db/postgres7.php [deleted file]
blocks/social_activities/db/mysql.php [deleted file]
blocks/social_activities/db/postgres7.php [deleted file]
course/format/topicscss/ajax.php [deleted file]
course/format/topicscss/format.php [deleted file]
course/format/weekscss/ajax.php [deleted file]
course/format/weekscss/format.php [deleted file]
doc/pix/cvstree.png [deleted file]
doc/pix/files.jpg [deleted file]
doc/pix/social.jpg [deleted file]
doc/pix/topics.jpg [deleted file]
doc/pix/weekly.jpg [deleted file]
enrol/authorize/authorizenetlib.php [deleted file]
enrol/authorize/const.php
enrol/authorize/db/mysql.php [deleted file]
enrol/authorize/db/postgres7.php [deleted file]
enrol/paypal/db/mysql.php [deleted file]
enrol/paypal/db/postgres7.php [deleted file]
filter/algebra/algebradebug.php
filter/algebra/pix.php
filter/tex/pix.php
filter/tex/texdebug.php
filter/tex/texed.php
grade/export/csv/db/access.php [deleted file]
grade/export/ods/dump.php
grade/export/txt/dump.php
grade/export/xls/dump.php
grade/export/xml/dump.php
grade/import/xml/fetch.php
index.php
install/lang/en_utf8/installer.php
lang/en_utf8/block_search.php
lib/adodb/adodb-time.zip [deleted file]
lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/media/bg_left.png [deleted file]
lib/adodb/adodb-xmlschema.zip [deleted file]
lib/adodb/cute_icons_for_site/adodb.gif [deleted file]
lib/adodb/cute_icons_for_site/adodb.png [deleted file]
lib/adodb/cute_icons_for_site/adodb2.gif [deleted file]
lib/adodb/cute_icons_for_site/adodb2.png [deleted file]
lib/adodb/tests/tmssql.php [deleted file]
lib/componentlib.class.php
lib/cookieless.php [deleted file]
lib/db/mysql.php [deleted file]
lib/db/postgres7.php [deleted file]
lib/filelib.php
lib/form/modgroupmode.php [deleted file]
lib/form/selectallornone.php [deleted file]
lib/grade/lib_wrapper.php [deleted file]
lib/javascript-mod.php
lib/pear/System.php [deleted file]
lib/session-test.php
lib/setup.php
lib/simpletest/testdmllib.php [deleted file]
lib/timezones.txt [deleted file]
lib/yui/button/assets/background.png [deleted file]
lib/yui/button/assets/button.css [deleted file]
lib/yui/button/assets/menuarrow.gif [deleted file]
lib/yui/button/assets/splitarrow.gif [deleted file]
lib/yui/button/assets/splitarrow_active.gif [deleted file]
lib/yui/button/button-beta-debug.js [deleted file]
lib/yui/button/button-beta-min.js [deleted file]
lib/yui/button/button-beta.js [deleted file]
lib/yui/colorpicker/colorpicker-beta-debug.js [deleted file]
lib/yui/colorpicker/colorpicker-beta-min.js [deleted file]
lib/yui/colorpicker/colorpicker-beta.js [deleted file]
lib/yui/history/history-beta-debug.js [deleted file]
lib/yui/history/history-beta-min.js [deleted file]
lib/yui/history/history-beta.js [deleted file]
lib/yui/imageloader/imageloader-experimental-debug.js [deleted file]
lib/yui/imageloader/imageloader-experimental-min.js [deleted file]
lib/yui/imageloader/imageloader-experimental.js [deleted file]
lib/yui/menu/assets/map.gif [deleted file]
lib/yui/menu/assets/menuarodwn8_dim_1.gif [deleted file]
lib/yui/menu/assets/menuarodwn8_hov_1.gif [deleted file]
lib/yui/menu/assets/menuarodwn8_nrm_1.gif [deleted file]
lib/yui/menu/assets/menuarorght8_dim_1.gif [deleted file]
lib/yui/menu/assets/menuarorght8_hov_1.gif [deleted file]
lib/yui/menu/assets/menuarorght8_nrm_1.gif [deleted file]
lib/yui/menu/assets/menuchk8_dim_1.gif [deleted file]
lib/yui/menu/assets/menuchk8_hov_1.gif [deleted file]
lib/yui/menu/assets/menuchk8_nrm_1.gif [deleted file]
lib/yui/reset-fonts-grids/reset-fonts-grids-min.css [deleted file]
lib/yui/treeview/assets/lm.gif [deleted file]
lib/yui/treeview/assets/lmh.gif [deleted file]
lib/yui/treeview/assets/ln.gif [deleted file]
lib/yui/treeview/assets/loading.gif [deleted file]
lib/yui/treeview/assets/lp.gif [deleted file]
lib/yui/treeview/assets/lph.gif [deleted file]
lib/yui/treeview/assets/tm.gif [deleted file]
lib/yui/treeview/assets/tmh.gif [deleted file]
lib/yui/treeview/assets/tn.gif [deleted file]
lib/yui/treeview/assets/tp.gif [deleted file]
lib/yui/treeview/assets/tph.gif [deleted file]
lib/yui/treeview/assets/tree.css [deleted file]
lib/yui/treeview/assets/vline.gif [deleted file]
login/confirm.php
login/index.php
mnet/environment.php
mod/assignment/db/mysql.php [deleted file]
mod/assignment/db/postgres7.php [deleted file]
mod/assignment/type/online/db/mysql.php [deleted file]
mod/assignment/type/online/db/postgres7.php [deleted file]
mod/chat/chatd.php
mod/chat/db/mysql.php [deleted file]
mod/chat/db/postgres7.php [deleted file]
mod/chat/gui_header_js/jsupdated.php
mod/chat/gui_header_js/users.php
mod/chat/gui_sockets/chatinput.php
mod/choice/db/mysql.php [deleted file]
mod/choice/db/postgres7.php [deleted file]
mod/data/css.php
mod/data/db/mysql.php [deleted file]
mod/data/db/postgres7.php [deleted file]
mod/data/js.php
mod/exercise/assessments.php [deleted file]
mod/exercise/backuplib.php [deleted file]
mod/exercise/construction_icon.gif [deleted file]
mod/exercise/db/access.php [deleted file]
mod/exercise/db/install.xml [deleted file]
mod/exercise/db/mysql.php [deleted file]
mod/exercise/db/postgres7.php [deleted file]
mod/exercise/db/upgrade.php [deleted file]
mod/exercise/defaults.php [deleted file]
mod/exercise/icon.gif [deleted file]
mod/exercise/icon.png [deleted file]
mod/exercise/icon2.gif [deleted file]
mod/exercise/icon2.png [deleted file]
mod/exercise/index.php [deleted file]
mod/exercise/lib.php [deleted file]
mod/exercise/locallib.php [deleted file]
mod/exercise/mod_form.php [deleted file]
mod/exercise/restorelib.php [deleted file]
mod/exercise/submissions.php [deleted file]
mod/exercise/upload.php [deleted file]
mod/exercise/version.php [deleted file]
mod/exercise/view.php [deleted file]
mod/forum/db/mysql.php [deleted file]
mod/forum/db/postgres7.php [deleted file]
mod/glossary/db/mysql.php [deleted file]
mod/glossary/db/postgres7.php [deleted file]
mod/hotpot/db/mysql.php [deleted file]
mod/hotpot/db/postgres7.php [deleted file]
mod/hotpot/db/update_to_v2.php [deleted file]
mod/hotpot/mod.html [deleted file]
mod/journal/backuplib.php [deleted file]
mod/journal/db/install.xml [deleted file]
mod/journal/db/mysql.php [deleted file]
mod/journal/db/postgres7.php [deleted file]
mod/journal/db/upgrade.php [deleted file]
mod/journal/defaults.php [deleted file]
mod/journal/edit.html [deleted file]
mod/journal/edit.php [deleted file]
mod/journal/icon.gif [deleted file]
mod/journal/index.php [deleted file]
mod/journal/lib.php [deleted file]
mod/journal/mod_form.php [deleted file]
mod/journal/report.php [deleted file]
mod/journal/restorelib.php [deleted file]
mod/journal/version.php [deleted file]
mod/journal/view.php [deleted file]
mod/label/db/mysql.php [deleted file]
mod/label/db/postgres7.php [deleted file]
mod/lams/constants.php [deleted file]
mod/lams/db/access.php [deleted file]
mod/lams/db/install.xml [deleted file]
mod/lams/db/mysql.php [deleted file]
mod/lams/db/postgres7.php [deleted file]
mod/lams/db/upgrade.php [deleted file]
mod/lams/defaults.php [deleted file]
mod/lams/icon.gif [deleted file]
mod/lams/index.php [deleted file]
mod/lams/lib.php [deleted file]
mod/lams/list.php [deleted file]
mod/lams/mod.html [deleted file]
mod/lams/settings.php [deleted file]
mod/lams/userinfo.php [deleted file]
mod/lams/version.php [deleted file]
mod/lams/view.php [deleted file]
mod/lesson/db/mysql.php [deleted file]
mod/lesson/db/postgres7.php [deleted file]
mod/quiz/accessrules.php
mod/quiz/db/mysql.php [deleted file]
mod/quiz/db/postgres7.php [deleted file]
mod/quiz/jstimer.php [deleted file]
mod/quiz/protect_js.php [deleted file]
mod/resource/db/mysql.php [deleted file]
mod/resource/db/postgres7.php [deleted file]
mod/scorm/db/mysql.php [deleted file]
mod/scorm/db/postgres7.php [deleted file]
mod/survey/db/mysql.php [deleted file]
mod/survey/db/postgres7.php [deleted file]
mod/wiki/db/mysql.php [deleted file]
mod/wiki/db/postgres7.php [deleted file]
mod/workshop/assess.php [deleted file]
mod/workshop/assessment_grading_form.html [deleted file]
mod/workshop/assessments.php [deleted file]
mod/workshop/backuplib.php [deleted file]
mod/workshop/db/access.php [deleted file]
mod/workshop/db/install.xml [deleted file]
mod/workshop/db/mysql.php [deleted file]
mod/workshop/db/postgres7.php [deleted file]
mod/workshop/db/upgrade.php [deleted file]
mod/workshop/defaults.php [deleted file]
mod/workshop/icon.gif [deleted file]
mod/workshop/index.php [deleted file]
mod/workshop/lib.php [deleted file]
mod/workshop/locallib.php [deleted file]
mod/workshop/mod.html [deleted file]
mod/workshop/restorelib.php [deleted file]
mod/workshop/styles.php [deleted file]
mod/workshop/submissions.php [deleted file]
mod/workshop/upload.php [deleted file]
mod/workshop/version.php [deleted file]
mod/workshop/view.php [deleted file]
mod/workshop/viewassessment.php [deleted file]
pix/smartpix.php
question/type/calculated/db/mysql.php [deleted file]
question/type/calculated/db/postgres7.php [deleted file]
question/type/essay/db/mysql.php [deleted file]
question/type/essay/db/postgres7.php [deleted file]
question/type/match/db/mysql.php [deleted file]
question/type/match/db/postgres7.php [deleted file]
question/type/multianswer/db/mysql.php [deleted file]
question/type/multianswer/db/postgres7.php [deleted file]
question/type/multichoice/db/mysql.php [deleted file]
question/type/multichoice/db/postgres7.php [deleted file]
question/type/numerical/db/mysql.php [deleted file]
question/type/numerical/db/postgres7.php [deleted file]
question/type/randomsamatch/db/mysql.php [deleted file]
question/type/randomsamatch/db/postgres7.php [deleted file]
question/type/rqp/icon.gif [deleted file]
question/type/shortanswer/db/mysql.php [deleted file]
question/type/shortanswer/db/postgres7.php [deleted file]
question/type/truefalse/db/mysql.php [deleted file]
question/type/truefalse/db/postgres7.php [deleted file]
rss/file.php
search/LISEZMOI.txt
search/README.txt
search/READMETOO.txt [deleted file]
search/README_ARCHIVE.txt [new file with mode: 0644]
search/Zend/Search/Lucene/Analysis/Analyzer/Common.php
search/Zend/Search/Lucene/Analysis/Analyzer/Common/Text/CaseInsensitive.php
search/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum.php
search/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum/CaseInsensitive.php
search/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8/CaseInsensitive.php [new file with mode: 0644]
search/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8Num.php
search/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8Num/CaseInsensitive.php [new file with mode: 0644]
search/Zend/Search/Lucene/Analysis/Token.php
search/Zend/Search/Lucene/Analysis/TokenFilter.php
search/Zend/Search/Lucene/Analysis/TokenFilter/LowerCase.php
search/Zend/Search/Lucene/Analysis/TokenFilter/ShortWords.php
search/Zend/Search/Lucene/Analysis/TokenFilter/StopWords.php
search/Zend/Search/Lucene/Document/Html.php
search/Zend/Search/Lucene/EncodingConverter.php [deleted file]
search/Zend/Search/Lucene/FSM.php
search/Zend/Search/Lucene/FSMAction.php
search/Zend/Search/Lucene/Field.php
search/Zend/Search/Lucene/Index/DictionaryLoader.php
search/Zend/Search/Lucene/Index/FieldInfo.php
search/Zend/Search/Lucene/Index/SegmentInfo.php
search/Zend/Search/Lucene/Index/SegmentInfoPriorityQueue.php
search/Zend/Search/Lucene/Index/SegmentMerger.php
search/Zend/Search/Lucene/Index/SegmentWriter.php
search/Zend/Search/Lucene/Index/SegmentWriter/DocumentWriter.php
search/Zend/Search/Lucene/Index/SegmentWriter/StreamWriter.php
search/Zend/Search/Lucene/Index/Term.php
search/Zend/Search/Lucene/Index/TermInfo.php
search/Zend/Search/Lucene/Index/Writer.php
search/Zend/Search/Lucene/Interface.php
search/Zend/Search/Lucene/LockManager.php [new file with mode: 0644]
search/Zend/Search/Lucene/PriorityQueue.php
search/Zend/Search/Lucene/Proxy.php
search/Zend/Search/Lucene/Search/BooleanExpressionRecognizer.php
search/Zend/Search/Lucene/Search/Query.php
search/Zend/Search/Lucene/Search/Query/Boolean.php
search/Zend/Search/Lucene/Search/Query/Empty.php
search/Zend/Search/Lucene/Search/Query/Fuzzy.php [new file with mode: 0644]
search/Zend/Search/Lucene/Search/Query/Insignificant.php [new file with mode: 0644]
search/Zend/Search/Lucene/Search/Query/MultiTerm.php
search/Zend/Search/Lucene/Search/Query/Phrase.php
search/Zend/Search/Lucene/Search/Query/Range.php [new file with mode: 0644]
search/Zend/Search/Lucene/Search/Query/Wildcard.php [new file with mode: 0644]
search/Zend/Search/Lucene/Search/QueryEntry.php
search/Zend/Search/Lucene/Search/QueryEntry/Phrase.php
search/Zend/Search/Lucene/Search/QueryEntry/Subquery.php
search/Zend/Search/Lucene/Search/QueryEntry/Term.php
search/Zend/Search/Lucene/Search/QueryHit.php
search/Zend/Search/Lucene/Search/QueryLexer.php
search/Zend/Search/Lucene/Search/QueryParserContext.php
search/Zend/Search/Lucene/Search/QueryParserException.php
search/Zend/Search/Lucene/Search/QueryToken.php
search/Zend/Search/Lucene/Search/QueryTokenizer.php [deleted file]
search/Zend/Search/Lucene/Search/Similarity.php
search/Zend/Search/Lucene/Search/Similarity/Default.php
search/Zend/Search/Lucene/Search/Weight.php
search/Zend/Search/Lucene/Search/Weight/Boolean.php
search/Zend/Search/Lucene/Search/Weight/Empty.php
search/Zend/Search/Lucene/Search/Weight/MultiTerm.php
search/Zend/Search/Lucene/Search/Weight/Phrase.php
search/Zend/Search/Lucene/Search/Weight/Term.php
search/Zend/Search/Lucene/Storage/Directory.php
search/Zend/Search/Lucene/Storage/Directory/Filesystem.php
search/Zend/Search/Lucene/Storage/File.php
search/Zend/Search/Lucene/Storage/File/Filesystem.php
search/Zend/Search/Lucene/Storage/File/Memory.php
search/documents/physical_html.php
search/documents/techproject_document.php [deleted file]
search/lang/en_utf8/search.php [deleted file]
search/lang/fr_utf8/search.php [deleted file]
search/lang/nl_utf8/search.php [deleted file]
theme/chameleon/styles.php
theme/cornflower/docstyles.php
theme/cornflower/images/headerbg.jpg [deleted file]
theme/cornflower/images/logo2.jpg [deleted file]
theme/cornflower/styles.php
theme/custom_corners/js/jquery-latest.pack.js [deleted file]
theme/custom_corners/js/jquery.php [deleted file]
theme/custom_corners/styles.php
theme/formal_white/docstyles.php
theme/formal_white/styles.php
theme/metal/styles.php
theme/oceanblue/docstyles.php
theme/oceanblue/styles.php
theme/orangewhite/docstyles.php
theme/orangewhite/styles.php
theme/orangewhitepda/docstyles.php
theme/orangewhitepda/styles.php
theme/standard/docstyles.php
theme/standard/styles.php
theme/standardblue/styles.php
theme/standardgreen/styles.php
theme/standardlogo/styles.php
theme/standardred/styles.php
theme/standardwhite/styles.php
theme/wood/styles.php
user/pix.php
user/pixgroup.php

index 61afb67..41faab5 100644 (file)
@@ -30,7 +30,7 @@ if (empty($CFG->auth)) {
 }
 
 if (!empty($auth) and !exists_auth_plugin($auth)) {
-    error(get_string('pluginnotinstalled', 'auth', $auth), $url);
+    print_error('pluginnotinstalled', 'auth', $url, $auth);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -67,7 +67,7 @@ switch ($action) {
         $key = array_search($auth, $authsenabled);
         // check auth plugin is valid
         if ($key === false) {
-            error(get_string('pluginnotenabled', 'auth', $auth), $url);
+            print_error('pluginnotenabled', 'auth', $url, $auth);
         }
         // move down the list
         if ($key < (count($authsenabled) - 1)) {
@@ -82,7 +82,7 @@ switch ($action) {
         $key = array_search($auth, $authsenabled);
         // check auth is valid
         if ($key === false) {
-            error(get_string('pluginnotenabled', 'auth', $auth), $url);
+            print_error('pluginnotenabled', 'auth', $url, $auth);
         }
         // move up the list
         if ($key >= 1) {
index f5f49bb..3ace8d8 100644 (file)
@@ -20,7 +20,7 @@
 
 
 /// Do not set moodle cookie because we do not need it here, it is better to emulate session
-    $nomoodlecookie = true;
+    define('NO_MOODLE_COOKIES', true);
 
 /// The current directory in PHP version 4.3.0 and above isn't necessarily the
 /// directory of the script when run from the command line. The require_once()
@@ -66,7 +66,6 @@
 
 
 /// emulate normal session
-    $SESSION = new object();
     $USER = get_admin();      /// Temporarily, to provide environment for this script
 
 /// ignore admins timezone, language and locale - use site deafult instead!
index 8e0cfdf..14b75d6 100644 (file)
@@ -18,7 +18,7 @@
 
     if ($frm = data_submitted()) {
         if (!confirm_sesskey()) {
-            error(get_string('confirmsesskeybad', 'error'));
+            print_error('confirmsesskeybad', 'error');
         }
         if (empty($frm->enable)) {
             $frm->enable = array();
 
     admin_externalpage_print_footer();
 
-?>
\ No newline at end of file
+?>
index a281f1c..d03efaa 100644 (file)
@@ -48,7 +48,7 @@
             }
         } elseif (!empty($form->submit) && $form->submit == get_string('delete')) {
             $MNET->get_private_key();
-            $_SESSION['mnet_confirm_delete_key'] = md5(sha1($MNET->keypair['keypair_PEM'])).':'.time();
+            $SESSION->mnet_confirm_delete_key = md5(sha1($MNET->keypair['keypair_PEM'])).':'.time();
             notice_yesno(get_string("deletekeycheck", "mnet"),
                                     "index.php?sesskey=$USER->sesskey&amp;confirm=".md5($MNET->public_key),
                                     "index.php",
             // We're deleting
             
             
-            if (!isset($_SESSION['mnet_confirm_delete_key'])) {
+            if (!isset($SESSION->mnet_confirm_delete_key)) {
                 // fail - you're being attacked?
             }
 
             $key = '';
             $time = '';
-            @list($key, $time) = explode(':',$_SESSION['mnet_confirm_delete_key']);
+            @list($key, $time) = explode(':',$SESSION->mnet_confirm_delete_key);
             $MNET->get_private_key();
 
             if($time < time() - 60) {
index 3b2c8cc..e503b82 100644 (file)
@@ -10,7 +10,7 @@
         $module = optional_param('module', '', PARAM_SAFEDIR);
 
         if (!confirm_sesskey()) {
-            error(get_string('confirmsesskeybad', 'error'));
+            print_error('confirmsesskeybad', 'error');
         }
 
         if ($module != '') {
index e1cc5ac..9abc5fc 100644 (file)
@@ -27,7 +27,7 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
     exit;
 }
 
-$nomoodlecookie = true; // cookie not needed
+define('NO_MOODLE_COOKIES', true);
 
 require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file.
 
index b4e22aa..8ed5de0 100644 (file)
@@ -27,7 +27,7 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
     exit;
 }
 
-$nomoodlecookie = true; // cookie not needed
+define('NO_MOODLE_COOKIES', true);
 
 require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file.
 
index 5ea3f31..8b8d1cf 100644 (file)
@@ -1764,7 +1764,7 @@ class auth_plugin_ldap extends auth_plugin_base {
      *
      * NOTE that this code will execute under the OS user credentials, 
      * so we MUST avoid dealing with files -- such as session files.
-     * (The caller should set $nomoodlecookie before including config.php)
+     * (The caller should define('NO_MOODLE_COOKIES', true) before including config.php)
      *
      */
     function ntlmsso_magic($sesskey) {
index 8b76424..528d355 100755 (executable)
@@ -26,7 +26,7 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
     exit;
 }
 
-$nomoodlecookie = true; // cookie not needed
+define('NO_MOODLE_COOKIES', true);
 
 require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file.
 
index 79077ef..fc1120e 100644 (file)
@@ -4,7 +4,7 @@
 // as we will be executing under the OS security
 // context of the user we are trying to login, rather than
 // of the webserver.
-$nomoodlecookie=true;
+define('NO_MOODLE_COOKIES', true);
 
 require_once(dirname(dirname(dirname(__FILE__)))."/config.php");
 
index 3cf39a7..90ba89a 100644 (file)
@@ -43,7 +43,7 @@
             update_user_login_times();
             
             // Don't show username on login page
-            set_moodle_cookie('nobody');
+            $SESSION->set_moodle_cookie('nobody');
 
             set_login_session_preferences();
             
index ff6de2d..7f7c032 100644 (file)
@@ -38,8 +38,8 @@ httpsrequired();
     $loginurl = (!empty($CFG->alternateloginurl)) ? $CFG->alternateloginurl : '';
 
 
-    if (get_moodle_cookie() == '') {   
-        set_moodle_cookie('nobody');   // To help search for cookies
+    if ($SESSION->get_moodle_cookie() == '') {   
+        $SESSION->set_moodle_cookie('nobody');   // To help search for cookies
     }
 
     if (!empty($CFG->registerauth) or is_enabled_auth('none') or !empty($CFG->auth_instructions)) {
diff --git a/backup/db/mysql.php b/backup/db/mysql.php
deleted file mode 100644 (file)
index af93afa..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-<?php  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function backup_upgrade($oldversion=0) {
-
-    global $CFG;
-
-    $result = true;
-
-    if ($oldversion < 2003050300 and $result) {
-        $result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_ids` (
-                        `backup_code` INT(12) UNSIGNED NOT NULL, 
-                        `table_name` VARCHAR(30) NOT NULL, 
-                        `old_id` INT(10) UNSIGNED NOT NULL, 
-                        `new_id` INT(10) UNSIGNED,
-                         PRIMARY KEY (`backup_code`, `table_name`, `old_id`)
-                     )
-                     COMMENT = 'To store and convert ids in backup/restore'");
-    }
-
-    if ($oldversion < 2003050301 and $result) {
-        $result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
-                         ADD `info` VARCHAR(30)");
-    }
-
-    if ($oldversion < 2003050400 and $result) {
-        $result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
-                         MODIFY `info` VARCHAR(255)");
-    } 
-
-    if ($oldversion < 2003050401 and $result) {
-        $result = execute_sql("CREATE  TABLE  `{$CFG->prefix}backup_files` (
-                                  `backup_code` INT( 10  ) UNSIGNED NOT  NULL ,
-                                  `file_type` VARCHAR( 10  )  NOT  NULL ,
-                                  `path` VARCHAR( 255  )  NOT  NULL ,
-                                  `old_id` INT( 10  ) UNSIGNED,
-                                  `new_id` INT( 10  ) UNSIGNED,
-                               PRIMARY  KEY (  `backup_code` ,  `file_type` ,  `path`  ) 
-                               ) COMMENT  =  'To store and recode ids to user & course files.'");
-    }
-
-    if ($oldversion < 2003052000 and $result) {
-        $result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
-                         MODIFY `info` TEXT");
-    } 
-
-    if ($oldversion < 2003061100 and $result) {
-        $result = execute_sql("ALTER TABLE `{$CFG->prefix}backup_ids`
-                         MODIFY `info` MEDIUMTEXT");
-    } 
-
-    if ($oldversion < 2003082600 and $result) {
-        print_simple_box("This is the first non-alpha release of the Backup/Restore module.<p>Thanks for upgrading!","center", "50%", '', "20", "noticebox");
-    }
-
-    if ($oldversion < 2003112700 and $result) {
-        $result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_config` (
-                      `id` int(10) unsigned NOT NULL auto_increment,
-                      `name` varchar(255) NOT NULL default '',
-                      `value` varchar(255) NOT NULL default '',
-                      PRIMARY KEY  (`id`),
-                      UNIQUE KEY `name` (`name`)
-                  ) TYPE=MyISAM COMMENT='To store backup configuration variables'");
-    }
-
-    if ($oldversion < 2003120800 and $result) {
-        $result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_courses` (
-                      `id` int(10) unsigned NOT NULL auto_increment,
-                      `courseid` int(10) unsigned NOT NULL default '0',
-                      `laststarttime` int(10) unsigned NOT NULL default '0',
-                      `lastendtime` int(10) unsigned NOT NULL default '0',
-                      `laststatus` varchar(1) NOT NULL default '0',
-                      `nextstarttime` int(10) unsigned NOT NULL default '0',
-                      PRIMARY KEY  (`id`),
-                      UNIQUE KEY `courseid` (`courseid`)
-                  ) TYPE=MyISAM COMMENT='To store every course backup status'");
-
-        if ($result) {
-            $result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_log` (    
-                          `id` int(10) unsigned NOT NULL auto_increment, 
-                          `courseid` int(10) unsigned NOT NULL default '0',
-                          `time` int(10) unsigned NOT NULL default '0',
-                          `laststarttime` int(10) unsigned NOT NULL default '0',
-                          `info` varchar(255) NOT NULL default '',
-                          PRIMARY KEY  (`id`)
-                      ) TYPE=MyISAM COMMENT='To store every course backup log info'");
-        }
-    }
-
-    if ($oldversion < 2006011600 and $result) {
-        $result = execute_sql("DROP TABLE {$CFG->prefix}backup_files");
-        if ($result) {
-            $result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_files` (
-                          `id` int(10) unsigned NOT NULL auto_increment,
-                          `backup_code` int(10) unsigned NOT NULL default '0',
-                          `file_type` varchar(10) NOT NULL default '',
-                          `path` varchar(255) NOT NULL default '',
-                          `old_id` int(10) unsigned NOT NULL default '0',
-                          `new_id` int(10) unsigned NOT NULL default '0',
-                          PRIMARY KEY  (`id`),
-                          UNIQUE KEY `{$CFG->prefix}backup_files_uk` (`backup_code`,`file_type`,`path`)
-                      ) TYPE=MyISAM COMMENT='To store and recode ids to user and course files.'");
-        }
-        if ($result) {
-            $result = execute_sql("DROP TABLE {$CFG->prefix}backup_ids");
-        }
-        if ($result) {
-            $result = execute_sql("CREATE TABLE `{$CFG->prefix}backup_ids` (
-                          `id` int(10) unsigned NOT NULL auto_increment,
-                          `backup_code` int(12) unsigned NOT NULL default '0',
-                          `table_name` varchar(30) NOT NULL default '',
-                          `old_id` int(10) unsigned NOT NULL default '0',
-                          `new_id` int(10) unsigned NOT NULL default '0',
-                          `info` mediumtext,
-                          PRIMARY KEY  (`id`),
-                          UNIQUE KEY `{$CFG->prefix}backup_ids_uk` (`backup_code` ,`table_name`,`old_id`)
-                      ) TYPE=MyISAM COMMENT='To store and convert ids in backup/restore'");
-        }
-    }
-
-
-    // code to drop the prefix in tables
-    if ($oldversion < 2006042100) {
-        // see bug 5205, silent drops, so should not panic anyone
-        $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files DROP INDEX backup_files_uk", false);
-        $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files DROP INDEX {$CFG->prefix}backup_files_uk", false);
-        $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids DROP INDEX backup_ids_uk", false);
-        $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids DROP INDEX {$CFG->prefix}backup_ids_uk", false);
-        $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files ADD UNIQUE INDEX backup_files_uk(backup_code,file_type(10),path(255))");
-        $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids ADD UNIQUE INDEX backup_ids_uk(backup_code,table_name(30),old_id)");
-    }
-
-    // chaing default nulls to not null default 0
-    
-    if ($oldversion < 2006042800) {
-
-        execute_sql("UPDATE {$CFG->prefix}backup_files SET old_id='0' WHERE old_id IS NULL");
-        table_column('backup_files','old_id','old_id','int','10','unsigned','0','not null');
-
-        execute_sql("UPDATE {$CFG->prefix}backup_files SET new_id='0' WHERE new_id IS NULL");
-        table_column('backup_files','new_id','new_id','int','10','unsigned','0','not null');
-
-        execute_sql("UPDATE {$CFG->prefix}backup_ids SET new_id='0' WHERE new_id IS NULL");
-        table_column('backup_ids','new_id','new_id','int','10','unsigned','0','not null');
-
-        execute_sql("UPDATE {$CFG->prefix}backup_ids SET info='' WHERE info IS NULL");
-        table_column('backup_ids','info','info','mediumtext','','','','not null');
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-
-}
-
-?>
diff --git a/backup/db/postgres7.php b/backup/db/postgres7.php
deleted file mode 100644 (file)
index 87fa622..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-
-function backup_upgrade($oldversion=0) {
-
-    global $CFG;
-
-    $result = true;
-
-    if ($oldversion < 2006011600 and $result) {
-        $result = execute_sql("DROP TABLE {$CFG->prefix}backup_files");
-        if ($result) {
-            $result = execute_sql("CREATE TABLE {$CFG->prefix}backup_files (
-                          id SERIAL PRIMARY KEY,
-                          backup_code integer NOT NULL default '0',
-                          file_type varchar(10) NOT NULL default '',
-                          path varchar(255) NOT NULL default '',
-                          old_id integer default NULL,
-                          new_id integer default NULL,
-                          CONSTRAINT {$CFG->prefix}backup_files_uk UNIQUE (backup_code, file_type, path))");
-        }
-        if ($result) {
-            $result = execute_sql("DROP TABLE {$CFG->prefix}backup_ids");
-        }
-        if ($result) {
-            $result = execute_sql("CREATE TABLE {$CFG->prefix}backup_ids (
-                          id SERIAL PRIMARY KEY,
-                          backup_code integer NOT NULL default '0',
-                          table_name varchar(30) NOT NULL default '',
-                          old_id integer NOT NULL default '0',
-                          new_id integer default NULL,
-                          info text,
-                          CONSTRAINT {$CFG->prefix}backup_ids_uk UNIQUE (backup_code, table_name, old_id))");
-        }
-    }
-
-    if ($oldversion < 2006042801) {
-        table_column('backup_log', 'time', 'time', 'integer', '', '', '0');
-        table_column('backup_log', 'laststarttime', 'laststarttime', 'integer', '', '', '0');
-        table_column('backup_log', 'courseid', 'courseid', 'integer', '', '', '0');
-
-        table_column('backup_courses', 'lastendtime', 'lastendtime', 'integer', '', '', '0');
-        table_column('backup_courses', 'laststarttime', 'laststarttime', 'integer', '', '', '0');
-        table_column('backup_courses', 'courseid', 'courseid', 'integer', '', '', '0');
-        table_column('backup_courses', 'nextstarttime', 'nextstarttime', 'integer', '', '', '0');
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-
-}
-
-?>
diff --git a/blocks/activity_modules/db/mysql.php b/blocks/activity_modules/db/mysql.php
deleted file mode 100644 (file)
index 1549db4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?PHP  //$Id$
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function activity_modules_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/activity_modules/db/postgres7.php b/blocks/activity_modules/db/postgres7.php
deleted file mode 100644 (file)
index 228bade..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function activity_modules_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/admin/db/mysql.php b/blocks/admin/db/mysql.php
deleted file mode 100644 (file)
index 845fbc9..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function admin_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/admin/db/mysql.sql b/blocks/admin/db/mysql.sql
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/blocks/admin/db/postgres7.php b/blocks/admin/db/postgres7.php
deleted file mode 100644 (file)
index bf288a2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function admin_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/admin/db/postgres7.sql b/blocks/admin/db/postgres7.sql
deleted file mode 100644 (file)
index e69de29..0000000
index a0e1969..746c5cf 100644 (file)
@@ -12,7 +12,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
         $bookmarks = explode(',', get_user_preferences('admin_bookmarks'));
 
         if (in_array($section, $bookmarks)) {
-            error(get_string('bookmarkalreadyexists','admin'));
+            print_error('bookmarkalreadyexists','admin');
             die;
         }
 
@@ -28,7 +28,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
         set_user_preference('admin_bookmarks', $bookmarks);
 
     } else {
-        error(get_string('invalidsection','admin'));
+        print_error('invalidsection','admin');
         die;
     }
 
@@ -40,7 +40,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
     }
 
 } else {
-    error(get_string('invalidsection','admin'));
+    print_error('invalidsection','admin');
     die;
 }
 
index 1ad4f15..cc06f06 100644 (file)
@@ -16,7 +16,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
         $key = array_search($section, $bookmarks);
 
         if ($key === false) {
-            error(get_string('nonexistentbookmark','admin'));
+            print_error('nonexistentbookmark','admin');
             die;
         }
 
@@ -38,12 +38,12 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey(
 
     }
 
-    error(get_string('nobookmarksforuser','admin'));
+    print_error('nobookmarksforuser','admin');
     die;
 
 } else {
-    error(get_string('invalidsection', 'admin'));
+    print_error('invalidsection', 'admin');
     die;
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/blocks/calendar_month/db/mysql.php b/blocks/calendar_month/db/mysql.php
deleted file mode 100644 (file)
index 4e529be..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function calendar_month_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/calendar_month/db/postgres7.php b/blocks/calendar_month/db/postgres7.php
deleted file mode 100644 (file)
index 9ba1754..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function calendar_month_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/calendar_upcoming/db/mysql.php b/blocks/calendar_upcoming/db/mysql.php
deleted file mode 100644 (file)
index 5ccd912..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function calendar_upcoming_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/calendar_upcoming/db/postgres7.php b/blocks/calendar_upcoming/db/postgres7.php
deleted file mode 100644 (file)
index b5cbdee..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function calendar_upcoming_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/course_list/db/mysql.php b/blocks/course_list/db/mysql.php
deleted file mode 100644 (file)
index 1d006bb..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function course_list_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/course_list/db/postgres7.php b/blocks/course_list/db/postgres7.php
deleted file mode 100644 (file)
index a58d050..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function course_list_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/course_summary/db/mysql.php b/blocks/course_summary/db/mysql.php
deleted file mode 100644 (file)
index 4dccae1..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function course_summary_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/course_summary/db/postgres7.php b/blocks/course_summary/db/postgres7.php
deleted file mode 100644 (file)
index 972d417..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function course_summary_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/db/mysql.php b/blocks/db/mysql.php
deleted file mode 100644 (file)
index 2c58e40..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function blocks_upgrade($oldversion=0) {
-
-global $CFG;
-    
-    $result = true;
-    
-    if ($oldversion < 2004041000 && $result) {
-        $result = execute_sql("CREATE TABLE `{$CFG->prefix}blocks` (
-                        `id` int(10) unsigned NOT NULL auto_increment,
-                        `name` varchar(40) NOT NULL default '',
-                        `version` int(10) NOT NULL default '0',
-                        `cron` int(10) unsigned NOT NULL default '0',
-                        `lastcron` int(10) unsigned NOT NULL default '0',
-                        `visible` tinyint(1) NOT NULL default '1',
-                        PRIMARY KEY (`id`)
-                     ) 
-                     COMMENT = 'To register and update all the available blocks'");
-    }
-
-    if ($oldversion < 2004101900 && $result) {
-        $result = execute_sql("CREATE TABLE `{$CFG->prefix}block` (
-                        `id` int(10) unsigned NOT NULL auto_increment,
-                        `name` varchar(40) NOT NULL default '',
-                        `version` int(10) NOT NULL default '0',
-                        `cron` int(10) unsigned NOT NULL default '0',
-                        `lastcron` int(10) unsigned NOT NULL default '0',
-                        `visible` tinyint(1) NOT NULL default '1',
-                        `multiple` tinyint(1) NOT NULL default '0',
-                        PRIMARY KEY (`id`)
-                     ) 
-                     COMMENT = 'To register and update all the available blocks'");
-
-        if(!$result) {
-            return false;
-        }
-
-        $records = get_records('blocks');
-        if(!empty($records)) {
-            foreach($records as $block) {
-                $block->multiple = 0;
-                insert_record('block', $block, false);
-            }
-        }
-
-        execute_sql("DROP TABLE `{$CFG->prefix}blocks`");
-
-        $result = execute_sql("CREATE TABLE `{$CFG->prefix}block_instance` (
-                        `id` int(10) not null auto_increment,
-                        `blockid` int(10) not null default '0',
-                        `pageid` int(10) not null default '0',
-                        `pagetype` varchar(12) not null default '',
-                        `position` enum('l', 'r') not null default 'l',
-                        `weight` tinyint(3) not null default '0',
-                        `visible` tinyint(1) not null default '0',
-                        `configdata` text not null default '',
-                        
-                        PRIMARY KEY(`id`),
-                        INDEX pageid(`pageid`)
-                    )");
-
-        if(!$result) {
-            return false;
-        }
-
-        $records = get_records('course', '','','', 'id, shortname, blockinfo');
-        if(!empty($records)) {
-            foreach($records as $thiscourse) {
-                // The @ suppresses a notice emitted if there is no : in the string
-                @list($left, $right) = split(':', $thiscourse->blockinfo);
-                if(!empty($left)) {
-                    $arr = explode(',', $left);
-                    foreach($arr as $weight => $blk) {
-                        $instance = new stdClass;
-                        $instance->blockid    = abs($blk);
-                        $instance->pageid     = $thiscourse->id;
-                        $instance->pagetype   = PAGE_COURSE_VIEW;
-                        $instance->position   = BLOCK_POS_LEFT;
-                        $instance->weight     = $weight;
-                        $instance->visible    = ($blk > 0) ? 1 : 0;
-                        $instance->configdata = '';
-                        insert_record('block_instance', $instance, false);
-                    }
-                }
-                if(!empty($right)) {
-                    $arr = explode(',', $right);
-                    foreach($arr as $weight => $blk) {
-                        $instance = new stdClass;
-                        $instance->blockid    = abs($blk);
-                        $instance->pageid     = $thiscourse->id;
-                        $instance->pagetype   = PAGE_COURSE_VIEW;
-                        $instance->position   = BLOCK_POS_RIGHT;
-                        $instance->weight     = $weight;
-                        $instance->visible    = ($blk > 0) ? 1 : 0;
-                        $instance->configdata = '';
-                        insert_record('block_instance', $instance, false);
-                    }
-                }
-            }
-        }
-
-        execute_sql("ALTER TABLE `{$CFG->prefix}course` DROP COLUMN blockinfo");
-    }
-
-    if ($oldversion < 2004112900 && $result) {
-        $result = $result && table_column('block_instance', 'pagetype', 'pagetype', 'varchar', '20', '');
-        $result = $result && table_column('block_instance', 'position', 'position', 'varchar', '10', '');
-    }
-
-    if ($oldversion < 2004112900 && $result) {
-        execute_sql('UPDATE '.$CFG->prefix.'block_instance SET pagetype = \''.PAGE_COURSE_VIEW.'\' WHERE pagetype = \'\'');
-    }
-
-    if ($oldversion < 2005043000 && $result) {
-        $records = get_records('block');
-        if(!empty($records)) {
-            foreach($records as $block) {
-                if(!block_is_compatible($block->name)) {
-                    $block->visible = 0;
-                    update_record('block', $block);
-                    notify('The '.$block->name.' block has been disabled because it is not compatible with Moodle 1.5 and needs to be updated by a programmer.');
-                }
-            }
-        }
-    }
-
-    if ($oldversion < 2005081600) {
-         $result = $result && modify_database('',"CREATE TABLE `prefix_block_pinned` (
-           `id` int(10) not null auto_increment,
-           `blockid` int(10) not null default '0',
-           `pagetype` varchar(20) not null default '',
-           `position` varchar(10) not null default '',
-           `weight` tinyint(3) not null default '0',
-           `visible` tinyint(1) not null default '0',
-           `configdata` text not null default '',
-           PRIMARY KEY(`id`)
-          ) TYPE=MyISAM;");
-    }
-    
-    if ($oldversion < 2005090200) {
-        execute_sql("ALTER TABLE {$CFG->prefix}block_instance ADD INDEX pagetype (pagetype);",false);  // do it silently, in case it's already there from 1.5
-        modify_database('','ALTER TABLE prefix_block_pinned ADD INDEX pagetype (pagetype);');
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
-?>
diff --git a/blocks/db/postgres7.php b/blocks/db/postgres7.php
deleted file mode 100644 (file)
index 6122508..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function blocks_upgrade($oldversion=0) {
-
-global $CFG;
-    
-    $result = true;
-    
-    if ($oldversion < 2004041000 and $result) {
-        $result = execute_sql("
-                                CREATE TABLE {$CFG->prefix}blocks 
-                                (
-                                  id SERIAL8 PRIMARY KEY,
-                                  name varchar(40) NOT NULL default '',
-                                  version INT8 NOT NULL default '0',
-                                  cron INT8  NOT NULL default '0',
-                                  lastcron INT8  NOT NULL default '0',
-                                  visible int NOT NULL default '1'
-                                )
-        ") ;
-
-    }
-
-    if ($oldversion < 2004101900 && $result) {
-        $result = execute_sql("CREATE TABLE {$CFG->prefix}block (
-                        id SERIAL8 PRIMARY KEY,
-                        name varchar(40) NOT NULL default '',
-                        version INT8 NOT NULL default '0',
-                        cron INT8 NOT NULL default '0',
-                        lastcron INT8 NOT NULL default '0',
-                        visible int NOT NULL default '1',
-                        multiple int NOT NULL default '0'
-                     ) 
-                     ");
-
-        if(!$result) {
-            return false;
-        }
-
-        $records = get_records('blocks');
-        if(!empty($records)) {
-            foreach($records as $block) {
-                $block->multiple = 0;
-                insert_record('block', $block, false);
-            }
-            execute_sql("SELECT setval('{$CFG->prefix}block_id_seq', (SELECT MAX(id) FROM {$CFG->prefix}block), true)");
-        }
-
-        execute_sql("DROP TABLE {$CFG->prefix}blocks");
-        
-        $result = execute_sql("CREATE TABLE {$CFG->prefix}block_instance (
-                        id SERIAL8 PRIMARY KEY,
-                        blockid INT8 not null default '0',
-                        pageid INT8 not null default '0',
-                        pagetype varchar(12) not null default '',
-                        position char not null default 'l' check (position in ('l', 'r')) ,
-                        weight int not null default '0',
-                        visible int not null default '0',
-                        configdata text not null default ''
-                    )");
-
-        if(!$result) {
-            return false;
-        }
-        
-        $records = get_records('course', '','','', 'id, shortname, blockinfo');
-        if(!empty($records)) {
-            foreach($records as $thiscourse) {
-                // The @ suppresses a notice emitted if there is no : in the string
-                @list($left, $right) = split(':', $thiscourse->blockinfo);
-                if(!empty($left)) {
-                    $arr = explode(',', $left);
-                    foreach($arr as $weight => $blk) {
-                        $instance = new stdClass;
-                        $instance->blockid    = abs($blk);
-                        $instance->pageid     = $thiscourse->id;
-                        $instance->pagetype   = PAGE_COURSE_VIEW;
-                        $instance->position   = BLOCK_POS_LEFT;
-                        $instance->weight     = $weight;
-                        $instance->visible    = ($blk > 0) ? 1 : 0;
-                        $instance->configdata = '';
-                        insert_record('block_instance', $instance, false);
-                    }
-                }
-                if(!empty($right)) {
-                    $arr = explode(',', $right);
-                    foreach($arr as $weight => $blk) {
-                        $instance = new stdClass;
-                        $instance->blockid    = abs($blk);
-                        $instance->pageid     = $thiscourse->id;
-                        $instance->pagetype   = PAGE_COURSE_VIEW;
-                        $instance->position   = BLOCK_POS_RIGHT;
-                        $instance->weight     = $weight;
-                        $instance->visible    = ($blk > 0) ? 1 : 0;
-                        $instance->configdata = '';
-                        insert_record('block_instance', $instance, false);
-                    }
-                }
-            }
-        }
-
-        execute_sql("ALTER TABLE {$CFG->prefix}course DROP COLUMN blockinfo");
-    }
-
-    if ($oldversion < 2004112900 && $result) {
-        $result = $result && table_column('block_instance', 'pagetype', 'pagetype', 'varchar', '20', '');
-        $result = $result && table_column('block_instance', 'position', 'position', 'varchar', '10', '');
-    }
-
-    if ($oldversion < 2005043000 && $result) {
-        $records = get_records('block');
-        if(!empty($records)) {
-            foreach($records as $block) {
-                if(!block_is_compatible($block->name)) {
-                    $block->visible = 0;
-                    update_record('block', $block);
-                    notify('The '.$block->name.' block has been disabled because it is not compatible with Moodle 1.5 and needs to be updated by a programmer.');
-                }
-            }
-        }
-    }
-
-    if ($oldversion < 2005022401 && $result) { // Mass cleanup of bad upgrade scripts
-        execute_sql("CREATE INDEX {$CFG->prefix}block_instance_pageid_idx ON {$CFG->prefix}block_instance (pageid)",false); // this one should be quiet...
-        modify_database('','ALTER TABLE prefix_block_instance ALTER pagetype SET DEFAULT \'\'');
-        modify_database('','ALTER TABLE prefix_block_instance ALTER position SET DEFAULT \'\'');
-        modify_database('','ALTER TABLE prefix_block_instance ALTER pagetype SET NOT NULL');
-        modify_database('','ALTER TABLE prefix_block_instance ALTER position SET NOT NULL');
-    }
-
-    if ($oldversion < 2005081600) {
-        modify_database('',"CREATE TABLE prefix_block_pinned ( 
-            id SERIAL8 PRIMARY KEY,
-            blockid INT8 NOT NULL default 0,
-            pagetype varchar(20) NOT NULL default '',
-            position varchar(10) NOT NULL default '',
-            weight INT NOT NULL default 0,
-            visible INT NOT NULL default 0,
-            configdata text NOT NULL default 0
-          );");
-     }
-
-    if ($oldversion < 2005090200) {
-        execute_sql("CREATE INDEX {$CFG->prefix}block_instance_pagetype_idx ON {$CFG->prefix}block_instance (pagetype);",false); // do it silently, in case it's already there from 1.5
-        modify_database('','CREATE INDEX prefix_block_pinned_pagetype_idx ON prefix_block_pinned (pagetype);');
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
-?>
diff --git a/blocks/news_items/db/mysql.php b/blocks/news_items/db/mysql.php
deleted file mode 100644 (file)
index 2728665..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function news_items_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/news_items/db/postgres7.php b/blocks/news_items/db/postgres7.php
deleted file mode 100644 (file)
index 650dc38..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function news_items_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/online_users/db/mysql.php b/blocks/online_users/db/mysql.php
deleted file mode 100644 (file)
index 4f05306..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function online_users_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/online_users/db/postgres7.php b/blocks/online_users/db/postgres7.php
deleted file mode 100644 (file)
index 06b5209..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function online_users_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/participants/db/mysql.php b/blocks/participants/db/mysql.php
deleted file mode 100644 (file)
index 996ae7c..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function participants_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/participants/db/postgres7.php b/blocks/participants/db/postgres7.php
deleted file mode 100644 (file)
index 7e297c7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function participants_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/recent_activity/db/mysql.php b/blocks/recent_activity/db/mysql.php
deleted file mode 100644 (file)
index 4581389..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function recent_activity_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/recent_activity/db/postgres7.php b/blocks/recent_activity/db/postgres7.php
deleted file mode 100644 (file)
index 23073ca..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function recent_activity_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/rss_client/db/mysql.php b/blocks/rss_client/db/mysql.php
deleted file mode 100644 (file)
index d708a30..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-
-function rss_client_upgrade($oldversion) {
-/// This function does anything necessary to upgrade 
-/// older versions to match current functionality 
-
-    global $CFG;
-
-    if ($oldversion < 2003111500) {
-       # Do something ...
-    }
-
-    if ($oldversion < 2005111400) {
-        // title and description should be TEXT as we don't have control over their length.
-        table_column('block_rss_client','title','title','text',10,'unsigned','');
-        table_column('block_rss_client','description','description','text',10,'unsigned','');
-    }
-
-
-    if ($oldversion < 2006091100) {
-
-        // We need a new field to store whether an RSS feed is shared or private.
-        table_column('block_rss_client', '', 'shared', 'integer');
-
-        // Admin feeds used to be displayed to everybody (shared feeds).
-        $admins = get_admins();
-        if (!empty($admins)) {
-            $count = 0;
-            foreach($admins as $admin) {
-                if (!$count) {
-                    $adminsql = 'userid = '.$admin->id;
-                } else {
-                    $adminsql .= ' OR userid = '.$admin->id;
-                }
-                $count++;
-            }
-            if ($rssfeeds = get_records_select('block_rss_client', $adminsql)) {
-                foreach ($rssfeeds as $rssfeed) {
-                    if (!set_field('block_rss_client', 'shared', 1)) {
-                        notice('Could not set '.$rssfeed->title.' as a shared RSS feed.');
-                    }
-                }
-            }
-        }
-    }
-
-/// see MDL-6707 for more info about problem that was here
-
-    if ($oldversion < 2006100101) {
-
-        // Upgrade block to use the Roles System.
-        $block = get_record('block', 'name', 'rss_client');
-        
-        if ($blockinstances = get_records('block_instance', 'blockid', $block->id)) {
-            
-            if (!$adminroles = get_roles_with_capability('moodle/legacy:admin', CAP_ALLOW)) {
-                notice('Default student role was not found. Roles and permissions '.
-                       'for all your Remote RSS Feed blocks will have to be '.
-                       'manually set after this upgrade.');
-            }
-            if (!$teacherroles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW)) {
-                notice('Default teacher role was not found. Roles and permissions '.
-                       'for all your Remote RSS Feed blocks will have to be '.
-                       'manually set after this upgrade.');
-            }
-            if (!$studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) {
-                notice('Default student role was not found. Roles and permissions '.
-                       'for all your Remote RSS Feed blocks will have to be '.
-                       'manually set after this upgrade.');
-            }
-            
-            foreach ($blockinstances as $bi) {
-                $context = get_context_instance(CONTEXT_BLOCK, $bi->id);
-                
-                if ($bi->pagetype == 'course-view' && $bi->pageid == SITEID) {
-                    
-                    // Only the admin was allowed to manage the RSS feed block
-                    // on the site home page.
-                    
-                    // Since this is already the default behavior set in
-                    // blocks/rss_client/db/access.php, we don't need to
-                    // specifically assign the capabilities here.
-                    
-                } else {
-                    
-                    // Who can add shared feeds? This was defined in lib/rsslib.php
-                    // for config var block_rss_client_submitters.
-                    switch ($CFG->block_rss_client_submitters) {
-                        
-                        case 0:
-                            // SUBMITTERS_ALL_ACCOUNT_HOLDERS
-                            
-                            foreach ($adminroles as $adminrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_ALLOW, $adminrole->id, $context->id);
-                            }
-                            foreach ($teacherroles as $teacherrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_ALLOW, $teacherrole->id, $context->id);
-                            }
-                            foreach ($studentroles as $studentrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_ALLOW, $studentrole->id, $context->id);
-                            }
-                            break;
-                        
-                        case 1:
-                            // SUBMITTERS_ADMIN_ONLY
-                            
-                            // Since this is already the default behavior set in
-                            // blocks/rss_client/db/access.php, we don't need to
-                            // specifically assign the capabilities here.
-                            break;
-                        
-                        case 2:
-                            // SUBMITTERS_ADMIN_AND_TEACHER
-                            
-                            foreach ($adminroles as $adminrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_ALLOW, $adminrole->id, $context->id);
-                            }
-                            foreach ($teacherroles as $teacherrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_ALLOW, $teacherrole->id, $context->id);
-                            }
-                            foreach ($studentroles as $studentrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_PREVENT, $studentrole->id, $context->id);
-                            }
-                            break;
-
-                    } // End switch.
-                    
-                }
-            }   
-        }
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    return true;
-}
-
-?>
diff --git a/blocks/rss_client/db/postgres7.php b/blocks/rss_client/db/postgres7.php
deleted file mode 100644 (file)
index 4204ed8..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-
-function rss_client_upgrade($oldversion) {
-/// This function does anything necessary to upgrade 
-/// older versions to match current functionality 
-
-    global $CFG;
-
-    if ($oldversion < 2005111400) {
-        // title and description should be TEXT as we don't have control over their length.
-        table_column('block_rss_client','title','title','text');
-        table_column('block_rss_client','description','description','text');
-    }
-
-    if ($oldversion < 2005090201) {
-        modify_database('', 'ALTER TABLE prefix_block_rss_client
-            ALTER COLUMN title SET DEFAULT \'\',
-            ALTER COLUMN description SET DEFAULT \'\'');
-    }
-
-
-    if ($oldversion < 2006091100) {
-
-        // We need a new field to store whether an RSS feed is shared or private.
-        table_column('block_rss_client', '', 'shared', 'integer');
-
-        // Admin feeds used to be displayed to everybody (shared feeds).
-        $admins = get_admins();
-        if (!empty($admins)) {
-            $count = 0;
-            foreach($admins as $admin) {
-                if (!$count) {
-                    $adminsql = 'userid = '.$admin->id;
-                } else {
-                    $adminsql .= ' OR userid = '.$admin->id;
-                }
-                $count++;
-            }
-            if ($rssfeeds = get_records_select('block_rss_client', $adminsql)) {
-                foreach ($rssfeeds as $rssfeed) {
-                    if (!set_field('block_rss_client', 'shared', 1)) {
-                        notice('Could not set '.$rssfeed->title.' as a shared RSS feed.');
-                    }
-                }
-            }
-        }
-    }
-
-/// see MDL-6707 for more info about problem that was here
-
-    if ($oldversion < 2006100101) {
-        
-        // Upgrade block to use the Roles System.
-        $block = get_record('block', 'name', 'rss_client');
-        
-        if ($blockinstances = get_records('block_instance', 'blockid', $block->id)) {
-            
-            if (!$adminroles = get_roles_with_capability('moodle/legacy:admin', CAP_ALLOW)) {
-                notice('Default student role was not found. Roles and permissions '.
-                       'for all your Remote RSS Feed blocks will have to be '.
-                       'manually set after this upgrade.');
-            }
-            if (!$teacherroles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW)) {
-                notice('Default teacher role was not found. Roles and permissions '.
-                       'for all your Remote RSS Feed blocks will have to be '.
-                       'manually set after this upgrade.');
-            }
-            if (!$studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) {
-                notice('Default student role was not found. Roles and permissions '.
-                       'for all your Remote RSS Feed blocks will have to be '.
-                       'manually set after this upgrade.');
-            }
-            
-            foreach ($blockinstances as $bi) {
-                $context = get_context_instance(CONTEXT_BLOCK, $bi->id);
-                
-                if ($bi->pagetype == 'course-view' && $bi->pageid == SITEID) {
-                    
-                    // Only the admin was allowed to manage the RSS feed block
-                    // on the site home page.
-                    
-                    // Since this is already the default behavior set in
-                    // blocks/rss_client/db/access.php, we don't need to
-                    // specifically assign the capabilities here.
-                    
-                } else {
-                    
-                    // Who can add shared feeds? This was defined in lib/rsslib.php
-                    // for config var block_rss_client_submitters.
-                    switch ($CFG->block_rss_client_submitters) {
-                        
-                        case 0:
-                            // SUBMITTERS_ALL_ACCOUNT_HOLDERS
-                            
-                            foreach ($adminroles as $adminrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_ALLOW, $adminrole->id, $context->id);
-                            }
-                            foreach ($teacherroles as $teacherrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_ALLOW, $teacherrole->id, $context->id);
-                            }
-                            foreach ($studentroles as $studentrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_ALLOW, $studentrole->id, $context->id);
-                            }
-                            break;
-                        
-                        case 1:
-                            // SUBMITTERS_ADMIN_ONLY
-                            
-                            // Since this is already the default behavior set in
-                            // blocks/rss_client/db/access.php, we don't need to
-                            // specifically assign the capabilities here.
-                            break;
-                        
-                        case 2:
-                            // SUBMITTERS_ADMIN_AND_TEACHER
-                            
-                            foreach ($adminroles as $adminrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_ALLOW, $adminrole->id, $context->id);
-                            }
-                            foreach ($teacherroles as $teacherrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_ALLOW, $teacherrole->id, $context->id);
-                            }
-                            foreach ($studentroles as $studentrole) {
-                                assign_capability('block/rss_client:createsharedfeeds', CAP_PREVENT, $studentrole->id, $context->id);
-                            }
-                            break;
-
-                    } // End switch.
-                    
-                }
-            }   
-        }
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    return true;
-}
-
-?>
index e021f99..65fabe2 100644 (file)
@@ -81,4 +81,4 @@
       
   } //block_search
 
-?>
\ No newline at end of file
+?>
index 234e77e..b118e4e 100644 (file)
@@ -12,8 +12,8 @@
         <FIELD NAME="itemtype" TYPE="char" LENGTH="32" NOTNULL="true" DEFAULT="standard" SEQUENCE="false" ENUM="false" PREVIOUS="doctype" NEXT="title"/>
         <FIELD NAME="title" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="itemtype" NEXT="url"/>
         <FIELD NAME="url" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="title" NEXT="docdate"/>
-        <FIELD NAME="docdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="url" NEXT="updated"/>
-        <FIELD NAME="updated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="docdate" NEXT="courseid"/>
+        <FIELD NAME="docdate" TYPE="datetime" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="url" NEXT="updated"/>
+        <FIELD NAME="updated" TYPE="datetime" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="docdate" NEXT="courseid"/>
         <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="updated" NEXT="groupid"/>
         <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid"/>
       </FIELDS>
diff --git a/blocks/search_forums/db/mysql.php b/blocks/search_forums/db/mysql.php
deleted file mode 100644 (file)
index 5161f4f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function search_forums_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/search_forums/db/postgres7.php b/blocks/search_forums/db/postgres7.php
deleted file mode 100644 (file)
index d213fbd..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function search_forums_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/section_links/db/mysql.php b/blocks/section_links/db/mysql.php
deleted file mode 100644 (file)
index d714536..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function section_links_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004050500 and $result) {
-        $result = true; //Nothing to do
-    }
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/section_links/db/postgres7.php b/blocks/section_links/db/postgres7.php
deleted file mode 100644 (file)
index 2466998..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function section_links_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004050500 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/social_activities/db/mysql.php b/blocks/social_activities/db/mysql.php
deleted file mode 100644 (file)
index aaca971..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to MySQL
-
-function social_activities_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/blocks/social_activities/db/postgres7.php b/blocks/social_activities/db/postgres7.php
deleted file mode 100644 (file)
index 54aca77..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-// This file is tailored to PostgreSQL
-
-function social_activities_upgrade($oldversion=0) {
-
-    global $CFG;
-    
-    $result = true;
-
-    if ($oldversion < 2004041000 and $result) {
-        $result = true; //Nothing to do
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    //Finally, return result
-    return $result;
-}
diff --git a/course/format/topicscss/ajax.php b/course/format/topicscss/ajax.php
deleted file mode 100644 (file)
index 2280edd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-/**
- * This file is required if the course format is to support AJAX.
- */
-
-
-$CFG->ajaxcapable = true;
-$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111);
-
-?>
diff --git a/course/format/topicscss/format.php b/course/format/topicscss/format.php
deleted file mode 100644 (file)
index b4a62b7..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-<?php // $Id$
-      // Display the whole course as "topics" made of of modules
-      // Included from "view.php"
-/**
- * Evaluation topics format for course display - NO layout tables, for accessibility, etc.
- * 
- * A duplicate course format to enable the Moodle development team to evaluate 
- * CSS for the multi-column layout in place of layout tables. 
- * Less risk for the Moodle 1.6 beta release.
- *   1. Straight copy of topics/format.php
- *   2. Replace <table> and <td> with DIVs; inline styles.
- *   3. Reorder columns so that in linear view content is first then blocks;
- * styles to maintain original graphical (side by side) view.
- *
- * Target: 3-column graphical view using relative widths for pixel screen sizes 
- * 800x600, 1024x768... on IE6, Firefox. Below 800 columns will shift downwards.
- * 
- * http://www.maxdesign.com.au/presentation/em/ Ideal length for content.
- * http://www.svendtofte.com/code/max_width_in_ie/ Max width in IE.
- *
- * @copyright &copy; 2006 The Open University
- * @author N.D.Freear@open.ac.uk, and others.
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- * @package  
- */
-//TODO (nfreear): Accessibility: evaluation, lang/en_utf8/moodle.php: $string['formattopicscss']
-
-    require_once($CFG->libdir.'/ajax/ajaxlib.php');
-
-    if (!empty($THEME->customcorners)) {
-        require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
-    }
-
-    $topic = optional_param('topic', -1, PARAM_INT);
-
-    if ($topic != -1) {
-        $displaysection = course_set_display($course->id, $topic);
-    } else {
-        if (isset($USER->display[$course->id])) {
-            $displaysection = $USER->display[$course->id];
-        } else {
-            $displaysection = course_set_display($course->id, 0);
-        }
-    }
-
-    $context = get_context_instance(CONTEXT_COURSE, $course->id);
-
-    if (($marker >=0) && has_capability('moodle/course:setcurrentsection', $context) && confirm_sesskey()) {
-       $course->marker = $marker;
-       if (! set_field("course", "marker", $marker, "id", $course->id)) {
-           error("Could not mark that topic for this course");
-       }
-    }
-
-    $streditsummary  = get_string('editsummary');
-    $stradd          = get_string('add');
-    $stractivities   = get_string('activities');
-    $strshowalltopics = get_string('showalltopics');
-    $strtopic         = get_string('topic');
-    $strgroups       = get_string('groups');
-    $strgroupmy      = get_string('groupmy');
-    $editing         = $PAGE->user_is_editing();
-
-    if ($editing) {
-        $strstudents = moodle_strtolower($course->students);
-        $strtopichide = get_string('topichide', '', $strstudents);
-        $strtopicshow = get_string('topicshow', '', $strstudents);
-       $strmarkthistopic = get_string('markthistopic');
-       $strmarkedthistopic = get_string('markedthistopic');
-        $strmoveup   = get_string('moveup');
-        $strmovedown = get_string('movedown');
-    }
-
-/* Internet Explorer min-width fix. (See theme/standard/styles_layout.css: min-width for Firefox.)
-   Window width: 800px, Firefox 763px, IE 752px. (Window width: 640px, Firefox 602px, IE 588px.)    
-*/
-?>
-
-<!--[if IE]>
-  <style type="text/css">
-  .topicscss-format { width: expression(document.body.clientWidth < 800 ? "752px" : "auto"); }
-  </style>
-<![endif]-->
-<?php
-/// Layout the whole page as three big columns (was, id="layout-table")
-    echo '<div class="topicscss-format">';
-
-/// The left column ...
-
-    if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
-        echo '<div id="left-column">';
-        blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
-        echo '</div>';
-    }
-    
-/// The right column, BEFORE the middle-column.
-    if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
-        echo '<div id="right-column">';
-        blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
-        echo '</div>';
-    }
-
-/// Start main column
-    echo '<div id="middle-column">';
-
-    if (!empty($THEME->customcorners)) print_custom_corners_start();
-
-    echo skip_main_destination();
-
-    print_heading_block(get_string('topicoutline'), 'outline');
-
-    // Note, an ordered list would confuse - "1" could be the clipboard or summary.
-    echo "<ul class='topicscss'>\n";
-
-/// If currently moving a file then show the current clipboard
-    if (ismoving($course->id)) {
-        $stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname)));
-        $strcancel= get_string('cancel');
-        echo '<li class="clipboard">';
-        echo $stractivityclipboard.'&nbsp;&nbsp;(<a href="mod.php?cancelcopy=true&amp;sesskey='.$USER->sesskey.'">'.$strcancel.'</a>)';
-        echo "</li>\n";
-    }
-
-/// Print Section 0 with general activities
-
-    $section = 0;
-    $thissection = $sections[$section];
-
-    if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
-
-        // Note, no need for a 'left side' cell or DIV.
-        // Note, 'right side' is BEFORE content.
-        echo '<li id="section-0" class="section main" >';
-       echo '<div class="left side">&nbsp;</div>';
-        echo '<div class="right side" >&nbsp;</div>';        
-        echo '<div class="content">';
-        echo '<div class="summary">';
-        $summaryformatoptions->noclean = true;
-        echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions);
-
-        if (isediting($course->id) && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {
-            echo '<a title="'.$streditsummary.'" '.
-                 ' href="editsection.php?id='.$thissection->id.'"><img src="'.$CFG->pixpath.'/t/edit.gif" '.
-                 ' class="icon edit" alt="'.$streditsummary.'" /></a>';
-        }
-        echo '</div>';
-        
-        print_section($course, $thissection, $mods, $modnamesused);
-
-        if (isediting($course->id)) {
-            print_section_add_menus($course, $section, $modnames);
-        }
-
-        echo '</div>';
-        echo "</li>\n";
-    }
-
-
-/// Now all the normal modules by topic
-/// Everything below uses "section" terminology - each "section" is a topic.
-
-    $timenow = time();
-    $section = 1;
-    $sectionmenu = array();
-
-    while ($section <= $course->numsections) {
-
-        if (!empty($sections[$section])) {
-            $thissection = $sections[$section];
-
-        } else {
-            unset($thissection);
-            $thissection->course = $course->id;   // Create a new section structure
-            $thissection->section = $section;
-            $thissection->summary = '';
-            $thissection->visible = 1;
-            if (!$thissection->id = insert_record('course_sections', $thissection)) {
-                notify('Error inserting new topic!');
-            }
-        }
-
-        $showsection = (has_capability('moodle/course:viewhiddensections', $context) or $thissection->visible or !$course->hiddensections);
-
-        if (!empty($displaysection) and $displaysection != $section) {  // Check this topic is visible
-            if ($showsection) {
-               $strsummary = strip_tags(format_string($thissection->summary,true));
-               if (strlen($strsummary) < 57) {
-                   $strsummary = ' - '.$strsummary;
-               } else {
-                   $strsummary = ' - '.substr($strsummary, 0, 60).'...';
-               }
-                $sectionmenu['topic='.$section] = s($section.$strsummary);
-            }
-            $section++;
-            continue;
-        }
-
-        if ($showsection) {
-
-            $currenttopic = ($course->marker == $section);
-
-            $currenttext = '';
-            if (!$thissection->visible) {
-                $sectionstyle = ' hidden';
-            } else if ($currenttopic) {
-                $sectionstyle = ' current';
-                $currenttext = get_accesshide(get_string('currenttopic','access'));
-            } else {
-                $sectionstyle = '';
-            }
-
-            echo '<li id="section-'.$section.'" class="section main'.$sectionstyle.'" >'; //'<div class="left side">&nbsp;</div>';
-
-               echo '<div class="left side">'.$currenttext.$section.'</div>';
-            // Note, 'right side' is BEFORE content.
-            echo '<div class="right side">';
-            
-            if ($displaysection == $section) { // Show the zoom boxes
-                echo '<a href="view.php?id='.$course->id.'&amp;topic=0#section-'.$section.'" title="'.$strshowalltopics.'">'.
-                     '<img src="'.$CFG->pixpath.'/i/all.gif" class="icon" alt="'.$strshowalltopics.'" /></a><br />';
-            } else {
-                $strshowonlytopic = get_string("showonlytopic", "", $section);
-                echo '<a href="view.php?id='.$course->id.'&amp;topic='.$section.'" title="'.$strshowonlytopic.'">'.
-                     '<img src="'.$CFG->pixpath.'/i/one.gif" class="icon" alt="'.$strshowonlytopic.'" /></a><br />';
-            }
-
-            if (isediting($course->id) && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {
-
-               if ($course->marker == $section) {  // Show the "light globe" on/off
-                           echo '<a href="view.php?id='.$course->id.'&amp;marker=0&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strmarkedthistopic.'">'.'<img src="'.$CFG->pixpath.'/i/marked.gif" alt="'.$strmarkedthistopic.'" /></a><br />';
-               } else {
-                    echo '<a href="view.php?id='.$course->id.'&amp;marker='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strmarkthistopic.'">'.'<img src="'.$CFG->pixpath.'/i/marker.gif" alt="'.$strmarkthistopic.'" /></a><br />';
-               }
-
-                if ($thissection->visible) {        // Show the hide/show eye
-                    echo '<a href="view.php?id='.$course->id.'&amp;hide='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strtopichide.'">'.
-                         '<img src="'.$CFG->pixpath.'/i/hide.gif" class="icon hide" alt="'.$strtopichide.'" /></a><br />';
-                } else {
-                    echo '<a href="view.php?id='.$course->id.'&amp;show='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strtopicshow.'">'.
-                         '<img src="'.$CFG->pixpath.'/i/show.gif" class="icon hide" alt="'.$strtopicshow.'" /></a><br />';
-                }
-                if ($section > 1) {                       // Add a arrow to move section up
-                    echo '<a href="view.php?id='.$course->id.'&amp;random='.rand(1,10000).'&amp;section='.$section.'&amp;move=-1&amp;sesskey='.$USER->sesskey.'#section-'.($section-1).'" title="'.$strmoveup.'">'.
-                         '<img src="'.$CFG->pixpath.'/t/up.gif" class="icon up" alt="'.$strmoveup.'" /></a><br />';
-                }
-
-                if ($section < $course->numsections) {    // Add a arrow to move section down
-                    echo '<a href="view.php?id='.$course->id.'&amp;random='.rand(1,10000).'&amp;section='.$section.'&amp;move=1&amp;sesskey='.$USER->sesskey.'#section-'.($section+1).'" title="'.$strmovedown.'">'.
-                         '<img src="'.$CFG->pixpath.'/t/down.gif" class="icon down" alt="'.$strmovedown.'" /></a><br />';
-                }
-            }
-            echo '</div>';
-
-            echo '<div class="content">';
-            if (!has_capability('moodle/course:viewhiddensections', $context) and !$thissection->visible) {   // Hidden for students
-               echo get_string('notavailable').'</div>';
-           } else {
-                echo '<div class="summary">';
-                $summaryformatoptions->noclean = true;
-               if ($thissection->summary) {
-                   echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions);
-               } else {
-                  echo '&nbsp;';
-               }
-
-                if (isediting($course->id) && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {
-                    echo ' <a title="'.$streditsummary.'" href="editsection.php?id='.$thissection->id.'">'.
-                         '<img src="'.$CFG->pixpath.'/t/edit.gif" class="icon edit" alt="'.$streditsummary.'" /></a><br /><br />';
-                }
-                echo '</div>';
-
-                print_section($course, $thissection, $mods, $modnamesused);
-
-                if (isediting($course->id)) {
-                    print_section_add_menus($course, $section, $modnames);
-                }
-            }
-
-            echo '</div>';
-            echo "</li>\n";
-        }
-
-        $section++;
-    }
-    echo "</ul>\n";
-
-    if (!empty($sectionmenu)) {
-        echo '<div align="center" class="jumpmenu">';
-        echo popup_form($CFG->wwwroot.'/course/view.php?id='.$course->id.'&amp;', $sectionmenu,
-                   'sectionmenu', '', get_string('jumpto'), '', '', true);
-        echo '</div>';
-    }
-
-    if (!empty($THEME->customcorners)) print_custom_corners_end();
-
-    echo '</div>';
-
-    echo '</div>';
-    echo '<div class="clearer"></div>';
-
-?>
diff --git a/course/format/weekscss/ajax.php b/course/format/weekscss/ajax.php
deleted file mode 100644 (file)
index 2280edd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-/**
- * This file is required if the course format is to support AJAX.
- */
-
-
-$CFG->ajaxcapable = true;
-$CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111);
-
-?>
diff --git a/course/format/weekscss/format.php b/course/format/weekscss/format.php
deleted file mode 100644 (file)
index a120bfd..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-<?php // $Id$
-      // Display the whole course as "weeks" made of of modules
-      // Included from "view.php"
-/**
- * Evaluation weekly format for course display - NO layout tables, for accessibility, etc.
- * 
- * A duplicate course format to enable the Moodle development team to evaluate 
- * CSS for the multi-column layout in place of layout tables. 
- * Less risk for the Moodle 1.6 beta release.
- *   1. Straight copy of weeks/format.php
- *   2. Replace <table> and <td> with DIVs; inline styles.
- *   3. Reorder columns so that in linear view content is first then blocks;
- * styles to maintain original graphical (side by side) view.
- *
- * Target: 3-column graphical view using relative widths for pixel screen sizes 
- * 800x600, 1024x768... on IE6, Firefox. Below 800 columns will shift downwards.
- * 
- * http://www.maxdesign.com.au/presentation/em/ Ideal length for content.
- * http://www.svendtofte.com/code/max_width_in_ie/ Max width in IE.
- *
- * @copyright &copy; 2006 The Open University
- * @author N.D.Freear@open.ac.uk, and others.
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- * @package  
- */
-//TODO (nfreear): Accessibility: evaluation, lang/en_utf8/moodle.php: $string['formatweekscss']
-
-    $week = optional_param('week', -1, PARAM_INT);
-
-    if ($week != -1) {
-        $displaysection = course_set_display($course->id, $week);
-    } else {
-        if (isset($USER->display[$course->id])) {
-            $displaysection = $USER->display[$course->id];
-        } else {
-            $displaysection = course_set_display($course->id, 0);
-        }
-    }
-
-    $streditsummary  = get_string('editsummary');
-    $stradd          = get_string('add');
-    $stractivities   = get_string('activities');
-    $strshowallweeks = get_string('showallweeks');
-    $strweek         = get_string('week');
-    $strgroups       = get_string('groups');
-    $strgroupmy      = get_string('groupmy');
-    $editing         = $PAGE->user_is_editing();
-
-    if ($editing) {
-        $strstudents = moodle_strtolower($course->students);
-        $strweekhide = get_string('weekhide', '', $strstudents);
-        $strweekshow = get_string('weekshow', '', $strstudents);
-        $strmoveup   = get_string('moveup');
-        $strmovedown = get_string('movedown');
-    }
-
-    $context = get_context_instance(CONTEXT_COURSE, $course->id);
-/* Internet Explorer min-width fix. (See theme/standard/styles_layout.css: min-width for Firefox.)
-   Window width: 800px, Firefox 763px, IE 752px. (Window width: 640px, Firefox 602px, IE 588px.)    
-*/
-?>
-
-<!--[if IE]>
-  <style type="text/css">
-  .weekscss-format { width: expression(document.body.clientWidth < 800 ? "752px" : "auto"); }
-  </style>
-<![endif]-->
-<?php
-/// Layout the whole page as three big columns (was, id="layout-table")
-    echo '<div class="weekscss-format">';
-
-/// The left column ...
-
-    if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
-        echo '<div id="left-column">';
-        blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
-        echo '</div>';
-    }
-    
-/// The right column, BEFORE the middle-column.
-    if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
-        echo '<div id="right-column">';
-        blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
-        echo '</div>';
-    }
-
-/// Start main column
-    echo '<div id="middle-column">'. skip_main_destination();
-
-    print_heading_block(get_string('weeklyoutline'), 'outline');
-
-    // Note, an ordered list would confuse - "1" could be the clipboard or summary.
-    echo "<ul class='weekscss'>\n";
-
-/// If currently moving a file then show the current clipboard
-    if (ismoving($course->id)) {
-        $stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname)));
-        $strcancel= get_string('cancel');
-        echo '<li class="clipboard">';
-        echo $stractivityclipboard.'&nbsp;&nbsp;(<a href="mod.php?cancelcopy=true&amp;sesskey='.$USER->sesskey.'">'.$strcancel.'</a>)';
-        echo "</li>\n";
-    }
-
-/// Print Section 0 with general activities
-
-    $section = 0;
-    $thissection = $sections[$section];
-
-    if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
-
-        // Note, no need for a 'left side' cell or DIV.
-        // Note, 'right side' is BEFORE content.
-        echo '<li id="section-0" class="section main" >';
-        echo '<div class="right side" >&nbsp;</div>';        
-        echo '<div class="content">';
-        
-        echo '<div class="summary">';
-        $summaryformatoptions->noclean = true;
-        echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions);
-
-        if (isediting($course->id) && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {
-            echo '<p><a title="'.$streditsummary.'" '.
-                 ' href="editsection.php?id='.$thissection->id.'"><img src="'.$CFG->pixpath.'/t/edit.gif" '.
-                 ' class="icon edit" alt="'.$streditsummary.'" /></a></p>';
-        }
-        echo '</div>';
-        
-        print_section($course, $thissection, $mods, $modnamesused);
-
-        if (isediting($course->id)) {
-            print_section_add_menus($course, $section, $modnames);
-        }
-
-        echo '</div>';
-        echo "</li>\n";
-    }
-
-
-/// Now all the normal modules by week
-/// Everything below uses "section" terminology - each "section" is a week.
-
-    $timenow = time();
-    $weekdate = $course->startdate;    // this should be 0:00 Monday of that week
-    $weekdate += 7200;                 // Add two hours to avoid possible DST problems
-    $section = 1;
-    $sectionmenu = array();
-    $weekofseconds = 604800;
-    $course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
-
-    $strftimedateshort = ' '.get_string('strftimedateshort');
-
-    while ($weekdate < $course->enddate) {
-
-        $nextweekdate = $weekdate + ($weekofseconds);
-        $weekday = userdate($weekdate, $strftimedateshort);
-        $endweekday = userdate($weekdate+518400, $strftimedateshort);
-
-        if (!empty($sections[$section])) {
-            $thissection = $sections[$section];
-
-        } else {
-            unset($thissection);
-            $thissection->course = $course->id;   // Create a new week structure
-            $thissection->section = $section;
-            $thissection->summary = '';
-            $thissection->visible = 1;
-            if (!$thissection->id = insert_record('course_sections', $thissection)) {
-                notify('Error inserting new week!');
-            }
-        }
-
-        $showsection = (has_capability('moodle/course:viewhiddensections', $context) or $thissection->visible or !$course->hiddensections);
-
-        if (!empty($displaysection) and $displaysection != $section) {  // Check this week is visible
-            if ($showsection) {
-                $sectionmenu['week='.$section] = s("$strweek $section |     $weekday - $endweekday");
-            }
-            $section++;
-            $weekdate = $nextweekdate;
-            continue;
-        }
-
-        if ($showsection) {
-
-            $currentweek = (($weekdate <= $timenow) && ($timenow < $nextweekdate));
-
-            $currenttext = '';
-            if (!$thissection->visible) {
-                $sectionstyle = ' hidden';
-            } else if ($currentweek) {
-                $sectionstyle = ' current';
-                $currenttext = get_accesshide(get_string('currentweek','access'));
-            } else {
-                $sectionstyle = '';
-            }
-
-            echo '<li id="section-'.$section.'" class="section main'.$sectionstyle.'" >'; //'<div class="left side">&nbsp;</div>';
-
-            // Note, 'right side' is BEFORE content.
-            echo '<div class="right side">';
-            
-            if ($displaysection == $section) {
-                echo '<a href="view.php?id='.$course->id.'&amp;week=0#section-'.$section.'" title="'.$strshowallweeks.'">'.
-                     '<img src="'.$CFG->pixpath.'/i/all.gif" class="icon wkall" alt="'.$strshowallweeks.'" /></a><br />';
-            } else {
-                $strshowonlyweek = get_string("showonlyweek", "", $section);
-                echo '<a href="view.php?id='.$course->id.'&amp;week='.$section.'" title="'.$strshowonlyweek.'">'.
-                     '<img src="'.$CFG->pixpath.'/i/one.gif" class="icon wkone" alt="'.$strshowonlyweek.'" /></a><br />';
-            }
-
-            if (isediting($course->id) && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {
-                if ($thissection->visible) {        // Show the hide/show eye
-                    echo '<a href="view.php?id='.$course->id.'&amp;hide='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strweekhide.'">'.
-                         '<img src="'.$CFG->pixpath.'/i/hide.gif" class="icon hide" alt="'.$strweekhide.'" /></a><br />';
-                } else {
-                    echo '<a href="view.php?id='.$course->id.'&amp;show='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strweekshow.'">'.
-                         '<img src="'.$CFG->pixpath.'/i/show.gif" class="icon hide" alt="'.$strweekshow.'" /></a><br />';
-                }
-                if ($section > 1) {                       // Add a arrow to move section up
-                    echo '<a href="view.php?id='.$course->id.'&amp;random='.rand(1,10000).'&amp;section='.$section.'&amp;move=-1&amp;sesskey='.$USER->sesskey.'#section-'.($section-1).'" title="'.$strmoveup.'">'.
-                         '<img src="'.$CFG->pixpath.'/t/up.gif" class="icon up" alt="'.$strmoveup.'" /></a><br />';
-                }
-
-                if ($section < $course->numsections) {    // Add a arrow to move section down
-                    echo '<a href="view.php?id='.$course->id.'&amp;random='.rand(1,10000).'&amp;section='.$section.'&amp;move=1&amp;sesskey='.$USER->sesskey.'#section-'.($section+1).'" title="'.$strmovedown.'">'.
-                         '<img src="'.$CFG->pixpath.'/t/down.gif" class="icon down" alt="'.$strmovedown.'" /></a><br />';
-                }
-            }
-            echo '</div>';
-
-            echo '<div class="content">';
-            if (!has_capability('moodle/course:viewhiddensections', $context) and !$thissection->visible) {   // Hidden for students
-                echo '<div class="weekdates">'.$currenttext.$weekday.' - '.$endweekday.' ('.get_string('notavailable').')</div>';
-
-            } else {
-                echo '<div class="weekdates">'.$currenttext.$weekday.' - '.$endweekday.'</div>';
-
-                echo '<div class="summary">';
-                $summaryformatoptions->noclean = true;
-                echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions);
-
-                if (isediting($course->id) && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {
-                    echo ' <a title="'.$streditsummary.'" href="editsection.php?id='.$thissection->id.'">'.
-                         '<img src="'.$CFG->pixpath.'/t/edit.gif" class="icon edit" alt="'.$streditsummary.'" /></a><br /><br />';
-                }
-                echo '</div>';
-
-                print_section($course, $thissection, $mods, $modnamesused);
-
-                if (isediting($course->id)) {
-                    print_section_add_menus($course, $section, $modnames);
-                }
-            }
-
-            echo '</div>';
-            echo "</li>\n";
-        }
-
-        $section++;
-        $weekdate = $nextweekdate;
-    }
-    echo "</ul>\n";
-
-    if (!empty($sectionmenu)) {
-        echo '<div align="center" class="jumpmenu">';
-        echo popup_form($CFG->wwwroot.'/course/view.php?id='.$course->id.'&amp;', $sectionmenu,
-                   'sectionmenu', '', get_string('jumpto'), '', '', true);
-        echo '</div>';
-    }
-
-    echo '</div>';
-
-    echo '</div>';
-    echo '<div class="clearer"></div>';
-
-?>
diff --git a/doc/pix/cvstree.png b/doc/pix/cvstree.png
deleted file mode 100755 (executable)
index 803ad27..0000000
Binary files a/doc/pix/cvstree.png and /dev/null differ
diff --git a/doc/pix/files.jpg b/doc/pix/files.jpg
deleted file mode 100755 (executable)
index ff8f7d0..0000000
Binary files a/doc/pix/files.jpg and /dev/null differ
diff --git a/doc/pix/social.jpg b/doc/pix/social.jpg
deleted file mode 100755 (executable)
index 69596f9..0000000
Binary files a/doc/pix/social.jpg and /dev/null differ
diff --git a/doc/pix/topics.jpg b/doc/pix/topics.jpg
deleted file mode 100755 (executable)
index c8a099e..0000000
Binary files a/doc/pix/topics.jpg and /dev/null differ
diff --git a/doc/pix/weekly.jpg b/doc/pix/weekly.jpg
deleted file mode 100755 (executable)
index 1ffc82c..0000000
Binary files a/doc/pix/weekly.jpg and /dev/null differ
diff --git a/enrol/authorize/authorizenetlib.php b/enrol/authorize/authorizenetlib.php
deleted file mode 100644 (file)
index 0350105..0000000
+++ /dev/null
@@ -1,410 +0,0 @@
-<?php //  $Id$
-
-if (!defined('MOODLE_INTERNAL')) {
-    die('Direct access to this script is forbidden.');
-}
-
-define('AN_DELIM',    '|');
-define('AN_ENCAP',    '"');
-
-define('AN_REASON_NOCCTYPE',    17);
-define('AN_REASON_NOCCTYPE2',   28);
-define('AN_REASON_NOACH',       18);
-define('AN_REASON_ACHONLY',     56);
-define('AN_REASON_NOACHTYPE',  245);
-define('AN_REASON_NOACHTYPE2', 246);
-
-require_once($CFG->dirroot.'/enrol/authorize/const.php');
-require_once($CFG->dirroot.'/enrol/authorize/localfuncs.php');
-
-/**
- * Gets settlement date and time
- *
- * @param int $time Time processed, usually now.
- * @return int Settlement date and time
- */
-function authorize_getsettletime($time)
-{
-    global $CFG;
-
-    $cutoff = intval($CFG->an_cutoff);
-    $mins = $cutoff % 60;
-    $hrs = ($cutoff - $mins) / 60;
-    $cutofftime = strtotime("$hrs:$mins", $time);
-    if ($cutofftime < $time) {
-        $cutofftime = strtotime("$hrs:$mins", $time + (24 * 3600));
-    }
-    return $cutofftime;
-}
-
-/**
- * Is order settled? Status must be auth_captured or credited.
- *
- * @param object $order Order details
- * @return bool true, if settled, false otherwise.
- */
-function authorize_settled($order)
-{
-    return (($order->status == AN_STATUS_AUTHCAPTURE || $order->status == AN_STATUS_CREDIT) &&
-            ($order->settletime > 0) && ($order->settletime < time()));
-}
-
-/**
- * Is order expired? 'Authorized/Pending Capture' transactions are expired after 30 days.
- *
- * @param object &$order Order details.
- * @return bool true, transaction is expired, false otherwise.
- */
-function authorize_expired(&$order)
-{
-    static $timediff30;
-
-    if ($order->status == AN_STATUS_EXPIRE) {
-        return true;
-    }
-    elseif ($order->status != AN_STATUS_AUTH) {
-        return false;
-    }
-
-    if (empty($timediff30)) {
-        $timediff30 = authorize_getsettletime(time()) - (30 * 24 * 3600);
-    }
-
-    $isexpired = (authorize_getsettletime($order->timecreated) < $timediff30);
-    if ($isexpired) {
-        $order->status = AN_STATUS_EXPIRE;
-        update_record('enrol_authorize', $order);
-    }
-    return $isexpired;
-}
-
-/**
- * Performs an action on authorize.net and updates/inserts records. If record update fails,
- * sends email to admin.
- *
- * @param object &$order Which transaction data will be sent. See enrol_authorize table.
- * @param string &$message Information about error message.
- * @param object &$extra Extra data that used for refunding and credit card information.
- * @param int $action Which action will be performed. See AN_ACTION_*
- * @param string $cctype Used internally to configure credit types automatically.
- * @return int AN_APPROVED Transaction was successful, AN_RETURNZERO otherwise. Use $message for reason.
- * @author Ethem Evlice <ethem a.t evlice d.o.t com>
- * @uses $CFG
- */
-function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE, $cctype=NULL)
-{
-    global $CFG;
-    static $constpd;
-    require_once($CFG->libdir.'/filelib.php');
-
-    if (!isset($constpd)) {
-        $mconfig = get_config('enrol/authorize');
-        $constpd = array(
-             'x_version'         => '3.1',
-             'x_delim_data'      => 'True',
-             'x_delim_char'      => AN_DELIM,
-             'x_encap_char'      => AN_ENCAP,
-             'x_relay_response'  => 'FALSE',
-             'x_login'           => rc4decrypt($mconfig->an_login)
-        );
-
-        if (!empty($mconfig->an_tran_key)) {
-            $constpd['x_tran_key'] = rc4decrypt($mconfig->an_tran_key);
-        }
-        else {
-            $constpd['x_password'] = rc4decrypt($mconfig->an_password);
-        }
-    }
-
-    if (empty($order) or empty($order->id)) {
-        $message = "Check order->id!";
-        return AN_RETURNZERO;
-    }
-
-    $method = $order->paymentmethod;
-    if (empty($method)) {
-        $method = AN_METHOD_CC;
-    }
-    elseif ($method != AN_METHOD_CC && $method != AN_METHOD_ECHECK) {
-        $message = "Invalid method: $method";
-        return AN_RETURNZERO;
-    }
-
-    $action = intval($action);
-    if ($method == AN_METHOD_ECHECK) {
-        if ($action != AN_ACTION_AUTH_CAPTURE && $action != AN_ACTION_CREDIT) {
-            $message = "Please perform AUTH_CAPTURE or CREDIT for echecks";
-            return AN_RETURNZERO;
-        }
-    }
-
-    $pd = $constpd;
-    $pd['x_method'] = $method;
-    $test = !empty($CFG->an_test);
-    $pd['x_test_request'] = ($test ? 'TRUE' : 'FALSE');
-
-    switch ($action) {
-        case AN_ACTION_AUTH_ONLY:
-        case AN_ACTION_CAPTURE_ONLY:
-        case AN_ACTION_AUTH_CAPTURE:
-        {
-            if ($order->status != AN_STATUS_NONE) {
-                $message = "Order status must be AN_STATUS_NONE(0)!";
-                return AN_RETURNZERO;
-            }
-            elseif (empty($extra)) {
-                $message = "Need extra fields!";
-                return AN_RETURNZERO;
-            }
-            elseif (($action == AN_ACTION_CAPTURE_ONLY) and empty($extra->x_auth_code)) {
-                $message = "x_auth_code is required for capture only transactions!";
-                return AN_RETURNZERO;
-            }
-
-            $ext = (array)$extra;
-            $pd['x_type'] = (($action==AN_ACTION_AUTH_ONLY)
-                              ? 'AUTH_ONLY' :( ($action==AN_ACTION_CAPTURE_ONLY)
-                                                ? 'CAPTURE_ONLY' : 'AUTH_CAPTURE'));
-            foreach($ext as $k => $v) {
-                $pd[$k] = $v;
-            }
-            break;
-        }
-
-        case AN_ACTION_PRIOR_AUTH_CAPTURE:
-        {
-            if ($order->status != AN_STATUS_AUTH) {
-                $message = "Order status must be authorized!";
-                return AN_RETURNZERO;
-            }
-            if (authorize_expired($order)) {
-                $message = "Transaction must be captured within 30 days. EXPIRED!";
-                return AN_RETURNZERO;
-            }
-            $pd['x_type'] = 'PRIOR_AUTH_CAPTURE';
-            $pd['x_trans_id'] = $order->transid;
-            break;
-        }
-
-        case AN_ACTION_CREDIT:
-        {
-            if ($order->status != AN_STATUS_AUTHCAPTURE) {
-                $message = "Order status must be authorized/captured!";
-                return AN_RETURNZERO;
-            }
-            if (!authorize_settled($order)) {
-                $message = "Order must be settled. Try VOID, check Cut-Off time if it fails!";
-                return AN_RETURNZERO;
-            }
-            if (empty($extra->amount)) {
-                $message = "No valid amount!";
-                return AN_RETURNZERO;
-            }
-            $timenowsettle = authorize_getsettletime(time());
-            $timediff = $timenowsettle - (120 * 3600 * 24);
-            if ($order->settletime < $timediff) {
-                $message = "Order must be credited within 120 days!";
-                return AN_RETURNZERO;
-            }
-
-            $pd['x_type'] = 'CREDIT';
-            $pd['x_trans_id'] = $order->transid;
-            $pd['x_currency_code'] = $order->currency;
-            $pd['x_invoice_num'] = $extra->orderid;
-            $pd['x_amount'] = $extra->amount;
-            if ($method == AN_METHOD_CC) {
-                $pd['x_card_num'] = sprintf("%04d", intval($order->refundinfo));
-            }
-            elseif ($method == AN_METHOD_ECHECK && empty($order->refundinfo)) {
-                $message = "Business checkings can be refunded only.";
-                return AN_RETURNZERO;
-            }
-            break;
-        }
-
-        case AN_ACTION_VOID:
-        {
-            if (authorize_expired($order) || authorize_settled($order)) {
-                $message = "The transaction cannot be voided due to the fact that it is expired or settled.";
-                return AN_RETURNZERO;
-            }
-            $pd['x_type'] = 'VOID';
-            $pd['x_trans_id'] = $order->transid;
-            break;
-        }
-
-        default: {
-            $message = "Invalid action: $action";
-            return AN_RETURNZERO;
-        }
-    }
-
-    $headers = array('Connection' => 'close');
-    if (! (empty($CFG->an_referer) || $CFG->an_referer == "http://")) {
-        $headers['Referer'] = $CFG->an_referer;
-    }
-
-    @ignore_user_abort(true);
-    if (intval(ini_get('max_execution_time')) > 0) {
-        @set_time_limit(300);
-    }
-
-    $host = $test ? 'certification.authorize.net' : 'secure.authorize.net';
-    $data = download_file_content("https://$host:443/gateway/transact.dll", $headers, $pd, false, 60);
-    if (!$data) {
-        $message = "No connection to https://$host:443";
-        return AN_RETURNZERO;
-    }
-    $response = explode(AN_ENCAP.AN_DELIM.AN_ENCAP, $data);
-    if ($response === false) {
-        $message = "response error";
-        return AN_RETURNZERO;
-    }
-    $rcount = count($response) - 1;
-    if ($response[0]{0} == AN_ENCAP) {
-        $response[0] = substr($response[0], 1);
-    }
-    if (substr($response[$rcount], -1) == AN_ENCAP) {
-        $response[$rcount] = substr($response[$rcount], 0, -1);
-    }
-
-    $responsecode = intval($response[0]);
-    if ($responsecode == AN_APPROVED || $responsecode == AN_REVIEW)
-    {
-        $transid = intval($response[6]);
-        if ($test || $transid == 0) {
-            return $responsecode; // don't update original transaction in test mode.
-        }
-        switch ($action) {
-            case AN_ACTION_AUTH_ONLY:
-            case AN_ACTION_CAPTURE_ONLY:
-            case AN_ACTION_AUTH_CAPTURE:
-            case AN_ACTION_PRIOR_AUTH_CAPTURE:
-            {
-                $order->transid = $transid;
-
-                if ($method == AN_METHOD_CC) {
-                    if ($action == AN_ACTION_AUTH_ONLY || $responsecode == AN_REVIEW) {
-                        $order->status = AN_STATUS_AUTH;
-                    } else {
-                        $order->status = AN_STATUS_AUTHCAPTURE;
-                        $order->settletime = authorize_getsettletime(time());
-                    }
-                }
-                elseif ($method == AN_METHOD_ECHECK) {
-                    $order->status = AN_STATUS_UNDERREVIEW;
-                }
-
-                if (! update_record('enrol_authorize', $order)) {
-                    email_to_admin("Error while trying to update data " .
-                    "in table enrol_authorize. Please edit manually this record: ID=$order->id.", $order);
-                }
-                break;
-            }
-            case AN_ACTION_CREDIT:
-            {
-                // Credit generates new transaction id.
-                // So, $extra must be updated, not $order.
-                $extra->status = AN_STATUS_CREDIT;
-                $extra->transid = $transid;
-                $extra->settletime = authorize_getsettletime(time());
-                if (! $extra->id = insert_record('enrol_authorize_refunds', $extra)) {
-                    unset($extra->id);
-                    email_to_admin("Error while trying to insert data " .
-                    "into table enrol_authorize_refunds. Please add manually this record:", $extra);
-                }
-                break;
-            }
-            case AN_ACTION_VOID:
-            {
-                $tableupdate = 'enrol_authorize';
-                if ($order->status == AN_STATUS_CREDIT) {
-                    $tableupdate = 'enrol_authorize_refunds';
-                    unset($order->paymentmethod);
-                }
-                $order->status = AN_STATUS_VOID;
-                if (! update_record($tableupdate, $order)) {
-                    email_to_admin("Error while trying to update data " .
-                    "in table $tableupdate. Please edit manually this record: ID=$order->id.", $order);
-                }
-                break;
-            }
-        }
-    }
-    else
-    {
-        $reasonno = $response[2];
-        $reasonstr = "reason" . $reasonno;
-        $message = get_string($reasonstr, "enrol_authorize");
-        if ($message == '[[' . $reasonstr . ']]') {
-            $message = isset($response[3]) ? $response[3] : 'unknown error';
-        }
-        if ($method == AN_METHOD_CC && !empty($CFG->an_avs) && $response[5] != "P") {
-            $avs = "avs" . strtolower($response[5]);
-            $stravs = get_string($avs, "enrol_authorize");
-            $message .= "<br />" . get_string("avsresult", "enrol_authorize", $stravs);
-        }
-        if (!$test) { // Autoconfigure :)
-            switch($reasonno) {
-                // Credit card type isn't accepted
-                case AN_REASON_NOCCTYPE:
-                case AN_REASON_NOCCTYPE2:
-                {
-                    if (!empty($cctype)) {
-                        $ccaccepts = get_list_of_creditcards();
-                        unset($ccaccepts[$cctype]);
-                        set_config('an_acceptccs', implode(',', array_keys($ccaccepts)));
-                        email_to_admin("$message ($cctype)" .
-                        "This is new config(an_acceptccs):", $ccaccepts);
-                    }
-                    break;
-                }
-                // Echecks only
-                case AN_REASON_ACHONLY:
-                {
-                    set_config('an_acceptmethods', AN_METHOD_ECHECK);
-                    email_to_admin("$message " .
-                    "This is new config(an_acceptmethods):", array(AN_METHOD_ECHECK));
-                    break;
-                }
-                // Echecks aren't accepted
-                case AN_REASON_NOACH:
-                {
-                    set_config('an_acceptmethods', AN_METHOD_CC);
-                    email_to_admin("$message " .
-                    "This is new config(an_acceptmethods):", array(AN_METHOD_CC));
-                    break;
-                }
-                // This echeck type isn't accepted
-                case AN_REASON_NOACHTYPE:
-                case AN_REASON_NOACHTYPE2:
-                {
-                    if (!empty($extra->x_echeck_type)) {
-                        switch ($extra->x_echeck_type) {
-                            // CCD=BUSINESSCHECKING
-                            case 'CCD':
-                            {
-                                set_config('an_acceptechecktypes', 'CHECKING,SAVINGS');
-                                email_to_admin("$message " .
-                                "This is new config(an_acceptechecktypes):", array('CHECKING','SAVINGS'));
-                            }
-                            break;
-                            // WEB=CHECKING or SAVINGS
-                            case 'WEB':
-                            {
-                                set_config('an_acceptechecktypes', 'BUSINESSCHECKING');
-                                email_to_admin("$message " .
-                                "This is new config(an_acceptechecktypes):", array('BUSINESSCHECKING'));
-                            }
-                            break;
-                        }
-                    }
-                    break;
-                }
-            }
-        }
-    }
-    return $responsecode;
-}
-
-?>
index c666986..650dbbe 100644 (file)
@@ -20,7 +20,7 @@ define('AN_METHOD_ECHECK', 'echeck');
  * CREDIT: Refunded.
  * VOID: Cancelled.
  * EXPIRE: Expired. Orders be expired unless be accepted within 30 days.
- * 
+ *
  * These are valid only for ECHECK:
  * UNDERREVIEW: Hold for review.
  * APPROVEDREVIEW: Approved review.
@@ -41,7 +41,7 @@ define('AN_STATUS_TEST',            0xff); // dummy status
 /**#@-*/
 
 /**#@+
- * Actions used in authorize_action() function.
+ * Actions used in AuthorizeNet::process() method.
  *
  * NONE: No action. Function always returns false.
  * AUTH_ONLY: Used to authorize only, don't capture.
@@ -75,7 +75,7 @@ define('AN_ACTION_VOID',                6);
 /**#@-*/
 
 /**#@+
- * Return codes for authorize_action() function.
+ * Return codes for AuthorizeNet::process() method.
  *
  * AN_RETURNZERO: No connection was made on authorize.net.
  * AN_APPROVED: The transaction was accepted.
diff --git a/enrol/authorize/db/mysql.php b/enrol/authorize/db/mysql.php
deleted file mode 100755 (executable)
index 9dbf661..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-
-// MySQL commands for upgrading this enrolment module
-
-function enrol_authorize_upgrade($oldversion=0) {
-    global $CFG, $THEME, $db;
-    require_once("$CFG->dirroot/enrol/authorize/const.php");
-
-    $result = true;
-
-    if ($oldversion < 2005071600) {
-        // Be sure, only last 4 digit is inserted.
-        table_column('enrol_authorize', 'cclastfour', 'cclastfour', 'integer', '4', 'unsigned', '0', 'not null');
-        table_column('enrol_authorize', 'courseid', 'courseid', 'integer', '10', 'unsigned', '0', 'not null');
-        table_column('enrol_authorize', 'userid', 'userid', 'integer', '10', 'unsigned', '0', 'not null');
-        // Add some indexes for speed.
-        execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX courseid(courseid)", false);
-        execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX userid(userid)", false);
-    }
-
-    if ($oldversion && $oldversion < 2005071602) {
-        notify("If you are using the authorize.net enrolment plugin for credit card
-                handling, please ensure that you have turned loginhttps ON in Admin >> Variables >> Security.");
-    }
-
-    if ($oldversion < 2005112100) {
-        table_column('enrol_authorize', '', 'authcode', 'varchar', '6', '', '', '', 'avscode'); // CAPTURE_ONLY
-        table_column('enrol_authorize', '', 'status', 'integer', '10', 'unsigned', '0', 'not null', 'transid');
-        table_column('enrol_authorize', '', 'timecreated', 'integer', '10', 'unsigned', '0', 'not null', 'status');
-        table_column('enrol_authorize', '', 'timeupdated', 'integer', '10', 'unsigned', '0', 'not null', 'timecreated');
-        // status index for speed.
-        execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX status(status)");
-        // defaults.
-        $status = AN_STATUS_AUTH | AN_STATUS_CAPTURE;
-        execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET status='$status' WHERE transid<>'0'", false);
-        $timenow = time();
-        execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET timecreated='$timenow', timeupdated='$timenow'", false);
-    }
-
-    if ($oldversion < 2005121200) {
-        // new fields for refund and sales reports.
-        $defaultcurrency = empty($CFG->enrol_currency) ? 'USD' : $CFG->enrol_currency;
-        table_column('enrol_authorize', '', 'amount', 'varchar', '10', '', '0', 'not null', 'timeupdated');
-        table_column('enrol_authorize', '', 'currency', 'varchar', '3', '', $defaultcurrency, 'not null', 'amount');
-        modify_database("","CREATE TABLE prefix_enrol_authorize_refunds (
-          `id` int(10) unsigned NOT NULL auto_increment,
-          `orderid` int(10) unsigned NOT NULL default 0,
-          `refundtype` int(1) unsigned NOT NULL default 0,
-          `amount` varchar(10) NOT NULL default '',
-          `transid` int(10) unsigned NULL default 0,
-          PRIMARY KEY (`id`),
-          KEY `orderid` (`orderid`));");
-        // defaults.
-        if (($courses = get_records_select('course', '', '', 'id, cost, currency'))) {
-            foreach ($courses as $course) {
-                execute_sql("UPDATE {$CFG->prefix}enrol_authorize
-                             SET amount = '$course->cost', currency = '$course->currency'
-                             WHERE courseid = '$course->id'", false);
-            }
-        }
-    }
-
-    if ($oldversion < 2005122200) { // settletime
-        table_column('enrol_authorize_refunds', 'refundtype', 'status', 'integer', '1', 'unsigned', '0', 'not null');
-        table_column('enrol_authorize_refunds', '', 'settletime', 'integer', '10', 'unsigned', '0', 'not null', 'transid');
-        table_column('enrol_authorize', 'timeupdated', 'settletime', 'integer', '10', 'unsigned', '0', 'not null');
-        $status = AN_STATUS_AUTH | AN_STATUS_CAPTURE;
-        if (($settlements = get_records_select('enrol_authorize', "status='$status'", '', 'id, settletime'))) {
-            include_once("$CFG->dirroot/enrol/authorize/authorizenetlib.php");
-            foreach ($settlements as $settlement) {
-                execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET settletime = '" .
-                authorize_getsettletime($settlement->settletime) . "' WHERE id = '$settlement->id'", false);
-            }
-        }
-    }
-
-    if ($oldversion < 2005122800) { // no need anymore some fields.
-        execute_sql("ALTER TABLE {$CFG->prefix}enrol_authorize DROP ccexp", false);
-        execute_sql("ALTER TABLE {$CFG->prefix}enrol_authorize DROP cvv", false);
-        execute_sql("ALTER TABLE {$CFG->prefix}enrol_authorize DROP avscode", false);
-        execute_sql("ALTER TABLE {$CFG->prefix}enrol_authorize DROP authcode", false);
-    }
-
-    if ($oldversion < 2006010200) { // rename an_review_day
-        if (isset($CFG->an_review_day)) {
-            set_config('an_capture_day', $CFG->an_review_day);
-            delete_records('config', 'name', 'an_review_day');
-        }
-    }
-
-    if ($oldversion < 2006020100) { // rename an_cutoff_hour and an_cutoff_min to an_cutoff
-        if (isset($CFG->an_cutoff_hour) && isset($CFG->an_cutoff_min)) {
-            $an_cutoff_hour = intval($CFG->an_cutoff_hour);
-            $an_cutoff_min = intval($CFG->an_cutoff_min);
-            $an_cutoff = ($an_cutoff_hour * 60) + $an_cutoff_min;
-            if (set_config('an_cutoff', $an_cutoff)) {
-                delete_records('config', 'name', 'an_cutoff_hour');
-                delete_records('config', 'name', 'an_cutoff_min');
-            }
-        }
-    }
-
-    if ($oldversion < 2006021500) { // transid is int
-        table_column('enrol_authorize', 'transid', 'transid', 'integer', '10', 'unsigned', '0', 'not null');
-    }
-
-    if ($oldversion < 2006021501) { // delete an_nextmail record from config_plugins table
-        delete_records('config_plugins', 'name', 'an_nextmail');
-    }
-
-    if ($oldversion < 2006050400) { // Create transid indexes for backup & restore speed.
-        execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX transid(transid)", false);
-        execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize_refunds` ADD INDEX transid(transid)", false);
-    }
-
-    if ($oldversion < 2006060500) { // delete an_nextmail record from config_plugins table
-        delete_records('config_plugins', 'name', 'an_nextmail'); // run twice.
-    }
-
-    if ($oldversion < 2006081401) { // no need an_teachermanagepay in 1.7
-        if (isset($CFG->an_teachermanagepay)) {
-            delete_records('config', 'name', 'an_teachermanagepay');
-        }
-    }
-
-    if ($oldversion < 2006083100) {
-        // enums are lower case
-        if (isset($CFG->an_acceptmethods)) {
-            set_config('an_acceptmethods', strtolower($CFG->an_acceptmethods));
-        }
-        // new ENUM field: paymentmethod(cc,echeck)
-        execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD paymentmethod enum('cc', 'echeck') NOT NULL default 'cc' AFTER `id`", true);
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    return $result;
-}
-
-?>
diff --git a/enrol/authorize/db/postgres7.php b/enrol/authorize/db/postgres7.php
deleted file mode 100644 (file)
index 62c1d87..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-<?php //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-
-// PostgreSQL commands for upgrading this enrolment module
-
-function enrol_authorize_upgrade($oldversion=0) {
-    global $CFG, $THEME, $db;
-    require_once("$CFG->dirroot/enrol/authorize/const.php");
-
-    $result = true;
-
-    if (!$tables = $db->MetaColumns($CFG->prefix . 'enrol_authorize')) {
-        $installfirst = true;
-    }
-
-    if ($oldversion == 0 || !empty($installfirst)) { // First time install
-        $result = modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql");
-        return $result; // RETURN, sql file contains last upgrades.
-    }
-
-    // Authorize module was installed before. Upgrades must be applied to SQL file.
-
-    if ($oldversion && $oldversion < 2005071602) {
-        notify("If you are using the authorize.net enrolment plugin for credit card
-                handling, please ensure that you have turned loginhttps ON in Admin >> Variables >> Security.");
-    }
-
-    if ($oldversion < 2005080200) {
-        // Be sure, only last 4 digit is inserted.
-        table_column('enrol_authorize', 'cclastfour', 'cclastfour', 'integer', '4', 'unsigned', '0', 'not null');
-        table_column('enrol_authorize', 'courseid', 'courseid', 'integer', '10', 'unsigned', '0', 'not null');
-        table_column('enrol_authorize', 'userid', 'userid', 'integer', '10', 'unsigned', '0', 'not null');
-        // Add some indexes for speed.
-        execute_sql("CREATE INDEX {$CFG->prefix}enrol_authorize_courseid_idx ON {$CFG->prefix}enrol_authorize (courseid);", false);
-        execute_sql("CREATE INDEX {$CFG->prefix}enrol_authorize_userid_idx ON {$CFG->prefix}enrol_authorize (userid);", false);
-    }
-
-    if ($oldversion < 2005112100) {
-        table_column('enrol_authorize', '', 'authcode', 'varchar', '6', '', '', '', 'avscode'); // CAPTURE_ONLY
-        table_column('enrol_authorize', '', 'status', 'integer', '10', 'unsigned', '0', 'not null', 'transid');
-        table_column('enrol_authorize', '', 'timecreated', 'integer', '10', 'unsigned', '0', 'not null', 'status');
-        table_column('enrol_authorize', '', 'timeupdated', 'integer', '10', 'unsigned', '0', 'not null', 'timecreated');
-        // status index for speed.
-        modify_database('',"CREATE INDEX prefix_enrol_authorize_status_idx ON prefix_enrol_authorize (status);");
-        // defaults.
-        $status = AN_STATUS_AUTH | AN_STATUS_CAPTURE;
-        execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET status='$status' WHERE transid<>'0'", false);
-        $timenow = time();
-        execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET timecreated='$timenow', timeupdated='$timenow'", false);
-    }
-
-    if ($oldversion < 2005121200) {
-        // new fields for refund and sales reports.
-        $defaultcurrency = empty($CFG->enrol_currency) ? 'USD' : $CFG->enrol_currency;
-        table_column('enrol_authorize', '', 'amount', 'varchar', '10', '', '0', 'not null', 'timeupdated');
-        table_column('enrol_authorize', '', 'currency', 'varchar', '3', '', $defaultcurrency, 'not null', 'amount');
-        modify_database("","CREATE TABLE prefix_enrol_authorize_refunds (
-           id SERIAL PRIMARY KEY,
-           orderid INTEGER NOT NULL default 0,
-           refundtype INTEGER NOT NULL default 0,
-           amount varchar(10) NOT NULL default '',
-           transid INTEGER NULL default 0
-         );");
-        modify_database("","CREATE INDEX prefix_enrol_authorize_refunds_orderid_idx ON prefix_enrol_authorize_refunds (orderid);");
-        // defaults.
-        if (($courses = get_records_select('course', '', '', 'id, cost, currency'))) {
-            foreach ($courses as $course) {
-                execute_sql("UPDATE {$CFG->prefix}enrol_authorize
-                             SET amount = '$course->cost', currency = '$course->currency'
-                             WHERE courseid = '$course->id'", false);
-            }
-        }
-    }
-
-    if ($oldversion < 2005122200) { // settletime
-        table_column('enrol_authorize_refunds', 'refundtype', 'status', 'integer', '1', 'unsigned', '0', 'not null');
-        table_column('enrol_authorize_refunds', '', 'settletime', 'integer', '10', 'unsigned', '0', 'not null', 'transid');
-        table_column('enrol_authorize', 'timeupdated', 'settletime', 'integer', '10', 'unsigned', '0', 'not null');
-        $status = AN_STATUS_AUTH | AN_STATUS_CAPTURE;
-        if (($settlements = get_records_select('enrol_authorize', "status='$status'", '', 'id, settletime'))) {
-            include_once("$CFG->dirroot/enrol/authorize/authorizenetlib.php");
-            foreach ($settlements as $settlement) {
-                execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET settletime = '" .
-                authorize_getsettletime($settlement->settletime) . "' WHERE id = '$settlement->id'", false);
-            }
-        }
-    }
-
-    if ($oldversion < 2005122800) { // no need anymore some fields.
-        execute_sql("ALTER TABLE {$CFG->prefix}enrol_authorize DROP ccexp", false);
-        execute_sql("ALTER TABLE {$CFG->prefix}enrol_authorize DROP cvv", false);
-        execute_sql("ALTER TABLE {$CFG->prefix}enrol_authorize DROP avscode", false);
-        execute_sql("ALTER TABLE {$CFG->prefix}enrol_authorize DROP authcode", false);
-    }
-
-    if ($oldversion < 2006010200) { // rename an_review_day
-        if (isset($CFG->an_review_day)) {
-            set_config('an_capture_day', $CFG->an_review_day);
-            delete_records('config', 'name', 'an_review_day');
-        }
-    }
-
-    if ($oldversion < 2006020100) { // rename an_cutoff_hour and an_cutoff_min to an_cutoff
-        if (isset($CFG->an_cutoff_hour) && isset($CFG->an_cutoff_min)) {
-            $an_cutoff_hour = intval($CFG->an_cutoff_hour);
-            $an_cutoff_min = intval($CFG->an_cutoff_min);
-            $an_cutoff = ($an_cutoff_hour * 60) + $an_cutoff_min;
-            if (set_config('an_cutoff', $an_cutoff)) {
-                delete_records('config', 'name', 'an_cutoff_hour');
-                delete_records('config', 'name', 'an_cutoff_min');
-            }
-        }
-    }
-
-    if ($oldversion < 2006021500) { // transid is int
-        table_column('enrol_authorize', 'transid', 'transid', 'integer', '10', 'unsigned', '0', 'not null');
-    }
-
-    if ($oldversion < 2006021501) { // delete an_nextmail record from config_plugins table
-        delete_records('config_plugins', 'name', 'an_nextmail');
-    }
-
-    if ($oldversion < 2006050400) { // Create transid indexes for backup & restore speed.
-        execute_sql("CREATE INDEX {$CFG->prefix}enrol_authorize_transid_idx ON {$CFG->prefix}enrol_authorize(transid);", false);
-        execute_sql("CREATE INDEX {$CFG->prefix}enrol_authorize_refunds_transid_idx ON {$CFG->prefix}enrol_authorize_refunds(transid);", false);
-    }
-
-    if ($oldversion < 2006060500) { // delete an_nextmail record from config_plugins table
-        delete_records('config_plugins', 'name', 'an_nextmail'); // run twice.
-    }
-
-    if ($oldversion < 2006081401) { // no need an_teachermanagepay in 1.7
-        if (isset($CFG->an_teachermanagepay)) {
-            delete_records('config', 'name', 'an_teachermanagepay');
-        }
-    }
-
-    if ($oldversion < 2006083100) {
-        // enums are lower case
-        if (isset($CFG->an_acceptmethods)) {
-            set_config('an_acceptmethods', strtolower($CFG->an_acceptmethods));
-        }
-        // new ENUM field: paymentmethod(cc,echeck)
-        table_column('enrol_authorize', '', 'paymentmethod', 'varchar', '6', '', 'cc', 'not null');
-        execute_sql("ALTER TABLE {$CFG->prefix}enrol_authorize ADD CONSTRAINT enroauth_pay_ck CHECK (paymentmethod IN ('cc', 'echeck'))", true);
-    }
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    return $result;
-}
-
-?>
diff --git a/enrol/paypal/db/mysql.php b/enrol/paypal/db/mysql.php
deleted file mode 100644 (file)
index 7a926a0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-
-// MySQL commands for upgrading this enrolment module
-
-function enrol_paypal_upgrade($oldversion=0) {
-
-    global $CFG, $THEME, $db;
-
-    $result = true;
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    return $result;
-
-}
-
-?>
diff --git a/enrol/paypal/db/postgres7.php b/enrol/paypal/db/postgres7.php
deleted file mode 100644 (file)
index 35768f7..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?PHP  //$Id$
-
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-
-// PostgreSQL commands for upgrading this enrolment module
-
-function enrol_paypal_upgrade($oldversion=0) {
-
-    global $CFG, $THEME, $db;
-
-    $result = true;
-
-    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
-
-    return $result;
-
-}
-
-?>
index 2000a06..f864454 100644 (file)
@@ -3,7 +3,7 @@
       // If not, it obtains the corresponding TeX expression from the cache_tex db table
       // and uses mimeTeX to create the image file
 
-    $nomoodlecookie = true;     // Because it interferes with caching
+    define('NO_MOODLE_COOKIES', true); // Because it interferes with caching
 
     require_once("../../config.php");
 
index 3c14bd2..fe93abc 100644 (file)
@@ -3,7 +3,7 @@
       // If not, it obtains the corresponding TeX expression from the cache_tex db table
       // and uses mimeTeX to create the image file
 
-    $nomoodlecookie = true;     // Because it interferes with caching
+    define('NO_MOODLE_COOKIES', true); // Because it interferes with caching
 
     require_once('../../config.php');
 
index 6ca5bb5..dd7e969 100644 (file)
@@ -3,7 +3,7 @@
       // If not, it obtains the corresponding TeX expression from the cache_tex db table
       // and uses mimeTeX to create the image file
 
-    $nomoodlecookie = true;     // Because it interferes with caching
+define('NO_MOODLE_COOKIES', true); // Because it interferes with caching
 
     require_once('../../config.php');
 
index 6a976f4..4cd5f96 100644 (file)
@@ -3,7 +3,7 @@
       // If not, it obtains the corresponding TeX expression from the cache_tex db table
       // and uses mimeTeX to create the image file
 
-    $nomoodlecookie = true;     // Because it interferes with caching
+    define('NO_MOODLE_COOKIES', true); // Because it interferes with caching
 
     require_once("../../config.php");
 
index 5ff4c0b..3a40ba1 100644 (file)
@@ -3,7 +3,7 @@
       // If not, it obtains the corresponding TeX expression from the cache_tex db table
       // and uses mimeTeX to create the image file
 
-    $nomoodlecookie = true;     // Because it interferes with caching
+    define('NO_MOODLE_COOKIES', true); // Because it interferes with caching
 
     require_once("../../config.php");
     require_once($CFG->dirroot.'/filter/tex/lib.php');
diff --git a/grade/export/csv/db/access.php b/grade/export/csv/db/access.php
deleted file mode 100644 (file)
index b28b04f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
index eff5cb6..f6c21a7 100644 (file)
@@ -23,7 +23,7 @@
 //                                                                       //
 ///////////////////////////////////////////////////////////////////////////
 
-$nomoodlecookie = true; // session not used here
+define('NO_MOODLE_COOKIES', true); // session not used here
 require '../../../config.php';
 
 $id = required_param('id', PARAM_INT); // course id
index 91f1ebe..bb9b45a 100644 (file)
@@ -23,7 +23,7 @@
 //                                                                       //
 ///////////////////////////////////////////////////////////////////////////
 
-$nomoodlecookie = true; // session not used here
+define('NO_MOODLE_COOKIES', true); // session not used here
 require '../../../config.php';
 
 $id = required_param('id', PARAM_INT); // course id
index 11cdd27..b3efcb7 100644 (file)
@@ -23,7 +23,7 @@
 //                                                                       //
 ///////////////////////////////////////////////////////////////////////////
 
-$nomoodlecookie = true; // session not used here
+define('NO_MOODLE_COOKIES', true); // session not used here
 require '../../../config.php';
 
 $id = required_param('id', PARAM_INT); // course id
index 6362af0..275cc22 100644 (file)
@@ -23,7 +23,7 @@
 //                                                                       //
 ///////////////////////////////////////////////////////////////////////////
 
-$nomoodlecookie = true; // session not used here
+define('NO_MOODLE_COOKIES', true); // session not used here
 require '../../../config.php';
 
 $id = required_param('id', PARAM_INT); // course id
index 48d9d3e..008c394 100644 (file)
@@ -23,7 +23,7 @@
 //                                                                       //
 ///////////////////////////////////////////////////////////////////////////
 
-$nomoodlecookie = true; // session not used here
+define('NO_MOODLE_COOKIES', true); // session not used here
 require '../../../config.php';
 
 $id = required_param('id', PARAM_INT); // course id
index dcf1356..0a7cb9d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -85,8 +85,8 @@
     }
 
 
-    if (get_moodle_cookie() == '') {
-        set_moodle_cookie('nobody');   // To help search for cookies on login page
+    if ($SESSION->get_moodle_cookie() == '') {
+        $SESSION->set_moodle_cookie('nobody');   // To help search for cookies on login page
     }
 
     if (!empty($USER->id)) {
index 67d10fa..26f74af 100644 (file)
@@ -36,14 +36,14 @@ $string['availabledbtypes']='Available db types';
 $string['availablelangs']='List of available languages';
 $string['bypassed'] = 'Bypassed';
 $string['cannotconnecttodb'] = 'Cannot connect to db';
-$string['cannotcreatelangdir'] = 'Cannot create lang dir.';
-$string['cannotcreatetempdir'] = 'Cannot create temp dir.';
-$string['cannotdownloadcomponents'] = 'Cannot download components.';
-$string['cannotdownloadzipfile'] = 'Cannot download ZIP file.';
-$string['cannotfindcomponent'] = 'Cannot find component.';
-$string['cannotsavemd5file'] = 'Cannot save md5 file.';
-$string['cannotsavezipfile'] = 'Cannot save ZIP file.';
-$string['cannotunzipfile'] = 'Cannot unzip file.';
+$string['cannotcreatelangdir'] = 'Cannot create lang directory';
+$string['cannotcreatetempdir'] = 'Cannot create temp directory';
+$string['cannotdownloadcomponents'] = 'Cannot download components';
+$string['cannotdownloadzipfile'] = 'Cannot download ZIP file';
+$string['cannotfindcomponent'] = 'Cannot find component';
+$string['cannotsavemd5file'] = 'Cannot save md5 file';
+$string['cannotsavezipfile'] = 'Cannot save ZIP file';
+$string['cannotunzipfile'] = 'Cannot unzip file';
 $string['caution'] = 'Caution';
 $string['check'] = 'Check';
 $string['checkingphpsettings']='Checking PHP Settings';
@@ -54,7 +54,7 @@ $string['closewindow'] = 'Close this window';
 $string['compatibilitysettings'] = 'Checking your PHP settings ...';
 $string['compatibilitysettingshead'] = 'Checking your PHP settings ...';
 $string['compatibilitysettingssub'] = 'Your server should pass all these tests to make Moodle run properly';
-$string['componentisuptodate'] = 'Component is up to date.';
+$string['componentisuptodate'] = 'Component is up-to-date';
 $string['configfilecreated'] = 'Configuration file successfully created';
 $string['configfiledoesnotexist'] = 'Configuration file does not exist !!!';
 $string['configfilenotwritten'] = 'The installer script was not able to automatically create a config.php file containing your chosen settings, probably because the Moodle directory is not writeable. You can manually copy the following code into a file named config.php within the root directory of Moodle.';
@@ -215,7 +215,7 @@ $string['dirroot'] = 'Moodle Directory';
 $string['dirrooterror'] = 'The \'Moodle Directory\' setting seems to be incorrect - we can\'t find a Moodle installation there. The value below has been reset.';
 $string['disagreelicense'] = 'Upgrade cannot proceed due to disagreement to GPL!';
 $string['download'] = 'Download';
-$string['downloadedfilecheckfailed'] = 'Downloaded file check failed.';
+$string['downloadedfilecheckfailed'] = 'Downloaded file check failed';
 $string['downloadlanguagebutton'] = 'Download the &quot;$a&quot; language pack';
 $string['downloadlanguagehead'] = 'Download language pack';
 $string['downloadlanguagenotneeded'] = 'You may continue the installation process using the default language pack, \"$a\".';
@@ -363,7 +363,7 @@ $string['phpversionhelp'] = '<p>Moodle requires a PHP version of at least 4.3.0
 <p>You must upgrade PHP or move to a host with a newer version of PHP!<br/>
 (In case of 5.0.x you could also downgrade to 4.4.x version)</p>';
 $string['postgres7'] = 'PostgreSQL (postgres7)';
-$string['prefixcannotbeempty'] = '<p>Error: database table prefix can not be empty ($a)</p>
+$string['prefixcannotbeempty'] = '<p>Error: database table prefix cannot be empty ($a)</p>
 <p>The site administrator must fix this problem.</p>';
 $string['prefixtoolong'] = '<p>Error: database table prefix is too long ($a->dbfamily)</p>
 <p>The site administrator must fix this problem. Maximum length for table prefixes in $a->dbfamily is $a->maxlength characters.</p>';
@@ -469,9 +469,9 @@ $string['welcomep60'] = 'The following pages will lead you through some easy to
 $string['welcomep70'] = 'Click the \"Next\" button below to continue with the set up of <strong>Moodle</strong>.';
 $string['welcometext']='---Welcome to moodle commandline installer---';
 $string['writetoconfigfilefaild'] = 'Error: Write to config file failed ';
-$string['wrongdestpath'] = 'Wrong destination path.';
-$string['wrongsourcebase'] = 'Wrong source URL base.';
-$string['wrongzipfilename'] = 'Wrong ZIP filename.';
+$string['wrongdestpath'] = 'Wrong destination path';
+$string['wrongsourcebase'] = 'Wrong source URL base';
+$string['wrongzipfilename'] = 'Wrong ZIP file name';
 $string['wwwroot'] = 'Web address';
 $string['wwwrooterror'] = 'The \'Web Address\' does not appear to be valid - this Moodle installation doesn\'t appear to be there. The value below has been reset.';
 $string['xmlrpcrecommended'] = 'Installing the optional xmlrpc extension is useful for Moodle Networking functionality.';
index 0dc8473..060e4c0 100644 (file)
@@ -12,4 +12,14 @@ $string['go'] = 'Go!';
 $string['bytes'] = ' bytes (0 stands for no limits)';
 $string['searchmoodle'] = 'Search Moodle';
 $string['usemoodleroot'] = 'Use moodle root for external converters';
+$string['wordhandling'] = 'Microsoft Word handling';
+$string['pdfhandling'] = 'Acrobat PDF handling';
+$string['handlingfor'] = 'Extra handling for';
+$string['searchdiscovery'] = 'Searchable items discovery';
+$string['configtypetotxtcmd'] = 'Converter\'s command line';
+$string['configtypetotxtenv'] = 'Environment define for converter';
+$string['modulessearchswitches'] = 'Indexer activation for modules';
+$string['blockssearchswitches'] = 'Indexer activation for blocks';
+$string['nosearchablemodules'] = 'No searchable modules';
+$string['nosearchableblocks'] = 'No searchable blocks';
 ?>
\ No newline at end of file
diff --git a/lib/adodb/adodb-time.zip b/lib/adodb/adodb-time.zip
deleted file mode 100644 (file)
index d3239db..0000000
Binary files a/lib/adodb/adodb-time.zip and /dev/null differ
diff --git a/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/media/bg_left.png b/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/media/bg_left.png
deleted file mode 100644 (file)
index 19fdf05..0000000
Binary files a/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/media/bg_left.png and /dev/null differ
diff --git a/lib/adodb/adodb-xmlschema.zip b/lib/adodb/adodb-xmlschema.zip
deleted file mode 100644 (file)
index 14e6a8f..0000000
Binary files a/lib/adodb/adodb-xmlschema.zip and /dev/null differ
diff --git a/lib/adodb/cute_icons_for_site/adodb.gif b/lib/adodb/cute_icons_for_site/adodb.gif
deleted file mode 100644 (file)
index c5e8dfc..0000000
Binary files a/lib/adodb/cute_icons_for_site/adodb.gif and /dev/null differ
diff --git a/lib/adodb/cute_icons_for_site/adodb.png b/lib/adodb/cute_icons_for_site/adodb.png
deleted file mode 100644 (file)
index 339dd76..0000000
Binary files a/lib/adodb/cute_icons_for_site/adodb.png and /dev/null differ
diff --git a/lib/adodb/cute_icons_for_site/adodb2.gif b/lib/adodb/cute_icons_for_site/adodb2.gif
deleted file mode 100644 (file)
index f12ae20..0000000
Binary files a/lib/adodb/cute_icons_for_site/adodb2.gif and /dev/null differ
diff --git a/lib/adodb/cute_icons_for_site/adodb2.png b/lib/adodb/cute_icons_for_site/adodb2.png
deleted file mode 100644 (file)
index ab18515..0000000
Binary files a/lib/adodb/cute_icons_for_site/adodb2.png and /dev/null differ
diff --git a/lib/adodb/tests/tmssql.php b/lib/adodb/tests/tmssql.php
deleted file mode 100644 (file)
index 69bcb9e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php\r
-\r
-require_once('../../../config.php');\r
-require_once('../../weblib.php');\r
-\r
-add_to_log(0, 'adodb', 'intrusion attempt', 'lib/adodb/tests/tmssql.php');\r
-trigger_error('SECURITY WARNING: intrusion attempt against lib/tests/tmssql.php from ' . getremoteaddr());\r
-error('SECURITY WARNING: logged intrusion attempt against lib/adodb/tests/tmssql.php');\r
-\r
-?>
\ No newline at end of file
index a394d77..e44115f 100644 (file)
@@ -84,9 +84,9 @@
 //                     $a = new stdClass();
 //                     $a->url = 'http://download.moodle.org/lang16/es_utf8.zip';
 //                     $a->dest= $CFG->dataroot.'/lang';
-//                     error(get_string($cd->get_error(), 'error', $a));
+//                     print_error($cd->get_error(), 'error', '', $a);
 //                 } else {
-//                     error(get_string($cd->get_error(), 'error'));
+//                     print_error($cd->get_error(), 'error');
 //                 }
 //                 break;
 //             case COMPONENT_UPTODATE:
diff --git a/lib/cookieless.php b/lib/cookieless.php
deleted file mode 100644 (file)
index e7ca80b..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-<?php  // $Id$
-/**
-* Enable cookieless sessions by including $CFG->usesid=true;
-* in config.php.
-* Based on code from php manual by Richard at postamble.co.uk
-* Attempts to use cookies if cookies not present then uses session ids attached to all urls and forms to pass session id from page to page.
-* If site is open to google, google is given guest access as usual and there are no sessions. No session ids will be attached to urls for googlebot.
-* This doesn't require trans_sid to be turned on but this is recommended for better performance
-* you should put :
-* session.use_trans_sid = 1 
-* in your php.ini file and make sure that you don't have a line like this in your php.ini
-* session.use_only_cookies = 1
-* @author Richard at postamble.co.uk and Jamie Pratt
-* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
-*/
-/**
-* You won't call this function directly. This function is used to process 
-* text buffered by php in an output buffer. All output is run through this function 
-* before it is ouput.
-* @param string $buffer is the output sent from php
-* @return string the output sent to the browser
-*/
-function sid_ob_rewrite($buffer){
-    $replacements = array(
-        '/(<\s*(a|link|script|frame|area)\s[^>]*(href|src)\s*=\s*")([^"]*)(")/i',
-        '/(<\s*(a|link|script|frame|area)\s[^>]*(href|src)\s*=\s*\')([^\']*)(\')/i');
-    $buffer = preg_replace_callback($replacements, "sid_rewrite_link_tag", $buffer);
-    $buffer = preg_replace('/<form\s[^>]*>/i',
-        '\0<input type="hidden" name="' . session_name() . '" value="' . session_id() . '"/>', $buffer);
-    
-      return $buffer;
-}
-/**
-* You won't call this function directly. This function is used to process 
-* text buffered by php in an output buffer. All output is run through this function 
-* before it is ouput.
-* This function only processes absolute urls, it is used when we decide that 
-* php is processing other urls itself but needs some help with internal absolute urls still.
-* @param string $buffer is the output sent from php
-* @return string the output sent to the browser
-*/
-function sid_ob_rewrite_absolute($buffer){
-    $replacements = array(
-        '/(<\s*(a|link|script|frame|area)\s[^>]*(href|src)\s*=\s*")((?:http|https)[^"]*)(")/i',
-        '/(<\s*(a|link|script|frame|area)\s[^>]*(href|src)\s*=\s*\')((?:http|https)[^\']*)(\')/i');
-    $buffer = preg_replace_callback($replacements, "sid_rewrite_link_tag", $buffer);
-    $buffer = preg_replace('/<form\s[^>]*>/i',
-        '\0<input type="hidden" name="' . session_name() . '" value="' . session_id() . '"/>', $buffer);
-    return $buffer;
-}
-/**
-* A function to process link, a and script tags found 
-* by preg_replace_callback in {@link sid_ob_rewrite($buffer)}.
-*/
-function sid_rewrite_link_tag($matches){
-    $url = $matches[4];
-    $url=sid_process_url($url);
-    return $matches[1]. $url.$matches[5];
-}
-/**
-* You can call this function directly. This function is used to process 
-* urls to add a moodle session id to the url for internal links.
-* @param string $url is a url
-* @return string the processed url
-*/
-function sid_process_url($url) {
-    global $CFG;
-    if ((preg_match('/^(http|https):/i', $url)) // absolute url
-        &&  ((stripos($url, $CFG->wwwroot)!==0) && stripos($url, $CFG->httpswwwroot)!==0)) { // and not local one
-        return $url; //don't attach sessid to non local urls
-    }
-    if ($url[0]=='#' || (stripos($url, 'javascript:')===0)) {
-        return $url; //don't attach sessid to anchors
-    }
-    if (strpos($url, session_name())!==FALSE)
-    {
-        return $url; //don't attach sessid to url that already has one sessid
-    }
-    if (strpos($url, "?")===FALSE){
-        $append="?".strip_tags(session_name() . '=' . session_id() );
-    }    else {
-        $append="&amp;".strip_tags(session_name() . '=' . session_id() );
-    }
-    //put sessid before any anchor
-    $p = strpos($url, "#");
-    if($p!==FALSE){
-        $anch = substr($url, $p);
-        $url = substr($url, 0, $p).$append.$anch ;
-    } else  {
-        $url .= $append ;
-    }
-    return $url;    
-}
-
-
-/**
-* Call this function before there has been any output to the browser to
-* buffer output and add session ids to all internal links.
-*/
-function sid_start_ob(){
-    global $CFG;
-    //don't attach sess id for bots
-
-    if (!empty($_SERVER['HTTP_USER_AGENT'])) {
-        if (!empty($CFG->opentogoogle)) {
-            if (strpos($_SERVER['HTTP_USER_AGENT'], 'Googlebot') !== false ) {
-                @ini_set('session.use_trans_sid', '0'); // try and turn off trans_sid
-                $CFG->usesid=false;
-                return;
-            }
-            if (strpos($_SERVER['HTTP_USER_AGENT'], 'google.com') !== false ) {
-                @ini_set('session.use_trans_sid', '0'); // try and turn off trans_sid
-                $CFG->usesid=false;
-                return;
-            }
-        }
-        if (strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') !== false ) {
-            @ini_set('session.use_trans_sid', '0'); // try and turn off trans_sid
-            $CFG->usesid=false;
-            return;
-        }
-    }
-    @ini_set('session.use_trans_sid', '1'); // try and turn on trans_sid
-    if (ini_get('session.use_trans_sid')!=0 ){ 
-        // use trans sid as its available
-        ini_set('url_rewriter.tags', 'a=href,area=href,script=src,link=href,' 
-            . 'frame=src,form=fakeentry');
-        ob_start('sid_ob_rewrite_absolute');
-    }else{
-        //rewrite all links ourselves
-        ob_start('sid_ob_rewrite');
-    }
-}
-?>
diff --git a/lib/db/mysql.php b/lib/db/mysql.php
deleted file mode 100644 (file)
index 3e27b02..0000000
+++ /dev/null
@@ -1,2337 +0,0 @@
-<?PHP  //$Id$
-// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
-//
-// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
-// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
-//
-//
-// This file is tailored to MySQL
-
-function main_upgrade($oldversion=0) {
-
-    global $CFG, $THEME, $db;
-
-    $result = true;
-
-    if ($oldversion == 0) {
-        execute_sql("
-          CREATE TABLE `config` (
-            `id` int(10) unsigned NOT NULL auto_increment,
-            `name` varchar(255) NOT NULL default '',
-            `value` varchar(255) NOT NULL default '',
-            PRIMARY KEY  (`id`),
-            UNIQUE KEY `name` (`name`)
-          ) COMMENT='Moodle configuration variables';");
-        notify("Created a new table 'config' to hold configuration data");
-    }
-    if ($oldversion < 2002073100) {
-        execute_sql(" DELETE FROM `modules` WHERE `name` = 'chat' ");
-    }
-    if ($oldversion < 2002080200) {
-        execute_sql(" ALTER TABLE `modules` DROP `fullname`  ");
-        execute_sql(" ALTER TABLE `modules` DROP `search`  ");
-    }
-    if ($oldversion < 2002080300) {
-        execute_sql(" ALTER TABLE `log_display` CHANGE `table` `mtable` VARCHAR( 20 ) NOT NULL ");
-        execute_sql(" ALTER TABLE `user_teachers` CHANGE `authority` `authority` TINYINT( 3 ) DEFAULT '3' NOT NULL ");
-    }
-    if ($oldversion < 2002082100) {
-        execute_sql(" ALTER TABLE `course` CHANGE `guest` `guest` TINYINT(2) UNSIGNED DEFAULT '0' NOT NULL ");
-    }
-    if ($oldversion < 2002082101) {
-        execute_sql(" ALTER TABLE `user` ADD `maildisplay` TINYINT(2) UNSIGNED DEFAULT '2' NOT NULL AFTER `mailformat` ");
-    }
-    if ($oldversion < 2002090100) {
-        execute_sql(" ALTER TABLE `course_sections` CHANGE `summary` `summary` TEXT NOT NULL ");
-    }
-    if ($oldversion < 2002090701) {
-        execute_sql(" ALTER TABLE `user_teachers` CHANGE `authority` `authority` TINYINT( 10 ) DEFAULT '3' NOT NULL ");
-        execute_sql(" ALTER TABLE `user_teachers` ADD `role` VARCHAR(40) NOT NULL AFTER `authority` ");
-    }
-    if ($oldversion < 2002090800) {
-        execute_sql(" ALTER TABLE `course` ADD `teachers` VARCHAR( 100 ) DEFAULT 'Teachers' NOT NULL AFTER `teacher` ");
-        execute_sql(" ALTER TABLE `course` ADD `students` VARCHAR( 100 ) DEFAULT 'Students' NOT NULL AFTER `student` ");
-    }
-    if ($oldversion < 2002091000) {
-        execute_sql(" ALTER TABLE `user` CHANGE `personality` `secret` VARCHAR( 15 ) NOT NULL DEFAULT ''  ");
-    }
-    if ($oldversion < 2002091400) {
-        execute_sql(" ALTER TABLE `user` ADD `lang` VARCHAR( 3 ) DEFAULT 'en' NOT NULL AFTER `country`  ");
-    }
-    if ($oldversion < 2002091900) {
-        notify("Most Moodle configuration variables have been moved to the database and can now be edited via the admin page.");
-        notify("Although it is not vital that you do so, you might want to edit <U>config.php</U> and remove all the unused settings (except the database, URL and directory definitions).  See <U>config-dist.php</U> for an example of how your new slim config.php should look.");
-    }
-    if ($oldversion < 2002092000) {
-        execute_sql(" ALTER TABLE `user` CHANGE `lang` `lang` VARCHAR(5) DEFAULT 'en' NOT NULL  ");
-    }
-    if ($oldversion < 2002092100) {
-        execute_sql(" ALTER TABLE `user` ADD `deleted` TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL AFTER `confirmed` ");
-    }
-    if ($oldversion < 2002101001) {
-        execute_sql(" ALTER TABLE `user` ADD `htmleditor` TINYINT(1) UNSIGNED DEFAULT '1' NOT NULL AFTER `maildisplay` ");
-    }
-    if ($oldversion < 2002101701) {
-        execute_sql(" ALTER TABLE `reading` RENAME `resource` ");  // Small line with big consequences!
-        execute_sql(" DELETE FROM `log_display` WHERE module = 'reading'");
-        execute_sql(" INSERT INTO log_display (module, action, mtable, field) VALUES ('resource', 'view', 'resource', 'name') ");
-        execute_sql(" UPDATE log SET module = 'resource' WHERE module = 'reading' ");
-        execute_sql(" UPDATE modules SET name = 'resource' WHERE name = 'reading' ");
-    }
-
-    if ($oldversion < 2002102503) {
-        execute_sql(" ALTER TABLE `course` ADD `modinfo` TEXT NOT NULL AFTER `format` ");
-        require_once("$CFG->dirroot/mod/forum/lib.php");
-        require_once("$CFG->dirroot/course/lib.php");
-
-        if (! $module = get_record("modules", "name", "forum")) {
-            notify("Could not find forum module!!");
-            return false;
-        }
-
-        // First upgrade the site forums
-        if ($site = get_site()) {
-            print_heading("Making News forums editable for main site (moving to section 1)...");
-            if ($news = forum_get_course_forum($site->id, "news")) {
-                $mod->course = $site->id;
-                $mod->module = $module->id;
-                $mod->instance = $news->id;
-                $mod->section = 1;
-                if (! $mod->coursemodule = add_course_module($mod) ) {
-                    notify("Could not add a new course module to the site");
-                    return false;
-                }
-                if (! $sectionid = add_mod_to_section($mod) ) {
-                    notify("Could not add the new course module to that section");
-                    return false;
-                }
-                if (! set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
-                    notify("Could not update the course module with the correct section");
-                    return false;
-                }
-            }
-        }
-
-
-        // Now upgrade the courses.
-        if ($courses = get_records_sql("SELECT * FROM course WHERE category > 0")) {
-            print_heading("Making News and Social forums editable for each course (moving to section 0)...");
-            foreach ($courses as $course) {
-                if ($course->format == "social") {  // we won't touch them
-                    continue;
-                }
-                if ($news = forum_get_course_forum($course->id, "news")) {
-                    $mod->course = $course->id;
-                    $mod->module = $module->id;
-                    $mod->instance = $news->id;
-                    $mod->section = 0;
-                    if (! $mod->coursemodule = add_course_module($mod) ) {
-                        notify("Could not add a new course module to the course '" . format_string($course->fullname) . "'");
-                        return false;
-                    }
-                    if (! $sectionid = add_mod_to_section($mod) ) {
-                        notify("Could not add the new course module to that section");
-                        return false;
-                    }
-                    if (! set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
-                        notify("Could not update the course module with the correct section");
-                        return false;
-                    }
-                }
-                if ($social = forum_get_course_forum($course->id, "social")) {
-                    $mod->course = $course->id;
-                    $mod->module = $module->id;
-                    $mod->instance = $social->id;
-                    $mod->section = 0;
-                    if (! $mod->coursemodule = add_course_module($mod) ) {
-                        notify("Could not add a new course module to the course '" . format_string($course->fullname) . "'");
-                        return false;
-                    }
-                    if (! $sectionid = add_mod_to_section($mod) ) {
-                        notify("Could not add the new course module to that section");
-                        return false;
-                    }
-                    if (! set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
-                        notify("Could not update the course module with the correct section");
-                        return false;
-                    }
-                }
-            }
-        }
-    }
-
-    if ($oldversion < 2002111003) {
-        execute_sql(" ALTER TABLE `course` ADD `modinfo` TEXT NOT NULL AFTER `format` ");
-        if ($courses = get_records_sql("SELECT * FROM course")) {
-            require_once("$CFG->dirroot/course/lib.php");
-            foreach ($courses as $course) {
-
-                $modinfo = serialize(get_array_of_activities($course->id));
-
-                if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
-                    notify("Could not cache module information for course '" . format_string($course->fullname) . "'!");
-                }
-            }
-        }
-    }
-
-    if ($oldversion < 2002111100) {
-        print_simple_box_start("CENTER", "", "#FFCCCC");
-        echo "<FONT SIZE=+1>";
-        echo "<P>Changes have been made to all built-in themes, to add the new popup navigation menu.";
-        echo "<P>If you have customised themes, you will need to edit theme/xxxx/header.html as follows:";
-        echo "<UL><LI>Change anywhere it says <B>$"."button</B> to say <B>$"."menu</B>";
-        echo "<LI>Add <B>$"."button</B> elsewhere (eg at the end of the navigation bar)</UL>";
-        echo "<P>See the standard themes for examples, eg: theme/standard/header.html";
-        print_simple_box_end();
-    }
-
-    if ($oldversion < 2002111200) {
-        execute_sql(" ALTER TABLE `course` ADD `showrecent` TINYINT(5) UNSIGNED DEFAULT '1' NOT NULL AFTER `numsections` ");
-    }
-
-    if ($oldversion < 2002111400) {
-    // Rebuild all course caches, because some may not be done in new installs (eg site page)
-        if ($courses = get_records_sql("SELECT * FROM course")) {
-            require_once("$CFG->dirroot/course/lib.php");
-            foreach ($courses as $course) {
-
-                $modinfo = serialize(get_array_of_activities($course->id));
-
-                if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
-                    notify("Could not cache module information for course '" . format_string($course->fullname) . "'!");
-                }
-            }
-        }
-    }
-
-    if ($oldversion < 2002112000) {
-        set_config("guestloginbutton", 1);
-    }
-
-    if ($oldversion < 2002122300) {
-        execute_sql("ALTER TABLE `log` CHANGE `user` `userid` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
-        execute_sql("ALTER TABLE `user_admins` CHANGE `user` `userid` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
-        execute_sql("ALTER TABLE `user_students` CHANGE `user` `userid` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
-        execute_sql("ALTER TABLE `user_teachers` CHANGE `user` `userid` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
-        execute_sql("ALTER TABLE `user_students` CHANGE `start` `timestart` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
-        execute_sql("ALTER TABLE `user_students` CHANGE `end` `timeend` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
-    }
-
-    if ($oldversion < 2002122700) {
-        if (! record_exists("log_display", "module", "user", "action", "view")) {
-            execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('user', 'view', 'user', 'CONCAT(firstname,' ',lastname)') ");
-        }
-    }
-    if ($oldversion < 2003010101) {
-        delete_records("log_display", "module", "user");
-        $new->module = "user";
-        $new->action = "view";
-        $new->mtable = "user";
-        $new->field  = "CONCAT(firstname,\" \",lastname)";
-        insert_record("log_display", $new);
-
-        delete_records("log_display", "module", "course");
-        $new->module = "course";
-        $new->action = "view";
-        $new->mtable = "course";
-        $new->field  = "fullname";
-        insert_record("log_display", $new);
-        $new->action = "update";
-        insert_record("log_display", $new);
-        $new->action = "enrol";
-        insert_record("log_display", $new);
-    }
-
-    if ($oldversion < 2003012200) {
-        // execute_sql(" ALTER TABLE `log_display` CHANGE `module` `module` VARCHAR( 20 ) NOT NULL ");
-        // Commented out - see below where it's done properly
-    }
-
-    if ($oldversion < 2003032500) {
-        modify_database("", "CREATE TABLE `prefix_user_coursecreators` (
-                             `id` int(10) unsigned NOT NULL auto_increment,
-                             `userid` int(10) unsigned NOT NULL default '0',
-                             PRIMARY KEY  (`id`),
-                             UNIQUE KEY `id` (`id`)
-                             ) TYPE=MyISAM COMMENT='One record per course creator';");
-    }
-    if ($oldversion < 2003032602) {
-        // Redoing it because of no prefix last time
-        execute_sql(" ALTER TABLE `{$CFG->prefix}log_display` CHANGE `module` `module` VARCHAR( 20 ) NOT NULL ");
-        // Add some indexes for speed
-        execute_sql(" ALTER TABLE `{$CFG->prefix}log` ADD INDEX(course) ");
-        execute_sql(" ALTER TABLE `{$CFG->prefix}log` ADD INDEX(userid) ");
-    }
-
-    if ($oldversion < 2003041400) {
-        table_column("course_modules", "", "visible", "integer", "1", "unsigned", "1", "not null", "score");
-    }
-
-    if ($oldversion < 2003042104) {  // Try to update permissions of all files
-        if ($files = get_directory_list($CFG->dataroot)) {
-            echo "Attempting to update permissions for all files... ignore any errors.";
-            foreach ($files as $file) {
-                echo "$CFG->dataroot/$file<br />";
-                @chmod("$CFG->dataroot/$file", $CFG->directorypermissions);
-            }
-        }
-    }
-
-    if ($oldversion < 2003042400) {
-    // Rebuild all course caches, because of changes to do with visible variable
-        if ($courses = get_records_sql("SELECT * FROM {$CFG->prefix}course")) {
-            require_once("$CFG->dirroot/course/lib.php");
-            foreach ($courses as $course) {
-                $modinfo = serialize(get_array_of_activities($course->id));
-
-                if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
-                    notify("Could not cache module information for course '" . format_string($course->fullname) . "'!");
-                }
-            }
-        }
-    }
-
-    if ($oldversion < 2003042500) {
-    //  Convert all usernames to lowercase.
-        $users = get_records_sql("SELECT id, username FROM {$CFG->prefix}user");
-        $cerrors = "";
-        $rarray = array();
-
-        foreach ($users as $user) {      // Check for possible conflicts
-            $lcname = trim(moodle_strtolower($user->username));
-            if (in_array($lcname, $rarray)) {
-                $cerrors .= $user->id."->".$lcname.'<br/>' ;
-            } else {
-                array_push($rarray,$lcname);
-            }
-        }
-
-        if ($cerrors != '') {
-            notify("Error: Cannot convert usernames to lowercase.
-                    Following usernames would overlap (id->username):<br/> $cerrors .
-                    Please resolve overlapping errors.");
-            $result = false;
-        }
-
-        $cerrors = "";
-        echo "Checking userdatabase:<br />";
-        foreach ($users as $user) {
-            $lcname = trim(moodle_strtolower($user->username));
-            if ($lcname != $user->username) {
-                $convert = set_field("user" , "username" , $lcname, "id", $user->id);
-                if (!$convert) {
-                    if ($cerrors){
-                       $cerrors .= ", ";
-                    }
-                    $cerrors .= $item;
-                } else {
-                    echo ".";
-                }
-            }
-        }
-        if ($cerrors != '') {
-            notify("There were errors when converting following usernames to lowercase.
-                   '$cerrors' . Sorry, but you will need to fix your database by hand.");
-            $result = false;
-        }
-    }
-
-    if ($oldversion < 2003042600) {
-        /// Some more indexes - we need all the help we can get on the logs
-        //execute_sql(" ALTER TABLE `{$CFG->prefix}log` ADD INDEX(module) ");
-        //execute_sql(" ALTER TABLE `{$CFG->prefix}log` ADD INDEX(action) ");
-    }
-
-    if ($oldversion < 2003042700) {
-        /// Changing to multiple indexes
-        execute_sql(" ALTER TABLE `{$CFG->prefix}log` DROP INDEX module ", false);
-        execute_sql(" ALTER TABLE `{$CFG->prefix}log` DROP INDEX action ", false);
-        execute_sql(" ALTER TABLE `{$CFG->prefix}log` DROP INDEX course ", false);
-        execute_sql(" ALTER TABLE `{$CFG->prefix}log` DROP INDEX userid ", false);
-        execute_sql(" ALTER TABLE `{$CFG->prefix}log` ADD INDEX coursemoduleaction (course,module,action) ");
-        execute_sql(" ALTER TABLE `{$CFG->prefix}log` ADD INDEX courseuserid (course,userid) ");
-    }
-
-    if ($oldversion < 2003042801) {
-        execute_sql("CREATE TABLE `{$CFG->prefix}course_display` (
-                        `id` int(10) unsigned NOT NULL auto_increment,
-                        `course` int(10) unsigned NOT NULL default '0',
-                        `userid` int(10) unsigned NOT NULL default '0',
-                        `display` int(10) NOT NULL default '0',
-                        PRIMARY KEY  (`id`),
-                        UNIQUE KEY `id` (`id`),
-                        KEY `courseuserid` (course,userid)
-                     ) TYPE=MyISAM COMMENT='Stores info about how to display the course'");
-    }
-
-    if ($oldversion < 2003050400) {
-        table_column("course_sections", "", "visible", "integer", "1", "unsigned", "1", "", "");
-    }
-
-    if ($oldversion < 2003050900) {
-        table_column("modules", "", "visible", "integer", "1", "unsigned", "1", "", "");
-    }
-
-    if ($oldversion < 2003050902) {
-        if (get_records("modules", "name", "pgassignment")) {
-            print_simple_box("Note: the pgassignment module has been removed (it will be replaced later by the workshop module).  Go to the new 'Manage Modules' page and DELETE IT from your system", "center", "50%", "$THEME->cellheading", "20", "noticebox");
-        }
-    }
-
-    if ($oldversion < 2003051600) {
-        print_simple_box("Thanks for upgrading!<p>There are many changes since the last release.  Please read the release notes carefully.  If you are using CUSTOM themes you will need to edit them.  You will also need to check your site's config.php file.", "center", "50%", "$THEME->cellheading", "20", "noticebox");
-    }
-
-    if ($oldversion < 2003052300) {
-        table_column("user", "", "autosubscribe", "integer", "1", "unsigned", "1", "", "htmleditor");
-    }
-
-    if ($oldversion < 2003072100) {
-        table_column("course", "", "visible", "integer", "1", "unsigned", "1", "", "marker");
-    }
-
-    if ($oldversion < 2003072101) {
-        table_column("course_sections", "sequence", "sequence", "text", "", "", "", "", "");
-    }
-
-    if ($oldversion < 2003072800) {
-        print_simple_box("The following database index improves performance, but can be quite large - if you are upgrading and you have problems with a limited quota you may want to delete this index later from the '{$CFG->prefix}log' table in your database", "center", "50%", "$THEME->cellheading", "20", "noticebox");
-        flush();
-        execute_sql(" ALTER TABLE `{$CFG->prefix}log` ADD INDEX timecoursemoduleaction (time,course,module,action) ");
-        execute_sql(" ALTER TABLE `{$CFG->prefix}user_students` ADD INDEX courseuserid (course,userid) ");
-        execute_sql(" ALTER TABLE `{$CFG->prefix}user_teachers` ADD INDEX courseuserid (course,userid) ");
-    }
-
-    if ($oldversion < 2003072803) {
-        table_column("course_categories", "", "description", "text", "", "", "");
-        table_column("course_categories", "", "parent", "integer", "10", "unsigned");
-        table_column("course_categories", "", "sortorder", "integer", "10", "unsigned");
-        table_column("course_categories", "", "courseorder", "text", "", "", "");
-        table_column("course_categories", "", "visible", "integer", "1", "unsigned", "1");
-        table_column("course_categories", "", "timemodified", "integer", "10", "unsigned");
-    }
-
-    if ($oldversion < 2003080400) {
-        table_column("course_categories", "courseorder", "courseorder", "integer", "10", "unsigned");
-        table_column("course", "", "sortorder", "integer", "10", "unsigned", "0", "", "category");
-    }
-
-    if ($oldversion < 2003080700) {
-        notify("Cleaning up categories and course ordering...");
-        fix_course_sortorder();
-    }
-
-    if ($oldversion < 2003081001) {
-        table_column("course", "format", "format", "varchar", "10", "", "topics");
-    }
-
-    if ($oldversion < 2003081500) {
-//        print_simple_box("Some important changes have been made to how course creators work.  Formerly, they could create new courses and assign teachers, and teachers could edit courses.  Now, ordinary teachers can no longer edit courses - they <b>need to be a teacher of a course AND a course creator</b>.  A new site-wide configuration variable allows you to choose whether to allow course creators to create new courses as well (by default this is off).  <p>The following update will automatically convert all your existing teachers into course creators, to maintain backward compatibility.  Make sure you look at your upgraded site carefully and understand these new changes.", "center", "50%", "$THEME->cellheading", "20", "noticebox");
-
-//        $count = 0;
-//        $errorcount = 0;
-//        if ($teachers = get_records("user_teachers")) {
-//            foreach ($teachers as $teacher) {
-//                if (! record_exists("user_coursecreators", "userid", $teacher->userid)) {
-//                    $creator = NULL;
-//                    $creator->userid = $teacher->userid;
-//                    if (!insert_record("user_coursecreators", $creator)) {
-//                        $errorcount++;
-//                    } else {
-//                        $count++;
-//                    }
-//                }
-//            }
-//        }
-//        print_simple_box("$count teachers were upgraded to course creators (with $errorcount errors)", "center", "50%", "$THEME->cellheading", "20", "noticebox");
-
-    }
-
-    if ($oldversion < 2003081501) {
-        execute_sql(" CREATE TABLE `{$CFG->prefix}scale` (
-                         `id` int(10) unsigned NOT NULL auto_increment,
-                         `courseid` int(10) unsigned NOT NULL default '0',
-                         `userid` int(10) unsigned NOT NULL default '0',
-                         `name` varchar(255) NOT NULL default '',
-                         `scale` text NOT NULL,
-                         `description` text NOT NULL,
-                         `timemodified` int(10) unsigned NOT NULL default '0',
-                         PRIMARY KEY  (id)
-                       ) TYPE=MyISAM COMMENT='Defines grading scales'");
-
-    }
-
-    if ($oldversion < 2003081503) {
-        table_column("forum", "", "scale", "integer", "10", "unsigned", "0", "", "assessed");
-        get_scales_menu(0);    // Just to force the default scale to be created
-    }
-
-    if ($oldversion < 2003081600) {
-        table_column("user_teachers", "", "editall", "integer", "1", "unsigned", "1", "", "role");
-        table_column("user_teachers", "", "timemodified", "integer", "10", "unsigned", "0", "", "editall");
-    }
-
-    if ($oldversion < 2003081900) {
-        table_column("course_categories", "courseorder", "coursecount", "integer", "10", "unsigned", "0");
-    }
-
-    if ($oldversion < 2003082001) {
-        table_column("course", "", "showgrades", "integer", "2", "unsigned", "1", "", "format");
-    }
-
-    if ($oldversion < 2003082101) {
-        execute_sql(" ALTER TABLE `{$CFG->prefix}course` ADD INDEX category (category) ");
-    }
-    if ($oldversion < 2003082702) {
-        execute_sql(" INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'user report', 'user', 'CONCAT(firstname,\" \",lastname)') ");
-    }
-
-    if ($oldversion < 2003091400) {
-        table_column("course_modules", "", "indent", "integer", "5", "unsigned", "0", "", "score");
-    }
-
-    if ($oldversion < 2003092900) {
-        table_column("course", "", "maxbytes", "integer", "10", "unsigned", "0", "", "marker");
-    }
-
-    if ($oldversion < 2003102700) {
-        table_column("user_students", "", "timeaccess", "integer", "10", "unsigned", "0", "", "time");
-        table_column("user_teachers", "", "timeaccess", "integer", "10", "unsigned", "0", "", "timemodified");
-
-        $db->debug = false;
-        $CFG->debug = 0;
-        notify("Calculating access times.  Please wait - this may take a long time on big sites...", "green");
-        flush();
-
-        if ($courses = get_records_select("course", "category > 0")) {
-            foreach ($courses as $course) {
-                notify("Processing " . format_string($course->fullname) . " ...", "green");
-                flush();
-                if ($users = get_records_select("user_teachers", "course = '$course->id'",
-                                                "id", "id, userid, timeaccess")) {
-                    foreach ($users as $user) {
-                        $loginfo = get_record_sql("SELECT id, time FROM {$CFG->prefix}log                                                                                  WHERE course = '$course->id' and userid = '$user->userid'                                                               ORDER by time DESC");
-                        if (empty($loginfo->time)) {
-                            $loginfo->time = 0;
-                        }
-                        execute_sql("UPDATE {$CFG->prefix}user_teachers                                                                                      SET timeaccess = '$loginfo->time'
-                                     WHERE userid = '$user->userid' AND course = '$course->id'", false);
-
-                    }
-                }
-
-                if ($users = get_records_select("user_students", "course = '$course->id'",
-                                                "id", "id, userid, timeaccess")) {
-                    foreach ($users as $user) {
-                        $loginfo = get_record_sql("SELECT id, time FROM {$CFG->prefix}log
-                                                   WHERE course = '$course->id' and userid = '$user->userid'
-                                                   ORDER by time DESC");
-                        if (empty($loginfo->time)) {
-                            $loginfo->time = 0;
-                        }
-                        execute_sql("UPDATE {$CFG->prefix}user_students
-                                     SET timeaccess = '$loginfo->time'
-                                     WHERE userid = '$user->userid' AND course = '$course->id'", false);
-
-                    }
-                }
-            }
-        }
-        notify("All courses complete.", "green");
-        $db->debug = true;
-    }
-
-    if ($oldversion < 2003103100) {
-        table_column("course", "", "showreports", "integer", "4", "unsigned", "0", "", "maxbytes");
-    }
-
-    if ($oldversion < 2003121600) {
-        modify_database("", "CREATE TABLE `prefix_groups` (
-                                `id` int(10) unsigned NOT NULL auto_increment,
-                                `courseid` int(10) unsigned NOT NULL default '0',
-                                `name` varchar(254) NOT NULL default '',
-                                `description` text NOT NULL,
-                                `lang` varchar(10) NOT NULL default 'en',
-                                `picture` int(10) unsigned NOT NULL default '0',
-                                `timecreated` int(10) unsigned NOT NULL default '0',
-                                `timemodified` int(10) unsigned NOT NULL default '0',
-                                PRIMARY KEY  (`id`),
-                                KEY `courseid` (`courseid`)
-                              ) TYPE=MyISAM COMMENT='Each record is a group in a course.'; ");
-
-        modify_database("", "CREATE TABLE `prefix_groups_members` (
-                                `id` int(10) unsigned NOT NULL auto_increment,
-                                `groupid` int(10) unsigned NOT NULL default '0',
-                                `userid` int(10) unsigned NOT NULL default '0',
-                                `timeadded` int(10) unsigned NOT NULL default '0',
-                                PRIMARY KEY  (`id`),
-                                KEY `groupid` (`groupid`)
-                              ) TYPE=MyISAM COMMENT='Lists memberships of users in groups'; ");
-    }
-
-    if ($oldversion < 2003121800) {
-        table_column("course", "modinfo", "modinfo", "longtext", "", "", "");
-    }
-
-    if ($oldversion < 2003122600) {
-        table_column("course", "", "groupmode", "integer", "4", "unsigned", "0", "", "showreports");
-        table_column("course", "", "groupmodeforce", "integer", "4", "unsigned", "0", "", "groupmode");
-    }
-
-    if ($oldversion < 2004010900) {
-        table_column("course_modules", "", "groupmode", "integer", "4", "unsigned", "0", "", "visible");
-    }
-
-    if ($oldversion < 2004011700) {
-        modify_database("", "CREATE TABLE `prefix_event` (
-                              `id` int(10) unsigned NOT NULL auto_increment,
-                              `name` varchar(255) NOT NULL default '',
-                              `description` text NOT NULL,
-                              `courseid` int(10) unsigned NOT NULL default '0',
-                              `groupid` int(10) unsigned NOT NULL default '0',
-                              `userid` int(10) unsigned NOT NULL default '0',
-                              `modulename` varchar(20) NOT NULL default '',
-                              `instance` int(10) unsigned NOT NULL default '0',
-                              `eventtype` varchar(20) NOT NULL default '',
-                              `timestart` int(10) unsigned NOT NULL default '0',
-                              `timeduration` int(10) unsigned NOT NULL default '0',
-                              `timemodified` int(10) unsigned NOT NULL default '0',
-                              PRIMARY KEY  (`id`),
-                              UNIQUE KEY `id` (`id`),
-                              KEY `courseid` (`courseid`),
-                              KEY `userid` (`userid`)
-                            ) TYPE=MyISAM COMMENT='For everything with a time associated to it'; ");
-    }
-
-    if ($oldversion < 2004012800) {
-        modify_database("", "CREATE TABLE `prefix_user_preferences` (
-                              `id` int(10) unsigned NOT NULL auto_increment,
-                              `userid` int(10) unsigned NOT NULL default '0',
-                              `name` varchar(50) NOT NULL default '',
-                              `value` varchar(255) NOT NULL default '',
-                              PRIMARY KEY  (`id`),
-                              UNIQUE KEY `id` (`id`),
-                              KEY `useridname` (userid,name)
-                            ) TYPE=MyISAM COMMENT='Allows modules to store arbitrary user preferences'; ");
-    }
-
-    if ($oldversion < 2004012900) {
-        table_column("config", "value", "value", "text", "", "", "");
-    }
-
-    if ($oldversion < 2004013101) {
-        table_column("log", "", "cmid", "integer", "10", "unsigned", "0", "", "module");
-        set_config("upgrade", "logs");
-    }
-
-    if ($oldversion < 2004020900) {
-        table_column("course", "", "lang", "varchar", "5", "", "", "", "groupmodeforce");
-    }
-
-    if ($oldversion < 2004020903) {
-        modify_database("", "CREATE TABLE `prefix_cache_text` (
-                                `id` int(10) unsigned NOT NULL auto_increment,
-                                `md5key` varchar(32) NOT NULL default '',
-                                `formattedtext` longtext NOT NULL,
-                                `timemodified` int(10) unsigned NOT NULL default '0',
-                                PRIMARY KEY  (`id`),
-                                KEY `md5key` (`md5key`)
-                             ) TYPE=MyISAM COMMENT='For storing temporary copies of processed texts';");
-    }
-
-    if ($oldversion < 2004021000) {
-        $textfilters = array();
-        for ($i=1; $i<=10; $i++) {
-            $variable = "textfilter$i";
-            if (!empty($CFG->$variable)) {   /// No more filters
-                if (is_readable("$CFG->dirroot/".$CFG->$variable)) {
-                    $textfilters[] = $CFG->$variable;
-                }
-            }
-        }
-        $textfilters = implode(',', $textfilters);
-        if (empty($textfilters)) {
-            $textfilters = 'mod/glossary/dynalink.php';
-        }
-        set_config('textfilters', $textfilters);
-    }
-
-    if ($oldversion < 2004021201) {
-        modify_database("", "CREATE TABLE `prefix_cache_filters` (
-                                `id` int(10) unsigned NOT NULL auto_increment,
-                                `filter` varchar(32) NOT NULL default '',
-                                `version` int(10) unsigned NOT NULL default '0',
-                                `md5key` varchar(32) NOT NULL default '',
-                                `rawtext` text NOT NULL,
-                                `timemodified` int(10) unsigned NOT NULL default '0',
-                                PRIMARY KEY  (`id`),
-                                KEY `filtermd5key` (filter,md5key)
-                              ) TYPE=MyISAM COMMENT='For keeping information about cached data';");
-    }
-
-    if ($oldversion < 2004021500) {
-        table_column("groups", "", "hidepicture", "integer", "2", "unsigned", "0", "", "picture");
-    }
-
-    if ($oldversion < 2004021700) {
-        if (!empty($CFG->textfilters)) {
-            $CFG->textfilters = str_replace("tex_filter.php", "filter.php", $CFG->textfilters);
-            $CFG->textfilters = str_replace("multilang.php", "filter.php", $CFG->textfilters);
-            $CFG->textfilters = str_replace("censor.php", "filter.php", $CFG->textfilters);
-            $CFG->textfilters = str_replace("mediaplugin.php", "filter.php", $CFG->textfilters);
-            $CFG->textfilters = str_replace("algebra_filter.php", "filter.php", $CFG->textfilters);
-            $CFG->textfilters = str_replace("dynalink.php", "filter.php", $CFG->textfilters);
-            set_config("textfilters", $CFG->textfilters);
-        }
-    }
-
-    if ($oldversion < 2004022000) {
-        table_column("user", "", "emailstop", "integer", "1", "unsigned", "0", "not null", "email");
-    }
-
-    if ($oldversion < 2004022200) {     /// Final renaming I hope.  :-)
-        if (!empty($CFG->textfilters)) {
-            $CFG->textfilters = str_replace("/filter.php", "", $CFG->textfilters);
-            $CFG->textfilters = str_replace("mod/glossary/dynalink.php", "mod/glossary", $CFG->textfilters);
-            $textfilters = explode(',', $CFG->textfilters);
-            foreach ($textfilters as $key => $textfilter) {
-                $textfilters[$key] = trim($textfilter);
-            }
-            set_config("textfilters", implode(',',$textfilters));
-        }
-    }
-
-    if ($oldversion < 2004030702) {     /// Because of the renaming of Czech language pack
-        execute_sql("UPDATE {$CFG->prefix}user SET lang = 'cs' WHERE lang = 'cz'");
-        execute_sql("UPDATE {$CFG->prefix}course SET lang = 'cs' WHERE lang = 'cz'");
-    }
-
-    if ($oldversion < 2004041800) {     /// Integrate Block System from contrib
-        table_column("course", "", "blockinfo", "varchar", "255", "", "", "not null", "modinfo");
-    }
-
-    if ($oldversion < 2004042600) {     /// Rebuild course caches for resource icons
-        //include_once("$CFG->dirroot/course/lib.php");
-        //rebuild_course_cache();
-    }
-
-    if ($oldversion < 2004042700) {     /// Increase size of lang fields
-        table_column("user",   "lang", "lang", "varchar", "10", "", "en");
-        table_column("groups", "lang", "lang", "varchar", "10", "", "");
-        table_column("course", "lang", "lang", "varchar", "10", "", "");
-    }
-
-    if ($oldversion < 2004042701) {     /// Add hiddentopics field to control hidden topics behaviour
-        table_column("course", "", "hiddentopics", "integer", "1", "unsigned", "0", "not null", "visible");
-    }
-
-    if ($oldversion < 2004042702) {     /// add a format field for the description
-        table_column("event", "", "format", "integer", "4", "unsigned", "0", "not null", "description");
-    }
-
-    if ($oldversion < 2004042900) {
-        execute_sql(" ALTER TABLE `{$CFG->prefix}course` DROP `showrecent` ");
-    }
-
-    if ($oldversion < 2004043001) {     /// Change hiddentopics to hiddensections
-        table_column("course", "hiddentopics", "hiddensections", "integer", "2", "unsigned", "0", "not null");
-    }
-
-    if ($oldversion < 2004050400) {     /// add a visible field for events
-        table_column("event", "", "visible", "tinyint", "1", "", "1", "not null", "timeduration");
-        if ($events = get_records('event')) {
-            foreach($events as $event) {
-                if ($moduleid = get_field('modules', 'id', 'name', $event->modulename)) {
-                    if (get_field('course_modules', 'visible', 'module', $moduleid, 'instance', $event->instance) == 0) {
-                        set_field('event', 'visible', 0, 'id', $event->id);
-                    }
-                }
-            }
-        }
-    }
-
-    if ($oldversion < 2004052800) {     /// First version tagged "1.4 development", version.php 1.227
-        set_config('siteblocksadded', true);   /// This will be used later by the block upgrade
-    }
-
-    if ($oldversion < 2004053000) {     /// set defaults for site course
-        $site = get_site();
-        set_field('course', 'numsections', 0, 'id', $site->id);
-        set_field('course', 'groupmodeforce', 1, 'id', $site->id);
-        set_field('course', 'teacher', get_string('administrator'), 'id', $site->id);
-        set_field('course', 'teachers', get_string('administrators'), 'id', $site->id);
-        set_field('course', 'student', get_string('user'), 'id', $site->id);
-        set_field('course', 'students', get_string('users'), 'id', $site->id);
-    }
-
-    if ($oldversion < 2004060100) {
-        set_config('digestmailtime', 0);
-        table_column('user', "", 'maildigest', 'tinyint', '1', '', '0', 'not null', 'mailformat');
-    }
-
-    if ($oldversion < 2004062400) {
-        table_column('user_teachers', "", 'timeend', 'int', '10', 'unsigned', '0', 'not null', 'editall');
-        table_column('user_teachers', "", 'timestart', 'int', '10', 'unsigned', '0', 'not null', 'editall');
-    }
-
-    if ($oldversion < 2004062401) {
-        table_column('course', '', 'idnumber', 'varchar', '100', '', '', 'not null', 'shortname');
-        execute_sql('UPDATE '.$CFG->prefix.'course SET idnumber = shortname');   // By default
-    }
-
-    if ($oldversion < 2004062600) {
-        table_column('course', '', 'cost', 'varchar', '10', '', '', 'not null', 'lang');
-    }
-
-    if ($oldversion < 2004072900) {
-        table_column('course', '', 'enrolperiod', 'int', '10', 'unsigned', '0', 'not null', 'startdate');
-    }
-
-    if ($oldversion < 2004072901) {  // Fixing error in schema
-        if ($record = get_record('log_display', 'module', 'course', 'action', 'update')) {
-            delete_records('log_display', 'module', 'course', 'action', 'update');
-            insert_record('log_display', $record, false);
-        }
-    }
-
-    if ($oldversion < 2004081200) {  // Fixing version errors in some blocks
-        set_field('blocks', 'version', 2004081200, 'name', 'admin');
-        set_field('blocks', 'version', 2004081200, 'name', 'calendar_month');
-        set_field('blocks', 'version', 2004081200, 'name', 'course_list');
-    }
-
-    if ($oldversion < 2004081500) {  // Adding new "auth" field to user table to allow more flexibility
-        table_column('user', '', 'auth', 'varchar', '20', '', 'manual', 'not null', 'id');
-
-        execute_sql("UPDATE {$CFG->prefix}user SET auth = 'manual'");  // Set everyone to 'manual' to be sure
-
-        if ($admins = get_admins()) {   // Set all the NON-admins to whatever the current auth module is
-            $adminlist = array();
-            foreach ($admins as $user) {
-                $adminlist[] = $user->id; 
-            }
-            $adminlist = implode(',', $adminlist);
-            execute_sql("UPDATE {$CFG->prefix}user SET auth = '$CFG->auth' WHERE id NOT IN ($adminlist)");
-        }
-    }
-    
-    if ($oldversion < 2004082200) { // Making admins teachers on site course
-        $site = get_site();
-        $admins = get_admins();
-        foreach ($admins as $admin) {
-            add_teacher($admin->id, $site->id);
-        }
-    }
-
-    if ($oldversion < 2004082600) {
-        //update auth-fields for external users
-        // following code would not work in 1.8
-/*        include_once ($CFG->dirroot."/auth/".$CFG->auth."/lib.php");
-        if (function_exists('auth_get_userlist')) {
-            $externalusers = auth_get_userlist();
-            if (!empty($externalusers)){
-                $externalusers = '\''. implode('\',\'',$externalusers).'\'';
-                execute_sql("UPDATE {$CFG->prefix}user SET auth = '$CFG->auth' WHERE username  IN ($externalusers)");
-            }
-        }*/
-    }
-
-    if ($oldversion < 2004082900) {  // Make sure guest is "manual" too.
-        set_field('user', 'auth', 'manual', 'username', 'guest');
-    }
-    
-    /* Commented out unused guid-field code
-    if ($oldversion < 2004090300) { // Add guid-field used in user syncronization
-        table_column('user', '', 'guid', 'varchar', '128', '', '', '', 'auth');
-        execute_sql("ALTER TABLE {$CFG->prefix}user ADD INDEX authguid (auth, guid)");
-    }
-    */
-
-    if ($oldversion < 2004091900) { // modify idnumber to hold longer values
-        table_column('user', 'idnumber', 'idnumber', 'varchar', '64', '', '', '', '');
-        execute_sql("ALTER TABLE {$CFG->prefix}user DROP INDEX user_idnumber",false); // added in case of conflicts with upgrade from 14stable
-        execute_sql("ALTER TABLE {$CFG->prefix}user DROP INDEX user_auth",false); // added in case of conflicts with upgrade from 14stable
-
-        execute_sql("ALTER TABLE {$CFG->prefix}user ADD INDEX idnumber (idnumber)");
-        execute_sql("ALTER TABLE {$CFG->prefix}user ADD INDEX auth (auth)");
-    }
-
-    if ($oldversion < 2004093001) { // add new table for sessions storage
-        execute_sql(" CREATE TABLE `{$CFG->prefix}sessions` (
-                          `sesskey` char(32) NOT null,
-                          `expiry` int(11) unsigned NOT null,
-                          `expireref` varchar(64),
-                          `data` text NOT null,
-                          PRIMARY KEY (`sesskey`), 
-                          KEY (`expiry`) 
-                      ) TYPE=MyISAM COMMENT='Optional database session storage, not used by default';");
-    }
-
-    if ($oldversion < 2004111500) {  // Update any users/courses using wrongly-named lang pack
-        execute_sql("UPDATE {$CFG->prefix}user SET lang = 'mi_nt' WHERE lang = 'ma_nt'");
-        execute_sql("UPDATE {$CFG->prefix}course SET lang = 'mi_nt' WHERE lang = 'ma_nt'");
-    }
-
-    if ($oldversion < 2004111700) { // add indexes. - drop them first silently to avoid conflicts when upgrading.
-        execute_sql(" ALTER TABLE `{$CFG->prefix}course` DROP INDEX idnumber;",false);
-        execute_sql(" ALTER TABLE `{$CFG->prefix}course` DROP INDEX shortname;",false);
-        execute_sql(" ALTER TABLE `{$CFG->prefix}user_students` DROP INDEX userid;",false);
-        execute_sql(" ALTER TABLE `{$CFG->prefix}user_teachers` DROP INDEX userid;",false);
-
-        execute_sql(" ALTER TABLE `{$CFG->prefix}course` ADD INDEX idnumber (idnumber);");
-        execute_sql(" ALTER TABLE `{$CFG->prefix}course` ADD INDEX shortname (shortname);");
-        execute_sql(" ALTER TABLE `{$CFG->prefix}user_students` ADD INDEX userid (userid);");
-        execute_sql(" ALTER TABLE `{$CFG->prefix}user_teachers` ADD INDEX userid (userid);");
-    }
-
-    if ($oldversion < 2004111700) {// add an index to event for timestart and timeduration. - drop them first silently to avoid conflicts when upgrading.
-        execute_sql("ALTER TABLE {$CFG->prefix}event DROP INDEX timestart;",false);
-        execute_sql("ALTER TABLE {$CFG->prefix}event DROP INDEX timeduration;",false); 
-
-        modify_database('','ALTER TABLE prefix_event ADD INDEX timestart (timestart);');
-        modify_database('','ALTER TABLE prefix_event ADD INDEX timeduration (timeduration);');
-    }
-
-    if ($oldversion < 2004111700) { //add indexes on modules and course_modules. - drop them first silently to avoid conflicts when upgrading.
-        execute_sql("ALTER TABLE {$CFG->prefix}course_modules drop key visible;",false);
-        execute_sql("ALTER TABLE {$CFG->prefix}course_modules drop key course;",false);
-        execute_sql("ALTER TABLE {$CFG->prefix}course_modules drop key module;",false);
-        execute_sql("ALTER TABLE {$CFG->prefix}course_modules drop key instance;",false);
-        execute_sql("ALTER TABLE {$CFG->prefix}course_modules drop key deleted;",false);
-        execute_sql("ALTER TABLE {$CFG->prefix}modules drop key name;",false);
-
-        modify_database('','ALTER TABLE prefix_course_modules add key visible(visible);');
-        modify_database('','ALTER TABLE prefix_course_modules add key course(course);');
-        modify_database('','ALTER TABLE prefix_course_modules add key module(module);');
-        modify_database('','ALTER TABLE prefix_course_modules add key instance (instance);');
-        modify_database('','ALTER TABLE prefix_course_modules add key deleted (deleted);');
-        modify_database('','ALTER TABLE prefix_modules add key name(name);');
-    }
-
-    if ($oldversion < 2004111700) { // add an index on the groups_members table. - drop them first silently to avoid conflicts when upgrading.
-        execute_sql("ALTER TABLE {$CFG->prefix}groups_members DROP INDEX userid;",false);
-
-        modify_database('','ALTER TABLE prefix_groups_members ADD INDEX userid (userid);');
-    }
-
-    if ($oldversion < 2004111700) { // add an index on user students timeaccess (used for sorting)- drop them first silently to avoid conflicts when upgrading
-        execute_sql("ALTER TABLE {$CFG->prefix}user_students DROP INDEX timeaccess;",false);
-
-        modify_database('','ALTER TABLE prefix_user_students ADD INDEX timeaccess (timeaccess);');
-    }
-
-    if ($oldversion < 2004111700) {  // add indexes on faux-foreign keys. - drop them first silently to avoid conflicts when upgrading.
-        execute_sql("ALTER TABLE {$CFG->prefix}scale DROP INDEX courseid;",false);
-        execute_sql("ALTER TABLE {$CFG->prefix}user_admins DROP INDEX userid;",false);
-        execute_sql("ALTER TABLE {$CFG->prefix}user_coursecreators DROP INDEX userid;",false);
-
-        modify_database('','ALTER TABLE prefix_scale ADD INDEX courseid (courseid);');
-        modify_database('','ALTER TABLE prefix_user_admins ADD INDEX userid (userid);');
-        modify_database('','ALTER TABLE prefix_user_coursecreators ADD INDEX userid (userid);');
-    }
-
-    if ($oldversion < 2004111700) { // replace index on course
-        fix_course_sortorder(0,0,1);
-        execute_sql("ALTER TABLE `{$CFG->prefix}course` DROP KEY category",false);
-
-        execute_sql("ALTER TABLE `{$CFG->prefix}course` DROP KEY category_sortorder;",false);
-        modify_database('', "ALTER TABLE `prefix_course` ADD UNIQUE KEY category_sortorder(category,sortorder)"); 
-
-        execute_sql("ALTER TABLE `{$CFG->prefix}user` DROP INDEX {$CFG->prefix}user_deleted_idx;",false);
-        execute_sql("ALTER TABLE `{$CFG->prefix}user` DROP INDEX {$CFG->prefix}user_confirmed_idx;",false);
-        execute_sql("ALTER TABLE `{$CFG->prefix}user` DROP INDEX {$CFG->prefix}user_firstname_idx;",false);
-        execute_sql("ALTER TABLE `{$CFG->prefix}user` DROP INDEX {$CFG->prefix}user_lastname_idx;",false);
-        execute_sql("ALTER TABLE `{$CFG->prefix}user` DROP INDEX {$CFG->prefix}user_city_idx;",false); 
-        execute_sql("ALTER TABLE `{$CFG->prefix}user` DROP INDEX {$CFG->prefix}user_country_idx;",false); 
-        execute_sql("ALTER TABLE `{$CFG->prefix}user` DROP INDEX {$CFG->prefix}user_lastaccess_idx;",false);
-
-        modify_database("", "ALTER TABLE `prefix_user` ADD INDEX prefix_user_deleted_idx  (deleted)");
-        modify_database("", "ALTER TABLE `prefix_user` ADD INDEX prefix_user_confirmed_idx (confirmed)");
-        modify_database("", "ALTER TABLE `prefix_user` ADD INDEX prefix_user_firstname_idx (firstname)");
-        modify_database("", "ALTER TABLE `prefix_user` ADD INDEX prefix_user_lastname_idx (lastname)");
-        modify_database("", "ALTER TABLE `prefix_user` ADD INDEX prefix_user_city_idx (city)");
-        modify_database("", "ALTER TABLE `prefix_user` ADD INDEX prefix_user_country_idx (country)");
-        modify_database("", "ALTER TABLE `prefix_user` ADD INDEX prefix_user_lastaccess_idx (lastaccess)");
-     }
-    if ($oldversion < 2004111700) { // one more index for email (for sorting)
-        execute_sql("ALTER TABLE `{$CFG->prefix}user` DROP INDEX {$CFG->prefix}user_email_idx;",false);
-        modify_database('','ALTER TABLE `prefix_user` ADD INDEX prefix_user_email_idx (email);');
-    }
-
-    if ($oldversion < 2004112200) { // new 'enrol' field for enrolment tables
-        table_column('user_students', '', 'enrol', 'varchar', '20', '', '', 'not null');
-        table_column('user_teachers', '', 'enrol', 'varchar', '20', '', '', 'not null');
-        execute_sql("ALTER TABLE `{$CFG->prefix}user_students` ADD INDEX enrol (enrol);");
-        execute_sql("ALTER TABLE `{$CFG->prefix}user_teachers` ADD INDEX enrol (enrol);");
-    }
-    
-    if ($oldversion < 2004112400) {
-        /// Delete duplicate enrolments 
-        /// and then tell the database course,userid is a unique combination
-        if ($users = get_records_select("user_students", "userid > 0 GROUP BY course, userid ".
-                                        "HAVING count(*) > 1", "", "max(id) as id, userid, course ,count(*)")) {
-            foreach ($users as $user) {
-                delete_records_select("user_students", "userid = '$user->userid' ".
-                                     "AND course = '$user->course' AND id <> '$user->id'");
-            }
-        }
-        flush();
-        
-        modify_database('','ALTER TABLE prefix_user_students DROP INDEX courseuserid;');
-        modify_database('','ALTER TABLE prefix_user_students ADD UNIQUE INDEX courseuserid(course,userid);');        
-
-        /// Delete duplicate teacher enrolments 
-        /// and then tell the database course,userid is a unique combination
-        if ($users = get_records_select("user_teachers", "userid > 0 GROUP BY course, userid ".
-                                        "HAVING count(*) > 1", "", "max(id) as id, userid, course ,count(*)")) {
-            foreach ($users as $user) {
-                delete_records_select("user_teachers", "userid = '$user->userid' ".
-                                     "AND course = '$user->course' AND id <> '$user->id'");
-            }
-        }
-        flush();
-        modify_database('','ALTER TABLE prefix_user_teachers DROP INDEX courseuserid;');
-        modify_database('','ALTER TABLE prefix_user_teachers ADD UNIQUE INDEX courseuserid(course,userid);');        
-    } 
-
-    if ($oldversion < 2004112900) {
-        table_column('user', '', 'policyagreed', 'integer', '1', 'unsigned', '0', 'not null', 'confirmed');
-    }
-
-    if ($oldversion < 2004121400) {
-        table_column('groups', '', 'password', 'varchar', '50', '', '', 'not null', 'description');
-    }
-
-    if ($oldversion < 2004121500) {
-        modify_database('',"CREATE TABLE prefix_dst_preset (
-            id int(10) NOT NULL auto_increment,
-            name char(48) default '' NOT NULL,
-            
-            apply_offset tinyint(3) default '0' NOT NULL,
-            
-            activate_index tinyint(1) default '1' NOT NULL,
-            activate_day tinyint(1) default '1' NOT NULL,
-            activate_month tinyint(2) default '1' NOT NULL,
-            activate_time char(5) default '03:00' NOT NULL,
-            
-            deactivate_index tinyint(1) default '1' NOT NULL,
-            deactivate_day tinyint(1) default '1' NOT NULL,
-            deactivate_month tinyint(2) default '2' NOT NULL,
-            deactivate_time char(5) default '03:00' NOT NULL,
-            
-            last_change int(10) default '0' NOT NULL,
-            next_change int(10) default '0' NOT NULL,
-            current_offset tinyint(3) default '0' NOT NULL,
-            
-            PRIMARY KEY (id))");
-    }       
-
-    if ($oldversion < 2004122800) {
-        execute_sql("DROP TABLE {$CFG->prefix}message", false);
-        execute_sql("DROP TABLE {$CFG->prefix}message_read", false);
-        execute_sql("DROP TABLE {$CFG->prefix}message_contacts", false);
-
-        modify_database('',"CREATE TABLE `prefix_message` (
-                               `id` int(10) unsigned NOT NULL auto_increment,
-                               `useridfrom` int(10) NOT NULL default '0',
-                               `useridto` int(10) NOT NULL default '0',
-                               `message` text NOT NULL,
-                               `timecreated` int(10) NOT NULL default '0',
-                               `messagetype` varchar(50) NOT NULL default '',
-                               PRIMARY KEY  (`id`),
-                               KEY `useridfrom` (`useridfrom`),
-                               KEY `useridto` (`useridto`)
-                             ) TYPE=MyISAM COMMENT='Stores all unread messages';");
-
-        modify_database('',"CREATE TABLE `prefix_message_read` (
-                               `id` int(10) unsigned NOT NULL auto_increment,
-                               `useridfrom` int(10) NOT NULL default '0',
-                               `useridto` int(10) NOT NULL default '0',
-                               `message` text NOT NULL,
-                               `timecreated` int(10) NOT NULL default '0',
-                               `timeread` int(10) NOT NULL default '0',
-                               `messagetype` varchar(50) NOT NULL default '',
-                               `mailed` tinyint(1) NOT NULL default '0',
-                               PRIMARY KEY  (`id`),
-                               KEY `useridfrom` (`useridfrom`),
-                               KEY `useridto` (`useridto`)
-                             ) TYPE=MyISAM COMMENT='Stores all messages that have been read';");
-
-        modify_database('',"CREATE TABLE `prefix_message_contacts` (
-                               `id` int(10) unsigned NOT NULL auto_increment,
-                               `userid` int(10) unsigned NOT NULL default '0',
-                               `contactid` int(10) unsigned NOT NULL default '0',
-                               `blocked` tinyint(1) unsigned NOT NULL default '0',
-                               PRIMARY KEY  (`id`),
-                               UNIQUE KEY `usercontact` (`userid`,`contactid`)
-                             ) TYPE=MyISAM COMMENT='Maintains lists of relationships between users';");
-
-        modify_database('', "INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'write', 'user', 'CONCAT(firstname,\" \",lastname)'); ");
-        modify_database('', "INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'read', 'user', 'CONCAT(firstname,\" \",lastname)'); ");
-    }
-
-    if ($oldversion < 2004122801) {
-        table_column('message', '', 'format', 'integer', '4', 'unsigned', '0', 'not null', 'message');
-        table_column('message_read', '', 'format', 'integer', '4', 'unsigned', '0', 'not null', 'message');
-    }
-
-    if ($oldversion < 2005010100) {
-        modify_database('', "INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'add contact', 'user', 'CONCAT(firstname,\" \",lastname)'); ");
-        modify_database('', "INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'remove contact', 'user', 'CONCAT(firstname,\" \",lastname)'); ");
-        modify_database('', "INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'block contact', 'user', 'CONCAT(firstname,\" \",lastname)'); ");
-        modify_database('', "INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'unblock contact', 'user', 'CONCAT(firstname,\" \",lastname)'); ");
-    }
-
-    if ($oldversion < 2005011000) {     // Create a .htaccess file in dataroot, just in case
-        if (!file_exists($CFG->dataroot.'/.htaccess')) {
-            if ($handle = fopen($CFG->dataroot.'/.htaccess', 'w')) {   // For safety
-                @fwrite($handle, "deny from all\r\nAllowOverride None\r\n");
-                @fclose($handle); 
-                notify("Created a default .htaccess file in $CFG->dataroot");
-            }
-        }
-    }
-    
-
-    if ($oldversion < 2005012500) { 
-        /*
-        // add new table for meta courses.
-        modify_database("","CREATE TABLE `prefix_meta_course` (
-            `id` int(1) unsigned NOT NULL auto_increment,
-            `parent_course` int(10) NOT NULL default 0,
-            `child_course` int(10) NOT NULL default 0,
-            PRIMARY KEY (`id`),
-            KEY `parent_course` (parent_course),
-            KEY `child_course` (child_course)
-        );");
-        // add flag to course field
-        table_column('course','','meta_course','integer','1','','0','not null');
-        */ // taking this OUT for upgrade from 1.4 to 1.5 (those tracking head will