phpBB

Code Changes

File: includes/acp/acp_prune.php

  Unmodified   Added   Modified   Removed
Line 25Line 25

function main($id, $mode)
{


function main($id, $mode)
{

		global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path;

		global $user, $phpEx, $phpbb_root_path;


$user->add_lang('acp/prune');


$user->add_lang('acp/prune');

		include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);






if (!function_exists('user_active_flip'))
{
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}


switch ($mode)
{


switch ($mode)
{

Line 51Line 55
	*/
function prune_forums($id, $mode)
{

	*/
function prune_forums($id, $mode)
{

		global $db, $user, $auth, $template, $cache;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;

		global $db, $user, $auth, $template, $phpbb_log, $request;






		$all_forums = request_var('all_forums', 0);
$forum_id = request_var('f', array(0));

		$all_forums = $request->variable('all_forums', 0);
$forum_id = $request->variable('f', array(0));

		$submit = (isset($_POST['submit'])) ? true : false;

if ($all_forums)

		$submit = (isset($_POST['submit'])) ? true : false;

if ($all_forums)

Line 77Line 80
		{
if (confirm_box(true))
{

		{
if (confirm_box(true))
{

				$prune_posted = request_var('prune_days', 0);
$prune_viewed = request_var('prune_vieweddays', 0);

				$prune_posted = $request->variable('prune_days', 0);
$prune_viewed = $request->variable('prune_vieweddays', 0);

				$prune_all = (!$prune_posted && !$prune_viewed) ? true : false;

$prune_flags = 0;

				$prune_all = (!$prune_posted && !$prune_viewed) ? true : false;

$prune_flags = 0;

				$prune_flags += (request_var('prune_old_polls', 0)) ? 2 : 0;
$prune_flags += (request_var('prune_announce', 0)) ? 4 : 0;
$prune_flags += (request_var('prune_sticky', 0)) ? 8 : 0;

				$prune_flags += ($request->variable('prune_old_polls', 0)) ? 2 : 0;
$prune_flags += ($request->variable('prune_announce', 0)) ? 4 : 0;
$prune_flags += ($request->variable('prune_sticky', 0)) ? 8 : 0;


// Convert days to seconds for timestamp functions...
$prunedate_posted = time() - ($prune_posted * 86400);


// Convert days to seconds for timestamp functions...
$prunedate_posted = time() - ($prune_posted * 86400);

Line 153Line 156

// Sync all pruned forums at once
sync('forum', 'forum_id', $prune_ids, true, true);


// Sync all pruned forums at once
sync('forum', 'forum_id', $prune_ids, true, true);

					add_log('admin', 'LOG_PRUNE', $log_data);



$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PRUNE', false, array($log_data));

				}
$db->sql_freeresult($result);


				}
$db->sql_freeresult($result);


Line 168Line 172
					'all_forums'	=> $all_forums,
'f' => $forum_id,


					'all_forums'	=> $all_forums,
'f' => $forum_id,


					'prune_days'		=> request_var('prune_days', 0),
'prune_vieweddays' => request_var('prune_vieweddays', 0),
'prune_old_polls' => request_var('prune_old_polls', 0),
'prune_announce' => request_var('prune_announce', 0),
'prune_sticky' => request_var('prune_sticky', 0),

					'prune_days'		=> $request->variable('prune_days', 0),
'prune_vieweddays' => $request->variable('prune_vieweddays', 0),
'prune_old_polls' => $request->variable('prune_old_polls', 0),
'prune_announce' => $request->variable('prune_announce', 0),
'prune_sticky' => $request->variable('prune_sticky', 0),

				)));
}
}

				)));
}
}

Line 228Line 232
	*/
function prune_users($id, $mode)
{

	*/
function prune_users($id, $mode)
{

		global $db, $user, $auth, $template, $cache;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;




		global $db, $user, $auth, $template, $phpbb_log, $request;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;

/** @var \phpbb\group\helper $group_helper */
$group_helper = $phpbb_container->get('group_helper');


$user->add_lang('memberlist');



$user->add_lang('memberlist');


Line 237Line 244

if ($prune)
{


if ($prune)
{

			$action = request_var('action', 'deactivate');
$deleteposts = request_var('deleteposts', 0);

			$action = $request->variable('action', 'deactivate');
$deleteposts = $request->variable('deleteposts', 0);


if (confirm_box(true))
{


if (confirm_box(true))
{

Line 268Line 275
						}
}


						}
}


					add_log('admin', $l_log, implode(', ', $usernames));

					$phpbb_log->add('admin', $user->data['user_id'], $user->ip, $l_log, false, array(implode(', ', $usernames)));

					$msg = $user->lang['USER_' . strtoupper($action) . '_SUCCESS'];
}
else

					$msg = $user->lang['USER_' . strtoupper($action) . '_SUCCESS'];
}
else

Line 310Line 317
					'mode'			=> $mode,
'prune' => 1,


					'mode'			=> $mode,
'prune' => 1,


					'deleteposts'	=> request_var('deleteposts', 0),
'action' => request_var('action', ''),

					'deleteposts'	=> $request->variable('deleteposts', 0),
'action' => $request->variable('action', ''),

				)), 'confirm_body_prune.html');
}
}

				)), 'confirm_body_prune.html');
}
}

Line 341Line 348
		$s_group_list = '';
while ($row = $db->sql_fetchrow($result))
{

		$s_group_list = '';
while ($row = $db->sql_fetchrow($result))
{

			$s_group_list .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';

			$s_group_list .= '<option value="' . $row['group_id'] . '">' . $group_helper->get_name($row['group_name']) . '</option>';

		}
$db->sql_freeresult($result);


		}
$db->sql_freeresult($result);


Line 368Line 375
	{
global $user, $db, $request;


	{
global $user, $db, $request;


		$users_by_name = request_var('users', '', true);
$users_by_id = request_var('user_ids', array(0));
$group_id = request_var('group_id', 0);

		$users_by_name = $request->variable('users', '', true);
$users_by_id = $request->variable('user_ids', array(0));
$group_id = $request->variable('group_id', 0);

		$posts_on_queue = (trim($request->variable('posts_on_queue', '')) === '') ? false : $request->variable('posts_on_queue', 0);

if ($users_by_name)

		$posts_on_queue = (trim($request->variable('posts_on_queue', '')) === '') ? false : $request->variable('posts_on_queue', 0);

if ($users_by_name)

Line 387Line 394
		}
else
{

		}
else
{

			$username = request_var('username', '', true);
$email = request_var('email', '');

			$username = $request->variable('username', '', true);
$email = $request->variable('email', '');





			$active_select = request_var('active_select', 'lt');
$count_select = request_var('count_select', 'eq');
$queue_select = request_var('queue_select', 'gt');
$joined_before = request_var('joined_before', '');
$joined_after = request_var('joined_after', '');
$active = request_var('active', '');

			$active_select = $request->variable('active_select', 'lt');
$count_select = $request->variable('count_select', 'eq');
$queue_select = $request->variable('queue_select', 'gt');
$joined_before = $request->variable('joined_before', '');
$joined_after = $request->variable('joined_after', '');
$active = $request->variable('active', '');


$count = ($request->variable('count', '') === '') ? false : $request->variable('count', 0);



$count = ($request->variable('count', '') === '') ? false : $request->variable('count', 0);


Line 433Line 440
			}

$key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');

			}

$key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');

			$sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit');

 

$where_sql = '';
$where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : '';


$where_sql = '';
$where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : '';