Skip to content

Commit

Permalink
admin/modules.php is now using sesskey.
Browse files Browse the repository at this point in the history
Merged from MOODLE_14_STABLE
  • Loading branch information
stronk7 committed Oct 3, 2004
1 parent 8c100dd commit 5ba7f1b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions admin/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,29 @@

/// If data submitted, then process and store.

if (!empty($hide)) {
if (!empty($hide) and confirm_sesskey()) {
if (!$module = get_record("modules", "name", $hide)) {
error("Module doesn't exist!");
}
set_field("modules", "visible", "0", "id", $module->id); // Hide main module
set_field("course_modules", "visible", "0", "module", $module->id); // Hide all related activity modules
}

if (!empty($show)) {
if (!empty($show) and confirm_sesskey()) {
if (!$module = get_record("modules", "name", $show)) {
error("Module doesn't exist!");
}
set_field("modules", "visible", "1", "id", $module->id); // Show main module
set_field("course_modules", "visible", "1", "module", $module->id); // Show all related activity modules
}

if (!empty($delete)) {
if (!empty($delete) and confirm_sesskey()) {

$strmodulename = get_string("modulename", "$delete");

if (empty($confirm)) {
notice_yesno(get_string("moduledeleteconfirm", "", $strmodulename),
"modules.php?delete=$delete&confirm=$delete",
"modules.php?delete=$delete&confirm=$delete&sesskey=$USER->sesskey",
"modules.php");
print_footer();
exit;
Expand Down Expand Up @@ -162,7 +162,7 @@

$icon = "<img src=\"$modpixpath/$module->name/icon.gif\" hspace=\"10\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" />";

$delete = "<a href=\"modules.php?delete=$module->name\">$strdelete</a>";
$delete = "<a href=\"modules.php?delete=$module->name&sesskey=$USER->sesskey\">$strdelete</a>";

if (file_exists("$CFG->dirroot/mod/$module->name/config.html")) {
$settings = "<a href=\"module.php?module=$module->name&sesskey=$USER->sesskey\">$strsettings</a>";
Expand All @@ -173,11 +173,11 @@
$count = count_records("$module->name");

if ($module->visible) {
$visible = "<a href=\"modules.php?hide=$module->name\" title=\"$strhide\">".
$visible = "<a href=\"modules.php?hide=$module->name&amp;sesskey=$USER->sesskey\" title=\"$strhide\">".
"<img src=\"$pixpath/i/hide.gif\" align=\"middle\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" /></a>";
$class = "";
} else {
$visible = "<a href=\"modules.php?show=$module->name\" title=\"$strshow\">".
$visible = "<a href=\"modules.php?show=$module->name&amp;sesskey=$USER->sesskey\" title=\"$strshow\">".
"<img src=\"$pixpath/i/show.gif\" align=\"middle\" height=\"16\" width=\"16\" border=\"0\" alt=\"\" /></a>";
$class = "class=\"dimmed_text\"";
}
Expand Down

0 comments on commit 5ba7f1b

Please sign in to comment.