diff --git a/admin/xmldb/actions/save_xml_file/save_xml_file.class.php b/admin/xmldb/actions/save_xml_file/save_xml_file.class.php index aed9b92f4e8..60f5810cf85 100644 --- a/admin/xmldb/actions/save_xml_file/save_xml_file.class.php +++ b/admin/xmldb/actions/save_xml_file/save_xml_file.class.php @@ -38,7 +38,7 @@ class save_xml_file extends XMLDBAction { /// Get needed strings $this->loadStrings(array( - /// 'key' => 'module' + 'filenotwriteable' => 'xmldb' )); } @@ -78,6 +78,12 @@ class save_xml_file extends XMLDBAction { } } + /// Chech for perms + if (!is_writeable($dirpath . '/install.xml')) { + $this->errormsg = $this->str['filenotwriteable'] . '(' . $dirpath . '/install.xml)'; + return false; + } + /// Save the original dir $result = $dbdir->xml_file->saveXMLFile(); @@ -91,7 +97,8 @@ class save_xml_file extends XMLDBAction { unset($XMLDB->dbdirs[$dirpath]->xml_exists); unset($XMLDB->dbdirs[$dirpath]->xml_writeable); } else { - $errormsg = 'Error saving XML file (' . $dirpath . ')'; + $this->errormsg = 'Error saving XML file (' . $dirpath . ')'; + return false; } /// Launch postaction if exists (leave this here!)