Remove $username parameter from db_log()

functions.inc.php:
- remove $username parameter from function db_log()
  (now auto-detected with authentication_get_username())

various files:
- remove hardcoded username ('CONSOLE', $username etc.) in db_log() calls


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

@ -124,7 +124,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$tMessage = $PALANG['pCreate_alias_domain_error3'];
}
else {
db_log ($SESSID_USERNAME, $fAliasDomain, 'create_alias_domain', "$fAliasDomain -> $fTargetDomain");
db_log ($fAliasDomain, 'create_alias_domain', "$fAliasDomain -> $fTargetDomain");
flash_info($PALANG['pCreate_alias_domain_success']);
# we would have to update the list of domains available for aliasing. Doing a redirect is easier.

@ -181,7 +181,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$tMessage = $PALANG['pCreate_alias_result_error'] . "<br />($fAddress -> $fGoto)<br />\n";
}
else {
db_log ($SESSID_USERNAME, $fDomain, 'create_alias', "$fAddress -> $fGoto");
db_log ($fDomain, 'create_alias', "$fAddress -> $fGoto");
$tDomain = $fDomain;
$tMessage = $PALANG['pCreate_alias_result_success'] . "<br />($fAddress -> $fGoto)<br />\n";

@ -224,7 +224,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
else
{
db_query('COMMIT');
db_log ($SESSID_USERNAME, $fDomain, 'create_mailbox', "$fUsername");
db_log ($fDomain, 'create_mailbox', "$fUsername");
$tDomain = $fDomain;
$tQuota = $CONF['maxquota'];

@ -119,7 +119,7 @@ elseif ($fTable == "alias" or $fTable == "mailbox")
$result = db_query("SELECT * FROM $table_alias WHERE address = '$fDelete' AND domain = '$fDomain'");
if($result['rows'] == 1) {
$result = db_query ("DELETE FROM $table_alias WHERE address='$fDelete' AND domain='$fDomain'");
db_log ($SESSID_USERNAME, $fDomain, 'delete_alias', $fDelete);
db_log ($fDomain, 'delete_alias', $fDelete);
}
/* is there a mailbox? if do delete it from orbit; it's the only way to be sure */
$result = db_query ("SELECT * FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'");
@ -142,7 +142,7 @@ elseif ($fTable == "alias" or $fTable == "mailbox")
}
$tMessage.=')</span>';
}
db_log ($SESSID_USERNAME, $fDomain, 'delete_mailbox', $fDelete);
db_log ($fDomain, 'delete_mailbox', $fDelete);
}
$result = db_query("SELECT * FROM $table_vacation WHERE email = '$fDelete' AND domain = '$fDomain'");
if($result['rows'] == 1) {

@ -65,7 +65,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
}
else
{
db_log ($SESSID_USERNAME, $fDomain, 'edit_mailbox_state', $fUsername);
db_log ($fDomain, 'edit_mailbox_state', $fUsername);
}
}
if ($fAlias != '')
@ -78,7 +78,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
}
else
{
db_log ($SESSID_USERNAME, $fDomain, 'edit_alias_state', $fAlias);
db_log ($fDomain, 'edit_alias_state', $fAlias);
}
}
if ($fAliasDomain != '')
@ -91,7 +91,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
}
else
{
db_log ($SESSID_USERNAME, $fDomain, 'edit_alias_domain_state', $fDomain);
db_log ($fDomain, 'edit_alias_domain_state', $fDomain);
}
}
}

