aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/memberlist.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-11-21 18:15:53 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-11-21 18:15:53 +0000
commitab9ec8064acb25d09d6d0edb93ecbe3b59541010 (patch)
tree3ffb1cd5767a69f850daba6277f5cf93b91f1d9d /phpBB/memberlist.php
parent5be570b1f06f342a7f217679d102cdb7724905cf (diff)
downloadforums-ab9ec8064acb25d09d6d0edb93ecbe3b59541010.tar
forums-ab9ec8064acb25d09d6d0edb93ecbe3b59541010.tar.gz
forums-ab9ec8064acb25d09d6d0edb93ecbe3b59541010.tar.bz2
forums-ab9ec8064acb25d09d6d0edb93ecbe3b59541010.tar.xz
forums-ab9ec8064acb25d09d6d0edb93ecbe3b59541010.zip
- fixing a bunch of bugs
- moved the install trigger error to sessions and also disabled it for those having DEBUG_EXTRA enabled. i hope not having introduced too many new bugs. git-svn-id: file:///svn/phpbb/trunk@6628 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/memberlist.php')
-rw-r--r--phpBB/memberlist.php75
1 files changed, 66 insertions, 9 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index fe0ddc8c27..150bdb4941 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -346,15 +346,20 @@ switch ($mode)
{
$sql = 'SELECT *
FROM ' . USERS_TABLE . "
- WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'
- AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+ WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
}
else
{
$sql = 'SELECT *
FROM ' . USERS_TABLE . "
- WHERE user_id = $user_id
- AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+ WHERE user_id = $user_id";
+ }
+
+ // a_user admins and founder are able to view inactive users and bots to be able to
+ // manage them more easily
+ if (!$auth->acl_get('a_user') && $user->data['user_type'] != USER_FOUNDER)
+ {
+ $sql .= ' AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
}
$result = $db->sql_query($sql);
@@ -530,6 +535,38 @@ switch ($mode)
}
}
+ // Inactive reason/account?
+ if ($member['user_type'] == USER_INACTIVE)
+ {
+ $user->add_lang('acp/common');
+
+ $inactive_reason = $user->lang['INACTIVE_REASON_UNKNOWN'];
+
+ switch ($member['user_inactive_reason'])
+ {
+ case INACTIVE_REGISTER:
+ $inactive_reason = $user->lang['INACTIVE_REASON_REGISTER'];
+ break;
+
+ case INACTIVE_PROFILE:
+ $inactive_reason = $user->lang['INACTIVE_REASON_PROFILE'];
+ break;
+
+ case INACTIVE_MANUAL:
+ $inactive_reason = $user->lang['INACTIVE_REASON_MANUAL'];
+ break;
+
+ case INACTIVE_REMIND:
+ $inactive_reason = $user->lang['INACTIVE_REASON_REMIND'];
+ break;
+ }
+
+ $template->assign_vars(array(
+ 'S_USER_INACTIVE' => true,
+ 'USER_INACTIVE_REASON' => $inactive_reason)
+ );
+ }
+
// Now generate page tilte
$page_title = sprintf($user->lang['VIEWING_PROFILE'], $member['username']);
$template_html = 'memberlist_view.html';
@@ -799,8 +836,21 @@ switch ($mode)
$template_html = 'memberlist_body.html';
// Sorting
- $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'e' => $user->lang['SORT_EMAIL'], 'f' => $user->lang['WEBSITE'], 'g' => $user->lang['ICQ'], 'h' => $user->lang['AIM'], 'i' => $user->lang['MSNM'], 'j' => $user->lang['YIM'], 'k' => $user->lang['JABBER'], 'l' => $user->lang['SORT_LAST_ACTIVE'], 'm' => $user->lang['SORT_RANK'] );
- $sort_key_sql = array('a' => 'u.username', 'b' => 'u.user_from', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'e' => 'u.user_email', 'f' => 'u.user_website', 'g' => 'u.user_icq', 'h' => 'u.user_aim', 'i' => 'u.user_msnm', 'j' => 'u.user_yim', 'k' => 'u.user_jabber', 'l' => 'u.user_lastvisit', 'm' => 'u.user_rank DESC, u.user_posts');
+ $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'e' => $user->lang['SORT_EMAIL'], 'f' => $user->lang['WEBSITE'], 'g' => $user->lang['ICQ'], 'h' => $user->lang['AIM'], 'i' => $user->lang['MSNM'], 'j' => $user->lang['YIM'], 'k' => $user->lang['JABBER']);
+
+ if ($auth->acl_get('u_viewonline'))
+ {
+ $sort_key_text['l'] = $user->lang['SORT_LAST_ACTIVE'];
+ }
+ $sort_key_text['m'] = $user->lang['SORT_RANK'];
+
+ $sort_key_sql = array('a' => 'u.username', 'b' => 'u.user_from', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'e' => 'u.user_email', 'f' => 'u.user_website', 'g' => 'u.user_icq', 'h' => 'u.user_aim', 'i' => 'u.user_msnm', 'j' => 'u.user_yim', 'k' => 'u.user_jabber');
+
+ if ($auth->acl_get('u_viewonline'))
+ {
+ $sort_key_sql['l'] = 'u.user_lastvisit';
+ }
+ $sort_key_sql['m'] = 'u.user_rank DESC, u.user_posts';
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
@@ -828,7 +878,7 @@ switch ($mode)
if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_')))
{
$username = request_var('username', '', true);
- $email = request_var('email', '');
+ $email = strtolower(request_var('email', ''));
$icq = request_var('icq', '');
$aim = request_var('aim', '');
$yahoo = request_var('yahoo', '');
@@ -1345,8 +1395,6 @@ function show_profile($data)
$email = '';
}
- $last_visit = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_lastvisit'];
-
if ($config['load_onlinetrack'])
{
$update_time = $config['load_online_time'] * 60;
@@ -1357,6 +1405,15 @@ function show_profile($data)
$online = false;
}
+ if ($data['user_allow_viewonline'] || $auth->acl_get('u_viewonline'))
+ {
+ $last_visit = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_lastvisit'];
+ }
+ else
+ {
+ $last_visit = '';
+ }
+
$age = '';
if ($data['user_birthday'])