mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge branch 'develop' of github.com:phpbb/phpbb3 into ticket/11832
# By Nathan Guse (22) and others # Via Nathan Guse (10) and others * 'develop' of github.com:phpbb/phpbb3: (39 commits) [ticket/11843] Added newlines and included numbers in the DEFINE vars test [ticket/11843] Add checking DEFINE variables with underscores to template_test [ticket/11843] The twig lexer fixes DEFINE variables with underscores again [ticket/11727] Fix indentation [ticket/11727] Fix indentation [ticket/11745] Correct language, coding guidelines [ticket/11828] Fix greedy operators in lexer [ticket/11833] Prevent Twig errors from invalid template loops using BEGINELSE [ticket/11833] Fix bad template loop [ticket/11816] !$DOESNT_EXIST test [ticket/9550] Add the core.viewtopic_post_rowset_data event to viewtopic.php [ticket/11829] Use report_closed to determine status in MCP report_details [ticket/11816] Test !$DEFINITION [ticket/11822] Use namespace lookup order for asset loading [ticket/11727] Template loader support for safe directories to load files from [ticket/11816] Fix define/loop checks in IF statements containing parenthesis [ticket/11373] Use inheritdoc [ticket/11637] generate_text_for_display on search.php [ticket/11744] Cast to int [ticket/11744] Inheritdoc ...
This commit is contained in:
@@ -328,6 +328,7 @@ class acp_board
|
||||
'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int:60:9999999999', 'type' => 'number:60:9999999999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
|
||||
'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
|
||||
'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
|
||||
'read_notification_expire_days' => array('lang' => 'READ_NOTIFICATION_EXPIRE_DAYS', 'validate' => 'int:0', 'type' => 'number:0', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
|
||||
|
||||
'legend2' => 'GENERAL_OPTIONS',
|
||||
'load_notifications' => array('lang' => 'LOAD_NOTIFICATIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
@@ -2534,7 +2534,7 @@ function group_delete($group_id, $group_name = false)
|
||||
*/
|
||||
function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0, $pending = 0, $group_attributes = false)
|
||||
{
|
||||
global $db, $auth;
|
||||
global $db, $auth, $phpbb_container;
|
||||
|
||||
// We need both username and user_id info
|
||||
$result = user_get_id_name($user_id_ary, $username_ary);
|
||||
@@ -2622,6 +2622,20 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
|
||||
|
||||
group_update_listings($group_id);
|
||||
|
||||
if ($pending)
|
||||
{
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
foreach ($add_id_ary as $user_id)
|
||||
{
|
||||
$phpbb_notifications->add_notifications('group_request', array(
|
||||
'group_id' => $group_id,
|
||||
'user_id' => $user_id,
|
||||
'group_name' => $group_name,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// Return false - no error
|
||||
return false;
|
||||
}
|
||||
@@ -2635,7 +2649,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
|
||||
*/
|
||||
function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false)
|
||||
{
|
||||
global $db, $auth, $config, $phpbb_dispatcher;
|
||||
global $db, $auth, $config, $phpbb_dispatcher, $phpbb_container;
|
||||
|
||||
if ($config['coppa_enable'])
|
||||
{
|
||||
@@ -2769,6 +2783,10 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
|
||||
|
||||
group_update_listings($group_id);
|
||||
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
$phpbb_notifications->delete_notifications('group_request', $user_id_ary, $group_id);
|
||||
|
||||
// Return false - no error
|
||||
return false;
|
||||
}
|
||||
@@ -2858,7 +2876,7 @@ function remove_default_rank($group_id, $user_ids)
|
||||
*/
|
||||
function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false)
|
||||
{
|
||||
global $db, $auth, $phpbb_root_path, $phpEx, $config;
|
||||
global $db, $auth, $phpbb_root_path, $phpEx, $config, $phpbb_container;
|
||||
|
||||
// We need both username and user_id info
|
||||
$result = user_get_id_name($user_id_ary, $username_ary);
|
||||
@@ -2911,11 +2929,10 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
||||
AND ' . $db->sql_in_set('ug.user_id', $user_id_ary);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$user_id_ary = $email_users = array();
|
||||
$user_id_ary = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$user_id_ary[] = $row['user_id'];
|
||||
$email_users[] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
@@ -2930,26 +2947,14 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
||||
AND " . $db->sql_in_set('user_id', $user_id_ary);
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Send approved email to users...
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
$messenger = new messenger();
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
foreach ($email_users as $row)
|
||||
{
|
||||
$messenger->template('group_approved', $row['user_lang']);
|
||||
|
||||
$messenger->set_addresses($row);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($row['username']),
|
||||
'GROUP_NAME' => htmlspecialchars_decode($group_name),
|
||||
'U_GROUP' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=membership")
|
||||
);
|
||||
|
||||
$messenger->send($row['user_notify_type']);
|
||||
}
|
||||
|
||||
$messenger->save_queue();
|
||||
$phpbb_notifications->add_notifications('group_request_approved', array(
|
||||
'user_ids' => $user_id_ary,
|
||||
'group_id' => $group_id,
|
||||
'group_name' => $group_name,
|
||||
));
|
||||
$phpbb_notifications->delete_notifications('group_request', $user_id_ary, $group_id);
|
||||
|
||||
$log = 'LOG_USERS_APPROVED';
|
||||
break;
|
||||
|
@@ -161,6 +161,7 @@ class mcp_pm_reports
|
||||
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $report_id),
|
||||
'S_CAN_VIEWIP' => $auth->acl_getf_global('m_info'),
|
||||
'S_POST_REPORTED' => $pm_info['message_reported'],
|
||||
'S_REPORT_CLOSED' => $report['report_closed'],
|
||||
'S_USER_NOTES' => true,
|
||||
|
||||
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $report_id),
|
||||
|
@@ -189,6 +189,7 @@ class mcp_reports
|
||||
'S_POST_REPORTED' => $post_info['post_reported'],
|
||||
'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED),
|
||||
'S_POST_LOCKED' => $post_info['post_edit_locked'],
|
||||
'S_REPORT_CLOSED' => $report['report_closed'],
|
||||
'S_USER_NOTES' => true,
|
||||
|
||||
'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '',
|
||||
|
@@ -197,37 +197,6 @@ class ucp_groups
|
||||
else
|
||||
{
|
||||
group_user_add($group_id, $user->data['user_id'], false, false, false, 0, 1);
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
$messenger = new messenger();
|
||||
|
||||
$sql = 'SELECT u.username, u.username_clean, u.user_email, u.user_notify_type, u.user_jabber, u.user_lang
|
||||
FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . " u
|
||||
WHERE ug.user_id = u.user_id
|
||||
AND ug.group_leader = 1
|
||||
AND ug.group_id = $group_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$messenger->template('group_request', $row['user_lang']);
|
||||
|
||||
$messenger->set_addresses($row);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($row['username']),
|
||||
'GROUP_NAME' => htmlspecialchars_decode($group_row[$group_id]['group_name']),
|
||||
'REQUEST_USERNAME' => $user->data['username'],
|
||||
|
||||
'U_PENDING' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=manage&action=list&g=$group_id",
|
||||
'U_GROUP' => generate_board_url() . "/memberlist.$phpEx?mode=group&g=$group_id")
|
||||
);
|
||||
|
||||
$messenger->send($row['user_notify_type']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$messenger->save_queue();
|
||||
}
|
||||
|
||||
add_log('user', $user->data['user_id'], 'LOG_USER_GROUP_JOIN' . (($group_row[$group_id]['group_type'] == GROUP_FREE) ? '' : '_PENDING'), $group_row[$group_id]['group_name']);
|
||||
|
Reference in New Issue
Block a user