From 48ba27466011e84a8979ff9579f2bf8819d8862a Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sun, 3 Oct 2004 09:18:19 +0000 Subject: [PATCH] admin/lang.php is now using sesskey. Merged from MOODLE_14_STABLE --- admin/lang.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/admin/lang.php b/admin/lang.php index 62514447ef..237502c110 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -29,6 +29,7 @@ $title = $strmissingstrings; $button = '
'. ''. + ''. '
'; break; case "compare": @@ -36,6 +37,7 @@ $title = $strcomparelanguage; $button = '
'. ''. + ''. '
'; break; default: @@ -60,8 +62,8 @@ echo ""; echo popup_form ("$CFG->wwwroot/admin/lang.php?lang=", $langs, "chooselang", $currlang, "", "", "", true); echo ""; - print_heading("$strmissingstrings"); - print_heading("$strcomparelanguage"); + print_heading("sesskey\">$strmissingstrings"); + print_heading("sesskey\">$strcomparelanguage"); echo "

"; $options["lang"] = $currentlang; print_single_button("http://moodle.org/download/lang/", $options, get_string("latestlanguagepack")); @@ -85,7 +87,7 @@ } } - if ($mode == "missing") { + if ($mode == "missing" and confirm_sesskey()) { // For each file, check that a counterpart exists, then check all the strings foreach ($stringfiles as $file) { @@ -151,7 +153,7 @@ notice(get_string("languagegood"), "lang.php"); } - } else if ($mode == "compare") { + } else if ($mode == "compare" and confirm_sesskey()) { if (isset($_POST['currentfile'])){ // Save a file $newstrings = $_POST; @@ -159,7 +161,7 @@ if (lang_save_file($langdir, $currentfile, $newstrings)) { notify(get_string("changessaved")." ($langdir/$currentfile)", "green"); } else { - error("Could not save the file '$currentfile'!", "lang.php?mode=compare&currentfile=$currentfile"); + error("Could not save the file '$currentfile'!", "lang.php?mode=compare&currentfile=$currentfile&sesskey=$USER->sesskey"); } } @@ -171,7 +173,7 @@ if ($file == $currentfile) { echo "$file   "; } else { - echo "$file   "; + echo "sesskey\">$file   "; } } echo '
'; @@ -214,6 +216,7 @@ if ($editable) { echo "
"; + echo ''; } echo ""; foreach ($enstring as $key => $envalue) { -- 2.39.5