From b4f3a93b01af73f01e3d1617edd069c4970da0f8 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 30 Aug 2006 17:12:00 +0000 Subject: [PATCH] Improve save file, showing the proper error if not writeable. --- .../actions/save_xml_file/save_xml_file.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 aed9b92f4e..60f5810cf8 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!) -- 2.39.5