@ -161,7 +161,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
}
else
{
db_log ($SESSID_USERNAME, $fDomain, 'edit_alias', "$fAddress -> $goto");
db_log ($fDomain, 'edit_alias', "$fAddress -> $goto");
header ("Location: list-virtual.php?domain=$fDomain");
exit;

@ -160,7 +160,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$tMessage = $PALANG['pEdit_mailbox_result_error'];
}
else {
db_log ($SESSID_USERNAME, $fDomain, 'edit_mailbox', $fUsername);
db_log ($fDomain, 'edit_mailbox', $fUsername);
header ("Location: list-virtual.php?domain=$fDomain");
exit(0);

@ -1809,7 +1809,7 @@ function db_rollback () {
/**
* db_log
* Action: Logs actions from admin
* Call: db_log (string username, string domain, string action, string data)
* Call: db_log (string domain, string action, string data)
* Possible actions are:
* 'create_domain'
* 'create_alias'
@ -1827,7 +1827,7 @@ function db_rollback () {
* 'edit_mailbox_state'
* 'edit_password'
*/
function db_log ($username,$domain,$action,$data)
function db_log ($domain,$action,$data)
{
global $CONF;
global $table_log;
@ -2428,7 +2428,7 @@ function create_admin($fUsername, $fPassword, $fPassword2, $fDomains, $no_genera
# TODO: should we log creation, editing and deletion of admins?
# Note: needs special handling in viewlog, because domain is empty
# db_log ($SESSID_USERNAME, '', 'create_admin', "$fUsername");
# db_log ('', 'create_admin', "$fUsername");
return array(
$error,

@ -177,7 +177,7 @@ class AliasHandler {
if($result != 1) {
return false;
}
db_log($this->username, $domain, 'edit_alias', "$E_username -> $goto");
db_log ($domain, 'edit_alias', "$E_username -> $goto");
return true;
}
@ -226,7 +226,7 @@ class AliasHandler {
$result = db_delete('alias', 'address', $this->username);
if( $result == 1 ) {
list(/*NULL*/,$domain) = explode('@', $this->username);
db_log ('CLI', $domain, 'delete_alias', $this->username); # TODO: replace hardcoded CLI
db_log ($domain, 'delete_alias', $this->username);
return true;
}
}

@ -61,7 +61,7 @@ class DomainHandler {
if (!domain_postcreation($domain)) {
$tMessage = Lang::read('pAdminCreate_domain_error');
}
db_log('CONSOLE', $domain, 'create_domain', "");
db_log ($domain, 'create_domain', "");
return true;
}
@ -94,7 +94,7 @@ class DomainHandler {
$result = db_delete('domain', 'domain', $this->username);
if( $result == 1 ) {
list(/*NULL*/,$domain) = explode('@', $this->username);
db_log ('CLI', $domain, 'delete_domain', $this->username); # TODO: replace hardcoded CLI # TODO delete_domain is not a valid db_log keyword yet because we don't yet log add/delete domain
db_log ($domain, 'delete_domain', $this->username); # TODO delete_domain is not a valid db_log keyword yet because we don't yet log add/delete domain
return true;
}
}

@ -39,7 +39,7 @@ class UserHandler {
$result = db_assoc($result['result']);
if (pacrypt($old_password, $result['password']) != $result['password']) {
db_log ('CONSOLE', $domain, 'edit_password', "MATCH FAILURE: " . $this->username); # TODO: replace hardcoded CONSOLE - class is used by XMLRPC and users/
db_log ($domain, 'edit_password', "MATCH FAILURE: " . $this->username);
$this->errormsg[] = 'Passwords do not match'; # TODO: make translatable
return false;
}
@ -52,12 +52,12 @@ class UserHandler {
$result = db_update('mailbox', 'username', $this->username, $set );
if ($result != 1) {
db_log ('CONSOLE', $domain, 'edit_password', "FAILURE: " . $this->username); # TODO: replace hardcoded CONSOLE - class is used by XMLRPC and users/
db_log ($domain, 'edit_password', "FAILURE: " . $this->username);
$this->errormsg[] = Lang::read('pEdit_mailbox_result_error');
return false;
}
db_log ('CONSOLE', $domain, 'edit_password', $this->username); # TODO: replace hardcoded CONSOLE - class is used by XMLRPC and users/
db_log ($domain, 'edit_password', $this->username);
return true;
}
@ -190,7 +190,7 @@ class UserHandler {
return false;
} else {
db_commit();
db_log ('CONSOLE', $domain, 'create_mailbox', $username); # TODO: remove hardcoded CONSOLE
db_log ($domain, 'create_mailbox', $username);
if ($mail == true)
@ -259,7 +259,7 @@ class UserHandler {
$result = db_query("SELECT * FROM $table_alias WHERE address = '$E_username' AND domain = '$domain'");
if($result['rows'] == 1) {
$result = db_delete('alias', 'address', $username);
db_log ('CONSOLE', $domain, 'delete_alias', $username); # TODO: remove hardcoded CONSOLE
db_log ($domain, 'delete_alias', $username);
} else {
$this->errormsg[] = "no alias $username"; # todo: better message, make translatable
$error = 1;
@ -294,7 +294,7 @@ class UserHandler {
$error = 1;
# return false; # TODO: does this make sense? Or should we still cleanup vacation and vacation_notification?
}
db_log ('CONSOLE', $domain, 'delete_mailbox', $username);
db_log ($domain, 'delete_mailbox', $username);
} else {
$this->errormsg[] = "no mailbox $username"; # TODO: better message, make translatable
$error = 1;

Loading…
Cancel
Save