Merge branch 'hotfix-2.3.108'

pull/542/merge v2.3.108
Iglocska 2015-08-18 09:45:41 +02:00
commit dd7c226183
3 changed files with 30 additions and 3 deletions

View File

@ -1 +1 @@
{"major":2, "minor":3, "hotfix":107}
{"major":2, "minor":3, "hotfix":108}

View File

@ -27,7 +27,8 @@ class Log extends AppModel {
'email',
'serverSettingsEdit',
'remove_dead_workers',
'upload_sample'
'upload_sample',
'update_database'
)),
'message' => 'Options : ...'
)

View File

@ -1688,7 +1688,33 @@ class Server extends AppModel {
break;
}
$m = ClassRegistry::init($model);
$m->query($sql);
$this->Log = ClassRegistry::init('Log');
try {
$m->query($sql);
$this->Log->create();
$this->Log->save(array(
'org' => 'SYSTEM',
'model' => 'Server',
'model_id' => 0,
'email' => 'SYSTEM',
'action' => 'update_database',
'user_id' => 0,
'title' => 'Successfuly executed the SQL query for ' . $command,
'change' => 'The executed SQL query was: ' . $sql
));
} catch (Exception $e) {
$this->Log->create();
$this->Log->save(array(
'org' => 'SYSTEM',
'model' => 'Server',
'model_id' => 0,
'email' => 'SYSTEM',
'action' => 'update_database',
'user_id' => 0,
'title' => 'Issues executing the SQL query for ' . $command,
'change' => 'The executed SQL query was: ' . $sql . PHP_EOL . ' The returned error is: ' . $e->getMessage()
));
}
$this->__cleanCacheFiles();
}