mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-08 17:56:52 +02:00
- added class="radio" to all radio- and checkboxes
- make sure the database gets closed correctly in cron.php - bugfixes git-svn-id: file:///svn/phpbb/trunk@6055 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -775,7 +775,7 @@ class acp_language
|
||||
$radio_buttons = '';
|
||||
foreach ($methods as $method)
|
||||
{
|
||||
$radio_buttons .= '<input type="radio"' . ((!$radio_buttons) ? ' id="use_method"' : '') . ' value="' . $method . '" name="use_method" /> ' . $method . ' ';
|
||||
$radio_buttons .= '<input type="radio"' . ((!$radio_buttons) ? ' id="use_method"' : '') . ' class="radio" value="' . $method . '" name="use_method" /> ' . $method . ' ';
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
|
@@ -1850,7 +1850,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
|
||||
$format_buttons = '';
|
||||
foreach ($methods as $method)
|
||||
{
|
||||
$format_buttons .= '<input type="radio"' . ((!$format_buttons) ? ' id="format"' : '') . ' value="' . $method . '" name="format"' . (($method == $format) ? ' checked="checked"' : '') . ' /> ' . $method . ' ';
|
||||
$format_buttons .= '<input type="radio"' . ((!$format_buttons) ? ' id="format"' : '') . ' class="radio" value="' . $method . '" name="format"' . (($method == $format) ? ' checked="checked"' : '') . ' /> ' . $method . ' ';
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
|
@@ -223,8 +223,8 @@ class acp_users
|
||||
|
||||
user_ban(substr($action, 3), $ban, 0, 0, 0, $user->lang[$reason]);
|
||||
|
||||
add_log('admin', $log, $user->lang['reason']);
|
||||
add_log('user', $user_id, $log, $user->lang['reason']);
|
||||
add_log('admin', $log, $user->lang[$reason]);
|
||||
add_log('user', $user_id, $log, $user->lang[$reason]);
|
||||
|
||||
trigger_error($user->lang['BAN_SUCCESSFUL'] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||
|
||||
|
@@ -2747,6 +2747,19 @@ function page_footer()
|
||||
|
||||
$template->display('body');
|
||||
|
||||
garbage_collection();
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closing the cache object and the database
|
||||
* Cool function name, eh? We might want to add operations to it later
|
||||
*/
|
||||
function garbage_collection()
|
||||
{
|
||||
global $cache, $db;
|
||||
|
||||
// Unload cache, must be done before the DB connection if closed
|
||||
if (!empty($cache))
|
||||
{
|
||||
@@ -2755,8 +2768,6 @@ function page_footer()
|
||||
|
||||
// Close our DB connection.
|
||||
$db->sql_close();
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
@@ -2119,7 +2119,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
'forum_id' => $row['forum_id'],
|
||||
'topic_id' => $row['topic_id'],
|
||||
|
||||
'viewforum' => ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
|
||||
'viewforum' => ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : false,
|
||||
'action' => (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',
|
||||
);
|
||||
|
||||
@@ -2195,8 +2195,8 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
|
||||
foreach ($log as $key => $row)
|
||||
{
|
||||
$log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id']) : '';
|
||||
$log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, $user->session_id) : '';
|
||||
$log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id']) : false;
|
||||
$log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, $user->session_id) : false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2214,7 +2214,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
|
||||
foreach ($log as $key => $row)
|
||||
{
|
||||
$log[$key]['reportee_username'] = (isset($reportee_names_list[$row['reportee_id']])) ? '<a href="' . $profile_url . '&u=' . $row['reportee_id'] . '">' . $reportee_names_list[$row['reportee_id']] . '</a>' : '';
|
||||
$log[$key]['reportee_username'] = (isset($reportee_names_list[$row['reportee_id']])) ? '<a href="' . $profile_url . '&u=' . $row['reportee_id'] . '">' . $reportee_names_list[$row['reportee_id']] . '</a>' : false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -280,7 +280,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
|
||||
case ACTION_MARK_AS_READ:
|
||||
case ACTION_MARK_AS_IMPORTANT:
|
||||
case ACTION_DELETE_MESSAGE:
|
||||
return array('action' => $rule_row['rule_action'], 'unread' => $message_row['unread'], 'important' => $message_row['important']);
|
||||
return array('action' => $rule_row['rule_action'], 'unread' => $message_row['unread'], 'marked' => $message_row['marked']);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -465,7 +465,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
|
||||
break;
|
||||
|
||||
case ACTION_MARK_AS_IMPORTANT:
|
||||
if (!$rule_ary['important'])
|
||||
if (!$rule_ary['marked'])
|
||||
{
|
||||
$important_ids[] = $msg_id;
|
||||
}
|
||||
|
@@ -963,7 +963,7 @@ class custom_profile_admin extends custom_profile
|
||||
);
|
||||
|
||||
$options = array(
|
||||
0 => array('TITLE' => $user->lang['FIELD_TYPE'], 'EXPLAIN' => $user->lang['BOOL_TYPE_EXPLAIN'], 'FIELD' => '<input type="radio" name="field_length" value="1"' . (($this->vars['field_length'] == 1) ? ' checked="checked"' : '') . ' />' . $user->lang['RADIO_BUTTONS'] . ' <input type="radio" name="field_length" value="2"' . (($this->vars['field_length'] == 2) ? ' checked="checked"' : '') . ' />' . $user->lang['CHECKBOX'] . ' '),
|
||||
0 => array('TITLE' => $user->lang['FIELD_TYPE'], 'EXPLAIN' => $user->lang['BOOL_TYPE_EXPLAIN'], 'FIELD' => '<input type="radio" class="radio" name="field_length" value="1"' . (($this->vars['field_length'] == 1) ? ' checked="checked"' : '') . ' />' . $user->lang['RADIO_BUTTONS'] . ' <input type="radio" class="radio" name="field_length" value="2"' . (($this->vars['field_length'] == 2) ? ' checked="checked"' : '') . ' />' . $user->lang['CHECKBOX'] . ' '),
|
||||
1 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row))
|
||||
);
|
||||
|
||||
@@ -1029,7 +1029,7 @@ class custom_profile_admin extends custom_profile
|
||||
|
||||
$options = array(
|
||||
0 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row)),
|
||||
1 => array('TITLE' => $user->lang['ALWAYS_TODAY'], 'FIELD' => '<input type="radio" name="always_now" value="1"' . (($s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $user->lang['YES'] . ' <input type="radio" name="always_now" value="0"' . ((!$s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $user->lang['NO']),
|
||||
1 => array('TITLE' => $user->lang['ALWAYS_TODAY'], 'FIELD' => '<input type="radio" class="radio" name="always_now" value="1"' . (($s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $user->lang['YES'] . ' <input type="radio" class="radio" name="always_now" value="0"' . ((!$s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $user->lang['NO']),
|
||||
);
|
||||
|
||||
return $options;
|
||||
|
@@ -324,7 +324,7 @@ class mcp_queue
|
||||
$poster = $row['username'];
|
||||
}
|
||||
|
||||
$s_checkbox = '<input type="checkbox" name="post_id_list[]" value="' . $row['post_id'] . '" />';
|
||||
$s_checkbox = '<input type="checkbox" class="radio" name="post_id_list[]" value="' . $row['post_id'] . '" />';
|
||||
|
||||
$global_topic = ($row['forum_id']) ? false : true;
|
||||
if ($global_topic)
|
||||
|
@@ -295,7 +295,7 @@ class mcp_reports
|
||||
$poster = $row['username'];
|
||||
}
|
||||
|
||||
$s_checkbox = '<input type="checkbox" name="post_id_list[]" value="' . $row['post_id'] . '" />';
|
||||
$s_checkbox = '<input type="checkbox" class="radio" name="post_id_list[]" value="' . $row['post_id'] . '" />';
|
||||
|
||||
$template->assign_block_vars('postrow', array(
|
||||
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
|
||||
|
@@ -119,7 +119,7 @@ function mcp_topic_view($id, $mode, $action)
|
||||
$message = str_replace("\n", '<br />', $message);
|
||||
|
||||
$checked = ($post_id_list && in_array(intval($row['post_id']), $post_id_list)) ? 'checked="checked" ' : '';
|
||||
$s_checkbox = '<input type="checkbox" name="post_id_list[]" value="' . $row['post_id'] . '" ' . $checked . '/>';
|
||||
$s_checkbox = '<input type="checkbox" class="radio" name="post_id_list[]" value="' . $row['post_id'] . '" ' . $checked . '/>';
|
||||
|
||||
if (!$row['post_approved'])
|
||||
{
|
||||
|
@@ -269,21 +269,9 @@ class bbcode_firstpass extends bbcode
|
||||
}
|
||||
}
|
||||
|
||||
// Is the user trying to link to a php file in this domain and script path?
|
||||
if (strpos($in, ".{$phpEx}") !== false && strpos($in, substr($user->page['root_script_path'], 0, -1)) !== false)
|
||||
if ($this->path_in_domain($in))
|
||||
{
|
||||
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
|
||||
// Forcing server vars is the only way to specify/override the protocol
|
||||
if ($config['force_server_vars'] || !$server_name)
|
||||
{
|
||||
$server_name = $config['server_name'];
|
||||
}
|
||||
|
||||
if (strpos($in, $server_name) !== false)
|
||||
{
|
||||
return '[img]' . $in . '[/img]';
|
||||
}
|
||||
return '[img]' . $in . '[/img]';
|
||||
}
|
||||
|
||||
return '[img:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($in) . '[/img:' . $this->bbcode_uid . ']';
|
||||
@@ -317,21 +305,9 @@ class bbcode_firstpass extends bbcode
|
||||
}
|
||||
}
|
||||
|
||||
// Is the user trying to link to a php file in this domain and script path?
|
||||
if (strpos($in, ".{$phpEx}") !== false && strpos($in, substr($user->page['root_script_path'], 0, -1)) !== false)
|
||||
if ($this->path_in_domain($in))
|
||||
{
|
||||
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
|
||||
// Forcing server vars is the only way to specify/override the protocol
|
||||
if ($config['force_server_vars'] || !$server_name)
|
||||
{
|
||||
$server_name = $config['server_name'];
|
||||
}
|
||||
|
||||
if (strpos($in, $server_name) !== false)
|
||||
{
|
||||
return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]';
|
||||
}
|
||||
return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]';
|
||||
}
|
||||
|
||||
return '[flash=' . $width . ',' . $height . ':' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($in) . '[/flash:' . $this->bbcode_uid . ']';
|
||||
@@ -796,6 +772,43 @@ class bbcode_firstpass extends bbcode
|
||||
|
||||
return '[url' . (($var1) ? '=' . $var1 : '') . ']' . $var2 . '[/url]';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if url is pointing to this domain/script_path/php-file
|
||||
*
|
||||
* @param string $url the url to check
|
||||
* @return true if the url is pointing to this domain/script_path/php-file, false if not
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function path_in_domain($url)
|
||||
{
|
||||
global $config, $phpEx, $user;
|
||||
|
||||
// Is the user trying to link to a php file in this domain and script path?
|
||||
if (strpos($url, ".{$phpEx}") !== false && strpos($url, substr($user->page['root_script_path'], 0, -1)) !== false)
|
||||
{
|
||||
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
|
||||
// Forcing server vars is the only way to specify/override the protocol
|
||||
if ($config['force_server_vars'] || !$server_name)
|
||||
{
|
||||
$server_name = $config['server_name'];
|
||||
}
|
||||
|
||||
// Check again in correct order...
|
||||
$pos_ext = strpos($url, ".{$phpEx}");
|
||||
$pos_path = strpos($url, substr($user->page['root_script_path'], 0, -1));
|
||||
$pos_domain = strpos($url, $server_name);
|
||||
|
||||
if ($pos_domain !== false && $pos_path >= $pos_domain && $pos_ext >= $pos_path)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -18,7 +18,8 @@ class ucp_groups
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
|
||||
global $config, $phpbb_root_path, $phpEx;
|
||||
global $db, $user, $auth, $cache, $template;
|
||||
|
||||
$user->add_lang('groups');
|
||||
|
||||
|
Reference in New Issue
Block a user