mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
- drop in the new administration panel
- not finished yet: some user related items, style admin, database admin and permissions - Graham: Please add your MCP schema data to the schema data file. ;) git-svn-id: file:///svn/phpbb/trunk@5357 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -52,6 +52,9 @@ class acp_jabber
|
||||
$jabber->password = $jab_password;
|
||||
$jabber->resource = $jab_resource;
|
||||
|
||||
$message = $user->lang['JAB_SETTINGS_CHANGED'];
|
||||
$log = 'JAB_SETTINGS_CHANGED';
|
||||
|
||||
// Are changing (or initialising) a new host or username? If so run some checks and
|
||||
// try to create account if it doesn't exist
|
||||
if ($jab_enable)
|
||||
|
@@ -47,13 +47,13 @@ class acp_logs
|
||||
$sql_in = array();
|
||||
foreach ($marked as $mark)
|
||||
{
|
||||
$sql_in[] = $mark;
|
||||
$sql_in[] = $mark;
|
||||
}
|
||||
$where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')';
|
||||
unset($sql_in);
|
||||
}
|
||||
|
||||
if ($where_sql)
|
||||
if ($where_sql || $deleteall)
|
||||
{
|
||||
$sql = 'DELETE FROM ' . LOG_TABLE . "
|
||||
WHERE log_type = {$this->log_type}
|
||||
|
@@ -474,6 +474,7 @@ class acp_modules
|
||||
'MODULE_IMAGE' => $module_image,
|
||||
'MODULE_TITLE' => $langname,
|
||||
'MODULE_ENABLED' => ($row['module_enabled']) ? true : false,
|
||||
'MODULE_DISPLAYED' => ($row['module_display']) ? true : false,
|
||||
|
||||
'U_MODULE' => $u_action . '&parent_id=' . $row['module_id'],
|
||||
'U_MOVE_UP' => $url . '&action=move_up',
|
||||
|
1287
phpBB/includes/acp/acp_users.php
Normal file
1287
phpBB/includes/acp/acp_users.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1868,7 +1868,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
|
||||
$topic_id_list = $is_auth = $is_mod = array();
|
||||
|
||||
$profile_url = (defined('IN_ADMIN')) ? "admin_users.$phpEx$SID" : "memberlist.$phpEx$SID&mode=viewprofile";
|
||||
$profile_url = (defined('IN_ADMIN')) ? "index.$phpEx$SID&i=users&mode=overview" : "memberlist.$phpEx$SID&mode=viewprofile";
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
|
@@ -80,8 +80,8 @@ function user_update_name($old_name, $new_name)
|
||||
foreach ($field_ary as $field)
|
||||
{
|
||||
$sql = "UPDATE $table
|
||||
SET $field = '$new_name'
|
||||
WHERE $field = '$old_name'";
|
||||
SET $field = '" . $db->sql_escape($new_name) . "'
|
||||
WHERE $field = '" . $db->sql_escape($old_name) . "'";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
@@ -277,10 +277,10 @@ function user_active_flip($user_id, $user_type, $user_actkey = false, $username
|
||||
if (!function_exists('add_log'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
}
|
||||
|
||||
if (!$username)
|
||||
if ($username === false)
|
||||
{
|
||||
$sql = 'SELECT username
|
||||
FROM ' . USERS_TABLE . "
|
||||
@@ -296,7 +296,6 @@ function user_active_flip($user_id, $user_type, $user_actkey = false, $username
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a ban or ban exclusion to the banlist. Bans either a user, an IP or an email address
|
||||
*
|
||||
@@ -357,12 +356,13 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
{
|
||||
// Select the relevant user_ids.
|
||||
$sql_usernames = array();
|
||||
foreach($ban_list as $username)
|
||||
|
||||
foreach ($ban_list as $username)
|
||||
{
|
||||
$username = trim($username);
|
||||
if ($username != '')
|
||||
{
|
||||
$sql_usernames[] = "'" . $username . "'";
|
||||
$sql_usernames[] = "'" . $db->sql_escape($username) . "'";
|
||||
}
|
||||
}
|
||||
$sql_usernames = implode(', ', $sql_usernames);
|
||||
@@ -386,7 +386,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$type = 'ban_ip';
|
||||
@@ -458,7 +458,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
|
||||
foreach ($ip_ary as $ip)
|
||||
{
|
||||
if (!empty($ip))
|
||||
if ($ip)
|
||||
{
|
||||
$banlist_ary[] = $ip;
|
||||
}
|
||||
@@ -479,7 +479,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
trigger_error('NO_IPS_DEFINED');
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
$type = 'ban_email';
|
||||
@@ -496,7 +496,11 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
{
|
||||
trigger_error('NO_EMAILS_DEFINED');
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
trigger_error('NO_MODE');
|
||||
break;
|
||||
}
|
||||
|
||||
// Fetch currently set bans of the specified type and exclude state. Prevent duplicate bans.
|
||||
@@ -515,15 +519,15 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
{
|
||||
case 'user':
|
||||
$banlist_ary_tmp[] = $row['ban_userid'];
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$banlist_ary_tmp[] = $row['ban_ip'];
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
$banlist_ary_tmp[] = $row['ban_email'];
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
@@ -531,12 +535,14 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
$banlist_ary = array_unique(array_diff($banlist_ary, $banlist_ary_tmp));
|
||||
unset($banlist_ary_tmp);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// We have some entities to ban
|
||||
if (sizeof($banlist_ary))
|
||||
{
|
||||
$sql = '';
|
||||
$sql_ary = array();
|
||||
|
||||
foreach ($banlist_ary as $ban_entry)
|
||||
{
|
||||
$sql_ary[] = array(
|
||||
@@ -563,20 +569,22 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
{
|
||||
case 'user':
|
||||
$sql_where = 'WHERE session_user_id IN (' . implode(', ', $banlist_ary) . ')';
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$banlist_ary_sql = array();
|
||||
foreach($banlist_ary as $ban_entry)
|
||||
|
||||
foreach ($banlist_ary as $ban_entry)
|
||||
{
|
||||
$banlist_ary_sql[] = "'" . $db->sql_escape($ban_entry) . "'";
|
||||
}
|
||||
$sql_where = 'WHERE session_ip IN (' . implode(', ', $banlist_ary_sql) . ')';
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
$banlist_ary_sql = array();
|
||||
foreach($banlist_ary as $ban_entry)
|
||||
|
||||
foreach ($banlist_ary as $ban_entry)
|
||||
{
|
||||
$banlist_ary_sql[] = "'" . $db->sql_escape(str_replace('*', '%', $ban_entry)) . "'";
|
||||
}
|
||||
@@ -588,6 +596,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
|
||||
$sql_in = array();
|
||||
$sql = '';
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
@@ -598,10 +607,11 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
|
||||
$sql_where = 'WHERE session_user_id IN (' . implode(', ', $sql_in) . ")";
|
||||
}
|
||||
break;
|
||||
$db->sql_freeresult($result);
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset($sql_where))
|
||||
if (isset($sql_where) && $sql_where)
|
||||
{
|
||||
$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
|
||||
$sql_where";
|
||||
@@ -612,7 +622,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
if (!function_exists('add_log'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||
}
|
||||
|
||||
// Update log
|
||||
@@ -655,19 +665,19 @@ function user_unban($mode, $ban)
|
||||
FROM ' . USERS_TABLE . ' u, ' . BANLIST_TABLE . " b
|
||||
WHERE b.ban_id IN ($unban_sql)
|
||||
AND u.user_id = b.ban_userid";
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
$sql = 'SELECT ban_email AS unban_info
|
||||
FROM ' . BANLIST_TABLE . "
|
||||
WHERE ban_id IN ($unban_sql)";
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$sql = 'SELECT ban_ip AS unban_info
|
||||
FROM ' . BANLIST_TABLE . "
|
||||
WHERE ban_id IN ($unban_sql)";
|
||||
break;
|
||||
break;
|
||||
}
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
@@ -685,14 +695,13 @@ function user_unban($mode, $ban)
|
||||
if (!function_exists('add_log'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -985,9 +994,9 @@ function avatar_delete($id)
|
||||
{
|
||||
global $phpbb_root_path, $config, $db, $user;
|
||||
|
||||
if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . $id))
|
||||
if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . basename($id)))
|
||||
{
|
||||
@unlink($phpbb_root_path . $config['avatar_path'] . '/' . $id);
|
||||
@unlink($phpbb_root_path . $config['avatar_path'] . '/' . basename($id));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@@ -101,8 +101,8 @@ class bbcode_firstpass extends bbcode
|
||||
'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#ise' => "\$this->bbcode_code('\$1', '\$2')")),
|
||||
'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:="(.*?)")?\](.+)\[/quote\]#ise' => "\$this->bbcode_quote('\$0')")),
|
||||
'attachment'=> array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#ise' => "\$this->bbcode_attachment('\$1', '\$2')")),
|
||||
'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#ise' => "\$this->bbcode_strong('\$1')")),
|
||||
'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#ise' => "\$this->bbcode_italic('\$1')")),
|
||||
'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.+)\[/b\]#ise' => "\$this->bbcode_strong('\$1')")),
|
||||
'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.+)\[/i\]#ise' => "\$this->bbcode_italic('\$1')")),
|
||||
'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")),
|
||||
'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](https?://)([a-z0-9\-\.,\?!%\*_:;~\\&$@/=\+]+)\[/img\]#ie' => "\$this->bbcode_img('\$1\$2')")),
|
||||
'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?[1-2]?[0-9])\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")),
|
||||
|
@@ -402,7 +402,7 @@ class ucp_pm_info
|
||||
'unread' => array('title' => 'UCP_PM_UNREAD', 'auth' => 'cfg_allow_privmsg'),
|
||||
'drafts' => array('title' => 'UCP_PM_DRAFTS', 'auth' => 'cfg_allow_privmsg'),
|
||||
'options' => array('title' => 'UCP_PM_OPTIONS', 'auth' => 'cfg_allow_privmsg'),
|
||||
'popup' => array('title' => 'UCP_PM_POPUP_TITLE', 'auth' => 'cfg_allow_privmsg', 'display' => 0),
|
||||
'popup' => array('title' => 'UCP_PM_POPUP_TITLE', 'auth' => 'cfg_allow_privmsg', 'display' => false),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -169,7 +169,7 @@ class ucp_prefs
|
||||
'NOTIFY_IM' => ($notifymethod == NOTIFY_IM) ? 'checked="checked"' : '',
|
||||
'NOTIFY_BOTH' => ($notifymethod == NOTIFY_BOTH) ? 'checked="checked"' : '',
|
||||
|
||||
'DATE_FORMAT' => $dateformat,
|
||||
'DATE_FORMAT' => $dateformat,
|
||||
'S_DATEFORMAT_OPTIONS' => $dateformat_options,
|
||||
'S_CUSTOM_DATEFORMAT' => $s_custom,
|
||||
'DEFAULT_DATEFORMAT' => $config['default_dateformat'],
|
||||
@@ -256,7 +256,7 @@ class ucp_prefs
|
||||
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
|
||||
}
|
||||
|
||||
$topic_sk = (isset($topic_sk)) ? $topic_sk : ((!empty($user->data['user_tpic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't');
|
||||
$topic_sk = (isset($topic_sk)) ? $topic_sk : ((!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't');
|
||||
$post_sk = (isset($post_sk)) ? $post_sk : ((!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't');
|
||||
|
||||
$topic_sd = (isset($topic_sd)) ? $topic_sd : ((!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd');
|
||||
|
@@ -522,7 +522,8 @@ class ucp_profile
|
||||
}
|
||||
else if ($delete && $auth->acl_get('u_chgavatar'))
|
||||
{
|
||||
$type = $filename = $width = $height = '';
|
||||
$filename = '';
|
||||
$type = $width = $height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user