1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

merge revisions i missed... hopefully not breaking things - did not check every change.

git-svn-id: file:///svn/phpbb/trunk@9077 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2008-11-22 19:38:25 +00:00
parent 47b4b83468
commit d46e8e6f98
33 changed files with 161 additions and 59 deletions

View File

@@ -84,6 +84,11 @@ class acm
@flock($fp, LOCK_UN);
fclose($fp);
if (!function_exists('phpbb_chmod'))
{
include(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT);
}
phpbb_chmod($this->cache_dir . 'data_global.' . PHP_EXT, CHMOD_WRITE);
}
else
@@ -182,6 +187,11 @@ class acm
@flock($fp, LOCK_UN);
fclose($fp);
if (!function_exists('phpbb_chmod'))
{
include(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT);
}
phpbb_chmod($this->cache_dir . "data{$var_name}." . PHP_EXT, CHMOD_WRITE);
}
}
@@ -392,6 +402,11 @@ class acm
@flock($fp, LOCK_UN);
fclose($fp);
if (!function_exists('phpbb_chmod'))
{
include(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT);
}
phpbb_chmod($filename, CHMOD_WRITE);
$query_result = $query_id;

View File

@@ -768,6 +768,8 @@ class acp_attachments
$s_forum_id_options = '';
/** @todo use in-built function **/
$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
FROM ' . FORUMS_TABLE . '
ORDER BY left_id ASC';
@@ -798,7 +800,7 @@ class acp_attachments
}
else if ($row['left_id'] > $right + 1)
{
$padding = $padding_store[$row['parent_id']];
$padding = empty($padding_store[$row['parent_id']]) ? '' : $padding_store[$row['parent_id']];
}
$right = $row['right_id'];
@@ -1171,7 +1173,7 @@ class acp_attachments
$location .= '/';
}
if (@is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000)
if (@file_exists($location) && @is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000)
{
$imagick = str_replace('\\', '/', $location);
continue;

View File

@@ -87,7 +87,7 @@ class acp_groups
// Approve, demote or promote
$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
$error = group_user_attributes($action, $group_id, $mark_ary, false, $group_name);
if (!$error)
{
switch ($action)
@@ -111,7 +111,7 @@ class acp_groups
{
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING);
}
break;
case 'default':
@@ -179,7 +179,7 @@ class acp_groups
case 'deleteusers':
case 'delete':
if (!$group_id)
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@@ -187,6 +187,7 @@ class acp_groups
{
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
{
$error = '';
@@ -751,14 +752,14 @@ class acp_groups
foreach ($row_ary as $group_id => $row)
{
$group_name = (!empty($user->lang['G_' . $row['group_name']]))? $user->lang['G_' . $row['group_name']] : $row['group_name'];
$template->assign_block_vars('groups', array(
'U_LIST' => "{$this->u_action}&action=list&g=$group_id",
'U_EDIT' => "{$this->u_action}&action=edit&g=$group_id",
'U_DELETE' => ($auth->acl_get('a_groupdel')) ? "{$this->u_action}&action=delete&g=$group_id" : '',
'S_GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL) ? true : false,
'GROUP_NAME' => $group_name,
'TOTAL_MEMBERS' => $row['total_members'],
)

View File

@@ -483,7 +483,8 @@ class acp_main
if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) && is_writable(PHPBB_ROOT_PATH . 'config.' . PHP_EXT))
{
$template->assign_var('S_WRITABLE_CONFIG', true);
// World-Writable? (000x)
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) & 0x0002));
}
$this->tpl_name = 'acp_main';

View File

