diff --git a/admin/xmldb/actions/XMLDBAction.class.php b/admin/xmldb/actions/XMLDBAction.class.php index b0f1ea3c351..6e757318fb9 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 dcbe283ce54..6bec8d6a001 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.= ' ';
diff --git a/admin/xmldb/actions/check_bigints/check_bigints.class.php b/admin/xmldb/actions/check_bigints/check_bigints.class.php
index 2729a589be4..03a232e93c7 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 @@
.
-/// This class will check all the int(10) fields existing in the DB
-/// 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
+ */
+/**
+ * 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 66aad6b86bc..c7f336cc37b 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 @@
.
-/// 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
+ */
+/**
+ * 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 13240a7f317..19b11d658c7 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 9ac0cee9127..b52cc61734f 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 @@
.
-/// 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
+ */
+/**
+ * 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 8c4aa0a7bb2..ca292d29de7 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 @@
.
-/// 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
+ */
+/**
+ * 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'] . '
| ||||||||||||||||||||||||||||||||||||||||||||