aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r--phpBB/includes/ucp/info/ucp_pm.php1
-rw-r--r--phpBB/includes/ucp/ucp_activate.php5
-rw-r--r--phpBB/includes/ucp/ucp_groups.php5
-rw-r--r--phpBB/includes/ucp/ucp_notifications.php16
-rw-r--r--phpBB/includes/ucp/ucp_pm.php27
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewfolder.php2
-rw-r--r--phpBB/includes/ucp/ucp_profile.php4
-rw-r--r--phpBB/includes/ucp/ucp_register.php43
-rw-r--r--phpBB/includes/ucp/ucp_zebra.php2
9 files changed, 28 insertions, 77 deletions
diff --git a/phpBB/includes/ucp/info/ucp_pm.php b/phpBB/includes/ucp/info/ucp_pm.php
index 02931e9d31..a80de21999 100644
--- a/phpBB/includes/ucp/info/ucp_pm.php
+++ b/phpBB/includes/ucp/info/ucp_pm.php
@@ -22,7 +22,6 @@ class ucp_pm_info
'compose' => array('title' => 'UCP_PM_COMPOSE', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')),
'drafts' => array('title' => 'UCP_PM_DRAFTS', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')),
'options' => array('title' => 'UCP_PM_OPTIONS', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')),
- 'popup' => array('title' => 'UCP_PM_POPUP_TITLE', 'auth' => 'cfg_allow_privmsg', 'display' => false, 'cat' => array('UCP_PM')),
),
);
}
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_groups.php b/phpBB/includes/ucp/ucp_groups.php
index a75d2e9bfc..7c4bc8f617 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -465,7 +465,7 @@ class ucp_groups
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
// This is normalised data, without the group_ prefix
- $avatar_data = \phpbb\avatar\manager::clean_row($group_row);
+ $avatar_data = \phpbb\avatar\manager::clean_row($group_row, 'group');
}
// Did we submit?
@@ -509,7 +509,7 @@ class ucp_groups
}
else
{
- if ($driver = $phpbb_avatar_manager->get_driver($user->data['user_avatar_type']))
+ if ($driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type']))
{
$driver->delete($avatar_data);
}
@@ -699,7 +699,6 @@ class ucp_groups
'GROUP_CLOSED' => $type_closed,
'GROUP_HIDDEN' => $type_hidden,
- 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=ucp&name=group_colour'),
'S_UCP_ACTION' => $this->u_action . "&action=$action&g=$group_id",
'L_AVATAR_EXPLAIN' => phpbb_avatar_explanation_string(),
));
diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php
index 145963837c..63dbe79666 100644
--- a/phpBB/includes/ucp/ucp_notifications.php
+++ b/phpBB/includes/ucp/ucp_notifications.php
@@ -27,7 +27,8 @@ class ucp_notifications
add_form_key('ucp_notification');
$start = $request->variable('start', 0);
- $form_time = min($request->variable('form_time', 0), time());
+ $form_time = $request->variable('form_time', 0);
+ $form_time = ($form_time <= 0 || $form_time > time()) ? time() : $form_time;
$phpbb_notifications = $phpbb_container->get('notification_manager');
@@ -78,9 +79,9 @@ class ucp_notifications
trigger_error($message);
}
- $this->output_notification_methods('notification_methods', $phpbb_notifications, $template, $user);
+ $this->output_notification_methods($phpbb_notifications, $template, $user, 'notification_methods');
- $this->output_notification_types($subscriptions, 'notification_types', $phpbb_notifications, $template, $user);
+ $this->output_notification_types($subscriptions, $phpbb_notifications, $template, $user, 'notification_types');
$this->tpl_name = 'ucp_notifications';
$this->page_title = 'UCP_NOTIFICATION_OPTIONS';
@@ -162,12 +163,13 @@ class ucp_notifications
/**
* Output all the notification types to the template
*
- * @param string $block
+ * @param array $subscriptions Array containing global subscriptions
* @param \phpbb\notification\manager $phpbb_notifications
* @param \phpbb\template\template $template
* @param \phpbb\user $user
+ * @param string $block
*/
- public function output_notification_types($subscriptions, $block = 'notification_types', \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user)
+ public function output_notification_types($subscriptions, \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user, $block = 'notification_types')
{
$notification_methods = $phpbb_notifications->get_subscription_methods();
@@ -209,12 +211,12 @@ class ucp_notifications
/**
* Output all the notification methods to the template
*
- * @param string $block
* @param \phpbb\notification\manager $phpbb_notifications
* @param \phpbb\template\template $template
* @param \phpbb\user $user
+ * @param string $block
*/
- public function output_notification_methods($block = 'notification_methods', \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user)
+ public function output_notification_methods(\phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user, $block = 'notification_methods')
{
$notification_methods = $phpbb_notifications->get_subscription_methods();
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index d4ce8e41ee..517ae0b08c 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -83,33 +83,6 @@ class ucp_pm
switch ($mode)
{
- // New private messages popup
- case 'popup':
-
- $l_new_message = '';
- if ($user->data['is_registered'])
- {
- if ($user->data['user_new_privmsg'])
- {
- $l_new_message = ($user->data['user_new_privmsg'] == 1) ? $user->lang['YOU_NEW_PM'] : $user->lang['YOU_NEW_PMS'];
- }
- else
- {
- $l_new_message = $user->lang['YOU_NO_NEW_PM'];
- }
- }
-
- $template->assign_vars(array(
- 'MESSAGE' => $l_new_message,
- 'S_NOT_LOGGED_IN' => ($user->data['user_id'] == ANONYMOUS) ? true : false,
- 'CLICK_TO_VIEW' => sprintf($user->lang['CLICK_VIEW_PRIVMSG'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox') . '" onclick="jump_to_inbox(this.href); return false;">', '</a>'),
- 'U_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
- 'UA_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox', false))
- );
-
- $tpl_file = 'ucp_pm_popup';
- break;
-
// Compose message
case 'compose':
$action = request_var('action', 'post');
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php
index 625da23736..9393e65f3c 100644
--- a/phpBB/includes/ucp/ucp_pm_viewfolder.php
+++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php
@@ -269,7 +269,7 @@ function view_folder($id, $mode, $folder_id, $folder)
// There is the chance that all recipients of the message got deleted. To avoid creating
// exports without recipients, we add a bogus "undisclosed recipient".
if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) &&
- !(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u'])))
+ !(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u'])))
{
$address[$message_id]['u'] = array();
$address[$message_id]['u']['to'] = array();
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 3f58ce20b4..2252b2ea17 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -567,7 +567,7 @@ class ucp_profile
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
// This is normalised data, without the user_ prefix
- $avatar_data = \phpbb\avatar\manager::clean_row($user->data);
+ $avatar_data = \phpbb\avatar\manager::clean_row($user->data, 'user');
if ($submit)
{
@@ -603,7 +603,7 @@ class ucp_profile
}
else
{
- if ($driver = $phpbb_avatar_manager->get_driver($user->data['user_avatar_type']))
+ if ($driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type']))
{
$driver->delete($avatar_data);
}
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
diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php
index 6bb3cdc145..090f9bf34c 100644
--- a/phpBB/includes/ucp/ucp_zebra.php
+++ b/phpBB/includes/ucp/ucp_zebra.php
@@ -64,7 +64,7 @@ class ucp_zebra
* @var array user_ids User ids we remove
* @since 3.1-A1
*/
- $vars = array('user_ids');
+ $vars = array('mode', 'user_ids');
extract($phpbb_dispatcher->trigger_event('core.ucp_remove_zebra', compact($vars)));
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '