aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/modules/mcp/mcp_notes.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-10-04 18:13:59 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-10-04 18:13:59 +0000
commitbf8ac19eaa8d74f9dfd6d597190f5664e7339382 (patch)
treec3ad876736748e36cb9176a0248cc43badfc1d9a /phpBB/modules/mcp/mcp_notes.php
parent3215bbf88864139dc8c7e9ac5773b1ea8a7e96c1 (diff)
downloadforums-bf8ac19eaa8d74f9dfd6d597190f5664e7339382.tar
forums-bf8ac19eaa8d74f9dfd6d597190f5664e7339382.tar.gz
forums-bf8ac19eaa8d74f9dfd6d597190f5664e7339382.tar.bz2
forums-bf8ac19eaa8d74f9dfd6d597190f5664e7339382.tar.xz
forums-bf8ac19eaa8d74f9dfd6d597190f5664e7339382.zip
Move trunk/phpBB to old_trunk/phpBB
git-svn-id: file:///svn/phpbb/trunk@10210 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/modules/mcp/mcp_notes.php')
-rw-r--r--phpBB/modules/mcp/mcp_notes.php240
1 files changed, 0 insertions, 240 deletions
diff --git a/phpBB/modules/mcp/mcp_notes.php b/phpBB/modules/mcp/mcp_notes.php
deleted file mode 100644
index ed0bf373bf..0000000000
--- a/phpBB/modules/mcp/mcp_notes.php
+++ /dev/null
@@ -1,240 +0,0 @@
-<?php
-/**
-*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* mcp_notes
-* Displays notes about a user
-* @package mcp
-*/
-class mcp_notes
-{
- var $p_master;
- var $u_action;
-
- function __construct(&$p_master)
- {
- $this->p_master = &$p_master;
- }
-
- function main($id, $mode)
- {
- $action = request_var('action', array('' => ''));
-
- if (is_array($action))
- {
- list($action, ) = each($action);
- }
-
- $this->page_title = 'MCP_NOTES';
-
- switch ($mode)
- {
- case 'front':
- phpbb::$template->assign_vars(array(
- 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
- 'U_POST_ACTION' => append_sid('mcp', 'i=notes&amp;mode=user_notes'),
-
- 'L_TITLE' => phpbb::$user->lang['MCP_NOTES'],
- ));
-
- $this->tpl_name = 'mcp_notes_front';
- break;
-
- case 'user_notes':
- phpbb::$user->add_lang('acp/common');
-
- $this->mcp_notes_user_view($action);
- $this->tpl_name = 'mcp_notes_user';
- break;
- }
- }
-
- /**
- * Display user notes
- */
- function mcp_notes_user_view($action)
- {
- $user_id = request_var('u', 0);
- $username = request_var('username', '', true);
- $start = request_var('start', 0);
- $st = request_var('st', 0);
- $sk = request_var('sk', 'b');
- $sd = request_var('sd', 'd');
-
- add_form_key('mcp_notes');
-
- $sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . phpbb::$db->sql_escape(utf8_clean_string($username)) . "'";
-
- $sql = 'SELECT *
- FROM ' . USERS_TABLE . "
- WHERE $sql_where";
- $result = phpbb::$db->sql_query($sql);
- $userrow = phpbb::$db->sql_fetchrow($result);
- phpbb::$db->sql_freeresult($result);
-
- if (!$userrow)
- {
- trigger_error('NO_USER');
- }
-
- $user_id = $userrow['user_id'];
-
- // Populate user id to the currently active module (this module)
- // The following method is another way of adjusting module urls. It is the easy variant if we want
- // to directly adjust the current module url based on data retrieved within the same module.
- if (strpos($this->u_action, "&amp;u=$user_id") === false)
- {
- $this->p_master->adjust_url('&amp;u=' . $user_id);
- $this->u_action .= "&amp;u=$user_id";
- }
-
- $deletemark = ($action == 'del_marked') ? true : false;
- $deleteall = ($action == 'del_all') ? true : false;
- $marked = request_var('marknote', array(0));
- $usernote = utf8_normalize_nfc(request_var('usernote', '', true));
-
- // Handle any actions
- if (($deletemark || $deleteall) && phpbb::$acl->acl_get('a_clearlogs'))
- {
- $where_sql = '';
- if ($deletemark && $marked)
- {
- $sql_in = array();
- foreach ($marked as $mark)
- {
- $sql_in[] = $mark;
- }
- $where_sql = ' AND ' . phpbb::$db->sql_in_set('log_id', $sql_in);
- unset($sql_in);
- }
-
- if ($where_sql || $deleteall)
- {
- if (check_form_key('mcp_notes'))
- {
- $sql = 'DELETE FROM ' . LOG_TABLE . '
- WHERE log_type = ' . LOG_USERS . "
- AND reportee_id = $user_id
- $where_sql";
- phpbb::$db->sql_query($sql);
-
- add_log('admin', 'LOG_CLEAR_USER', $userrow['username']);
-
- $msg = ($deletemark) ? 'MARKED_NOTES_DELETED' : 'ALL_NOTES_DELETED';
- }
- else
- {
- $msg = 'FORM_INVALID';
- }
- $redirect = $this->u_action . '&amp;u=' . $user_id;
- meta_refresh(3, $redirect);
- trigger_error(phpbb::$user->lang[$msg] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
- }
- }
-
- if ($usernote && $action == 'add_feedback')
- {
- if (check_form_key('mcp_notes'))
- {
- add_log('admin', 'LOG_USER_FEEDBACK', $userrow['username']);
- add_log('mod', 0, 0, 'LOG_USER_FEEDBACK', $userrow['username']);
-
- add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote);
- $msg = phpbb::$user->lang['USER_FEEDBACK_ADDED'];
- }
- else
- {
- $msg = phpbb::$user->lang['FORM_INVALID'];
- }
- $redirect = $this->u_action;
- meta_refresh(3, $redirect);
-
- trigger_error($msg . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
- }
-
- // Generate the appropriate user information for the user we are looking at
- if (!function_exists('get_user_avatar'))
- {
- include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
- }
-
- $rank_title = $rank_img = '';
- $avatar_img = get_user_avatar($userrow['user_avatar'], $userrow['user_avatar_type'], $userrow['user_avatar_width'], $userrow['user_avatar_height']);
-
- $limit_days = array(0 => phpbb::$user->lang['ALL_ENTRIES'], 1 => phpbb::$user->lang['1_DAY'], 7 => phpbb::$user->lang['7_DAYS'], 14 => phpbb::$user->lang['2_WEEKS'], 30 => phpbb::$user->lang['1_MONTH'], 90 => phpbb::$user->lang['3_MONTHS'], 180 => phpbb::$user->lang['6_MONTHS'], 365 => phpbb::$user->lang['1_YEAR']);
- $sort_by_text = array('a' => phpbb::$user->lang['SORT_USERNAME'], 'b' => phpbb::$user->lang['SORT_DATE'], 'c' => phpbb::$user->lang['SORT_IP'], 'd' => phpbb::$user->lang['SORT_ACTION']);
- $sort_by_sql = array('a' => 'u.username_clean', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation');
-
- $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
- gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
-
- // Define where and sort sql for use in displaying logs
- $sql_where = ($st) ? (time() - ($st * 86400)) : 0;
- $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');
-
- $log_data = array();
- $log_count = 0;
- view_log('user', $log_data, $log_count, phpbb::$config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
-
- if ($log_count)
- {
- phpbb::$template->assign_var('S_USER_NOTES', true);
-
- foreach ($log_data as $row)
- {
- phpbb::$template->assign_block_vars('usernotes', array(
- 'REPORT_BY' => $row['username_full'],
- 'REPORT_AT' => phpbb::$user->format_date($row['time']),
- 'ACTION' => $row['action'],
- 'IP' => $row['ip'],
- 'ID' => $row['id'],
- ));
- }
- }
-
- phpbb::$template->assign_vars(array(
- 'U_POST_ACTION' => $this->u_action,
- 'S_CLEAR_ALLOWED' => (phpbb::$acl->acl_get('a_clearlogs')) ? true : false,
- 'S_SELECT_SORT_DIR' => $s_sort_dir,
- 'S_SELECT_SORT_KEY' => $s_sort_key,
- 'S_SELECT_SORT_DAYS' => $s_limit_days,
-
- 'L_TITLE' => phpbb::$user->lang['MCP_NOTES_USER'],
-
- 'PAGE_NUMBER' => on_page($log_count, phpbb::$config['posts_per_page'], $start),
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;st=$st&amp;sk=$sk&amp;sd=$sd", $log_count, phpbb::$config['posts_per_page'], $start),
- 'TOTAL_REPORTS' => ($log_count == 1) ? phpbb::$user->lang['LIST_REPORT'] : sprintf(phpbb::$user->lang['LIST_REPORTS'], $log_count),
-
- 'RANK_TITLE' => $rank_title,
- 'JOINED' => phpbb::$user->format_date($userrow['user_regdate']),
- 'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0,
- 'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0,
-
- 'USERNAME_FULL' => get_username_string('full', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
- 'USERNAME_COLOUR' => get_username_string('colour', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
- 'USERNAME' => get_username_string('username', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
- 'U_PROFILE' => get_username_string('profile', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
-
- 'AVATAR_IMG' => $avatar_img,
- 'RANK_IMG' => $rank_img,
- ));
- }
-
-}
-
-?> \ No newline at end of file