SF.net SVN: postfixadmin:[965] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2011-02-15 21:59:09
|
Revision: 965 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=965&view=rev Author: christian_boltz Date: 2011-02-15 21:59:03 +0000 (Tue, 15 Feb 2011) Log Message: ----------- Preparation for removing the $username parameter from db_log() (will be detected by authentication_get_username() instead) scripts/postfixadmin-cli.php: - define ("POSTFIXADMIN_CLI", 1) (we have no session running and need a way to tell authentication_get_username() that this is a CLI access) functions.inc.php: - authentication_get_username(): check for POSTFIXADMIN_CLI constant, return 'CLI' if set (hmmm, do we need a similar thing for XMLRPC?) - db_log(): override $username parameter with authentication_get_username() (removing it from function parameters will be my next big commit) Modified Paths: -------------- trunk/functions.inc.php trunk/scripts/postfixadmin-cli.php Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2011-02-14 18:32:36 UTC (rev 964) +++ trunk/functions.inc.php 2011-02-15 21:59:03 UTC (rev 965) @@ -27,6 +27,11 @@ function authentication_get_username() { global $CONF; + + if (defined('POSTFIXADMIN_CLI')) { + return 'CLI'; + } + if (!isset($_SESSION['sessid'])) { header ("Location: " . $CONF['postfix_admin_url'] . "/login.php"); exit(0); @@ -1828,6 +1833,8 @@ global $table_log; $REMOTE_ADDR = getRemoteAddr(); + $username = authentication_get_username(); + $action_list = array( 'create_alias', 'edit_alias', 'edit_alias_state', 'delete_alias', 'create_mailbox', 'edit_mailbox', 'edit_mailbox_state', 'delete_mailbox', Modified: trunk/scripts/postfixadmin-cli.php =================================================================== --- trunk/scripts/postfixadmin-cli.php 2011-02-14 18:32:36 UTC (rev 964) +++ trunk/scripts/postfixadmin-cli.php 2011-02-15 21:59:03 UTC (rev 965) @@ -557,6 +557,7 @@ } +define ("POSTFIXADMIN_CLI", 1); $dispatcher = new PostfixAdmin($argv); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |