From: Eloy Lafuente Date: Fri, 20 Nov 2009 19:48:01 +0000 (+0000) Subject: MDL-20916 protect the whole xmldb editor with sesskey. Merged from 19_STABLE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f25d53a992273eba86a5649f8cd2504a922d5e5e;p=moodle.git MDL-20916 protect the whole xmldb editor with sesskey. Merged from 19_STABLE --- diff --git a/admin/xmldb/actions/XMLDBAction.class.php b/admin/xmldb/actions/XMLDBAction.class.php index b0f1ea3c35..6e757318fb 100644 --- a/admin/xmldb/actions/XMLDBAction.class.php +++ b/admin/xmldb/actions/XMLDBAction.class.php @@ -51,6 +51,8 @@ class XMLDBAction { var $postaction; //Action to execute at the end of the invoke script + var $sesskey_protected; // Actions must be protected by sesskey mechanishm + /** * Constructor */ @@ -76,6 +78,7 @@ class XMLDBAction { $this->output = NULL; $this->errormsg = NULL; $this->subaction = NULL; + $this->sesskey_protected = true; } /** @@ -134,13 +137,18 @@ class XMLDBAction { } /** - * main invoke method, it simply sets the postaction attribute - * if possible + * main invoke method, it sets the postaction attribute + * if possible and checks sesskey_protected if needed */ function invoke() { global $SESSION; + /// Sesskey protection + if ($this->sesskey_protected) { + require_sesskey(); + } + /// If we are used any dir, save it in the lastused session object /// Some actions can use it to perform positioning if ($lastused = optional_param ('dir', NULL, PARAM_PATH)) { diff --git a/admin/xmldb/actions/XMLDBCheckAction.class.php b/admin/xmldb/actions/XMLDBCheckAction.class.php index dcbe283ce5..6bec8d6a00 100644 --- a/admin/xmldb/actions/XMLDBCheckAction.class.php +++ b/admin/xmldb/actions/XMLDBCheckAction.class.php @@ -96,7 +96,7 @@ abstract class XMLDBCheckAction extends XMLDBAction { $o.= '

' . $this->str[$this->introstr] . '

'; $o.= '
'; $o.= '
'; - $o.= '
'; + $o.= '
'; $o.= '
'; $o.= '
'; $o.= '
'; diff --git a/admin/xmldb/actions/check_bigints/check_bigints.class.php b/admin/xmldb/actions/check_bigints/check_bigints.class.php index 2729a589be..03a232e93c 100644 --- a/admin/xmldb/actions/check_bigints/check_bigints.class.php +++ b/admin/xmldb/actions/check_bigints/check_bigints.class.php @@ -1,34 +1,35 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * reporting about the ones not phisically implemented as BIGINTs + * and providing one SQL script to fix all them. Also, under MySQL, + * it performs one check of signed bigints. MDL-11038 + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class check_bigints extends XMLDBCheckAction { private $correct_type; private $dbfamily; diff --git a/admin/xmldb/actions/check_defaults/check_defaults.class.php b/admin/xmldb/actions/check_defaults/check_defaults.class.php index 66aad6b86b..c7f336cc37 100644 --- a/admin/xmldb/actions/check_defaults/check_defaults.class.php +++ b/admin/xmldb/actions/check_defaults/check_defaults.class.php @@ -1,33 +1,35 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will check all the default values existing in the DB + * match those specified in the xml specs + * and providing one SQL script to fix all them. + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class check_defaults extends XMLDBCheckAction { /** diff --git a/admin/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php b/admin/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php index 13240a7f31..19b11d658c 100644 --- a/admin/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php +++ b/admin/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php @@ -1,28 +1,25 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ /** * This class will look for data in the database that violates the foreign @@ -32,6 +29,10 @@ * violations from, say, a userid column defined as NOT NULL DEFAULT '0'. * Each 0 in that column will violate the foreign key, but we ignore them. * If you want a strict check performed, then add &strict=1 to the URL. + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class check_foreign_keys extends XMLDBCheckAction { diff --git a/admin/xmldb/actions/check_indexes/check_indexes.class.php b/admin/xmldb/actions/check_indexes/check_indexes.class.php index 9ac0cee912..b52cc61734 100644 --- a/admin/xmldb/actions/check_indexes/check_indexes.class.php +++ b/admin/xmldb/actions/check_indexes/check_indexes.class.php @@ -1,33 +1,35 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will compare all the indexes found in the XMLDB definitions + * with the phisical DB implementation, reporting about all the missing + * indexes to be created to be 100% ok. + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class check_indexes extends XMLDBCheckAction { /** diff --git a/admin/xmldb/actions/delete_field/delete_field.class.php b/admin/xmldb/actions/delete_field/delete_field.class.php index 8c4aa0a7bb..ca292d29de 100644 --- a/admin/xmldb/actions/delete_field/delete_field.class.php +++ b/admin/xmldb/actions/delete_field/delete_field.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will delete completely one field + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class delete_field extends XMLDBAction { /** @@ -77,7 +79,7 @@ class delete_field extends XMLDBAction { $o.= '

' . $this->str['confirmdeletefield'] . '

' . $fieldparam . '

'; $o.= '
'; $o.= '
'; - $o.= '
'; + $o.= '
'; $o.= '
'; $o.= '
'; $o.= '
'; diff --git a/admin/xmldb/actions/delete_index/delete_index.class.php b/admin/xmldb/actions/delete_index/delete_index.class.php index cbcfef28d2..d400ebedae 100644 --- a/admin/xmldb/actions/delete_index/delete_index.class.php +++ b/admin/xmldb/actions/delete_index/delete_index.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will delete completely one index + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class delete_index extends XMLDBAction { /** @@ -77,7 +79,7 @@ class delete_index extends XMLDBAction { $o.= '

' . $this->str['confirmdeleteindex'] . '

' . $indexparam . '

'; $o.= '
'; $o.= '
'; - $o.= '
'; + $o.= '
'; $o.= '
'; $o.= '
'; $o.= '
'; diff --git a/admin/xmldb/actions/delete_key/delete_key.class.php b/admin/xmldb/actions/delete_key/delete_key.class.php index fa406ca161..f37946d7ce 100644 --- a/admin/xmldb/actions/delete_key/delete_key.class.php +++ b/admin/xmldb/actions/delete_key/delete_key.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will delete completely one key + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class delete_key extends XMLDBAction { /** @@ -77,7 +79,7 @@ class delete_key extends XMLDBAction { $o.= '

' . $this->str['confirmdeletekey'] . '

' . $keyparam . '

'; $o.= '
'; $o.= '
'; - $o.= '
'; + $o.= '
'; $o.= '
'; $o.= '
'; $o.= '
'; diff --git a/admin/xmldb/actions/delete_sentence/delete_sentence.class.php b/admin/xmldb/actions/delete_sentence/delete_sentence.class.php index db48a3065e..c209c0e44d 100644 --- a/admin/xmldb/actions/delete_sentence/delete_sentence.class.php +++ b/admin/xmldb/actions/delete_sentence/delete_sentence.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will delete completely one sentence + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class delete_sentence extends XMLDBAction { /** @@ -77,7 +79,7 @@ class delete_sentence extends XMLDBAction { $o.= '

' . $this->str['confirmdeletesentence'] . '

'; $o.= '
'; $o.= '
'; - $o.= '
'; + $o.= '
'; $o.= '
'; $o.= '
'; $o.= '
'; diff --git a/admin/xmldb/actions/delete_statement/delete_statement.class.php b/admin/xmldb/actions/delete_statement/delete_statement.class.php index 824bf757ca..3d13ae5614 100644 --- a/admin/xmldb/actions/delete_statement/delete_statement.class.php +++ b/admin/xmldb/actions/delete_statement/delete_statement.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will delete completely one statement + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class delete_statement extends XMLDBAction { /** @@ -76,7 +78,7 @@ class delete_statement extends XMLDBAction { $o.= '

' . $this->str['confirmdeletestatement'] . '

' . $statementparam . '

'; $o.= '
'; $o.= '
'; - $o.= '
'; + $o.= '
'; $o.= '
'; $o.= '
'; $o.= '
'; diff --git a/admin/xmldb/actions/delete_table/delete_table.class.php b/admin/xmldb/actions/delete_table/delete_table.class.php index a5fe8daf3f..08c27b1d64 100644 --- a/admin/xmldb/actions/delete_table/delete_table.class.php +++ b/admin/xmldb/actions/delete_table/delete_table.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will delete completely one table + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class delete_table extends XMLDBAction { /** @@ -76,7 +78,7 @@ class delete_table extends XMLDBAction { $o.= '

' . $this->str['confirmdeletetable'] . '

' . $tableparam . '

'; $o.= '
'; $o.= '
'; - $o.= '
'; + $o.= '
'; $o.= '
'; $o.= '
'; $o.= '
'; diff --git a/admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php b/admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php index 37cbb95059..a8848fcb72 100644 --- a/admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php +++ b/admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will delete completely one XML file + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class delete_xml_file extends XMLDBAction { /** @@ -75,7 +77,7 @@ class delete_xml_file extends XMLDBAction { $o.= '

' . $this->str['confirmdeletexmlfile'] . '

' . $dirpath . '/install.php

'; $o.= '
'; $o.= '
'; - $o.= '
'; + $o.= '
'; $o.= '
'; $o.= '
'; $o.= '
'; diff --git a/admin/xmldb/actions/edit_field/edit_field.class.php b/admin/xmldb/actions/edit_field/edit_field.class.php index 27b579fc83..68effcfa20 100644 --- a/admin/xmldb/actions/edit_field/edit_field.class.php +++ b/admin/xmldb/actions/edit_field/edit_field.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will provide the interface for all the edit field actions + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class edit_field extends XMLDBAction { /** @@ -35,6 +37,7 @@ class edit_field extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( @@ -111,6 +114,7 @@ class edit_field extends XMLDBAction { $o.= ' '; $o.= ' '; $o.= ' '; + $o.= ' '; $o.= ' '; $o.= ' '; $o.= ' '; diff --git a/admin/xmldb/actions/edit_index/edit_index.class.php b/admin/xmldb/actions/edit_index/edit_index.class.php index 9eabd88323..721ca4810b 100644 --- a/admin/xmldb/actions/edit_index/edit_index.class.php +++ b/admin/xmldb/actions/edit_index/edit_index.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will provide the interface for all the edit index actions + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class edit_index extends XMLDBAction { /** @@ -35,6 +37,7 @@ class edit_index extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( @@ -103,6 +106,7 @@ class edit_index extends XMLDBAction { $o.= ' '; $o.= ' '; $o.= ' '; + $o.= ' '; $o.= ' '; $o.= ' '; $o.= '
'; diff --git a/admin/xmldb/actions/edit_key/edit_key.class.php b/admin/xmldb/actions/edit_key/edit_key.class.php index 333c65d930..bc9c878bc6 100644 --- a/admin/xmldb/actions/edit_key/edit_key.class.php +++ b/admin/xmldb/actions/edit_key/edit_key.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will provide the interface for all the edit key actions + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class edit_key extends XMLDBAction { /** @@ -35,6 +37,7 @@ class edit_key extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( @@ -103,6 +106,7 @@ class edit_key extends XMLDBAction { $o.= ' '; $o.= ' '; $o.= ' '; + $o.= ' '; $o.= ' '; $o.= ' '; $o.= '
'; diff --git a/admin/xmldb/actions/edit_sentence/edit_sentence.class.php b/admin/xmldb/actions/edit_sentence/edit_sentence.class.php index 1b8e34eb82..8edd5a3bd2 100644 --- a/admin/xmldb/actions/edit_sentence/edit_sentence.class.php +++ b/admin/xmldb/actions/edit_sentence/edit_sentence.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will provide the interface for all the edit sentence actions + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class edit_sentence extends XMLDBAction { /** @@ -35,6 +37,7 @@ class edit_sentence extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( @@ -119,6 +122,7 @@ class edit_sentence extends XMLDBAction { $o.= ' '; $o.= ' '; $o.= ' '; + $o.= ' '; $o.= ' '; $o.= ' '; $o.= '
'; diff --git a/admin/xmldb/actions/edit_statement/edit_statement.class.php b/admin/xmldb/actions/edit_statement/edit_statement.class.php index ba26c4e721..8b8b8c3e4e 100644 --- a/admin/xmldb/actions/edit_statement/edit_statement.class.php +++ b/admin/xmldb/actions/edit_statement/edit_statement.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will provide the interface for all the edit statement actions + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class edit_statement extends XMLDBAction { /** @@ -35,6 +37,7 @@ class edit_statement extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( @@ -106,6 +109,7 @@ class edit_statement extends XMLDBAction { $o.= '
'; $o.= ' '; $o.= ' '; + $o.= ' '; $o.= ' '; $o.= ' '; $o.= '
'; @@ -129,7 +133,7 @@ class edit_statement extends XMLDBAction { $b .= ' [' . $this->str['viewedited'] . ']'; } /// The new sentence button - $b .= ' [' . $this->str['newsentence'] . ']'; + $b .= ' [' . $this->str['newsentence'] . ']'; /// The back to edit xml file button $b .= ' [' . $this->str['back'] . ']'; $b .= '

'; @@ -157,10 +161,10 @@ class edit_statement extends XMLDBAction { $b .= '[' . $this->str['edit'] . ']'; $b .= ''; /// Print table row $o .= ''; diff --git a/admin/xmldb/actions/edit_table/edit_table.class.php b/admin/xmldb/actions/edit_table/edit_table.class.php index 099654f514..b8b715999d 100644 --- a/admin/xmldb/actions/edit_table/edit_table.class.php +++ b/admin/xmldb/actions/edit_table/edit_table.class.php @@ -41,6 +41,7 @@ class edit_table extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( @@ -123,6 +124,7 @@ class edit_table extends XMLDBAction { $o.= ' '; $o.= ' '; $o.= ' '; + $o.= ' '; $o.= ' '; $o.= '
'; /// The duplicate button - $b .= '[' . $this->str['duplicate'] . ']'; + $b .= '[' . $this->str['duplicate'] . ']'; $b .= ''; /// The delete button - $b .= '[' . $this->str['delete'] . ']'; + $b .= '[' . $this->str['delete'] . ']'; $b .= '
' . $p . $sentence . $b . '
'; /// If the table is being used, we cannot rename it @@ -161,11 +163,11 @@ class edit_table extends XMLDBAction { $b .= ' [' . $this->str['viewedited'] . ']'; } /// The new field button - $b .= ' [' . $this->str['newfield'] . ']'; + $b .= ' [' . $this->str['newfield'] . ']'; /// The new key button - $b .= ' [' . $this->str['newkey'] . ']'; + $b .= ' [' . $this->str['newkey'] . ']'; /// The new index button - $b .= ' [' . $this->str['newindex'] . ']'; + $b .= ' [' . $this->str['newindex'] . ']'; $b .= '

'; $b .= '

'; @@ -214,14 +216,14 @@ class edit_table extends XMLDBAction { $b .= '

'; /// The up button if ($field->getPrevious()) { - $b .= '[' . $this->str['up'] . ']'; + $b .= '[' . $this->str['up'] . ']'; } else { $b .= '[' . $this->str['up'] . ']'; } $b .= ''; /// The down button if ($field->getNext()) { - $b .= '[' . $this->str['down'] . ']'; + $b .= '[' . $this->str['down'] . ']'; } else { $b .= '[' . $this->str['down'] . ']'; } @@ -229,7 +231,7 @@ class edit_table extends XMLDBAction { /// The delete button (if we have more than one and it isn't used if (count($fields) > 1 && !$structure->getFieldUses($table->getName(), $field->getName())) { - $b .= '[' . $this->str['delete'] . ']'; + $b .= '[' . $this->str['delete'] . ']'; } else { $b .= '[' . $this->str['delete'] . ']'; } @@ -272,21 +274,21 @@ class edit_table extends XMLDBAction { $b .= ''; /// The up button if ($key->getPrevious()) { - $b .= '[' . $this->str['up'] . ']'; + $b .= '[' . $this->str['up'] . ']'; } else { $b .= '[' . $this->str['up'] . ']'; } $b .= ''; /// The down button if ($key->getNext()) { - $b .= '[' . $this->str['down'] . ']'; + $b .= '[' . $this->str['down'] . ']'; } else { $b .= '[' . $this->str['down'] . ']'; } $b .= ''; /// The delete button (if the key hasn't uses) if (!$structure->getKeyUses($table->getName(), $key->getName())) { - $b .= '[' . $this->str['delete'] . ']'; + $b .= '[' . $this->str['delete'] . ']'; } else { $b .= '[' . $this->str['delete'] . ']'; } @@ -317,20 +319,20 @@ class edit_table extends XMLDBAction { $b .= ''; /// The up button if ($index->getPrevious()) { - $b .= '[' . $this->str['up'] . ']'; + $b .= '[' . $this->str['up'] . ']'; } else { $b .= '[' . $this->str['up'] . ']'; } $b .= ''; /// The down button if ($index->getNext()) { - $b .= '[' . $this->str['down'] . ']'; + $b .= '[' . $this->str['down'] . ']'; } else { $b .= '[' . $this->str['down'] . ']'; } $b .= ''; /// The delete button - $b .= '[' . $this->str['delete'] . ']'; + $b .= '[' . $this->str['delete'] . ']'; $b .= ''; /// The view xml button $b .= '[' . $this->str['viewxml'] . ']'; diff --git a/admin/xmldb/actions/edit_xml_file/edit_xml_file.class.php b/admin/xmldb/actions/edit_xml_file/edit_xml_file.class.php index 2c0e40f39f..e5abbba088 100644 --- a/admin/xmldb/actions/edit_xml_file/edit_xml_file.class.php +++ b/admin/xmldb/actions/edit_xml_file/edit_xml_file.class.php @@ -40,6 +40,7 @@ class edit_xml_file extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( @@ -117,6 +118,7 @@ class edit_xml_file extends XMLDBAction { $o.= ' '; $o.= ' '; $o.= ' '; + $o.= ' '; $o.= ' '; $o.= ' '; $o.= ' '; @@ -146,15 +148,15 @@ class edit_xml_file extends XMLDBAction { $b .= ' [' . $this->str['viewedited'] . ']'; } /// The new table button - $b .= ' [' . $this->str['newtable'] . ']'; + $b .= ' [' . $this->str['newtable'] . ']'; /// The new from MySQL button if ($DB->get_dbfamily() == 'mysql') { - $b .= ' [' . $this->str['newtablefrommysql'] . ']'; + $b .= ' [' . $this->str['newtablefrommysql'] . ']'; } else { $b .= ' [' . $this->str['newtablefrommysql'] . ']'; } /// The new statement button - $b .= ' [' . $this->str['newstatement'] . ']'; + $b .= ' [' . $this->str['newstatement'] . ']'; $b .= '

'; $b .= '

'; @@ -193,14 +195,14 @@ class edit_xml_file extends XMLDBAction { $b .= '

Path:' . s($structure->getPath()) . '
Version:' . s($structure->getVersion()) . '
'; /// The up button if ($table->getPrevious()) { - $b .= '[' . $this->str['up'] . ']'; + $b .= '[' . $this->str['up'] . ']'; } else { $b .= '[' . $this->str['up'] . ']'; } $b .= ''; /// The down button if ($table->getNext()) { - $b .= '[' . $this->str['down'] . ']'; + $b .= '[' . $this->str['down'] . ']'; } else { $b .= '[' . $this->str['down'] . ']'; } @@ -209,7 +211,7 @@ class edit_xml_file extends XMLDBAction { if (count($tables) > 1 && !$structure->getTableUses($table->getName())) { ///!$structure->getTableUses($table->getName())) { - $b .= '[' . $this->str['delete'] . ']'; + $b .= '[' . $this->str['delete'] . ']'; } else { $b .= '[' . $this->str['delete'] . ']'; } @@ -243,20 +245,20 @@ class edit_xml_file extends XMLDBAction { $b .= ''; /// The up button if ($statement->getPrevious()) { - $b .= '[' . $this->str['up'] . ']'; + $b .= '[' . $this->str['up'] . ']'; } else { $b .= '[' . $this->str['up'] . ']'; } $b .= ''; /// The down button if ($statement->getNext()) { - $b .= '[' . $this->str['down'] . ']'; + $b .= '[' . $this->str['down'] . ']'; } else { $b .= '[' . $this->str['down'] . ']'; } $b .= ''; /// The delete button - $b .= '[' . $this->str['delete'] . ']'; + $b .= '[' . $this->str['delete'] . ']'; $b .= ''; /// The view xml button $b .= '[' . $this->str['viewxml'] . ']'; diff --git a/admin/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php b/admin/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php index 1fa0b19c54..3f36b30792 100644 --- a/admin/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php +++ b/admin/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php @@ -38,6 +38,7 @@ class generate_all_documentation extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/generate_documentation/generate_documentation.class.php b/admin/xmldb/actions/generate_documentation/generate_documentation.class.php index 7bee8a87d5..5bdcf8ea95 100644 --- a/admin/xmldb/actions/generate_documentation/generate_documentation.class.php +++ b/admin/xmldb/actions/generate_documentation/generate_documentation.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will produce XSL documentation for the loaded XML file + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class generate_documentation extends XMLDBAction { /** @@ -35,6 +37,7 @@ class generate_documentation extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/get_db_directories/get_db_directories.class.php b/admin/xmldb/actions/get_db_directories/get_db_directories.class.php index 8dfd2abbf8..1d8fa1954a 100644 --- a/admin/xmldb/actions/get_db_directories/get_db_directories.class.php +++ b/admin/xmldb/actions/get_db_directories/get_db_directories.class.php @@ -1,32 +1,34 @@ dbdirs array - +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will will check all the db directories existing under the + * current Moodle installation, sending them to the SESSION->dbdirs array + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class get_db_directories extends XMLDBAction { /** @@ -39,6 +41,7 @@ class get_db_directories extends XMLDBAction { //$this->can_subaction = ACTION_HAVE_SUBACTIONS; /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/load_xml_file/load_xml_file.class.php b/admin/xmldb/actions/load_xml_file/load_xml_file.class.php index 94b6c61c47..c74c2df0a5 100644 --- a/admin/xmldb/actions/load_xml_file/load_xml_file.class.php +++ b/admin/xmldb/actions/load_xml_file/load_xml_file.class.php @@ -1,31 +1,33 @@ . -/// This class will load one XML file to memory if necessary +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +/** + * This class will load one XML file to memory if necessary + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class load_xml_file extends XMLDBAction { /** @@ -38,6 +40,7 @@ class load_xml_file extends XMLDBAction { //$this->can_subaction = ACTION_HAVE_SUBACTIONS; /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/main_view/main_view.class.php b/admin/xmldb/actions/main_view/main_view.class.php index b943a8e897..76d91c775b 100644 --- a/admin/xmldb/actions/main_view/main_view.class.php +++ b/admin/xmldb/actions/main_view/main_view.class.php @@ -40,6 +40,7 @@ class main_view extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( @@ -95,18 +96,18 @@ class main_view extends XMLDBAction { /// The reserved_words button $b .= ' [' . $this->str['reservedwords'] . ']'; /// The test button - $b .= ' [' . $this->str['test'] . ']'; + $b .= ' [' . $this->str['test'] . ']'; /// The docs button $b .= ' [' . $this->str['doc'] . ']'; /// The check indexes button - $b .= ' [' . $this->str['checkindexes'] . ']'; + $b .= ' [' . $this->str['checkindexes'] . ']'; /// The check defaults button - $b .= ' [' . $this->str['checkdefaults'] . ']'; + $b .= ' [' . $this->str['checkdefaults'] . ']'; /// The check bigints button (only for MySQL and PostgreSQL) MDL-11038a if ($DB->get_dbfamily() == 'mysql' || $DB->get_dbfamily() == 'postgres') { - $b .= ' [' . $this->str['checkbigints'] . ']'; + $b .= ' [' . $this->str['checkbigints'] . ']'; } - $b .= ' [' . $this->str['checkforeignkeys'] . ']'; + $b .= ' [' . $this->str['checkforeignkeys'] . ']'; $b .= '

'; /// Send buttons to output $o .= $b; @@ -156,7 +157,7 @@ class main_view extends XMLDBAction { if ($dbdir->path_exists && !file_exists($key . '/install.xml') && is_writeable($key)) { - $b .= '[' . $this->str['create'] . ']'; + $b .= '[' . $this->str['create'] . ']'; } else { $b .= '[' . $this->str['create'] . ']'; } @@ -189,7 +190,7 @@ class main_view extends XMLDBAction { is_writeable($key) && !empty($dbdir->xml_loaded) && !empty($dbdir->xml_changed)) { - $b .= '[' . $this->str['save'] . ']'; + $b .= '[' . $this->str['save'] . ']'; /// Check if the file has been manually edited while being modified in the editor if ($dbdir->filemtime != filemtime($key . '/install.xml')) { /// File manually modified. Add to errors. @@ -227,7 +228,7 @@ class main_view extends XMLDBAction { is_writeable($key) && !empty($dbdir->xml_loaded) && !empty($dbdir->xml_changed)) { - $b .= '[' . $this->str['revert'] . ']'; + $b .= '[' . $this->str['revert'] . ']'; } else { $b .= '[' . $this->str['revert'] . ']'; } @@ -249,7 +250,7 @@ class main_view extends XMLDBAction { is_readable($key . '/install.xml') && is_writeable($key) && empty($dbdir->xml_loaded)) { - $b .= '[' . $this->str['delete'] . ']'; + $b .= '[' . $this->str['delete'] . ']'; } else { $b .= '[' . $this->str['delete'] . ']'; } diff --git a/admin/xmldb/actions/new_field/new_field.class.php b/admin/xmldb/actions/new_field/new_field.class.php index 6ce810d891..c1f2a611e1 100644 --- a/admin/xmldb/actions/new_field/new_field.class.php +++ b/admin/xmldb/actions/new_field/new_field.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will create a new default field to be edited + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class new_field extends XMLDBAction { /** diff --git a/admin/xmldb/actions/new_index/new_index.class.php b/admin/xmldb/actions/new_index/new_index.class.php index a3da0e115e..6cc956eac0 100644 --- a/admin/xmldb/actions/new_index/new_index.class.php +++ b/admin/xmldb/actions/new_index/new_index.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will create a new default index to be edited + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class new_index extends XMLDBAction { /** diff --git a/admin/xmldb/actions/new_key/new_key.class.php b/admin/xmldb/actions/new_key/new_key.class.php index 4b35db6202..4c645d2b14 100644 --- a/admin/xmldb/actions/new_key/new_key.class.php +++ b/admin/xmldb/actions/new_key/new_key.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will create a new default key to be edited + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class new_key extends XMLDBAction { /** diff --git a/admin/xmldb/actions/new_sentence/new_sentence.class.php b/admin/xmldb/actions/new_sentence/new_sentence.class.php index 869c8f299e..0c9d14815a 100644 --- a/admin/xmldb/actions/new_sentence/new_sentence.class.php +++ b/admin/xmldb/actions/new_sentence/new_sentence.class.php @@ -1,33 +1,35 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will create a new default sentence to be edited. + * If one previous sentence key is specified, it's used as + * base to build the new setence, else a blank one is used + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class new_sentence extends XMLDBAction { /** diff --git a/admin/xmldb/actions/new_statement/new_statement.class.php b/admin/xmldb/actions/new_statement/new_statement.class.php index 72f1124137..844713614a 100644 --- a/admin/xmldb/actions/new_statement/new_statement.class.php +++ b/admin/xmldb/actions/new_statement/new_statement.class.php @@ -1,32 +1,34 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will ask for one statement type and table + * to be able to add sentences of that type + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class new_statement extends XMLDBAction { /** @@ -102,6 +104,7 @@ class new_statement extends XMLDBAction { $o.= ' '; $o.= ' '; $o.= ' '; + $o.= ' '; $o.= ' '; $o.= ' '; $o.= ' '; diff --git a/admin/xmldb/actions/new_table/new_table.class.php b/admin/xmldb/actions/new_table/new_table.class.php index b2b9a38929..b4f390583d 100644 --- a/admin/xmldb/actions/new_table/new_table.class.php +++ b/admin/xmldb/actions/new_table/new_table.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will create a new default table to be edited + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class new_table extends XMLDBAction { /** diff --git a/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php b/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php index ebc919ccad..cacb6305a4 100644 --- a/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php +++ b/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php @@ -1,32 +1,34 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will ask and retrofit all the information from one + * mysql table present in the Moodle DB to one xmldb_table structure + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class new_table_from_mysql extends XMLDBAction { /** @@ -110,6 +112,7 @@ class new_table_from_mysql extends XMLDBAction { $o.= ' '; $o.= ' '; $o.= ' '; + $o.= ' '; $o.= '
' . $OUTPUT->select(html_select::make($typeoptions, 'type')) . '' .$OUTPUT->select(html_select::make($selecttables, 'table')) . '
'; $o.= ' '; $o.= ' '; diff --git a/admin/xmldb/actions/revert_changes/revert_changes.class.php b/admin/xmldb/actions/revert_changes/revert_changes.class.php index ed3be66cca..d775baf807 100644 --- a/admin/xmldb/actions/revert_changes/revert_changes.class.php +++ b/admin/xmldb/actions/revert_changes/revert_changes.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will revert changes (delete the editeddb) + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class revert_changes extends XMLDBAction { /** @@ -75,7 +77,7 @@ class revert_changes extends XMLDBAction { $o.= '

' . $this->str['confirmrevertchanges'] . '

' . $dirpath . '

'; $o.= '
' . $OUTPUT->select(html_select::make($selecttables, 'table')) . '' .$OUTPUT->select(html_select::make($aftertables, 'after')) . '
'; $o.= '
'; - $o.= '
'; + $o.= '
'; $o.= '
'; $o.= '
'; $o.= '
'; diff --git a/admin/xmldb/actions/test/test.class.php b/admin/xmldb/actions/test/test.class.php index 6bc79c9790..c507c695c2 100644 --- a/admin/xmldb/actions/test/test.class.php +++ b/admin/xmldb/actions/test/test.class.php @@ -1,32 +1,36 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will perform one full test of all the available DDL + * functions under your DB + * This class will will check all the db directories existing under the + * current Moodle installation, sending them to the SESSION->dbdirs array + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class test extends XMLDBAction { /** @@ -1131,6 +1135,20 @@ class test extends XMLDBAction { $this->output = $o; + /// Finally drop all the potentially existing test tables + $table = new XMLDBTable('testtable'); + if (table_exists($table)) { + $status = drop_table($table, true, false); + } + $table = new XMLDBTable ('anothertest'); + if (table_exists($table)) { + $status = drop_table($table, true, false); + } + $table = new XMLDBTable ('newnameforthetable'); + if (table_exists($table)) { + $status = drop_table($table, true, false); + } + /// Launch postaction if exists (leave this here!) if ($this->getPostAction() && $result) { return $this->launch($this->getPostAction()); diff --git a/admin/xmldb/actions/unload_xml_file/unload_xml_file.class.php b/admin/xmldb/actions/unload_xml_file/unload_xml_file.class.php index 4f8679e74b..1708574781 100644 --- a/admin/xmldb/actions/unload_xml_file/unload_xml_file.class.php +++ b/admin/xmldb/actions/unload_xml_file/unload_xml_file.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will unload one loaded file completely + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class unload_xml_file extends XMLDBAction { /** @@ -35,6 +37,7 @@ class unload_xml_file extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_field_xml/view_field_xml.class.php b/admin/xmldb/actions/view_field_xml/view_field_xml.class.php index 1d1a60f58c..717cec40da 100644 --- a/admin/xmldb/actions/view_field_xml/view_field_xml.class.php +++ b/admin/xmldb/actions/view_field_xml/view_field_xml.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will display the XML for one field being edited + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class view_field_xml extends XMLDBAction { /** @@ -35,6 +37,7 @@ class view_field_xml extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_index_xml/view_index_xml.class.php b/admin/xmldb/actions/view_index_xml/view_index_xml.class.php index 29ebd0726b..87e5181906 100644 --- a/admin/xmldb/actions/view_index_xml/view_index_xml.class.php +++ b/admin/xmldb/actions/view_index_xml/view_index_xml.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will display the XML for one index being edited + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class view_index_xml extends XMLDBAction { /** @@ -35,6 +37,7 @@ class view_index_xml extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_key_xml/view_key_xml.class.php b/admin/xmldb/actions/view_key_xml/view_key_xml.class.php index f140d9485b..00d3b6334f 100644 --- a/admin/xmldb/actions/view_key_xml/view_key_xml.class.php +++ b/admin/xmldb/actions/view_key_xml/view_key_xml.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will display the XML for one key being edited + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class view_key_xml extends XMLDBAction { /** @@ -35,6 +37,7 @@ class view_key_xml extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_reserved_words/view_reserved_words.class.php b/admin/xmldb/actions/view_reserved_words/view_reserved_words.class.php index 639110b84c..b5aaee14bb 100644 --- a/admin/xmldb/actions/view_reserved_words/view_reserved_words.class.php +++ b/admin/xmldb/actions/view_reserved_words/view_reserved_words.class.php @@ -1,34 +1,36 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will show all the reserved words in a format suitable to + * be pasted to: http://docs.moodle.org/en/XMLDB_reserved_words and + * http://docs.moodle.org/en/Database_reserved_words + * Also, it introspects te DB looking for such words and informing about + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class view_reserved_words extends XMLDBAction { /** @@ -38,6 +40,7 @@ class view_reserved_words extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_statement_xml/view_statement_xml.class.php b/admin/xmldb/actions/view_statement_xml/view_statement_xml.class.php index 07fa10d4fd..ae8cff8152 100644 --- a/admin/xmldb/actions/view_statement_xml/view_statement_xml.class.php +++ b/admin/xmldb/actions/view_statement_xml/view_statement_xml.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will display the XML for one statement being edited + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class view_statement_xml extends XMLDBAction { /** @@ -35,6 +37,7 @@ class view_statement_xml extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_structure_php/view_structure_php.class.php b/admin/xmldb/actions/view_structure_php/view_structure_php.class.php index 46420fcad9..d2ad4c5e9e 100644 --- a/admin/xmldb/actions/view_structure_php/view_structure_php.class.php +++ b/admin/xmldb/actions/view_structure_php/view_structure_php.class.php @@ -38,6 +38,7 @@ class view_structure_php extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php b/admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php index 72cf30fc7f..136e0cb2c7 100644 --- a/admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php +++ b/admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php @@ -1,32 +1,34 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will show the SQL generated for the selected RDBMS for + * the entire XMLDB file + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class view_structure_sql extends XMLDBAction { /** @@ -36,6 +38,7 @@ class view_structure_sql extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_structure_xml/view_structure_xml.class.php b/admin/xmldb/actions/view_structure_xml/view_structure_xml.class.php index 346db46ec0..7670b64747 100644 --- a/admin/xmldb/actions/view_structure_xml/view_structure_xml.class.php +++ b/admin/xmldb/actions/view_structure_xml/view_structure_xml.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will display the XML for one structure + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class view_structure_xml extends XMLDBAction { /** @@ -35,6 +37,7 @@ class view_structure_xml extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_table_php/view_table_php.class.php b/admin/xmldb/actions/view_table_php/view_table_php.class.php index 3b682386f0..ceba42948b 100644 --- a/admin/xmldb/actions/view_table_php/view_table_php.class.php +++ b/admin/xmldb/actions/view_table_php/view_table_php.class.php @@ -38,6 +38,7 @@ class view_table_php extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_table_sql/view_table_sql.class.php b/admin/xmldb/actions/view_table_sql/view_table_sql.class.php index 595a9cde1a..fe6a3070f0 100644 --- a/admin/xmldb/actions/view_table_sql/view_table_sql.class.php +++ b/admin/xmldb/actions/view_table_sql/view_table_sql.class.php @@ -1,32 +1,34 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** /// This class will show the SQL generated for the selected RDBMS for /// one table - + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class view_table_sql extends XMLDBAction { /** @@ -36,6 +38,7 @@ class view_table_sql extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_table_xml/view_table_xml.class.php b/admin/xmldb/actions/view_table_xml/view_table_xml.class.php index 3e57f20d4a..65d959d8b9 100644 --- a/admin/xmldb/actions/view_table_xml/view_table_xml.class.php +++ b/admin/xmldb/actions/view_table_xml/view_table_xml.class.php @@ -1,31 +1,33 @@ . + +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * This class will display the XML for one table bein edited + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class view_table_xml extends XMLDBAction { /** @@ -35,6 +37,7 @@ class view_table_xml extends XMLDBAction { parent::init(); /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array( diff --git a/admin/xmldb/actions/view_xml/view_xml.class.php b/admin/xmldb/actions/view_xml/view_xml.class.php index e14f0ec897..1361cf6e05 100644 --- a/admin/xmldb/actions/view_xml/view_xml.class.php +++ b/admin/xmldb/actions/view_xml/view_xml.class.php @@ -1,31 +1,33 @@ . -/// This class will display one XML file +/** + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +/** + * This class will display one XML file + * + * @package xmldb-editor + * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class view_xml extends XMLDBAction { /** @@ -38,6 +40,7 @@ class view_xml extends XMLDBAction { //$this->can_subaction = ACTION_HAVE_SUBACTIONS; /// Set own custom attributes + $this->sesskey_protected = false; // This action doesn't need sesskey protection /// Get needed strings $this->loadStrings(array(