rollback because of MySQL API not merged yet. Still fixes the return true which can be false because of do_action()

This commit is contained in:
AlternC VM 2014-06-30 17:11:56 +02:00
parent 64fa8a2795
commit ea7c943b67
1 changed files with 25 additions and 13 deletions

View File

@ -185,20 +185,32 @@ class m_action {
$err->log("action", "set", $type);
$serialized = serialize($parameters);
$type = strtoupper($type);
if (in_array($type, array('CREATE_FILE',
'CREATE_DIR',
'MOVE',
'FIX_USER',
'FIX_FILE',
'FIX_DIR',
'DELETE'))) {
$query = 'INSERT INTO `actions` (type, parameters, creation, user) VALUES(?, ?, now())';
} else {
switch ($type) {
case 'create_file':
$query = "insert into actions values ('','CREATE_FILE','$serialized',now(),'','','$user','');";
break;
case 'create_dir':
$query = "insert into actions values ('','CREATE_DIR','$serialized',now(),'','','$user','');";
break;
case 'move':
$query = "insert into actions values ('','MOVE','$serialized',now(),'','','$user','');";
break;
case 'fix_user':
$query = "insert into actions values ('','FIX_USER','$serialized',now(),'','','$user','');";
break;
case 'fix_file':
$query = "insert into actions values ('','FIX_FILE','$serialized',now(),'','','$user','');";
break;
case 'fix_dir':
$query = "insert into actions values ('','FIX_DIR','$serialized',now(),'','','$user','');";
break;
case 'delete':
$query = "insert into actions values ('','DELETE','$serialized',now(),'','','$user','');";
break;
default:
return false;
}
if (!$db->query($query, array($type, $serialized))) {
if (!$db->query($query)) {
$err->raise("action", _("Error setting actions"));
return false;
}