functions.inc.php: last commit missed some changes to db_log():

- sorted $action_list to make it more readable
- cleanup


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@910 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 14 years ago
parent f963cc33f1
commit 93d80797ea

@ -1813,7 +1813,13 @@ function db_log ($username,$domain,$action,$data)
global $table_log;
$REMOTE_ADDR = getRemoteAddr();
$action_list = array( 'create_domain', 'create_alias', 'create_alias_domain','delete_domain', 'delete_alias', 'delete_alias_domain','edit_domain', 'edit_alias', 'create_mailbox', 'delete_mailbox', 'edit_mailbox', 'edit_alias_state', 'edit_alias_domain_state', 'edit_mailbox_state', 'edit_password');
$action_list = array(
'create_alias', 'edit_alias', 'edit_alias_state', 'delete_alias',
'create_mailbox', 'edit_mailbox', 'edit_mailbox_state', 'delete_mailbox',
'create_domain', 'edit_domain', 'delete_domain',
'create_alias_domain', 'edit_alias_domain_state', 'delete_alias_domain',
'edit_password',
);
if(!in_array($action, $action_list)) {
die("Invalid log action : $action"); // could do with something better?
@ -1828,13 +1834,9 @@ function db_log ($username,$domain,$action,$data)
'data' => $data,
);
$result = db_insert('log', $logdata, array('timestamp') );
#$result = db_query ("INSERT INTO $table_log (timestamp,username,domain,action,data) VALUES (NOW(),'$username ($REMOTE_ADDR)','$domain','$action','$data')");
if ($result != 1)
{
if ($result != 1) {
return false;
}
else
{
} else {
return true;
}
}

Loading…
Cancel
Save