fix #7802 - read only db trying to write to DB
[Pman.Base] / Pman.php
index fd17b43..ddbb4ae 100644 (file)
--- a/Pman.php
+++ b/Pman.php
@@ -505,8 +505,9 @@ class Pman extends HTML_FlexyFramework_Page
         if ($cli) {
             echo "ERROR: " .$str . "\n"; // print the error first, as DB might fail..
         }
+        $pman = HTML_FlexyFramework::get();
         
-        if ($type !== false) {
+        if ($type !== false && empty($pman->nodatabase)) {
             
             if(!empty($errors)){
                 DB_DataObject::factory('Events')->writeEventLogExtra($errors);
@@ -1144,7 +1145,9 @@ class Pman extends HTML_FlexyFramework_Page
     function addEvent($act, $obj = false, $remarks = '') 
     {
         
-        if (!empty(HTML_FlexyFramework::get()->Pman['disable_events'])) {
+        if (!empty(HTML_FlexyFramework::get()->Pman['disable_events'])
+         || !empty(HTML_FlexyFramework::get()->database_is_readonly)
+        ) {
             $str = $obj !== false ? "{$obj->tableName()}:{$obj->id} " : '';
             $de = ini_set('display_errors', 0);
             trigger_error("$act {$str}{$remarks}" , E_USER_NOTICE);