Line 172 | Line 172 |
---|
if ($submit) {
|
if ($submit) {
|
// You can't delete the founder if ($delete && $user_row['user_type'] != USER_FOUNDER)
| if ($delete)
|
{ if (!$auth->acl_get('a_userdel')) {
| { if (!$auth->acl_get('a_userdel')) {
|
Line 184 | Line 183 |
---|
if ($user_id == ANONYMOUS) { trigger_error($user->lang['CANNOT_REMOVE_ANONYMOUS'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
if ($user_id == ANONYMOUS) { trigger_error($user->lang['CANNOT_REMOVE_ANONYMOUS'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
| }
// Founders can not be deleted. if ($user_row['user_type'] == USER_FOUNDER) { trigger_error($user->lang['CANNOT_REMOVE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
}
if ($user_id == $user->data['user_id'])
| }
if ($user_id == $user->data['user_id'])
|
Line 348 | Line 353 |
---|
$messenger->to($user_row['user_email'], $user_row['username']);
|
$messenger->to($user_row['user_email'], $user_row['username']);
|
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']); $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
| $messenger->anti_abuse_headers($config, $user);
|
$messenger->assign_vars(array( 'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
| $messenger->assign_vars(array( 'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
|
Line 406 | Line 408 |
---|
$messenger->to($user_row['user_email'], $user_row['username']);
|
$messenger->to($user_row['user_email'], $user_row['username']);
|
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']); $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
| $messenger->anti_abuse_headers($config, $user);
|
$messenger->assign_vars(array( 'USERNAME' => htmlspecialchars_decode($user_row['username']))
| $messenger->assign_vars(array( 'USERNAME' => htmlspecialchars_decode($user_row['username']))
|
Line 818 | Line 817 |
---|
// Which updates do we need to do? $update_username = ($user_row['username'] != $data['username']) ? $data['username'] : false;
|
// Which updates do we need to do? $update_username = ($user_row['username'] != $data['username']) ? $data['username'] : false;
|
$update_password = ($data['new_password'] && !phpbb_check_hash($user_row['user_password'], $data['new_password'])) ? true : false;
| $update_password = ($data['new_password'] && !phpbb_check_hash($data['new_password'], $user_row['user_password'])) ? true : false;
|
$update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false;
if (!sizeof($error))
| $update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false;
if (!sizeof($error))
|
Line 1013 | Line 1012 |
---|
AND post_approved = 0'; $result = $db->sql_query($sql); $user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
|
AND post_approved = 0'; $result = $db->sql_query($sql); $user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
|
| $db->sql_freeresult($result);
$sql = 'SELECT post_id FROM ' . POSTS_TABLE . ' WHERE poster_id = '. $user_id; $result = $db->sql_query_limit($sql, 1); $user_row['user_has_posts'] = (bool) $db->sql_fetchfield('post_id');
|
$db->sql_freeresult($result);
$template->assign_vars(array(
| $db->sql_freeresult($result);
$template->assign_vars(array(
|
Line 1031 | Line 1037 |
---|
'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'), 'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}", 'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',
|
'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'), 'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}", 'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',
|
| 'U_SEARCH_USER' => ($config['load_search'] && $auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$user_row['user_id']}&sr=posts") : '',
|
'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_row['user_id']}&hash=" . generate_link_hash('switchperm')) : '',
| 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_row['user_id']}&hash=" . generate_link_hash('switchperm')) : '',
|
Line 1042 | Line 1049 |
---|
'USER_EMAIL' => $user_row['user_email'], 'USER_WARNINGS' => $user_row['user_warnings'], 'USER_POSTS' => $user_row['user_posts'],
|
'USER_EMAIL' => $user_row['user_email'], 'USER_WARNINGS' => $user_row['user_warnings'], 'USER_POSTS' => $user_row['user_posts'],
|
| 'USER_HAS_POSTS' => $user_row['user_has_posts'],
|
'USER_INACTIVE_REASON' => $inactive_reason, ));
| 'USER_INACTIVE_REASON' => $inactive_reason, ));
|
Line 1124 | Line 1132 |
---|
// Grab log data $log_data = array(); $log_count = 0;
|
// Grab log data $log_data = array(); $log_count = 0;
|
view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
| $start = view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
|
$template->assign_vars(array( 'S_FEEDBACK' => true,
| $template->assign_vars(array( 'S_FEEDBACK' => true,
|
Line 2007 | Line 2015 |
---|
WHERE a.poster_id = ' . $user_id . " AND a.is_orphan = 0 ORDER BY $order_by";
|
WHERE a.poster_id = ' . $user_id . " AND a.is_orphan = 0 ORDER BY $order_by";
|
$result = $db->sql_query_limit($sql, $config['posts_per_page'], $start);
| $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
|
while ($row = $db->sql_fetchrow($result)) {
| while ($row = $db->sql_fetchrow($result)) {
|
Line 2345 | Line 2353 |
---|
}
/**
|
}
/**
|
* Optionset replacement for this module based on $user->optionset
| * Set option bit field for user options in a user row array. * * Optionset replacement for this module based on $user->optionset. * * @param array $user_row Row from the users table. * @param int $key Option key, as defined in $user->keyoptions property. * @param bool $value True to set the option, false to clear the option. * @param int $data Current bit field value, or false to use $user_row['user_options'] * @return int|bool If $data is false, the bit field is modified and * written back to $user_row['user_options'], and * return value is true if the bit field changed and * false otherwise. If $data is not false, the new * bitfield value is returned.
|
*/ function optionset(&$user_row, $key, $value, $data = false) { global $user;
|
*/ function optionset(&$user_row, $key, $value, $data = false) { global $user;
|
$var = ($data) ? $data : $user_row['user_options'];
| $var = ($data !== false) ? $data : $user_row['user_options'];
|
|
|
if ($value && !($var & 1 << $user->keyoptions[$key]))
| $new_var = phpbb_optionset($user->keyoptions[$key], $value, $var);
if ($data === false)
|
{
|
{
|
$var += 1 << $user->keyoptions[$key]; } else if (!$value && ($var & 1 << $user->keyoptions[$key]))
| if ($new_var != $var)
|
{
|
{
|
$var -= 1 << $user->keyoptions[$key];
| $user_row['user_options'] = $new_var; return true;
|
} else {
|
} else {
|
return ($data) ? $var : false;
| return false;
|
}
|
}
|
if (!$data) { $user_row['user_options'] = $var; return true;
| |
} else {
|
} else {
|
return $var;
| return $new_var;
|
} }
/**
|
} }
/**
|
* Optionget replacement for this module based on $user->optionget
| * Get option bit field from user options in a user row array. * * Optionget replacement for this module based on $user->optionget. * * @param array $user_row Row from the users table. * @param int $key option key, as defined in $user->keyoptions property. * @param int $data bit field value to use, or false to use $user_row['user_options'] * @return bool true if the option is set in the bit field, false otherwise
|
*/ function optionget(&$user_row, $key, $data = false) { global $user;
|
*/ function optionget(&$user_row, $key, $data = false) { global $user;
|
$var = ($data) ? $data : $user_row['user_options']; return ($var & 1 << $user->keyoptions[$key]) ? true : false;
| $var = ($data !== false) ? $data : $user_row['user_options']; return phpbb_optionget($user->keyoptions[$key], $var);
|
} }
| } }
|