prevent the attempt of editting packs located in $CFG->dirroot/lang (from get_list_of_languages() used in 1.6 sites that are not uncodedb)

This commit is contained in:
toyomoyo 2006-02-08 07:44:36 +00:00
parent bcfe401e39
commit 7988d9e75a
2 changed files with 13 additions and 1 deletions

View File

@ -98,8 +98,11 @@
}
if ($mode == "missing") {
if (!file_exists($langdir)) {
error ('to edit this language pack, you need to put it in '.$CFG->dataroot.'/lang');
}
// For each file, check that a counterpart exists, then check all the strings
foreach ($stringfiles as $file) {
unset($string);
include("$enlangdir/$file");
@ -164,6 +167,11 @@
} else if ($mode == "compare") {
if (!file_exists($langdir)) {
error ('to edit this language pack, you need to put it in '.$CFG->dataroot.'/lang');
}
if (isset($_POST['currentfile'])){ // Save a file
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));

View File

@ -52,6 +52,10 @@ Thanks: Jaime Villate for important bug fixing, koen roggemans for his job a
$langdir = "$CFG->dataroot/lang/$currentlang";
$enlangdir = "$CFG->dirroot/lang/en_utf8";
if (!file_exists($langdir)) {
error ('to edit this language pack, you need to put it in '.$CFG->dataroot.'/lang');
}
// Shall I save POSTed data?
if (isset($_POST['currentfile'])) {