@@ -688,7 +688,7 @@ parse_css_file = {PARSE_CSS_FILE}
}
fwrite($fp, $template_data);
fclose($fp);
// destroy the cached version of the template (filename without extension)
$this->clear_template_cache($template_info, array(substr($template_file, 0, -5)));
@@ -826,7 +826,7 @@ parse_css_file = {PARSE_CSS_FILE}
trigger_error($user->lang['TEMPLATE_CACHE_CLEARED'] . adm_back_link($this->u_action . "&action=cache&id=$template_id"));
}
$cache_prefix = 'tpl_' . $template_row['template_path'];
$cache_prefix = 'tpl_' . str_replace('_', '-', $template_row['template_path']);
// Someone wants to see the cached source ... so we'll highlight it,
// add line numbers and indent it appropriately. This could be nasty
@@ -1638,7 +1638,6 @@ parse_css_file = {PARSE_CSS_FILE}
if ($mode == 'template' || $inc_template)
{
$template_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['template_name'], $style_row['template_copyright'], $config['version']), $this->template_cfg);
$template_cfg .= "\nbbcode_bitfield = {$style_row['bbcode_bitfield']}";
$data[] = array(
'src' => $template_cfg,
@@ -2193,7 +2192,7 @@ parse_css_file = {PARSE_CSS_FILE}
{
global $user;
$cache_prefix = 'tpl_' . $template_path;
$cache_prefix = 'tpl_' . str_replace('_', '-', $template_path);
if (!($dp = @opendir(PHPBB_ROOT_PATH . 'cache')))
{
@@ -2229,7 +2228,7 @@ parse_css_file = {PARSE_CSS_FILE}
{
global $user;
$cache_prefix = 'tpl_' . $template_row['template_path'];
$cache_prefix = 'tpl_' . str_replace('_', '-', $template_row['template_path']);
if (!$file_ary || !is_array($file_ary))
{
@@ -3069,4 +3068,4 @@ parse_css_file = {PARSE_CSS_FILE}
}
}
?>
?>

View File

@@ -3547,9 +3547,6 @@ function page_header($page_title = '', $display_online_list = true)
'S_BOARD_DISABLED' => ($config['board_disable']) ? true : false,
'S_REGISTERED_USER' => (!empty($user->data['is_registered'])) ? true : false,
'S_IS_BOT' => (!empty($user->data['is_bot'])) ? true : false,
'S_IN_SEARCH' => false,
'S_VIEWTOPIC' => false,
'S_VIEWFORUM' => false,
'S_USER_PM_POPUP' => $user->optionget('popuppm'),
'S_USER_LANG' => $user_lang,
'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'],

View File

@@ -691,7 +691,7 @@ class queue
if ($fp = @fopen($this->cache_file, 'wb'))
{
@flock($fp, LOCK_EX);
fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->queue_data, true) . ";\n?>");
fwrite($fp, "<?php\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>");
@flock($fp, LOCK_UN);
fclose($fp);
@@ -732,7 +732,7 @@ class queue
if ($fp = @fopen($this->cache_file, 'w'))
{
@flock($fp, LOCK_EX);
fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->data, true) . ";\n?>");
fwrite($fp, "<?php\n\$this->queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>");
@flock($fp, LOCK_UN);
fclose($fp);

View File

@@ -67,7 +67,7 @@ class template
public function set_custom_template($template_path, $template_name)
{
$this->root = $template_path;
$this->cachepath = PHPBB_ROOT_PATH . 'cache/ctpl_' . $template_name . '_';
$this->cachepath = PHPBB_ROOT_PATH . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_';
return true;
}
@@ -174,7 +174,7 @@ class template
}
else
{
// if we could not eval AND the file exists, something horrific has occured
// if we could not eval AND the file exists, something horrific has occured
return false;
}

View File

@@ -418,6 +418,26 @@ function compose_pm($id, $mode, $action)
$max_recipients = (!$max_recipients) ? $config['pm_max_recipients'] : $max_recipients;
// If this is a quote/reply "to all"... we may increase the max_recpients to the number of original recipients
if (($action == 'reply' || $action == 'quote') && $max_recipients)
{
// We try to include every previously listed member from the TO Header
$list = rebuild_header(array('to' => $post['to_address']));
// Can be an empty array too ;)
$list = (!empty($list['u'])) ? $list['u'] : array();
$list[$post['author_id']] = 'to';
if (isset($list[$user->data['user_id']]))
{
unset($list[$user->data['user_id']]);
}
$max_recipients = ($max_recipients < sizeof($list)) ? sizeof($list) : $max_recipients;
unset($list);
}
// Handle User/Group adding/removing
handle_message_list_actions($address_list, $error, $remove_u, $remove_g, $add_to, $add_bcc);