aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-02-02 23:19:44 +0100
committerJoas Schilling <nickvergessen@gmx.de>2015-02-02 23:19:44 +0100
commit6678570f49969e3a6e47d917c142448c591f4c5a (patch)
tree9266c4d5c947aacb8533e0a94ce67a23ccbeec16 /phpBB/includes/functions_user.php
parente9eafece3fa3930202d6a218f25e5cbe508c6c27 (diff)
parent25b013f7814040b85893e39772d399aeeeefdb51 (diff)
downloadforums-6678570f49969e3a6e47d917c142448c591f4c5a.tar
forums-6678570f49969e3a6e47d917c142448c591f4c5a.tar.gz
forums-6678570f49969e3a6e47d917c142448c591f4c5a.tar.bz2
forums-6678570f49969e3a6e47d917c142448c591f4c5a.tar.xz
forums-6678570f49969e3a6e47d917c142448c591f4c5a.zip
Merge pull request #3324 from rxu/ticket/13336
[ticket/13336] Add core events to the function user_active_flip()
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php32
1 files changed, 31 insertions, 1 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index f79a8998c4..83f6e44453 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -703,7 +703,7 @@ function user_delete($mode, $user_ids, $retain_username = true)
*/
function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
{
- global $config, $db, $user, $auth;
+ global $config, $db, $user, $auth, $phpbb_dispatcher;
$deactivated = $activated = 0;
$sql_statements = array();
@@ -756,6 +756,21 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
}
$db->sql_freeresult($result);
+ /**
+ * Check or modify activated/deactivated users data before submitting it to the database
+ *
+ * @event core.user_active_flip_before
+ * @var string mode User type changing mode, can be: flip|activate|deactivate
+ * @var int reason Reason for changing user type, can be: INACTIVE_REGISTER|INACTIVE_PROFILE|INACTIVE_MANUAL|INACTIVE_REMIND
+ * @var int activated The number of users to be activated
+ * @var int deactivated The number of users to be deactivated
+ * @var array user_id_ary Array with user ids to change user type
+ * @var array sql_statements Array with users data to submit to the database, keys: user ids, values: arrays with user data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('mode', 'reason', 'activated', 'deactivated', 'user_id_ary', 'sql_statements');
+ extract($phpbb_dispatcher->trigger_event('core.user_active_flip_before', compact($vars)));
+
if (sizeof($sql_statements))
{
foreach ($sql_statements as $user_id => $sql_ary)
@@ -769,6 +784,21 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
$auth->acl_clear_prefetch(array_keys($sql_statements));
}
+ /**
+ * Perform additional actions after the users have been activated/deactivated
+ *
+ * @event core.user_active_flip_after
+ * @var string mode User type changing mode, can be: flip|activate|deactivate
+ * @var int reason Reason for changing user type, can be: INACTIVE_REGISTER|INACTIVE_PROFILE|INACTIVE_MANUAL|INACTIVE_REMIND
+ * @var int activated The number of users to be activated
+ * @var int deactivated The number of users to be deactivated
+ * @var array user_id_ary Array with user ids to change user type
+ * @var array sql_statements Array with users data to submit to the database, keys: user ids, values: arrays with user data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('mode', 'reason', 'activated', 'deactivated', 'user_id_ary', 'sql_statements');
+ extract($phpbb_dispatcher->trigger_event('core.user_active_flip_after', compact($vars)));
+
if ($deactivated)
{
set_config_count('num_users', $deactivated * (-1), true);