mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-13 12:14:06 +02:00
Merge branch 'develop' into feature/prune-users
* develop: (170 commits) [ticket/10145] Always recompile all templates when DEBUG_EXTRA is defined. [feature/attachment-management-no-reassignment] Handle privacy and some more. [ticket/10148] Turn TEMPLATE_BITFIELD into an instance variable. [ticket/10147] Corrected a typo in includes/functions_template.php. [ticket/10141] Save a hash lookup when value is not in cache. [ticket/10143] Added tests for storing a previously deleted value in db cache. [ticket/10105] Update AIM express link. [ticket/10105] Update AIM application download link. [ticket/10137] Remove unintended space at end of PHP_URL_FOPEN_SUPPORT_EXPLAIN. [ticket/10141] Split double-assignment into conditional and unconditional part. [ticket/10141] Use a cache in $auth->_fill_acl() for better performance. [ticket/9961] Create log entries when users are activated. [ticket/10139] Make signatures of set_atomic() consistent by using $new_value. [ticket/10139] Rename $cache to $use_cache to avoid confusion with cache object [ticket/10006] Remove unneeded if statements [ticket/10006] Remove return values [ticket/10006] More testing [ticket/10006] Tweak the tests a bit [ticket/10006] Add phpbb_config::delete [ticket/7941] Added @return to generate_board_url docstring. ...
This commit is contained in:
@@ -61,6 +61,10 @@ class acp_attachments
|
||||
$l_title = 'ACP_ORPHAN_ATTACHMENTS';
|
||||
break;
|
||||
|
||||
case 'manage':
|
||||
$l_title = 'ACP_MANAGE_ATTACHMENTS';
|
||||
break;
|
||||
|
||||
default:
|
||||
trigger_error('NO_MODE', E_USER_ERROR);
|
||||
break;
|
||||
@@ -1043,6 +1047,230 @@ class acp_attachments
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
break;
|
||||
|
||||
case 'manage':
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
$delete_files = (isset($_POST['delete'])) ? array_keys(request_var('delete', array('' => 0))) : array();
|
||||
|
||||
if (sizeof($delete_files))
|
||||
{
|
||||
// Select those attachments we want to delete...
|
||||
$sql = 'SELECT real_filename
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('attach_id', $delete_files) . '
|
||||
AND is_orphan = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$deleted_filenames[] = $row['real_filename'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($num_deleted = delete_attachments('attach', $delete_files))
|
||||
{
|
||||
if (sizeof($delete_files) != $num_deleted)
|
||||
{
|
||||
$error[] = $user->lang['FILES_GONE'];
|
||||
}
|
||||
add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $deleted_filenames));
|
||||
$notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode(', ', $deleted_filenames));
|
||||
}
|
||||
else
|
||||
{
|
||||
$error[] = $user->lang['NO_FILES_TO_DELETE'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_MANAGE' => true)
|
||||
);
|
||||
|
||||
$start = request_var('start', 0);
|
||||
|
||||
// Sort keys
|
||||
$sort_days = request_var('st', 0);
|
||||
$sort_key = request_var('sk', 't');
|
||||
$sort_dir = request_var('sd', 'd');
|
||||
|
||||
// Sorting
|
||||
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
|
||||
$sort_by_text = array('f' => $user->lang['FILENAME'], 't' => $user->lang['FILEDATE'], 's' => $user->lang['FILESIZE'], 'x' => $user->lang['EXTENSION'], 'd' => $user->lang['DOWNLOADS'],'p' => $user->lang['ATTACH_POST_TYPE'], 'u' => $user->lang['AUTHOR']);
|
||||
$sort_by_sql = array('f' => 'a.real_filename', 't' => 'a.filetime', 's' => 'a.filesize', 'x' => 'a.extension', 'd' => 'a.download_count', 'p' => 'a.in_message', 'u' => 'u.username');
|
||||
|
||||
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
|
||||
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
|
||||
|
||||
$min_filetime = ($sort_days) ? (time() - ($sort_days * 86400)) : '';
|
||||
$limit_filetime = ($min_filetime) ? " AND a.filetime >= $min_filetime " : '';
|
||||
$start = ($sort_days && isset($_POST['sort'])) ? 0 : $start;
|
||||
|
||||
$attachments_per_page = (int) $config['topics_per_page'];
|
||||
|
||||
// Handle files stats resync
|
||||
$action = request_var('action', '');
|
||||
$resync_files_stats = false;
|
||||
if ($action && $action = 'stats')
|
||||
{
|
||||
if (!confirm_box(true))
|
||||
{
|
||||
confirm_box(false, $user->lang['RESYNC_FILES_STATS_CONFIRM'], build_hidden_fields(array(
|
||||
'i' => $id,
|
||||
'mode' => $mode,
|
||||
'action' => $action,
|
||||
)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$resync_files_stats = true;
|
||||
add_log('admin', 'LOG_RESYNC_FILES_STATS');
|
||||
}
|
||||
}
|
||||
|
||||
// Check if files stats are accurate
|
||||
$sql = 'SELECT COUNT(attach_id) as num_files
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE is_orphan = 0';
|
||||
$result = $db->sql_query($sql, 600);
|
||||
$num_files_real = (int) $db->sql_fetchfield('num_files');
|
||||
if ($resync_files_stats === true)
|
||||
{
|
||||
set_config('num_files', $num_files_real, true);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT SUM(filesize) as upload_dir_size
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE is_orphan = 0';
|
||||
$result = $db->sql_query($sql, 600);
|
||||
$total_size_real = (float) $db->sql_fetchfield('upload_dir_size');
|
||||
if ($resync_files_stats === true)
|
||||
{
|
||||
set_config('upload_dir_size', $total_size_real, true);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Get current files stats
|
||||
$num_files = (int) $config['num_files'];
|
||||
$total_size = (float) $config['upload_dir_size'];
|
||||
|
||||
// Issue warning message if files stats are inaccurate
|
||||
if (($num_files != $num_files_real) || ($total_size != $total_size_real))
|
||||
{
|
||||
$error[] = sprintf($user->lang['FILES_STATS_WRONG'], $num_files_real, get_formatted_filesize($total_size_real));
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
|
||||
'U_ACTION' => $this->u_action,)
|
||||
);
|
||||
}
|
||||
|
||||
// Make sure $start is set to the last page if it exceeds the amount
|
||||
if ($start < 0 || $start > $num_files)
|
||||
{
|
||||
$start = ($start < 0) ? 0 : floor(($num_files - 1) / $attachments_per_page) * $attachments_per_page;
|
||||
}
|
||||
|
||||
// If the user is trying to reach the second half of the attachments list, fetch it starting from the end
|
||||
$store_reverse = false;
|
||||
$sql_limit = $attachments_per_page;
|
||||
|
||||
if ($start > $num_files / 2)
|
||||
{
|
||||
$store_reverse = true;
|
||||
|
||||
if ($start + $attachments_per_page > $num_files)
|
||||
{
|
||||
$sql_limit = min($attachments_per_page, max(1, $num_files - $start));
|
||||
}
|
||||
|
||||
// Select the sort order. Add time sort anchor for non-time sorting cases
|
||||
$sql_sort_anchor = ($sort_key != 't') ? ', a.filetime ' . (($sort_dir == 'd') ? 'ASC' : 'DESC') : '';
|
||||
$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC') . $sql_sort_anchor;
|
||||
$sql_start = max(0, $num_files - $sql_limit - $start);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Select the sort order. Add time sort anchor for non-time sorting cases
|
||||
$sql_sort_anchor = ($sort_key != 't') ? ', a.filetime ' . (($sort_dir == 'd') ? 'DESC' : 'ASC') : '';
|
||||
$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC') . $sql_sort_anchor;
|
||||
$sql_start = $start;
|
||||
|
||||
}
|
||||
|
||||
$attachments_list = array();
|
||||
|
||||
// Just get the files
|
||||
$sql = 'SELECT a.*, u.username, u.user_colour, t.topic_title
|
||||
FROM ' . ATTACHMENTS_TABLE . ' a
|
||||
LEFT JOIN ' . USERS_TABLE . ' u ON (u.user_id = a.poster_id)
|
||||
LEFT JOIN ' . TOPICS_TABLE . " t ON (a.topic_id = t.topic_id)
|
||||
WHERE a.is_orphan = 0
|
||||
$limit_filetime
|
||||
ORDER BY $sql_sort_order";
|
||||
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
|
||||
|
||||
$i = ($store_reverse) ? $sql_limit - 1 : 0;
|
||||
|
||||
// Store increment value in a variable to save some conditional calls
|
||||
$i_increment = ($store_reverse) ? -1 : 1;
|
||||
while ($attachment_row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$attachments_list[$i] = $attachment_row;
|
||||
$i = $i + $i_increment;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'TOTAL_FILES' => $num_files,
|
||||
'TOTAL_SIZE' => get_formatted_filesize($total_size),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $num_files, $attachments_per_page, $start, true),
|
||||
|
||||
'S_ON_PAGE' => on_page($num_files, $attachments_per_page, $start),
|
||||
'S_LIMIT_DAYS' => $s_limit_days,
|
||||
'S_SORT_KEY' => $s_sort_key,
|
||||
'S_SORT_DIR' => $s_sort_dir)
|
||||
);
|
||||
|
||||
// Grab extensions
|
||||
$extensions = $cache->obtain_attach_extensions(true);
|
||||
|
||||
for ($i = 0, $end = sizeof($attachments_list); $i < $end; ++$i)
|
||||
{
|
||||
$row = $attachments_list[$i];
|
||||
|
||||
$row['extension'] = strtolower(trim((string) $row['extension']));
|
||||
$comment = ($row['attach_comment'] && !$row['in_message']) ? str_replace(array("\n", "\r"), array('<br />', "\n"), $row['attach_comment']) : '';
|
||||
$display_cat = $extensions[$row['extension']]['display_cat'];
|
||||
$l_downloaded_viewed = ($display_cat == ATTACHMENT_CATEGORY_NONE) ? 'DOWNLOAD_COUNT' : 'VIEWED_COUNT';
|
||||
$l_download_count = (!isset($row['download_count']) || (int) $row['download_count'] == 0) ? $user->lang[$l_downloaded_viewed . '_NONE'] : (((int) $row['download_count'] == 1) ? sprintf($user->lang[$l_downloaded_viewed], $row['download_count']) : sprintf($user->lang[$l_downloaded_viewed . 'S'], $row['download_count']));
|
||||
|
||||
$template->assign_block_vars('attachments', array(
|
||||
'ATTACHMENT_POSTER' => get_username_string('full', (int) $row['poster_id'], (string) $row['username'], (string) $row['user_colour'], (string) $row['username']),
|
||||
'FILESIZE' => get_formatted_filesize((int) $row['filesize']),
|
||||
'FILETIME' => $user->format_date((int) $row['filetime']),
|
||||
'REAL_FILENAME' => (!$row['in_message']) ? utf8_wordwrap(utf8_basename((string) $row['real_filename']), 40, '<br />', true) : '',
|
||||
'PHYSICAL_FILENAME' => utf8_basename((string) $row['physical_filename']),
|
||||
'EXT_GROUP_NAME' => (!empty($extensions[$row['extension']]['group_name'])) ? $user->lang['EXT_GROUP_' . $extensions[$row['extension']]['group_name']] : '',
|
||||
'COMMENT' => $comment,
|
||||
'TOPIC_TITLE' => (!$row['in_message']) ? (string) $row['topic_title'] : '',
|
||||
'ATTACH_ID' => (int) $row['attach_id'],
|
||||
'POST_ID' => (int) $row['post_msg_id'],
|
||||
'TOPIC_ID' => (int) $row['topic_id'],
|
||||
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? (int) $post_ids[$row['attach_id']] : '',
|
||||
|
||||
'L_DOWNLOAD_COUNT' => $l_download_count,
|
||||
|
||||
'S_IN_MESSAGE' => (bool) $row['in_message'],
|
||||
|
||||
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&p={$row['post_msg_id']}") . "#p{$row['post_msg_id']}",
|
||||
'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&id=' . $row['attach_id']))
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (sizeof($error))
|
||||
|
@@ -110,10 +110,10 @@ class acp_board
|
||||
'vars' => array(
|
||||
'legend1' => 'ACP_AVATAR_SETTINGS',
|
||||
|
||||
'avatar_min_width' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
'avatar_min_height' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
'avatar_max_width' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
'avatar_max_height' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
'avatar_min_width' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
|
||||
'avatar_min_height' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
|
||||
'avatar_max_width' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
|
||||
'avatar_max_height' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
|
||||
|
||||
'allow_avatar' => array('lang' => 'ALLOW_AVATARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
@@ -124,7 +124,7 @@ class acp_board
|
||||
'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
|
||||
'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
|
||||
'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rwpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true)
|
||||
'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
)
|
||||
);
|
||||
break;
|
||||
@@ -296,7 +296,7 @@ class acp_board
|
||||
'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'validate' => 'string', 'type' => 'text::255', 'explain' => false),
|
||||
'cookie_name' => array('lang' => 'COOKIE_NAME', 'validate' => 'string', 'type' => 'text::16', 'explain' => false),
|
||||
'cookie_path' => array('lang' => 'COOKIE_PATH', 'validate' => 'string', 'type' => 'text::255', 'explain' => false),
|
||||
'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:disabled_enabled', 'explain' => true)
|
||||
'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:disabled_enabled', 'explain' => true),
|
||||
)
|
||||
);
|
||||
break;
|
||||
@@ -340,7 +340,7 @@ class acp_board
|
||||
'title' => 'ACP_AUTH_SETTINGS',
|
||||
'vars' => array(
|
||||
'legend1' => 'ACP_AUTH_SETTINGS',
|
||||
'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false)
|
||||
'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false),
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
@@ -56,6 +56,18 @@ class acp_disallow
|
||||
trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$sql = 'SELECT disallow_id
|
||||
FROM ' . DISALLOW_TABLE . "
|
||||
WHERE disallow_username = '" . $db->sql_escape($disallowed_user) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($row)
|
||||
{
|
||||
trigger_error($user->lang['DISALLOWED_ALREADY'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user));
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
@@ -82,23 +82,48 @@ class acp_email
|
||||
{
|
||||
if ($group_id)
|
||||
{
|
||||
$sql = 'SELECT u.user_email, u.username, u.username_clean, u.user_lang, u.user_jabber, u.user_notify_type
|
||||
FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug
|
||||
WHERE ug.group_id = ' . $group_id . '
|
||||
$sql_ary = array(
|
||||
'SELECT' => 'u.user_email, u.username, u.username_clean, u.user_lang, u.user_jabber, u.user_notify_type',
|
||||
'FROM' => array(
|
||||
USERS_TABLE => 'u',
|
||||
USER_GROUP_TABLE => 'ug',
|
||||
),
|
||||
'WHERE' => 'ug.group_id = ' . $group_id . '
|
||||
AND ug.user_pending = 0
|
||||
AND u.user_id = ug.user_id
|
||||
AND u.user_allow_massemail = 1
|
||||
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
|
||||
ORDER BY u.user_lang, u.user_notify_type';
|
||||
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')',
|
||||
'ORDER_BY' => 'u.user_lang, u.user_notify_type',
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT username, username_clean, user_email, user_jabber, user_notify_type, user_lang
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_allow_massemail = 1
|
||||
AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
|
||||
ORDER BY user_lang, user_notify_type';
|
||||
$sql_ary = array(
|
||||
'SELECT' => 'u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type',
|
||||
'FROM' => array(
|
||||
USERS_TABLE => 'u',
|
||||
),
|
||||
'WHERE' => 'u.user_allow_massemail = 1
|
||||
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')',
|
||||
'ORDER_BY' => 'u.user_lang, u.user_notify_type',
|
||||
);
|
||||
}
|
||||
|
||||
// Mail banned or not
|
||||
if (!isset($_REQUEST['mail_banned_flag']))
|
||||
{
|
||||
$sql_ary['WHERE'] .= ' AND (b.ban_id IS NULL
|
||||
OR b.ban_exclude = 1)';
|
||||
$sql_ary['LEFT_JOIN'] = array(
|
||||
array(
|
||||
'FROM' => array(
|
||||
BANLIST_TABLE => 'b',
|
||||
),
|
||||
'ON' => 'u.user_id = b.ban_userid',
|
||||
),
|
||||
);
|
||||
}
|
||||
$sql = $db->sql_build_query('SELECT', $sql_ary);
|
||||
}
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
@@ -35,6 +35,12 @@ class acp_groups
|
||||
$form_key = 'acp_groups';
|
||||
add_form_key($form_key);
|
||||
|
||||
if ($mode == 'position')
|
||||
{
|
||||
$this->manage_position();
|
||||
return;
|
||||
}
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
|
||||
// Check and set some common vars
|
||||
@@ -306,6 +312,7 @@ class acp_groups
|
||||
'rank' => request_var('group_rank', 0),
|
||||
'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
|
||||
'legend' => isset($_REQUEST['group_legend']) ? 1 : 0,
|
||||
'teampage' => isset($_REQUEST['group_teampage']) ? 1 : 0,
|
||||
'message_limit' => request_var('group_message_limit', 0),
|
||||
'max_recipients' => request_var('group_max_recipients', 0),
|
||||
'founder_manage' => 0,
|
||||
@@ -419,6 +426,7 @@ class acp_groups
|
||||
'avatar_height' => 'int',
|
||||
'receive_pm' => 'int',
|
||||
'legend' => 'int',
|
||||
'teampage' => 'int',
|
||||
'message_limit' => 'int',
|
||||
'max_recipients'=> 'int',
|
||||
'founder_manage'=> 'int',
|
||||
@@ -584,6 +592,7 @@ class acp_groups
|
||||
'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '',
|
||||
'GROUP_FOUNDER_MANAGE' => (isset($group_row['group_founder_manage']) && $group_row['group_founder_manage']) ? ' checked="checked"' : '',
|
||||
'GROUP_LEGEND' => (isset($group_row['group_legend']) && $group_row['group_legend']) ? ' checked="checked"' : '',
|
||||
'GROUP_TEAMPAGE' => (isset($group_row['group_teampage']) && $group_row['group_teampage']) ? ' checked="checked"' : '',
|
||||
'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
|
||||
'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
|
||||
'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
|
||||
@@ -793,4 +802,122 @@ class acp_groups
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function manage_position()
|
||||
{
|
||||
global $config, $db, $template, $user;
|
||||
|
||||
$this->tpl_name = 'acp_groups_position';
|
||||
$this->page_title = 'ACP_GROUPS_POSITION';
|
||||
|
||||
$field = request_var('field', '');
|
||||
$action = request_var('action', '');
|
||||
$group_id = request_var('g', 0);
|
||||
|
||||
if ($field && !in_array($field, array('legend', 'teampage')))
|
||||
{
|
||||
// Invalid mode
|
||||
trigger_error($user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
else if ($field)
|
||||
{
|
||||
$group_position = new phpbb_group_positions($db, $field, $this->u_action);
|
||||
}
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
case 'set_config_legend':
|
||||
set_config('legend_sort_groupname', request_var('legend_sort_groupname', 0));
|
||||
break;
|
||||
|
||||
case 'set_config_teampage':
|
||||
set_config('teampage_forums', request_var('teampage_forums', 0));
|
||||
set_config('teampage_multiple', request_var('teampage_multiple', 0));
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
$group_position->add_group($group_id);
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$group_position->delete_group($group_id);
|
||||
break;
|
||||
|
||||
case 'move_up':
|
||||
$group_position->move_up($group_id);
|
||||
break;
|
||||
|
||||
case 'move_down':
|
||||
$group_position->move_down($group_id);
|
||||
break;
|
||||
}
|
||||
|
||||
$sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
ORDER BY group_legend, group_name ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$s_group_select_legend = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
|
||||
if ($row['group_legend'])
|
||||
{
|
||||
$template->assign_block_vars('legend', array(
|
||||
'GROUP_NAME' => $group_name,
|
||||
'GROUP_COLOUR' => ($row['group_colour']) ? ' style="color: #' . $row['group_colour'] . '"' : '',
|
||||
'GROUP_TYPE' => $user->lang[phpbb_group_positions::group_type_language($row['group_type'])],
|
||||
|
||||
'U_MOVE_DOWN' => "{$this->u_action}&field=legend&action=move_down&g=" . $row['group_id'],
|
||||
'U_MOVE_UP' => "{$this->u_action}&field=legend&action=move_up&g=" . $row['group_id'],
|
||||
'U_DELETE' => "{$this->u_action}&field=legend&action=delete&g=" . $row['group_id'],
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_group_select_legend .= '<option value="' . (int) $row['group_id'] . '">' . $group_name . '</option>';
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT group_id, group_name, group_colour, group_type, group_teampage
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
ORDER BY group_teampage, group_name ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$s_group_select_teampage = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
|
||||
if ($row['group_teampage'])
|
||||
{
|
||||
$template->assign_block_vars('teampage', array(
|
||||
'GROUP_NAME' => $group_name,
|
||||
'GROUP_COLOUR' => ($row['group_colour']) ? ' style="color: #' . $row['group_colour'] . '"' : '',
|
||||
'GROUP_TYPE' => $user->lang[phpbb_group_positions::group_type_language($row['group_type'])],
|
||||
|
||||
'U_MOVE_DOWN' => "{$this->u_action}&field=teampage&action=move_down&g=" . $row['group_id'],
|
||||
'U_MOVE_UP' => "{$this->u_action}&field=teampage&action=move_up&g=" . $row['group_id'],
|
||||
'U_DELETE' => "{$this->u_action}&field=teampage&action=delete&g=" . $row['group_id'],
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_group_select_teampage .= '<option value="' . (int) $row['group_id'] . '">' . $group_name . '</option>';
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_ACTION' => $this->u_action,
|
||||
'U_ACTION_LEGEND' => $this->u_action . '&field=legend',
|
||||
'U_ACTION_TEAMPAGE' => $this->u_action . '&field=teampage',
|
||||
|
||||
'S_GROUP_SELECT_LEGEND' => $s_group_select_legend,
|
||||
'S_GROUP_SELECT_TEAMPAGE' => $s_group_select_teampage,
|
||||
'DISPLAY_FORUMS' => ($config['teampage_forums']) ? true : false,
|
||||
'DISPLAY_MULTIPLE' => ($config['teampage_multiple']) ? true : false,
|
||||
'LEGEND_SORT_GROUPNAME' => ($config['legend_sort_groupname']) ? true : false,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@@ -395,6 +395,10 @@ class acp_icons
|
||||
{
|
||||
// skip images where add wasn't checked
|
||||
}
|
||||
else if (!file_exists($phpbb_root_path . $img_path . '/' . $image))
|
||||
{
|
||||
$errors[$image] = 'SMILIE_NO_FILE';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($image_width[$image] == 0 || $image_height[$image] == 0)
|
||||
|
@@ -384,17 +384,30 @@ class acp_search
|
||||
AND post_id <= ' . (int) ($post_counter + $this->batch_size);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
$buffer = $db->sql_buffer_nested_transactions();
|
||||
|
||||
if ($buffer)
|
||||
{
|
||||
// Indexing enabled for this forum or global announcement?
|
||||
// Global announcements get indexed by default.
|
||||
if (!$row['forum_id'] || (isset($forums[$row['forum_id']]) && $forums[$row['forum_id']]))
|
||||
$rows = $db->sql_fetchrowset($result);
|
||||
$rows[] = false; // indicate end of array for while loop below
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
while ($row = ($buffer ? $rows[$i++] : $db->sql_fetchrow($result)))
|
||||
{
|
||||
// Indexing enabled for this forum
|
||||
if (isset($forums[$row['forum_id']]) && $forums[$row['forum_id']])
|
||||
{
|
||||
$this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']);
|
||||
}
|
||||
$row_count++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
if (!$buffer)
|
||||
{
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$post_counter += $this->batch_size;
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ class acp_styles
|
||||
$bitfield->set(9);
|
||||
$bitfield->set(11);
|
||||
$bitfield->set(12);
|
||||
define('TEMPLATE_BITFIELD', $bitfield->get_base64());
|
||||
$this->template_bitfield = $bitfield->get_base64();
|
||||
unset($bitfield);
|
||||
|
||||
$user->add_lang('acp/styles');
|
||||
@@ -716,7 +716,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||
$save_changes = (isset($_POST['save'])) ? true : false;
|
||||
|
||||
// make sure template_file path doesn't go upwards
|
||||
$template_file = str_replace('..', '.', $template_file);
|
||||
$template_file = preg_replace('#\.{2,}#', '.', $template_file);
|
||||
|
||||
// Retrieve some information about the template
|
||||
$sql = 'SELECT template_storedb, template_path, template_name
|
||||
@@ -3496,7 +3496,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql_ary['bbcode_bitfield'] = TEMPLATE_BITFIELD;
|
||||
$sql_ary['bbcode_bitfield'] = $this->template_bitfield;
|
||||
}
|
||||
|
||||
// We set a pre-defined bitfield here which we may use further in 3.2
|
||||
|
@@ -23,7 +23,8 @@ class acp_attachments_info
|
||||
'attach' => array('title' => 'ACP_ATTACHMENT_SETTINGS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_ATTACHMENTS')),
|
||||
'extensions' => array('title' => 'ACP_MANAGE_EXTENSIONS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')),
|
||||
'ext_groups' => array('title' => 'ACP_EXTENSION_GROUPS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')),
|
||||
'orphan' => array('title' => 'ACP_ORPHAN_ATTACHMENTS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS'))
|
||||
'orphan' => array('title' => 'ACP_ORPHAN_ATTACHMENTS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')),
|
||||
'manage' => array('title' => 'ACP_MANAGE_ATTACHMENTS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ class acp_groups_info
|
||||
'version' => '1.0.0',
|
||||
'modes' => array(
|
||||
'manage' => array('title' => 'ACP_GROUPS_MANAGE', 'auth' => 'acl_a_group', 'cat' => array('ACP_GROUPS')),
|
||||
'position' => array('title' => 'ACP_GROUPS_POSITION', 'auth' => 'acl_a_group', 'cat' => array('ACP_GROUPS')),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user