The permissions were only temporary.
I had tried both with and without the ().
Now it gives:
Fatal error: Call to a member function quote() on a non-object in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php on line 280
...
OK, got it working but had to modify the ISPConfig 3 code slightly. Not sure if the modification is a work around or a bug fix. Will leave that to others to decide.
in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php the $old_rec variable is empty and not being seen as an object. Added the line "$old_rec = $new_rec;" as shown below to define it and now my script works. Comments? Does this break something else?
Code:
public function datalogInsert($tablename, $insert_data, $index_field) {
global $app;
$old_rec = array();
$this->query("INSERT INTO $tablename $insert_data");
$index_value = $this->insertID();
$new_rec = $this->queryOneRecord("SELECT * FROM $tablename WHERE $index_field = '$index_value'");
$old_rec = $new_rec; // Added.
$this->datalogSave($tablename, 'INSERT', $index_field, $index_value, $old_rec, $new_rec);
return $index_value;
}
Also added a shell script so can be run as root instead of from the web server. When there is confirmation that this doesn't break something else I'll post the full scripts with the entire mail_content_filters.csv attached.