diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2012-03-28 15:48:45 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2012-08-21 12:12:41 +0200 |
| commit | 3170845a5011ea76af7f4f8359acafb43ad7e19e (patch) | |
| tree | 3f9b3aed307b3160158e3492aea06082d7c26481 /phpBB | |
| parent | 2c7f498c1b43cfb96f868e9b0f9b80ad5ec626a8 (diff) | |
| download | forums-3170845a5011ea76af7f4f8359acafb43ad7e19e.tar forums-3170845a5011ea76af7f4f8359acafb43ad7e19e.tar.gz forums-3170845a5011ea76af7f4f8359acafb43ad7e19e.tar.bz2 forums-3170845a5011ea76af7f4f8359acafb43ad7e19e.tar.xz forums-3170845a5011ea76af7f4f8359acafb43ad7e19e.zip | |
[ticket/10714] Refactor disable mechanism to only disable certain types
Only disable admin log when adding multiple users, so critical errors are still
logged.
PHPBB3-10714
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/includes/functions_user.php | 4 | ||||
| -rw-r--r-- | phpBB/includes/log/interface.php | 16 |
2 files changed, 14 insertions, 6 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 4074eaa2f2..d1f1544fcd 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -302,7 +302,7 @@ function user_add($user_row, $cp_data = false) global $phpbb_log; // Because these actions only fill the log unneccessarily we skip the add_log() entry. - $phpbb_log->disable(); + $phpbb_log->disable('admin'); // Add user to "newly registered users" group and set to default group if admin specified so. if ($config['new_member_group_default']) @@ -315,7 +315,7 @@ function user_add($user_row, $cp_data = false) group_user_add($add_group_id, $user_id); } - $phpbb_log->enable(); + $phpbb_log->enable('admin'); } } diff --git a/phpBB/includes/log/interface.php b/phpBB/includes/log/interface.php index fde718b71a..feeab585bf 100644 --- a/phpBB/includes/log/interface.php +++ b/phpBB/includes/log/interface.php @@ -25,23 +25,31 @@ interface phpbb_log_interface /** * This function returns the state of the log-system. * - * @return bool True if log is enabled + * @param string $type The log type we want to check. Empty to get global log status. + * + * @return bool True if log for the type is enabled */ - public function is_enabled(); + public function is_enabled($type = ''); /** * This function allows disable the log-system. When add_log is called, the log will not be added to the database. * + * @param mixed $type The log type we want to disable. Empty to disable all logs. + * Can also be an array of types + * * @return null */ - public function disable(); + public function disable($type = ''); /** * This function allows re-enable the log-system. * + * @param mixed $type The log type we want to enable. Empty to enable all logs. + * Can also be an array of types + * * @return null */ - public function enable(); + public function enable($type = ''); /** * Adds a log to the database |
