diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-11-02 11:55:16 -0700 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-11-02 11:55:16 -0700 |
commit | 0a3bb18e93bcb8321e09ca313431ae66f2284e7b (patch) | |
tree | 0a082db6007f7438e51f0fd0b10598d3445b9a88 /phpBB/includes | |
parent | 4d6c7223b4fa8946a40ac5779bfa20d4a561a574 (diff) | |
parent | c5fc8c43cbca82d2a064859828950477cfd5d767 (diff) | |
download | forums-0a3bb18e93bcb8321e09ca313431ae66f2284e7b.tar forums-0a3bb18e93bcb8321e09ca313431ae66f2284e7b.tar.gz forums-0a3bb18e93bcb8321e09ca313431ae66f2284e7b.tar.bz2 forums-0a3bb18e93bcb8321e09ca313431ae66f2284e7b.tar.xz forums-0a3bb18e93bcb8321e09ca313431ae66f2284e7b.zip |
Merge pull request #1812 from prototech/ticket/11746
[ticket/11746] Add "admin activation required" notification.
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 3 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_activate.php | 5 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_register.php | 43 |
3 files changed, 16 insertions, 35 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 52f9b7149d..fd9c17f171 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -396,6 +396,9 @@ class acp_users { if ($config['require_activation'] == USER_ACTIVATION_ADMIN) { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + $phpbb_notifications->delete_notifications('admin_activate_user', $user_row['user_id']); + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $messenger = new messenger(false); diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index 898dacd831..2a94acbe02 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -27,7 +27,7 @@ class ucp_activate function main($id, $mode) { global $config, $phpbb_root_path, $phpEx; - global $db, $user, $auth, $template; + global $db, $user, $auth, $template, $phpbb_container; $user_id = request_var('u', 0); $key = request_var('k', ''); @@ -108,6 +108,9 @@ class ucp_activate if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password) { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + $phpbb_notifications->delete_notifications('admin_activate_user', $user_row['user_id']); + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $messenger = new messenger(false); diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 1f9ab23326..1641c6eef1 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -379,41 +379,16 @@ class ucp_register } $messenger->send(NOTIFY_EMAIL); + } - if ($config['require_activation'] == USER_ACTIVATION_ADMIN) - { - // Grab an array of user_id's with a_user permissions ... these users can activate a user - $admin_ary = $auth->acl_get_list(false, 'a_user', false); - $admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array(); - - // Also include founders - $where_sql = ' WHERE user_type = ' . USER_FOUNDER; - - if (sizeof($admin_ary)) - { - $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary); - } - - $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type - FROM ' . USERS_TABLE . ' ' . - $where_sql; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $messenger->template('admin_activate', $row['user_lang']); - $messenger->set_addresses($row); - - $messenger->assign_vars(array( - 'USERNAME' => htmlspecialchars_decode($data['username']), - 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u=$user_id", - 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey") - ); - - $messenger->send($row['user_notify_type']); - } - $db->sql_freeresult($result); - } + if ($config['require_activation'] == USER_ACTIVATION_ADMIN) + { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + $phpbb_notifications->add_notifications('admin_activate_user', array( + 'user_id' => $user_id, + 'user_actkey' => $user_row['user_actkey'], + 'user_regdate' => $user_row['user_regdate'], + )); } // Perform account linking if necessary |