diff --git a/admin/auth.php b/admin/auth.php index 61afb67c19f4a..41faab54ddc43 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -30,7 +30,7 @@ } 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 @@ $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 @@ $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) { diff --git a/admin/cron.php b/admin/cron.php index f5f49bb664d41..3ace8d8f1833c 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -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! diff --git a/admin/enrol.php b/admin/enrol.php index 8e0cfdfd6bf42..14b75d6b10d09 100644 --- a/admin/enrol.php +++ b/admin/enrol.php @@ -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(); @@ -103,4 +103,4 @@ admin_externalpage_print_footer(); -?> \ No newline at end of file +?> diff --git a/admin/mnet/index.php b/admin/mnet/index.php index a281f1cec0960..d03efaa566090 100644 --- a/admin/mnet/index.php +++ b/admin/mnet/index.php @@ -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&confirm=".md5($MNET->public_key), "index.php", @@ -61,13 +61,13 @@ // 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) { diff --git a/admin/module.php b/admin/module.php index 3b2c8cc99e9b6..e503b8292e0a5 100644 --- a/admin/module.php +++ b/admin/module.php @@ -10,7 +10,7 @@ $module = optional_param('module', '', PARAM_SAFEDIR); if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } if ($module != '') { diff --git a/auth/cas/cas_ldap_sync_users.php b/auth/cas/cas_ldap_sync_users.php index e1cc5acd4c20c..9abc5fc095866 100644 --- a/auth/cas/cas_ldap_sync_users.php +++ b/auth/cas/cas_ldap_sync_users.php @@ -27,7 +27,7 @@ exit; } -$nomoodlecookie = true; // cookie not needed +define('NO_MOODLE_COOKIES', true); require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file. diff --git a/auth/db/auth_db_sync_users.php b/auth/db/auth_db_sync_users.php index b4e22aa4b829e..8ed5de05bc417 100644 --- a/auth/db/auth_db_sync_users.php +++ b/auth/db/auth_db_sync_users.php @@ -27,7 +27,7 @@ exit; } -$nomoodlecookie = true; // cookie not needed +define('NO_MOODLE_COOKIES', true); require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file. diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index 5ea3f315e8f69..8b8d1cf62baeb 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -1764,7 +1764,7 @@ function loginpage_hook() { * * 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) { diff --git a/auth/ldap/auth_ldap_sync_users.php b/auth/ldap/auth_ldap_sync_users.php index 8b764242c7562..528d3556d7534 100755 --- a/auth/ldap/auth_ldap_sync_users.php +++ b/auth/ldap/auth_ldap_sync_users.php @@ -26,7 +26,7 @@ exit; } -$nomoodlecookie = true; // cookie not needed +define('NO_MOODLE_COOKIES', true); require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file. diff --git a/auth/ldap/ntlmsso_magic.php b/auth/ldap/ntlmsso_magic.php index 79077ef2b3f44..fc1120e05efcf 100644 --- a/auth/ldap/ntlmsso_magic.php +++ b/auth/ldap/ntlmsso_magic.php @@ -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"); diff --git a/auth/shibboleth/index.php b/auth/shibboleth/index.php index 3cf39a78495c5..90ba89a7b941f 100644 --- a/auth/shibboleth/index.php +++ b/auth/shibboleth/index.php @@ -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(); diff --git a/auth/shibboleth/login.php b/auth/shibboleth/login.php index ff6de2dbf563a..7f7c03212501e 100644 --- a/auth/shibboleth/login.php +++ b/auth/shibboleth/login.php @@ -38,8 +38,8 @@ $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 index af93afa8a6275..0000000000000 --- a/backup/db/mysql.php +++ /dev/null @@ -1,163 +0,0 @@ -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.
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
index 87fa622507ebc..0000000000000
--- a/backup/db/postgres7.php
+++ /dev/null
@@ -1,59 +0,0 @@
-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
index 1549db4838f02..0000000000000
--- a/blocks/activity_modules/db/mysql.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
\ 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
index 4e529bef17ddd..0000000000000
--- a/blocks/calendar_month/db/mysql.php
+++ /dev/null
@@ -1,24 +0,0 @@
-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
index 6122508413d40..0000000000000
--- a/blocks/db/postgres7.php
+++ /dev/null
@@ -1,160 +0,0 @@
-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
index 2728665f0d03e..0000000000000
--- a/blocks/news_items/db/mysql.php
+++ /dev/null
@@ -1,24 +0,0 @@
-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
index 4204ed8bafe3a..0000000000000
--- a/blocks/rss_client/db/postgres7.php
+++ /dev/null
@@ -1,145 +0,0 @@
-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/search/block_search.php b/blocks/search/block_search.php
index e021f9924353c..65fabe23c9f54 100644
--- a/blocks/search/block_search.php
+++ b/blocks/search/block_search.php
@@ -81,4 +81,4 @@ function cron(){
} //block_search
-?>
\ No newline at end of file
+?>
diff --git a/blocks/search/db/install.xml b/blocks/search/db/install.xml
index 234e77e147986..b118e4e1b2ced 100644
--- a/blocks/search/db/install.xml
+++ b/blocks/search/db/install.xml
@@ -12,8 +12,8 @@
You must upgrade PHP or move to a host with a newer version of PHP!
(In case of 5.0.x you could also downgrade to 4.4.x version)
Error: database table prefix can not be empty ($a)
+$string['prefixcannotbeempty'] = 'Error: database table prefix cannot be empty ($a)
The site administrator must fix this problem.
'; $string['prefixtoolong'] = 'Error: database table prefix is too long ($a->dbfamily)
The site administrator must fix this problem. Maximum length for table prefixes in $a->dbfamily is $a->maxlength characters.
'; @@ -469,9 +469,9 @@ $string['welcomep70'] = 'Click the \"Next\" button below to continue with the set up of Moodle.'; $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.'; diff --git a/lang/en_utf8/block_search.php b/lang/en_utf8/block_search.php index 0dc8473014844..060e4c0d46ca0 100644 --- a/lang/en_utf8/block_search.php +++ b/lang/en_utf8/block_search.php @@ -12,4 +12,14 @@ $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 index d3239dbc32b26..0000000000000 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 index 19fdf05d9fe4e..0000000000000 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 index 14e6a8f3287bb..0000000000000 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 index c5e8dfc6db2d4..0000000000000 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 index 339dd761ef6c2..0000000000000 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 index f12ae2037ee14..0000000000000 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 index ab18515a802bf..0000000000000 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 index 69bcb9ee7a724..0000000000000 --- a/lib/adodb/tests/tmssql.php +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/lib/componentlib.class.php b/lib/componentlib.class.php index a394d7786c01d..e44115f1edf1c 100644 --- a/lib/componentlib.class.php +++ b/lib/componentlib.class.php @@ -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 index e7ca80b3307a4..0000000000000 --- a/lib/cookieless.php +++ /dev/null @@ -1,136 +0,0 @@ -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('/