mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
fix some bugs... again. :)
git-svn-id: file:///svn/phpbb/trunk@6165 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -631,25 +631,30 @@ class acp_attachments
|
||||
|
||||
$img_path = $config['upload_icons_path'];
|
||||
|
||||
$imglist = filelist($phpbb_root_path . $img_path);
|
||||
$imglist = array_values($imglist);
|
||||
$imglist = $imglist[0];
|
||||
|
||||
$filename_list = '';
|
||||
$no_image_select = false;
|
||||
foreach ($imglist as $key => $img)
|
||||
{
|
||||
if (!$ext_group_row['upload_icon'])
|
||||
{
|
||||
$no_image_select = true;
|
||||
$selected = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = ($ext_group_row['upload_icon'] == $img) ? ' selected="selected"' : '';
|
||||
}
|
||||
|
||||
$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . htmlspecialchars($img) . '</option>';
|
||||
$imglist = filelist($phpbb_root_path . $img_path);
|
||||
|
||||
if (sizeof($imglist))
|
||||
{
|
||||
$imglist = array_values($imglist);
|
||||
$imglist = $imglist[0];
|
||||
|
||||
foreach ($imglist as $key => $img)
|
||||
{
|
||||
if (!$ext_group_row['upload_icon'])
|
||||
{
|
||||
$no_image_select = true;
|
||||
$selected = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = ($ext_group_row['upload_icon'] == $img) ? ' selected="selected"' : '';
|
||||
}
|
||||
|
||||
$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . htmlspecialchars($img) . '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
|
@@ -127,7 +127,8 @@ class acp_language
|
||||
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
$sql = 'SELECT * FROM ' . LANG_TABLE . "
|
||||
$sql = 'SELECT *
|
||||
FROM ' . LANG_TABLE . "
|
||||
WHERE lang_id = $lang_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
@@ -162,7 +163,8 @@ class acp_language
|
||||
trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
$sql = 'SELECT * FROM ' . LANG_TABLE . "
|
||||
$sql = 'SELECT *
|
||||
FROM ' . LANG_TABLE . "
|
||||
WHERE lang_id = $lang_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
@@ -332,7 +334,8 @@ class acp_language
|
||||
|
||||
$this->page_title = 'LANGUAGE_PACK_DETAILS';
|
||||
|
||||
$sql = 'SELECT * FROM ' . LANG_TABLE . '
|
||||
$sql = 'SELECT *
|
||||
FROM ' . LANG_TABLE . '
|
||||
WHERE lang_id = ' . $lang_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$lang_entries = $db->sql_fetchrow($result);
|
||||
@@ -644,7 +647,8 @@ class acp_language
|
||||
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
$sql = 'SELECT * FROM ' . LANG_TABLE . '
|
||||
$sql = 'SELECT *
|
||||
FROM ' . LANG_TABLE . '
|
||||
WHERE lang_id = ' . $lang_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
@@ -686,7 +690,8 @@ class acp_language
|
||||
);
|
||||
unset($file);
|
||||
|
||||
$sql = 'SELECT lang_iso FROM ' . LANG_TABLE . "
|
||||
$sql = 'SELECT lang_iso
|
||||
FROM ' . LANG_TABLE . "
|
||||
WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
@@ -725,7 +730,8 @@ class acp_language
|
||||
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
$sql = 'SELECT * FROM ' . LANG_TABLE . '
|
||||
$sql = 'SELECT *
|
||||
FROM ' . LANG_TABLE . '
|
||||
WHERE lang_id = ' . $lang_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
@@ -841,7 +847,8 @@ class acp_language
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . LANG_TABLE;
|
||||
FROM ' . LANG_TABLE . '
|
||||
ORDER BY lang_english_name';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$installed = array();
|
||||
|
@@ -50,7 +50,8 @@ class acp_profile
|
||||
$lang_defs = array();
|
||||
|
||||
$sql = 'SELECT lang_id, lang_iso
|
||||
FROM ' . LANG_TABLE;
|
||||
FROM ' . LANG_TABLE . '
|
||||
ORDER BY lang_english_name';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
@@ -63,7 +64,7 @@ class acp_profile
|
||||
|
||||
$sql = 'SELECT field_id, lang_id
|
||||
FROM ' . PROFILE_LANG_TABLE . '
|
||||
ORDER BY lang_id';
|
||||
ORDER BY lang_id';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
@@ -293,10 +294,11 @@ class acp_profile
|
||||
$field_type = $field_row['field_type'];
|
||||
|
||||
// Get language entries
|
||||
$sql = 'SELECT * FROM ' . PROFILE_FIELDS_LANG_TABLE . '
|
||||
$sql = 'SELECT *
|
||||
FROM ' . PROFILE_FIELDS_LANG_TABLE . '
|
||||
WHERE lang_id = ' . $lang_defs['iso'][$config['default_lang']] . "
|
||||
AND field_id = $field_id
|
||||
ORDER BY option_id ASC";
|
||||
ORDER BY option_id ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$lang_options = array();
|
||||
@@ -474,7 +476,8 @@ class acp_profile
|
||||
if ($action == 'edit')
|
||||
{
|
||||
// Get language entries
|
||||
$sql = 'SELECT * FROM ' . PROFILE_FIELDS_LANG_TABLE . '
|
||||
$sql = 'SELECT *
|
||||
FROM ' . PROFILE_FIELDS_LANG_TABLE . '
|
||||
WHERE lang_id <> ' . $lang_defs['iso'][$config['default_lang']] . "
|
||||
AND field_id = $field_id
|
||||
ORDER BY option_id ASC";
|
||||
@@ -488,7 +491,8 @@ class acp_profile
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value FROM ' . PROFILE_LANG_TABLE . '
|
||||
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value
|
||||
FROM ' . PROFILE_LANG_TABLE . '
|
||||
WHERE lang_id <> ' . $lang_defs['iso'][$config['default_lang']] . "
|
||||
AND field_id = $field_id
|
||||
ORDER BY lang_id ASC";
|
||||
@@ -769,7 +773,8 @@ class acp_profile
|
||||
|
||||
$sql = 'SELECT lang_id, lang_iso
|
||||
FROM ' . LANG_TABLE . "
|
||||
WHERE lang_iso <> '" . $config['default_lang'] . "'";
|
||||
WHERE lang_iso <> '" . $config['default_lang'] . "'
|
||||
ORDER BY lang_english_name";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$languages = array();
|
||||
|
@@ -192,6 +192,12 @@ class acp_users
|
||||
case 'banuser':
|
||||
case 'banemail':
|
||||
case 'banip':
|
||||
|
||||
if ($user_id == $user->data['user_id'])
|
||||
{
|
||||
trigger_error($user->lang['CANNOT_BAN_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||
}
|
||||
|
||||
$ban = array();
|
||||
|
||||
switch ($action)
|
||||
@@ -238,6 +244,11 @@ class acp_users
|
||||
|
||||
case 'reactivate':
|
||||
|
||||
if ($user_id == $user->data['user_id'])
|
||||
{
|
||||
trigger_error($user->lang['CANNOT_FORCE_REACT_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||
}
|
||||
|
||||
if ($config['email_enable'])
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
@@ -287,6 +298,12 @@ class acp_users
|
||||
|
||||
case 'active':
|
||||
|
||||
if ($user_id == $user->data['user_id'])
|
||||
{
|
||||
// It is only deactivation since the user is already activated (else he would not have reached this page)
|
||||
trigger_error($user->lang['CANNOT_DEACTIVATE_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||
}
|
||||
|
||||
user_active_flip($user_id, $user_row['user_type'], false, $user_row['username']);
|
||||
|
||||
$message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
|
||||
@@ -749,11 +766,19 @@ class acp_users
|
||||
}
|
||||
|
||||
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS');
|
||||
$quick_tool_ary = array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP', 'active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'), 'delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
|
||||
|
||||
if ($config['email_enable'])
|
||||
|
||||
if ($user_id == $user->data['user_id'])
|
||||
{
|
||||
$quick_tool_ary['reactivate'] = 'FORCE';
|
||||
$quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
|
||||
}
|
||||
else
|
||||
{
|
||||
$quick_tool_ary = array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP', 'active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'), 'delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
|
||||
|
||||
if ($config['email_enable'])
|
||||
{
|
||||
$quick_tool_ary['reactivate'] = 'FORCE';
|
||||
}
|
||||
}
|
||||
|
||||
$s_action_options = '<option class="sep" value="">' . $user->lang['SELECT_OPTION'] . '</option>';
|
||||
@@ -771,6 +796,7 @@ class acp_users
|
||||
'S_USER_IP' => ($user_row['user_ip']) ? true : false,
|
||||
'S_USER_FOUNDER' => ($user_row['user_type'] == USER_FOUNDER) ? true : false,
|
||||
'S_ACTION_OPTIONS' => $s_action_options,
|
||||
'S_OWN_ACCOUNT' => ($user_id == $user->data['user_id']) ? true : false,
|
||||
|
||||
'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']}",
|
||||
|
@@ -561,7 +561,7 @@ class bbcode
|
||||
$code = str_replace(' ', ' ', $code);
|
||||
|
||||
// remove newline at the beginning
|
||||
if ($code{0} == "\n")
|
||||
if (!empty($code) && $code{0} == "\n")
|
||||
{
|
||||
$code = substr($code, 1);
|
||||
}
|
||||
|
@@ -339,9 +339,18 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
|
||||
$file->upload->set_allowed_dimensions(0, 0, $config['img_max_width'], $config['img_max_height']);
|
||||
}
|
||||
|
||||
// Admins and mods are allowed to exceed the allowed filesize
|
||||
if (!$auth->acl_get('a_') && !$auth->acl_get('m_', $forum_id))
|
||||
{
|
||||
$allowed_filesize = ($extensions[$file->get('extension')]['max_filesize'] != 0) ? $extensions[$file->get('extension')]['max_filesize'] : (($is_message) ? $config['max_filesize_pm'] : $config['max_filesize']);
|
||||
if (!empty($extensions[$file->get('extension')]['max_filesize']))
|
||||
{
|
||||
$allowed_filesize = $extensions[$file->get('extension')]['max_filesize'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$allowed_filesize = ($is_message) ? $config['max_filesize_pm'] : $config['max_filesize'];
|
||||
}
|
||||
|
||||
$file->upload->set_max_filesize($allowed_filesize);
|
||||
}
|
||||
|
||||
|
@@ -384,10 +384,12 @@ function user_active_flip($user_id, $user_type, $user_actkey = false, $username
|
||||
WHERE user_id = $user_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$group_name = ($user_type == USER_NORMAL) ? 'REGISTERED' : 'INACTIVE';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if ($group_name = array_search($row['group_id'], $group_id_ary))
|
||||
if ($name = array_search($row['group_id'], $group_id_ary))
|
||||
{
|
||||
$group_name = $name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -29,7 +29,23 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||
$icons = array();
|
||||
$cache->obtain_icons($icons);
|
||||
|
||||
$color_rows = array('marked', 'replied', 'friend', 'foe');
|
||||
$color_rows = array('marked', 'replied');
|
||||
|
||||
// only show the friend/foe color rows if the module is enabled
|
||||
$zebra_enabled = false;
|
||||
|
||||
$_module = new p_master();
|
||||
$_module->list_modules('ucp');
|
||||
$_module->set_active('zebra');
|
||||
|
||||
$zebra_enabled = ($_module->active_module === false) ? false : true;
|
||||
|
||||
unset($_module);
|
||||
|
||||
if ($zebra_enabled)
|
||||
{
|
||||
$color_rows = array_merge($color_rows, array('friend', 'foe'));
|
||||
}
|
||||
|
||||
foreach ($color_rows as $var)
|
||||
{
|
||||
|
Reference in New Issue
Block a user