aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/functions.php8
-rw-r--r--phpBB/includes/functions_user.php9
2 files changed, 15 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index d1883907dd..02bd24b246 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3150,6 +3150,14 @@ function add_log()
{
global $db, $user;
+ // In phpBB 3.1.x i want to have logging in a class to be able to control it
+ // For now, we need a quite hakish approach to circumvent logging for some actions
+ // @todo implement cleanly
+ if (!empty($GLOBALS['skip_add_log']))
+ {
+ return false;
+ }
+
$args = func_get_args();
$mode = array_shift($args);
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index ca6aae2540..c562ac666f 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -290,6 +290,9 @@ function user_add($user_row, $cp_data = false)
if ($add_group_id)
{
+ // Because these actions only fill the log unneccessarily we skip the add_log() entry with a little hack. :/
+ $GLOBALS['skip_add_log'] = true;
+
// Add user to "newly registered users" group and set to default group if admin specified so.
if ($config['new_member_group_default'])
{
@@ -299,6 +302,8 @@ function user_add($user_row, $cp_data = false)
{
group_user_add($add_group_id, $user_id);
}
+
+ unset($GLOBALS['skip_add_log']);
}
}
@@ -3519,12 +3524,12 @@ function remove_newly_registered($user_id, $user_data = false)
$user_data = $user_row;
}
}
-
+
if (empty($user_data['user_new']))
{
return false;
}
-
+
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . "
WHERE group_name = 'NEWLY_REGISTERED'