Merge branch 'develop-olympus' into develop

I simply used the develop-olympus version of all files that conflicted.
Afterall there should not have been anything new in develop yet.
This commit is contained in:
Nils Adermann 2010-03-03 23:32:09 +01:00
commit 693a2dc99b
127 changed files with 6192 additions and 962 deletions

408
build/build_diff.php Executable file
View file

@ -0,0 +1,408 @@
#!/usr/bin/env php
<?php
/**
*
* @package build
* @version $Id$
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
// CONFIG - Begin
$substitute_old = '3.0.6';
$substitute_new = '3.0.7';
$simple_name_old = 'phpbb306';
$simple_name_new = 'phpbb307';
$echo_changes = false;
// Set this to true to just compress the changes and do not build them again
// This should be used for building custom modified txt file. ;)
$package_changed_files = false;
// CONFIG - End
//$debug_file = 'includes/functions_user.php'; //'styles/prosilver/style.cfg';
$debug_file = false;
if ($debug_file !== false)
{
$echo_changes = false;
}
$s_name = 'save_' . $substitute_old . '_to_' . $substitute_new;
$location = dirname(__FILE__);
if (!$package_changed_files)
{
if (!$echo_changes)
{
// Cleanup...
run_command("rm -R $location/save/*");
// Create directory...
run_command("mkdir $location/save/{$s_name}");
run_command("mkdir $location/save/{$s_name}/language");
run_command("mkdir $location/save/{$s_name}/prosilver");
run_command("mkdir $location/save/{$s_name}/subsilver2");
}
}
// Build code changes and place them into 'save'
if (!$package_changed_files)
{
build_code_changes('language');
build_code_changes('prosilver');
build_code_changes('subsilver2');
}
// Package code changes
$code_changes_filename = 'phpBB-' . $substitute_old . '_to_' . $substitute_new . '-codechanges';
if (!$echo_changes)
{
// Now compress the files...
// Build Main phpBB Release
$compress_programs = array(
// 'tar.gz' => 'tar -czf',
'tar.bz2' => 'tar -cjf',
'zip' => 'zip -r'
);
chdir($location . '/save/' . $s_name);
foreach ($compress_programs as $extension => $compress_command)
{
echo "Packaging code changes for $extension\n";
run_command("rm ./../../release_files/{$code_changes_filename}.{$extension}");
flush();
// Build Package
run_command("$compress_command ./../../release_files/{$code_changes_filename}.{$extension} *");
// Build MD5 Sum
run_command("md5sum ./../../release_files/{$code_changes_filename}.{$extension} > ./../../release_files/{$code_changes_filename}.{$extension}.md5");
flush();
}
}
/**
* $output_format can be: language, prosilver and subsilver2
*/
function build_code_changes($output_format)
{
global $substitute_new, $substitute_old, $simple_name_old, $simple_name_new, $echo_changes, $package_changed_files, $location, $debug_file, $s_name;
// Global array holding the data entries
$data = array(
'header' => array(),
'diff' => array(),
);
// Read diff file and prepare the output filedata...
//$patch_filename = '../new_version/patches/phpBB-' . $substitute_old . '_to_' . $substitute_new . '.patch';
$release_filename = 'phpbb-' . $substitute_old . '_to_' . $substitute_new . '_' . $output_format . '.txt';
if (!$package_changed_files)
{
if (!$echo_changes)
{
$fp = fopen('save/' . $s_name . '/' . $output_format . '/' . $release_filename, 'wb');
if (!$fp)
{
die('Unable to create ' . $release_filename);
}
}
}
include_once($location . '/build_helper.php');
$package = new build_package(array($substitute_old, $substitute_new), false);
$titles = array(
'language' => 'phpBB ' . $substitute_old . ' to phpBB ' . $substitute_new . ' Language Pack Changes',
'prosilver' => 'phpBB ' . $substitute_old . ' to phpBB ' . $substitute_new . ' prosilver Changes',
'subsilver2' => 'phpBB ' . $substitute_old . ' to phpBB ' . $substitute_new . ' subsilver2 Changes',
);
$data['header'] = array(
'title' => $titles[$output_format],
'intro' => '
These are the ' . $titles[$output_format] . ' summed up into a little Mod. These changes are only partial and do not include any code changes, therefore not meant for updating phpBB.
',
'included_files' => array(),
);
// We collect the files we want to diff first (ironically we grab this from a diff file)
if (!$echo_changes)
{
echo "\n\nCollecting Filenames:";
}
// We re-create the patch file
foreach ($package->old_packages as $_package_name => $dest_package_filename)
{
chdir($package->locations['old_versions']);
if (!$echo_changes)
{
echo "\n\n" . 'Creating patch/diff files for phpBB-' . $dest_package_filename . $package->get('new_version_number');
}
$dest_package_filename = $location . '/save/' . $s_name . '/phpBB-' . $dest_package_filename . $package->get('new_version_number') . '.patch';
$package->run_command('diff ' . $package->diff_options . ' ' . $_package_name . ' ' . $package->get('simple_name') . ' > ' . $dest_package_filename);
// Parse this diff to determine file changes from the checked versions and save them
$result = $package->collect_diff_files($dest_package_filename, $_package_name);
$package->run_command('rm ' . $dest_package_filename);
}
chdir($location);
$filenames = array();
foreach ($result['files'] as $filename)
{
if ($debug_file !== false && $filename != $debug_file)
{
continue;
}
// Decide which files to compare...
switch ($output_format)
{
case 'language':
if (strpos($filename, 'language/en/') !== 0)
{
continue 2;
}
break;
case 'prosilver':
if (strpos($filename, 'styles/prosilver/') !== 0)
{
continue 2;
}
break;
case 'subsilver2':
if (strpos($filename, 'styles/subsilver2/') !== 0)
{
continue 2;
}
break;
}
if (!file_exists($location . '/old_versions/' . $simple_name_old . '/' . $filename))
{
// New file... include it
$data['header']['included_files'][] = array(
'old' => $location . '/old_versions/' . $simple_name_old . '/' . $filename,
'new' => $location . '/old_versions/' . $simple_name_new . '/' . $filename,
'phpbb_filename' => $filename,
);
continue;
}
$filenames[] = array(
'old' => $location . '/old_versions/' . $simple_name_old . '/' . $filename,
'new' => $location . '/old_versions/' . $simple_name_new . '/' . $filename,
'phpbb_filename' => $filename,
);
}
// Now let us go through the filenames list and create a more comprehensive diff
if (!$echo_changes)
{
fwrite($fp, build_header($output_format, $filenames, $data['header']));
}
else
{
//echo build_header('text', $filenames, $data['header']);
}
// Copy files...
$files_to_copy = array();
foreach ($data['header']['included_files'] as $filename)
{
$files_to_copy[] = $filename['phpbb_filename'];
}
// First step is to copy the new version over (clean structure)
if (!$echo_changes && sizeof($files_to_copy))
{
foreach ($files_to_copy as $file)
{
// Create directory?
$dirname = dirname($file);
if ($dirname)
{
$dirname = explode('/', $dirname);
$__dir = array();
foreach ($dirname as $i => $dir)
{
$__dir[] = $dir;
run_command("mkdir -p $location/save/" . $s_name . '/' . $output_format . '/' . implode('/', $__dir));
}
}
$source_file = $location . '/new_version/phpBB3/' . $file;
$dest_file = $location . '/save/' . $s_name . '/' . $output_format . '/';
$dest_file .= $file;
$command = "cp -p $source_file $dest_file";
$result = trim(`$command`);
echo "- Copied File: " . $source_file . " -> " . $dest_file . "\n";
}
}
include_once('diff_class.php');
if (!$echo_changes)
{
echo "\n\nDiffing Codebases:";
}
foreach ($filenames as $file_ary)
{
if (!file_exists($file_ary['old']))
{
$lines1 = array();
}
else
{
$lines1 = file($file_ary['old']);
}
$lines2 = file($file_ary['new']);
if (!sizeof($lines1))
{
// New File
}
else
{
$diff = new Diff($lines1, $lines2);
$fmt = new BBCodeDiffFormatter(false, 5, $debug_file);
if (!$echo_changes)
{
fwrite($fp, $fmt->format_open($file_ary['phpbb_filename']));
fwrite($fp, $fmt->format($diff, $lines1));
fwrite($fp, $fmt->format_close($file_ary['phpbb_filename']));
}
else
{
echo $fmt->format_open($file_ary['phpbb_filename']);
echo $fmt->format($diff, $lines1);
echo $fmt->format_close($file_ary['phpbb_filename']);
}
if ($debug_file !== false)
{
echo $fmt->format_open($file_ary['phpbb_filename']);
echo $fmt->format($diff, $lines1);
echo $fmt->format_close($file_ary['phpbb_filename']);
exit;
}
}
}
if (!$echo_changes)
{
fwrite($fp, build_footer($output_format));
// Close file
fclose($fp);
chmod('save/' . $s_name . '/' . $output_format . '/' . $release_filename, 0666);
}
else
{
echo build_footer($output_format);
}
}
/**
* Build Footer
*/
function build_footer($mode)
{
$html = '';
$html .= "# \n";
$html .= "#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ \n";
$html .= "# \n";
$html .= "# EoM";
return $html;
}
/**
* Build Header
*/
function build_header($mode, $filenames, $header)
{
global $substitute_old;
$html = '';
$html .= "############################################################## \n";
$html .= "## Title: " . $header['title'] . "\n";
$html .= "## Author: naderman < naderman@phpbb.com > (Nils Adermann) http://www.phpbb.com \n";
$html .= "## Description: \n";
$intr = explode("\n", $header['intro']);
$introduction = '';
foreach ($intr as $_line)
{
$introduction .= wordwrap($_line, 80) . "\n";
}
$intr = explode("\n", $introduction);
foreach ($intr as $_line)
{
$html .= "## " . $_line . "\n";
}
$html .= "## \n";
$html .= "## Files To Edit: \n";
foreach ($filenames as $file_ary)
{
$html .= "## " . $file_ary['phpbb_filename'] . "\n";
}
$html .= "##\n";
if (sizeof($header['included_files']))
{
$html .= "## Included Files: \n";
foreach ($header['included_files'] as $filename)
{
$html .= "## {$filename['phpbb_filename']}\n";
}
}
$html .= "## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 \n";
$html .= "############################################################## \n";
$html .= "\n";
// COPY Statement?
if (sizeof($header['included_files']))
{
$html .= "#\n#-----[ COPY ]------------------------------------------\n#\n";
foreach ($header['included_files'] as $filename)
{
$html .= "copy {$filename['phpbb_filename']} to {$filename['phpbb_filename']}\n";
}
$html .= "\n";
}
return $html;
}
function run_command($command)
{
$result = trim(`$command`);
echo "\n- Command Run: " . $command . "\n";
}
?>

485
build/build_helper.php Normal file
View file

@ -0,0 +1,485 @@
<?php
/**
*
* @package build
* @version $Id$
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
class build_package
{
var $package_infos;
var $old_packages;
var $versions;
var $locations;
var $clean_directory_structure;
var $files_to_copy;
var $files_to_remove;
var $remove_from_diff_structure;
// -c - context diff
// -r - compare recursive
// -N - Treat missing files as empty
// -E - Ignore tab expansions
// not used: -b - Ignore space changes.
// -w - Ignore all whitespace
// -B - Ignore blank lines
// -d - Try to find smaller set of changes
var $diff_options = '-crNEBwd';
var $diff_options_long = '-x images -crNEB'; // -x fonts -x imageset //imageset not used here, because it includes the imageset.cfg file. ;)
var $verbose = false;
var $status_begun = false;
var $num_dots = 0;
function build_package($versions, $verbose = false)
{
$this->versions = $versions;
$this->verbose = $verbose;
// Get last two entries
$_latest = $this->versions[sizeof($this->versions) - 1];
$_before = $this->versions[sizeof($this->versions) - 2];
$this->locations = array(
'new_version' => dirname(dirname(__FILE__)) . '/phpBB/',
'old_versions' => dirname(__FILE__) . '/old_versions/',
'root' => dirname(__FILE__) . '/',
'package_dir' => dirname(__FILE__) . '/new_version/'
);
$this->package_infos = array(
'package_name' => 'phpBB3',
'name_prefix' => 'phpbb',
'simple_name' => 'phpbb' . str_replace('.', '', $_latest),
'new_version_number' => $_latest,
'short_version_number' => str_replace('.', '', $_latest),
'release_filename' => 'phpBB-' . $_latest,
'last_version' => 'phpbb' . str_replace('.', '', $_before),
'last_version_number' => $_before,
);
$this->package_infos['dest_dir'] = $this->locations['package_dir'] . $this->package_infos['package_name'];
$this->package_infos['diff_dir'] = $this->locations['old_versions'] . $this->package_infos['simple_name'];
$this->package_infos['patch_directory'] = $this->locations['package_dir'] . 'patches';
$this->package_infos['files_directory'] = $this->locations['package_dir'] . 'files';
$this->package_infos['update_directory'] = $this->locations['package_dir'] . 'update';
$this->package_infos['release_directory'] = $this->locations['package_dir'] . 'release_files';
// Old packages always exclude the latest version. ;)
$this->old_packages = array();
foreach ($this->versions as $package_version)
{
if ($package_version == $_latest)
{
continue;
}
$this->old_packages['phpbb' . str_replace('.', '', $package_version)] = $package_version . '_to_';
}
// We need to make sure this is up to date with the latest version
$this->clean_directory_structure = array(
'adm' => array(
'images' => '',
'style' => '',
),
'cache' => '',
'docs' => '',
'download' => '',
'files' => '',
'images' => array(
'avatars' => array(
'gallery' => '',
'upload' => '',
),
'icons' => array(
'misc' => '',
'smile' => '',
),
'ranks' => '',
'smilies' => '',
'upload_icons' => '',
),
'includes' => array(
'acm' => '',
'acp' => array(
'info' => '',
),
'auth' => '',
'captcha' => array(
'plugins' => '',
),
'diff' => '',
'db' => '',
'hooks' => '',
'mcp' => array(
'info' => '',
),
'questionnaire' => '',
'search' => '',
'ucp' => array(
'info' => '',
),
'utf' => array(
'data' => '',
),
),
'install' => array(
'convertors'=> '',
'schemas' => '',
// 'data' => '',
),
'language' => array(
'en' => array(
'acp' => '',
'email' => '',
'mods' => '',
),
),
'store' => '',
'styles' => array(
'subsilver2' => array(
'imageset' => array(
'en' => '',
),
'template' => '',
'theme' => array(
'images' => '',
),
),
'prosilver' => array(
'imageset' => array(
'en' => '',
),
'template' => '',
'theme' => array(
'images' => '',
),
),
),
);
// Files to remove (not include within package)
$this->files_to_remove = array(); //array('includes/utf/data/recode_cjk.php');
// Files within the main directory to copy - do not include config.php
$this->files_to_copy = array(
'.htaccess', 'common.php', 'cron.php', 'faq.php', 'feed.php', 'index.php', 'mcp.php', 'memberlist.php', 'posting.php', 'report.php',
'search.php', 'style.php', 'ucp.php', 'viewforum.php', 'viewonline.php', 'viewtopic.php'
);
// These files/directories will be removed and not used for creating the patch files
$this->remove_from_diff_structure = array(
'config.php', 'cache', 'docs', 'files', 'install', 'store', 'develop'
);
// Writeable directories
$this->writeable = array('cache', 'store', 'images/avatars/upload', 'files');
// Fill the rest of the files_to_copy array
foreach ($this->clean_directory_structure as $cur_dir => $dir_struct)
{
$this->_fill_files_to_copy($this->locations['new_version'] . $cur_dir, $cur_dir, $dir_struct);
}
}
function get($var)
{
return $this->package_infos[$var];
}
function _fill_files_to_copy($directory, $cur_dir, $dir_struct)
{
$dh = opendir($directory);
while ($file = readdir($dh))
{
if (is_file($directory . '/' . $file) && $file != '.' && $file != '..')
{
$_loc = str_replace($this->locations['new_version'], '', $directory . '/' . $file);
if (in_array($_loc, $this->files_to_remove))
{
continue;
}
$this->files_to_copy[] = $cur_dir . '/' . $file;
}
}
closedir($dh);
if (is_array($dir_struct))
{
foreach ($dir_struct as $_cur_dir => $_dir_struct)
{
$this->_fill_files_to_copy($directory . '/' . $_cur_dir, $cur_dir . '/' . $_cur_dir, $_dir_struct);
}
}
}
function adjust_permissions($directory)
{
$dh = opendir($directory);
while ($file = readdir($dh))
{
if ($file == '.' || $file == '..' || $file == '.svn')
{
continue;
}
// If file, then 644
if (is_file($directory . '/' . $file))
{
chmod($directory . '/' . $file, 0644);
}
else if (is_dir($directory . '/' . $file))
{
$_loc = str_replace($this->package_infos['dest_dir'] . '/', '', $directory . '/' . $file);
// If directory is within the writeable chmod to 777, else 755
$mode = (in_array($_loc, $this->writeable)) ? 0777 : 0755;
chmod($directory . '/' . $file, $mode);
// Now traverse to the directory
$this->adjust_permissions($directory . '/' . $file);
}
}
closedir($dh);
}
function begin_status($headline)
{
if ($this->status_begun)
{
echo "\nDone.\n\n";
}
$this->num_dots = 0;
echo $headline . "\n ";
$this->status_begun = true;
}
function run_command($command)
{
$result = trim(`$command`);
if ($this->verbose)
{
echo " command : " . getcwd() . '$ ' . $command . "\n";
echo " result : " . $result . "\n";
}
else
{
if ($this->num_dots > 70)
{
echo "\n";
$this->num_dots = 0;
}
echo '.';
$this->num_dots++;
}
flush();
}
function create_directory($directory, $dir_struct)
{
if (!file_exists($directory))
{
$this->run_command("mkdir $directory");
}
if (is_array($dir_struct))
{
foreach ($dir_struct as $_dir => $_dir_struct)
{
$this->create_directory($directory . '/' . $_dir, $_dir_struct);
}
}
}
function collect_diff_files($diff_filename, $package_name)
{
$diff_result = $binary = array();
$diff_contents = file($diff_filename);
$special_diff_contents = array();
foreach ($diff_contents as $num => $line)
{
$line = trim($line);
if (!$line)
{
continue;
}
// Special diff content?
if (strpos($line, 'diff ' . $this->diff_options . ' ') === 0 || strpos($line, '*** ') === 0 || strpos($line, '--- ') === 0 || (strpos($line, ' Exp $') !== false && strpos($line, '$Id:') !== false))
{
$special_diff_contents[] = $line;
}
else if (strpos($line, 'diff ' . $this->diff_options . ' ') === 0 || strpos($line, '*** ') === 0 || strpos($line, '--- ') === 0 || (strpos($line, ' Exp $') !== false && strpos($line, '$Id:') !== false) || (strpos($line, ' $') !== false && strpos($line, '$Id:') !== false))
{
$special_diff_contents[] = $line;
}
// Is diffing line?
if (strstr($line, 'diff ' . $this->diff_options . ' '))
{
$next_line = $diff_contents[$num+1];
if (strpos($next_line, '***') === 0)
{
// *** phpbb208/admin/admin_board.php Sat Jul 10 20:16:26 2004
$next_line = explode("\t", $next_line);
$next_line = trim($next_line[0]);
$next_line = str_replace('*** ' . $package_name . '/', '', $next_line);
$diff_result[] = $next_line;
}
}
// Is binary?
if (preg_match('/^Binary files ' . $package_name . '\/(.*) and [a-z0-9_-]+\/\1 differ/i', $line, $match))
{
$binary[] = trim($match[1]);
}
}
// Now go through the list again and find out which files have how many changes...
$num_changes = array();
/* [1070] => diff -crN phpbb200/includes/usercp_avatar.php phpbb2023/includes/usercp_avatar.php
[1071] => *** phpbb200/includes/usercp_avatar.php Sat Jul 10 20:16:13 2004
[1072] => --- phpbb2023/includes/usercp_avatar.php Wed Feb 6 22:28:04 2008
[1073] => *** 6,12 ****
[1074] => ! * $Id$
[1075] => --- 6,12 ----
[1076] => *** 51,59 ****
[1077] => --- 51,60 ----
[1078] => *** 62,80 ****
[1079] => --- 63,108 ----
[1080] => *** 87,97 ****
*/
while (($line = array_shift($special_diff_contents)) !== NULL)
{
$line = trim($line);
if (!$line)
{
continue;
}
// Is diffing line?
if (strstr($line, 'diff ' . $this->diff_options . ' '))
{
$next_line = array_shift($special_diff_contents);
if (strpos($next_line, '*** ') === 0)
{
// *** phpbb208/admin/admin_board.php Sat Jul 10 20:16:26 2004
$next_line = explode("\t", $next_line);
$next_line = trim($next_line[0]);
$next_line = str_replace('*** ' . $package_name . '/', '', $next_line);
$is_reached = false;
$prev_line = '';
while (!$is_reached)
{
$line = array_shift($special_diff_contents);
if (strpos($line, 'diff ' . $this->diff_options) === 0 || empty($special_diff_contents))
{
$is_reached = true;
array_unshift($special_diff_contents, $line);
continue;
}
if (strpos($line, '*** ') === 0 && strpos($line, ' ****') !== false)
{
$is_comment = false;
while (!(strpos($line, '--- ') === 0 && strpos($line, ' ----') !== false))
{
$line = array_shift($special_diff_contents);
if (strpos($line, ' Exp $') !== false || strpos($line, '$Id:') !== false)
{
$is_comment = true;
}
}
if (!$is_comment)
{
if (!isset($num_changes[$next_line]))
{
$num_changes[$next_line] = 1;
}
else
{
$num_changes[$next_line]++;
}
}
}
}
}
}
}
// Now remove those results not having changes
$return = array();
foreach ($diff_result as $key => $value)
{
if (isset($num_changes[$value]))
{
$return[] = $value;
}
}
foreach ($binary as $value)
{
$return[] = $value;
}
$diff_result = $return;
unset($return);
unset($special_diff_contents);
$result = array(
'files' => array(),
'binary' => array(),
'all' => $diff_result,
);
$binary_extensions = array('gif', 'jpg', 'jpeg', 'png', 'ttf');
// Split into file and binary
foreach ($diff_result as $filename)
{
if (strpos($filename, '.') === false)
{
$result['files'][] = $filename;
continue;
}
$extension = explode('.', $filename);
$extension = array_pop($extension);
if (in_array($extension, $binary_extensions))
{
$result['binary'][] = $filename;
}
else
{
$result['files'][] = $filename;
}
}
return $result;
}
}

39
build/compare.sh Executable file
View file

@ -0,0 +1,39 @@
#!/usr/bin/env bash
orig_dir="../../phpBB"
rm -rf test_release_files
mkdir test_release_files
cd test_release_files
for ext in "tar.bz2" "zip"
do
cp "../new_version/release_files/$1.$ext" ./
if [ "$ext" = "tar.bz2" ]
then
command="tar -xjf"
else
command="unzip -q"
fi
$command "$1.$ext"
for file in `find phpBB3 -name '.svn' -prune -o -type f -print`
do
orig_file="${file/#phpBB3/$orig_dir}"
diff_result=`diff $orig_file $file`
if [ -n "$diff_result" ]
then
echo "Difference in package $1.$ext"
echo $diff_result
fi
done
rm -rf phpBB3
done
cd ..
rm -rf test_release_files

1711
build/diff_class.php Normal file

File diff suppressed because it is too large Load diff

526
build/package.php Executable file
View file

@ -0,0 +1,526 @@
#!/usr/bin/env php
<?php
/**
*
* @package build
* @version $Id$
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
// The only thing i need to adjust. ;)
// Please always add the latest version number to the end
// Only have 5 releases here...
// If RC8 drops remove the install/data directory
//$versions = array('3.0.2', '3.0.3-RC1', '3.0.3', '3.0.4-RC1', '3.0.4', '3.0.5-RC1', '3.0.5', '3.0.6-RC1', '3.0.6-RC2', '3.0.6-RC3');
//$versions = array('3.0.2', '3.0.3', '3.0.4', '3.0.5', '3.0.6', '3.0.7-RC1', '3.0.7');
$versions = array('3.0.2', '3.0.3', '3.0.4', '3.0.5', '3.0.6', '3.0.7-RC1', '3.0.7-RC2', '3.0.7');
$verbose = false;
require('build_helper.php');
$package = new build_package($versions, $verbose);
echo "Building Release Packages\n";
echo "Now all three package types (patch, files, release) are built as well as the update package (update).\n";
$package->begin_status('Remove temporary files');
// Cleanup...
$package->run_command('rm -Rv ' . $package->get('dest_dir'));
$package->run_command('rm -Rv ' . $package->get('diff_dir'));
$package->run_command('rm -Rv ' . $package->get('patch_directory'));
$package->run_command('rm -Rv ' . $package->get('files_directory'));
$package->run_command('rm -Rv ' . $package->get('update_directory'));
$package->run_command('rm -Rv ' . $package->get('release_directory'));
$package->begin_status('Create new directories');
// Make sure the directories got removed
while (file_exists($package->get('update_directory')))
{
sleep(1);
}
if (!file_exists($package->get('dest_dir')))
{
$package->run_command('mkdir ' . $package->get('dest_dir'));
}
if (!file_exists($package->get('diff_dir')))
{
$package->run_command('mkdir ' . $package->get('diff_dir'));
}
if (!file_exists($package->get('patch_directory')))
{
$package->run_command('mkdir ' . $package->get('patch_directory'));
}
if (!file_exists($package->get('files_directory')))
{
$package->run_command('mkdir ' . $package->get('files_directory'));
}
if (!file_exists($package->get('update_directory')))
{
$package->run_command('mkdir ' . $package->get('update_directory'));
}
if (!file_exists($package->get('release_directory')))
{
$package->run_command('mkdir ' . $package->get('release_directory'));
}
$package->begin_status('Copy release files to clean release directory');
// Create config.php file
$package->run_command('touch ' . $package->get('dest_dir') . '/config.php');
//$package->run_command('sudo chown www-data:www-data ' . $package->get('dest_dir') . '/config.php');
// Create new directory structure
foreach ($package->clean_directory_structure as $dir => $dir_struct)
{
$package->create_directory($package->get('dest_dir') . '/' . $dir, $dir_struct);
}
// First step is to copy the new version over (clean structure)
foreach ($package->files_to_copy as $file)
{
$source_file = $package->locations['new_version'] . $file;
$dest_file = $package->get('dest_dir') . '/' . $file;
$package->run_command("cp -p $source_file $dest_file");
}
// fix line endings
chdir($package->get('dest_dir'));
$package->run_command($package->locations['new_version'] . 'develop/fix_files.sh');
// Now clean up the permissions
$package->begin_status('Adjust permissions');
$package->adjust_permissions($package->get('dest_dir'));
// Now create a version for diffing the version - copy the tree over to old_versions...
$package->begin_status('Create diff directory for obtaining file differences');
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/* ' . $package->get('diff_dir'));
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/.htaccess ' . $package->get('diff_dir'));
// Cleanup diff directory (only contents to diff)
foreach ($package->remove_from_diff_structure as $remove_dir)
{
$package->run_command('rm -Rv ' . $package->get('diff_dir') . '/' . $remove_dir);
}
// Now, first of all we need to rebuild all old packages we want to support
foreach ($package->old_packages as $package_name => $tag_name)
{
$package->begin_status('Create old packages directory for diffing to ' . $package_name);
chdir($package->locations['old_versions']);
if (is_dir($package->locations['old_versions'] . $package_name))
{
$package->run_command('rm -Rv ' . $package->locations['old_versions'] . $package_name);
}
// Now, create a new one...
$tag_name = 'release_' . str_replace(array('.', '_to_'), array('_', ''), $tag_name);
$package->run_command('svn export --non-interactive http://code.phpbb.com/svn/phpbb/tags/' . $tag_name . '/phpBB/ ' . $package_name);
$location = $package->locations['old_versions'] . $package_name;
chdir($location . '/');
$package->run_command($package->locations['new_version'] . 'develop/fix_files.sh');
// Now clean up the permissions
$package->begin_status('Adjust permissions for package ' . $package_name);
$package->adjust_permissions($location);
// Cleanup diff directory (only contents to diff)
foreach ($package->remove_from_diff_structure as $remove_dir)
{
$package->run_command('rm -Rv ' . $location . '/' . $remove_dir);
}
}
// Go trough all versions making a diff if we even have old versions
// For phpBB 3.0.x we might choose a different update method, rendering the things below useless...
if (sizeof($package->old_packages))
{
chdir($package->locations['old_versions']);
// This array is for holding the filenames change
$diff_file_changes = array();
foreach ($package->old_packages as $_package_name => $dest_package_filename)
{
$package->begin_status('Creating patch/diff files for phpBB-' . $dest_package_filename . $package->get('new_version_number'));
$dest_package_filename = $package->get('patch_directory') . '/phpBB-' . $dest_package_filename . $package->get('new_version_number') . '.patch';
$package->run_command('diff ' . $package->diff_options . ' ' . $_package_name . ' ' . $package->get('simple_name') . ' > ' . $dest_package_filename);
// Parse this diff to determine file changes from the checked versions and save them
$diff_file_changes[$_package_name] = $package->collect_diff_files($dest_package_filename, $_package_name);
}
// Now put those files determined within the correct directories
foreach ($diff_file_changes as $_package_name => $file_contents)
{
$package->begin_status('Creating files-only informations for ' . $package->old_packages[$_package_name] . $package->get('new_version_number'));
$dest_filename_dir = $package->get('files_directory') . '/' . $package->old_packages[$_package_name] . $package->get('new_version_number');
if (!file_exists($dest_filename_dir))
{
$package->run_command('mkdir ' . $dest_filename_dir);
}
// Now copy the file contents
foreach ($file_contents['all'] as $file)
{
$source_filename = $package->get('dest_dir') . '/' . $file;
$dest_filename = $dest_filename_dir . '/' . $file;
// Create Directories along the way?
$file = explode('/', $file);
// Remove filename portion
$file[sizeof($file)-1] = '';
chdir($dest_filename_dir);
foreach ($file as $entry)
{
$entry = trim($entry);
if ($entry)
{
if (!file_exists('./' . $entry))
{
$package->run_command('mkdir ' . $entry);
}
chdir('./' . $entry);
}
}
$package->run_command('cp ' . $source_filename . ' ' . $dest_filename);
}
}
// Because there might be binary changes, we re-create the patch files... without parsing file differences.
$package->run_command('rm -Rv ' . $package->get('patch_directory'));
if (!file_exists($package->get('patch_directory')))
{
$package->run_command('mkdir ' . $package->get('patch_directory'));
}
chdir($package->locations['old_versions']);
foreach ($package->old_packages as $_package_name => $dest_package_filename)
{
$package->begin_status('Creating patch/diff files for phpBB-' . $dest_package_filename . $package->get('new_version_number'));
$dest_package_filename = $package->get('patch_directory') . '/phpBB-' . $dest_package_filename . $package->get('new_version_number') . '.patch';
$package->run_command('diff ' . $package->diff_options_long . ' ' . $_package_name . ' ' . $package->get('simple_name') . ' > ' . $dest_package_filename);
}
$packages = $diff_file_changes;
foreach ($packages as $_package_name => $file_contents)
{
$package->begin_status('Building specific update files for ' . $package->old_packages[$_package_name] . $package->get('new_version_number'));
$dest_filename_dir = $package->get('update_directory') . '/' . $package->old_packages[$_package_name] . $package->get('new_version_number');
if (!file_exists($dest_filename_dir))
{
$package->run_command('mkdir ' . $dest_filename_dir);
}
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $dest_filename_dir);
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $dest_filename_dir);
$package->run_command('mkdir ' . $dest_filename_dir . '/install/update');
$package->run_command('mkdir ' . $dest_filename_dir . '/install/update/old');
$package->run_command('mkdir ' . $dest_filename_dir . '/install/update/new');
// Remove some files
$package->run_command('rm -v ' . $dest_filename_dir . '/install/install_install.php');
$package->run_command('rm -v ' . $dest_filename_dir . '/install/install_convert.php');
$package->run_command('rm -Rv ' . $dest_filename_dir . '/install/schemas');
$package->run_command('rm -Rv ' . $dest_filename_dir . '/install/convertors');
foreach ($file_contents['all'] as $index => $file)
{
if (strpos($file, 'recode_cjk') !== false)
{
unset($file_contents['all'][$index]);
}
}
// First of all, fill the 'old' directory
foreach ($file_contents['all'] as $file)
{
$source_filename = $package->locations['old_versions'] . $_package_name . '/' . $file;
$dest_filename = $dest_filename_dir . '/install/update/old/' . $file;
if (!file_exists($source_filename))
{
continue;
}
// Create Directories along the way?
$file = explode('/', $file);
// Remove filename portion
$file[sizeof($file)-1] = '';
chdir($dest_filename_dir . '/install/update/old');
foreach ($file as $entry)
{
$entry = trim($entry);
if ($entry)
{
if (!file_exists('./' . $entry))
{
$package->run_command('mkdir ' . $entry);
}
chdir('./' . $entry);
}
}
$package->run_command('cp ' . $source_filename . ' ' . $dest_filename);
}
// Then fill the 'new' directory
foreach ($file_contents['all'] as $file)
{
$source_filename = $package->locations['old_versions'] . $package->get('simple_name') . '/' . $file;
$dest_filename = $dest_filename_dir . '/install/update/new/' . $file;
if (!file_exists($source_filename))
{
continue;
}
// Create Directories along the way?
$file = explode('/', $file);
// Remove filename portion
$file[sizeof($file)-1] = '';
chdir($dest_filename_dir . '/install/update/new');
foreach ($file as $entry)
{
$entry = trim($entry);
if ($entry)
{
if (!file_exists('./' . $entry))
{
$package->run_command('mkdir ' . $entry);
}
chdir('./' . $entry);
}
}
$package->run_command('cp ' . $source_filename . ' ' . $dest_filename);
}
// Build index.php file for holding the file structure
$index_contents = '<?php
if (!defined(\'IN_PHPBB\'))
{
exit;
}
// Set update info with file structure to update
$update_info = array(
\'version\' => array(\'from\' => \'' . str_replace('_to_', '', $package->old_packages[$_package_name]) . '\', \'to\' => \'' . $package->get('new_version_number') . '\'),
';
if (sizeof($file_contents['all']))
{
$index_contents .= '\'files\' => array(\'' . implode("',\n\t'", $file_contents['all']) . '\'),
';
}
else
{
$index_contents .= '\'files\' => array(),
';
}
if (sizeof($file_contents['binary']))
{
$index_contents .= '\'binary\' => array(\'' . implode("',\n\t'", $file_contents['binary']) . '\'),
';
}
else
{
$index_contents .= '\'binary\' => array(),
';
}
$index_contents .= ');
?' . '>';
$fp = fopen($dest_filename_dir . '/install/update/index.php', 'wt');
fwrite($fp, $index_contents);
fclose($fp);
}
unset($diff_file_changes);
$package->begin_status('Clean up all install files');
// Copy the install files to their respective locations
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $package->get('patch_directory'));
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $package->get('patch_directory'));
// Remove some files
chdir($package->get('patch_directory') . '/install');
$package->run_command('rm -v install_install.php');
$package->run_command('rm -v install_update.php');
$package->run_command('rm -v install_convert.php');
$package->run_command('rm -Rv schemas');
$package->run_command('rm -Rv convertors');
}
// Build Main phpBB Release
$compress_programs = array(
// 'tar.gz' => 'tar -czf',
'tar.bz2' => 'tar -cjf',
'zip' => 'zip -r'
);
if (sizeof($package->old_packages))
{
// Build Patch Files
chdir($package->get('patch_directory'));
foreach ($compress_programs as $extension => $compress_command)
{
$package->begin_status('Packaging phpBB Patch Files for ' . $extension);
$package->run_command('rm -v ../release_files/' . $package->get('release_filename') . '-patch.' . $extension);
// Build Package
$package->run_command($compress_command . ' ../release_files/' . $package->get('release_filename') . '-patch.' . $extension . ' *');
// Build MD5 Sum
$package->run_command('md5sum ../release_files/' . $package->get('release_filename') . '-patch.' . $extension . ' > ../release_files/' . $package->get('release_filename') . '-patch.' . $extension . '.md5');
}
// Build Files Package
chdir($package->get('files_directory'));
foreach ($compress_programs as $extension => $compress_command)
{
$package->begin_status('Packaging phpBB Files for ' . $extension);
$package->run_command('rm -v ../release_files/' . $package->get('release_filename') . '-files.' . $extension);
$package->run_command('mkdir ' . $package->get('files_directory') . '/release');
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $package->get('files_directory') . '/release');
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $package->get('files_directory') . '/release');
$package->run_command('rm -v ' . $package->get('files_directory') . '/release/install/install_install.php');
$package->run_command('rm -v ' . $package->get('files_directory') . '/release/install/install_update.php');
$package->run_command('rm -v ' . $package->get('files_directory') . '/release/install/install_convert.php');
$package->run_command('rm -Rv ' . $package->get('files_directory') . '/release/install/schemas');
$package->run_command('rm -Rv ' . $package->get('files_directory') . '/release/install/convertors');
// Pack files
foreach ($package->old_packages as $_package_name => $package_path)
{
chdir($package_path . $package->get('new_version_number'));
$command = ($extension == 'zip') ? 'zip -r' : 'tar cf';
$_ext = ($extension == 'zip') ? 'zip' : 'tar';
$package->run_command("$command ../release/phpBB-$package_path" . $package->get('new_version_number') . ".$_ext *");
chdir('..');
}
chdir('./release');
$package->run_command("$compress_command ../../release_files/" . $package->get('release_filename') . '-files.' . $extension . ' *');
// Build MD5 Sum
$package->run_command('md5sum ../../release_files/' . $package->get('release_filename') . '-files.' . $extension . ' > ../../release_files/' . $package->get('release_filename') . '-files.' . $extension . '.md5');
chdir('..');
$package->run_command('rm -Rv ' . $package->get('files_directory') . '/release');
}
// Build Update Package
foreach ($compress_programs as $extension => $compress_command)
{
chdir($package->get('update_directory'));
$package->begin_status('Packaging phpBB Update for ' . $extension);
$package->run_command('rm -v ../release_files/' . $package->get('release_filename') . '-update.' . $extension);
$package->run_command('mkdir ' . $package->get('update_directory') . '/release');
// Pack update files
$packages = $package->old_packages;
foreach ($packages as $_package_name => $package_path)
{
chdir($package_path . $package->get('new_version_number'));
$package->run_command('rm -v install/install_install.php');
$package->run_command('rm -v install/install_convert.php');
$package->run_command('rm -v includes/utf/data/recode_cjk.php');
$package->run_command('rm -Rv install/schemas');
$package->run_command('rm -Rv install/convertors');
$command = ($extension == 'zip') ? 'zip -r' : 'tar cf';
$_ext = ($extension == 'zip') ? 'zip' : 'tar';
$package->run_command("$command ../release/$package_path" . $package->get('new_version_number') . ".$_ext *");
chdir('..');
$last_version = $package_path . $package->get('new_version_number');
// chdir('./release');
// $package->run_command("$compress_command ../../release_files/" . $package->get('release_filename') . '-update.' . $extension . ' *');
// chdir('..');
chdir('./' . $last_version);
// Copy last package over...
$package->run_command('rm -v ../release_files/phpBB-' . $last_version . ".$extension");
$package->run_command("$compress_command ../../release_files/phpBB-$last_version.$extension *");
// Build MD5 Sum
$package->run_command("md5sum ../../release_files/phpBB-$last_version.$extension > ../../release_files/phpBB-$last_version.$extension.md5");
chdir('..');
}
$package->run_command('rm -Rv ' . $package->get('update_directory') . '/release');
}
}
// Delete updater and convertor from main archive
chdir($package->get('dest_dir') . '/install');
// $package->run_command('rm -v database_update.php');
$package->run_command('rm -v install_update.php');
chdir($package->locations['package_dir']);
foreach ($compress_programs as $extension => $compress_command)
{
$package->begin_status('Packaging phpBB for ' . $extension);
$package->run_command('rm -v ./release_files/' . $package->get('release_filename') . ".{$extension}");
// Build Package
$package->run_command("$compress_command ./release_files/" . $package->get('release_filename') . '.' . $extension . ' ' . $package->get('package_name'));
// Build MD5 Sum
$package->run_command('md5sum ./release_files/' . $package->get('release_filename') . '.' . $extension . ' > ./release_files/' . $package->get('release_filename') . '.' . $extension . '.md5');
}
// verify results
chdir($package->locations['root']);
$package->begin_status('********** Verifying packages **********');
$package->run_command('./compare.sh ' . $package->package_infos['release_filename']);
echo "Done.\n";

View file

@ -1,3 +1,13 @@
#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#<IfModule mod_rewrite.c>
#RewriteEngine on
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#</IfModule>
<Files "config.php">
Order Allow,Deny
Deny from All

View file

@ -21,6 +21,10 @@
<dt><label for="max_reg_attempts">{L_REG_LIMIT}:</label><br /><span>{L_REG_LIMIT_EXPLAIN}</span></dt>
<dd><input id="max_reg_attempts" type="text" size="4" maxlength="4" name="max_reg_attempts" value="{REG_LIMIT}" /></dd>
</dl>
<dl>
<dt><label for="max_login_attempts">{L_MAX_LOGIN_ATTEMPTS}:</label><br /><span>{L_MAX_LOGIN_ATTEMPTS_EXPLAIN}</span></dt>
<dd><input id="max_login_attempts" type="text" size="4" maxlength="4" name="max_login_attempts" value="{MAX_LOGIN_ATTEMPTS}" /></dd>
</dl>
<dl>
<dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}:</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" id="enable_post_confirm" name="enable_post_confirm" value="1"<!-- IF POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>

View file

@ -120,7 +120,7 @@
</dl>
<dl>
<dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
<dd><input name="width" type="text" id="width" size="3" value="{AVATAR_WIDTH}" /> <span>px X </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>px</span></dd>
<dd><input name="width" type="text" id="width" size="3" value="{AVATAR_WIDTH}" /> <span>{L_PIXEL} &times; </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>{L_PIXEL}</span></dd>
</dl>
<!-- IF S_DISPLAY_GALLERY -->
<dl>

View file

@ -139,9 +139,9 @@
<td><input class="text post" type="text" size="3" name="add_width" id="add_width" value="{WIDTH}" /></td>
<td><input class="text post" type="text" size="3" name="add_height" id="add_height" value="{HEIGHT}" /></td>
<td><input type="checkbox" class="radio" name="add_display_on_posting" checked="checked" onclick="toggle_select('add', this.checked, 'add_order');"/></td>
<td><select id="add_order" name="add_order">
<optgroup id="order_disp[add]" label="{L_DISPLAY_POSTING}">{S_ADD_ORDER_LIST_DISPLAY}</optgroup>
<optgroup id="order_no_disp[add]" label="{L_DISPLAY_POSTING_NO}" disabled="disabled" class="disabled-options" >{S_ADD_ORDER_LIST_UNDISPLAY}</optgroup>
<td><select id="order_add_order" name="add_order">
<optgroup id="order_disp_add_order" label="{L_DISPLAY_POSTING}">{S_ADD_ORDER_LIST_DISPLAY}</optgroup>
<optgroup id="order_no_disp_add_order" label="{L_DISPLAY_POSTING_NO}" disabled="disabled" class="disabled-options" >{S_ADD_ORDER_LIST_UNDISPLAY}</optgroup>
</select></td>
<td><input type="checkbox" class="radio" name="add_additional_code" value="1" /></td>
</tr>

View file

@ -38,7 +38,7 @@
<dd><input type="text" id="jab_username" name="jab_username" value="{JAB_USERNAME}" /></dd>
</dl>
<dl>
<dt><label for="jab_password">{L_JAB_PASSWORD}:</label></dt>
<dt><label for="jab_password">{L_JAB_PASSWORD}:</label><br /><span>{L_JAB_PASSWORD_EXPLAIN}</span></dt>
<dd><input type="password" id="jab_password" name="jab_password" value="{JAB_PASSWORD}" /></dd>
</dl>
<!-- IF S_CAN_USE_SSL -->

View file

@ -40,6 +40,12 @@
</div>
<!-- ENDIF -->
<!-- IF S_PHP_VERSION_OLD -->
<div class="errorbox notice">
<p>{L_PHP_VERSION_OLD}</p>
</div>
<!-- ENDIF -->
<table cellspacing="1">
<caption>{L_FORUM_STATS}</caption>
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />

View file

@ -27,7 +27,7 @@
</dl>
<dl>
<dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
<dd><input name="width" type="text" id="width" size="3" value="{USER_AVATAR_WIDTH}" /> <span>px X </span> <input type="text" name="height" size="3" value="{USER_AVATAR_HEIGHT}" /> <span>px</span></dd>
<dd><input name="width" type="text" id="width" size="3" value="{USER_AVATAR_WIDTH}" /> <span>{L_PIXEL} &times; </span> <input type="text" name="height" size="3" value="{USER_AVATAR_HEIGHT}" /> <span>{L_PIXEL}</span></dd>
</dl>
<!-- ENDIF -->
<!-- IF S_DISPLAY_GALLERY -->

View file

@ -1,5 +1,5 @@
<dl>
<dt><label for="answer">{L_CONFIRM_QUESTION}:</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
<dt><label for="answer"><!-- IF QA_CONFIRM_QUESTION --> {QA_CONFIRM_QUESTION} <!-- ELSE --> {L_CONFIRM_QUESTION} <!-- ENDIF -->:</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
<dd>
<input type="text" tabindex="10" name="answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}" />

View file

@ -0,0 +1,22 @@
<!-- INCLUDE overall_header.html -->
<form id="confirm" method="post" action="{S_CONFIRM_ACTION}">
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{MESSAGE_TEXT}</p>
</div>
<fieldset>
{S_HIDDEN_FIELDS}
<div style="text-align: center;">
<input type="submit" name="confirm" value="{L_YES}" class="button2" />&nbsp;
<input type="submit" name="cancel" value="{L_CANCEL}" class="button2" />
</div>
</fieldset>
</form>
<!-- INCLUDE overall_footer.html -->

View file

@ -152,7 +152,7 @@ function insert_text(text, spaces, popup)
var sel_start = textarea.selectionStart;
var sel_end = textarea.selectionEnd;
mozWrap(textarea, text, '')
mozWrap(textarea, text, '');
textarea.selectionStart = sel_start + text.length;
textarea.selectionEnd = sel_end + text.length;
}
@ -269,7 +269,7 @@ function mozWrap(txtarea, open, close)
}
var s1 = (txtarea.value).substring(0,selStart);
var s2 = (txtarea.value).substring(selStart, selEnd)
var s2 = (txtarea.value).substring(selStart, selEnd);
var s3 = (txtarea.value).substring(selEnd, selLength);
txtarea.value = s1 + open + s2 + close + s3;

View file

@ -266,7 +266,8 @@ foreach ($supported_dbms as $dbms)
case 'mssql':
$line = "/*\n\n \$I" . "d: $\n\n*/\n\n";
$line .= "BEGIN TRANSACTION\nGO\n\n";
// no need to do this, no transaction support for schema changes
//$line .= "BEGIN TRANSACTION\nGO\n\n";
break;
case 'oracle':
@ -749,7 +750,8 @@ foreach ($supported_dbms as $dbms)
switch ($dbms)
{
case 'mssql':
$line = "\nCOMMIT\nGO\n\n";
// No need to do this, no transaction support for schema changes
//$line = "\nCOMMIT\nGO\n\n";
break;
case 'sqlite':
@ -1747,6 +1749,7 @@ function get_schema_struct()
),
'PRIMARY_KEY' => array('user_id', 'topic_id'),
'KEYS' => array(
'topic_id' => array('INDEX', 'topic_id'),
'forum_id' => array('INDEX', 'forum_id'),
),
);

View file

@ -21,9 +21,9 @@ rm FILELIST.$$
for i in $(cat FILELIST); do
if [ -f $i ]; then
sed -e s/
//g $i > $i.tmp
cat $i | tr -d '\r' > $i.tmp
mv $i.tmp $i
fi
done
rm FILELIST

View file

@ -114,6 +114,10 @@ $uniarray = array(
$copy = $uniarray;
/**
* @todo we need to check that the $uniarray does not reverse any of the mappings defined in the unicode definition
*/
foreach ($array as $value)
{
$temp_hold = implode(array_map('utf8_chr', array_map('hexdec', explode(' ', trim($value[2])))));

View file

@ -1237,6 +1237,7 @@ function get_schema_struct()
),
'PRIMARY_KEY' => array('user_id', 'topic_id'),
'KEYS' => array(
'topic_id' => array('INDEX', 'topic_id'),
'forum_id' => array('INDEX', 'forum_id'),
),
);

View file

@ -1,6 +1,6 @@
/**
*
* phpBB3 © Copyright 2000, 2002, 2005, 2007 phpBB Group
* phpBB3 © Copyright 2000, 2002, 2005, 2007 phpBB Group
* http://www.phpbb.com
*
* This program is free software: you can redistribute it and/or modify
@ -20,39 +20,41 @@
Please see: http://www.phpbb.com/about/team/ for a list of all the people currently
involved in phpBB.
phpBB Lead Developer : Acyd Burn (Meik Sievertsen)
phpBB Lead Developer: naderman (Nils Adermann)
phpBB Developers : APTX (Marek A. R.)
phpBB Developers: A_Jelly_Doughnut (Josh Woody)
Acyd Burn (Meik Sievertsen) [Lead 09/2005 - 01/2010]
APTX (Marek A. R.)
bantu (Andreas Fischer)
DavidMJ (David M.)
dhn (Dominik Dröscher)
dhn (Dominik Dröscher)
kellanved (Henry Sudhof)
naderman (Nils Adermann)
Terrafrost (Jim Wigginton)
ToonArmy (Chris Smith)
Contributions by : leviatan21 (Gabriel Vazquez)
Contributions by: Brainy (Cullen Walsh)
leviatan21 (Gabriel Vazquez)
nickvergessen (Joas Schilling)
Raimon (Raimon Meuldijk)
rxu (Ruslan Uzdenov)
Xore (Robert Hetzler)
-- Previous Contributors --
-- Former Contributors --
phpBB Project Manager : theFinn (James Atkinson) [Founder - 04/2007]
phpBB Project Manager: theFinn (James Atkinson) [Founder - 04/2007]
SHS` (Jonathan Stanley)
phpBB Lead Developer : psoTFX (Paul S. Owen) [2001 - 09/2005]
phpBB Lead Developer: psoTFX (Paul S. Owen) [2001 - 09/2005]
phpBB Developers : Ashe (Ludovic Arnaud) [10/2002 - 11/2003, 06/2006 - 10/2006]
phpBB Developers: Ashe (Ludovic Arnaud) [10/2002 - 11/2003, 06/2006 - 10/2006]
BartVB (Bart van Bragt) [11/2000 - 03/2006]
GrahamJE (Graham Eames) [09/2005 - 11/2006]
Vic D'Elfant (Vic D'Elfant) [04/2007 - 04/2009]
-- Copyrights --
Visual Confirmation : Xore (Robert Hetzler)
Visual Confirmation: Xore (Robert Hetzler)
Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Group
prosilver by subBlue Design, Tom Beddard, (c) 2004 phpBB Group

View file

@ -53,6 +53,7 @@
<ol>
<li><a href="#changelog">Changelog</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#v307">Changes since 3.0.7</a></li>
<li><a href="#v306">Changes since 3.0.6</a></li>
<li><a href="#v305">Changes since 3.0.5</a></li>
<li><a href="#v304">Changes since 3.0.4</a></li>
@ -86,7 +87,22 @@
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
<a name="v306"></a><h3>1.i. Changes since 3.0.6</h3>
<a name="v307"></a><h3>1.i. Changes since 3.0.7</h3>
<ul>
<li>[Fix] Correctly sort database backup file list by date on database restore page. (Bug #57385)</li>
<li>[Fix] Take admin's time zone settings into account when listing database backup files. (Bug #57385)</li>
<li>[Fix] Honor minimum and maximum password length in generated passwords as much as we can. (Bug #13181)</li>
<li>[Fix] No longer return the character O in generated random strings and passwords. (Bug #57345)</li>
<li>[Fix] Allow redirect() function to redirect across directories. (Bug #56965)</li>
<li>[Fix] Add terminating semicolons to JavaScript code. (Bug #58085 - Patch by nn-)</li>
<li>[Fix] Minor language fixes. (Bug #54855)</li>
<li>[Fix] Parsing urls in signatures properly uses config settings. (Bug #57105)</li>
<li>[Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)</li>
</ul>
<a name="v306"></a><h3>1.ii. Changes since 3.0.6</h3>
<ul>
<li>[Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)</li>
@ -98,7 +114,7 @@
<li>[Fix] Do not link to user profile in ATOM feed entry if post has been made by the guest user. (Bug #54275)</li>
<li>[Fix] Make word censoring case insensitive. (Bug #54265)</li>
<li>[Fix] Fulltext-MySQL search for keywords and username at the same time. (Bug #54325)</li>
<li>[Fix] Various XHTML mistakes in prosilver. (Bug #54705)</li>
<li>[Fix] Various XHTML and CSS mistakes in prosilver and subsilver2. (Bugs #54705, #55895, #57505, #57875 - Patch by HardStyle)</li>
<li>[Fix] Correctly show topic ATOM feed link when only post id is specified. (Bug #53025)</li>
<li>[Fix] Cleanly handle forum/topic not found in ATOM Feeds. (Bug #54295)</li>
<li>[Fix] PHP 5.3 compatibility: Check if function dl() exists before calling it. (Bug #54665)</li>
@ -119,15 +135,78 @@
<li>[Fix] Correct wording for &quot;How do I show an image below my username&quot; question answer in FAQ. (Bug #23935)</li>
<li>[Fix] Handle export of private messages where all recipients were deleted. (Bug #50985)</li>
<li>[Fix] Correctly get unread status information for global announcements in search results.</li>
<li>[Fix] Correctly handle global announcements in ATOM feeds.</li>
<li>[Fix] Use correct limit config parameter in the News feed.</li>
<li>[Fix] Restrict search for styles/../style.cfg to folders. (Bug #55665)</li>
<li>[Fix] Add ability to disable overall (aka board-wide) feed.</li>
<li>[Fix] Do not pass new_link parameter when creating a persistent connection with mysql. (Bug #55785)</li>
<li>[Fix] Improved search query performance through sorting words by their occurance. (Bug #21555)</li>
<li>[Fix] Correctly move sql_row_pointer forward when calling sql_fetchfield() on cached queries. (Bug #55865)</li>
<li>[Fix] Remove item limit from &quot;All forums&quot; feed.</li>
<li>[Fix] Do not use group colours for usernames on print view. (Bug #30315 - Patch by Pasqualle)</li>
<li>[Fix] Pagination of User Notes in MCP uses two different config values. (Bug #56025)</li>
<li>[Fix] List hidden groups on viewprofile where the viewing user is also a member. (Bug #31845)</li>
<li>[Fix] Sort viewprofile group list by group name.</li>
<li>[Fix] Strictly check whether a moderator can post in the destination forum when moving topic. (Bug #56255)</li>
<li>[Fix] Added some error handling to the compress class.</li>
<li>[Fix] Correctly determine permissions to show quick reply button. (Bug #56555)</li>
<li>[Fix] Do not unsubscribe users from topics replying with quickreply. (Bug #56235)</li>
<li>[Fix] Don't submit when pressing enter on preview button. (Bug #54395)</li>
<li>[Fix] Load reCAPTCHA over https when using a secure connection to the board. (Bug #55755)</li>
<li>[Fix] Clarify explanation of bump feature setting. (Bug #56075)</li>
<li>[Fix] Properly paginate unapproved posts in the MCP. (Bug #56285)</li>
<li>[Fix] Do not duplicate previous/next links in pagination text of moderator logs and user notes in MCP for subsilver2. (Bug #55045)</li>
<li>[Fix] Do not automatically unsubscribe users from topics, when email and jabber is disabled.</li>
<li>[Fix] Don't send activation email when user tries to change email without permission. (Bug #56335 - Fix by nrohler)</li>
<li>[Fix] Replace hard coded &quot;px&quot; with translated language-string. (Bug #52495)</li>
<li>[Fix] Correctly hover list menu in UCP and MCP for RTL languages. (Bug #49945)</li>
<li>[Fix] Correctly orientate quoted text image on RTL languages. (Bug #33745)</li>
<li>[Fix] Deprecate $allow_reply parameter to truncate_string() (Bug #56675)</li>
<li>[Fix] Fall back to default language email template if specified file does not exist. (Bug #35595)</li>
<li>[Fix] Update users last visit field correctly when changing activation status. (Bug #56185)</li>
<li>[Fix] Database updater now separates ADD COLUMN from SET NOT NULL and SET DEFAULT, when using PostgreSQL &lt;= 7.4 (Bug #54435)</li>
<li>[Fix] Styles adjustment to correctly display an order of rtl/ltr mixed content. (Bugs #55485, #55545)</li>
<li>[Fix] Fix language string for PM-Reports refering to post-data. (Bug #54745)</li>
<li>[Fix] Do not store email templates in database. (Bug #54505)</li>
<li>[Fix] Fix javascript bug in the smilies ACP. (Bug #55725)</li>
<li>[Fix] Unify BBCode Selection across browsers. (Bug #38765)</li>
<li>[Fix] Allow convertors to read in configuration from files. (Bug #57265 - Patch by Dicky)</li>
<li>[Fix] Fix problems with firebird by no longer using 'count' as a column alias. (Bug #57455)</li>
<li>[Fix] Small language correction for the FAQ page. (Bug #57825)</li>
<li>[Fix] Restrict search for language/../iso.txt to folders. (Bug #57795)</li>
<li>[Fix] Make user_email_hash() function independent from system's architecture. (Bug #57755)</li>
<li>[Fix] Correct behavior of &quot;force_approved_state&quot; when value is false. (Bug #57715)</li>
<li>[Fix] Global announcements could not be accessed on a board using Firebird as the database server. (Bug #57525)</li>
<li>[Fix] BBCode parser now uses the user object for all settings rather than taking some from the template object (Bug #57365)</li>
<li>[Fix] Ensure a database connection is available before logging general errors. (Bug #57975)</li>
<li>[Fix] Do not delete unrelated attachments when deleting empty forums. (Bug #57375)</li>
<li>[Fix] Update: Store expected resulting file contents in cache and do not suggest further merges if the contents match, also fixes infinite merge loop (Bug #54075)</li>
<li>[Change] Move redirect into a hidden field to avoid issues with mod_security. (Bug #54145)</li>
<li>[Change] Log activation through inactive users ACP. (Bug #30145)</li>
<li>[Change] Send time of last item instead of current time in ATOM Feeds. (Bug #53305)</li>
<li>[Change] Use em dash instead of hyphen/minus as separator in ATOM Feeds item statistics. (Bug #53565)</li>
<li>[Change] Cache overall, forums, topics and news feeds for anonymous users and bots.</li>
<li>[Change] Alter ACP user quick tools interface to reduce confusion with the delete operation.</li>
<li>[Change] Send statistics now check for IPv6 and send private network status as a boolean.</li>
<li>[Change] Split &quot;All topics&quot; feed into &quot;New Topics&quot; and &quot;Active Topics&quot; feeds.</li>
<li>[Change] Forum feed no longer includes posts of subforums.</li>
<li>[Change] Show login attempt CAPTCHA option in the captcha plugin module.</li>
<li>[Change] It is no longer possible to persist a solution for the login CAPTCHA.</li>
<li>[Change] SQLite is no longer autoloaded by the installer. (Bug #56105)</li>
<li>[Change] Friends and foes will not show up as private message rule options if their respective UCP modules are disabled. (Bug #51155)</li>
<li>[Change] Offer for guests to log in for egosearch and unreadposts search before the search permissions check. (Bug #51585)</li>
<li>[Change] Show warning box for users of PHP &lt; 5.2.0 about phpBB ending support.</li>
<li>[Change] Disallow deleting the last question of the Q&amp;A CAPTCHA.</li>
<li>[Change] Tweak Q&amp;A CAPTCHA garbage collection.</li>
<li>[Change] Show a proper preview for the Q&amp;A CAPTCHA. (Bug #56365)</li>
<li>[Change] Speed up topic move operation by adding an index for topic_id on the topics track table. (Bug #56545)</li>
<li>[Change] Warn users about potentially dangerous BBcodes.</li>
<li>[Feature] Ability to use HTTP authentication in ATOM feeds by passing the GET parameter &quot;auth=http&quot;.</li>
<li>[Feature] Add INTTEXT token type to custom bbcodes to allow non-ASCII letters in html attributes.</li>
<li>[Feature] Add ability to enable quick reply in all forums.</li>
</ul>
<a name="v305"></a><h3>1.ii. Changes since 3.0.5</h3>
<a name="v305"></a><h3>1.iii. Changes since 3.0.5</h3>
<ul>
<li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li>
@ -349,7 +428,7 @@
<li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>
</ul>
<a name="v304"></a><h3>1.iii. Changes since 3.0.4</h3>
<a name="v304"></a><h3>1.iv. Changes since 3.0.4</h3>
<ul>
<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
@ -438,7 +517,7 @@
<li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li>
</ul>
<a name="v303"></a><h3>1.iv. Changes since 3.0.3</h3>
<a name="v303"></a><h3>1.v. Changes since 3.0.3</h3>
<ul>
<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li>
@ -470,7 +549,7 @@
<li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li>
</ul>
<a name="v302"></a><h3>1.v. Changes since 3.0.2</h3>
<a name="v302"></a><h3>1.vi. Changes since 3.0.2</h3>
<ul>
<li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li>
@ -569,7 +648,7 @@
<li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li>
</ul>
<a name="v301"></a><h3>1.vi. Changes since 3.0.1</h3>
<a name="v301"></a><h3>1.vii. Changes since 3.0.1</h3>
<ul>
<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li>
@ -617,7 +696,7 @@
<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>
</ul>
<a name="v300"></a><h3>1.vii Changes since 3.0.0</h3>
<a name="v300"></a><h3>1.viii Changes since 3.0.0</h3>
<ul>
<li>[Change] Validate birthdays (Bug #15004)</li>
@ -688,7 +767,7 @@
<li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li>
</ul>
<a name="v30rc8"></a><h3>1.viii. Changes since 3.0.RC8</h3>
<a name="v30rc8"></a><h3>1.ix. Changes since 3.0.RC8</h3>
<ul>
<li>[Fix] Cleaned usernames contain only single spaces, so &quot;a_name&quot; and &quot;a__name&quot; are treated as the same name (Bug #15634)</li>
@ -697,7 +776,7 @@
<li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li>
</ul>
<a name="v30rc7"></a><h3>1.ix. Changes since 3.0.RC7</h3>
<a name="v30rc7"></a><h3>1.x. Changes since 3.0.RC7</h3>
<ul>
<li>[Fix] Fixed MSSQL related bug in the update system</li>
@ -732,7 +811,7 @@
<li>[Fix] No duplication of active topics (Bug #15474)</li>
</ul>
<a name="v30rc6"></a><h3>1.x. Changes since 3.0.RC6</h3>
<a name="v30rc6"></a><h3>1.xi. Changes since 3.0.RC6</h3>
<ul>
<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
@ -742,7 +821,7 @@
<li>[Fix] Able to request new password (Bug #14743)</li>
</ul>
<a name="v30rc5"></a><h3>1.xi. Changes since 3.0.RC5</h3>
<a name="v30rc5"></a><h3>1.xii. Changes since 3.0.RC5</h3>
<ul>
<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li>
@ -805,7 +884,7 @@
<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
</ul>
<a name="v30rc4"></a><h3>1.xii. Changes since 3.0.RC4</h3>
<a name="v30rc4"></a><h3>1.xiii. Changes since 3.0.RC4</h3>
<ul>
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
@ -856,7 +935,7 @@
<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
</ul>
<a name="v30rc3"></a><h3>1.xiii. Changes since 3.0.RC3</h3>
<a name="v30rc3"></a><h3>1.xiv. Changes since 3.0.RC3</h3>
<ul>
<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
@ -965,7 +1044,7 @@
</ul>
<a name="v30rc2"></a><h3>1.xiv. Changes since 3.0.RC2</h3>
<a name="v30rc2"></a><h3>1.xv. Changes since 3.0.RC2</h3>
<ul>
<li>[Fix] Re-allow searching within the memberlist</li>
@ -1011,7 +1090,7 @@
</ul>
<a name="v30rc1"></a><h3>1.xv. Changes since 3.0.RC1</h3>
<a name="v30rc1"></a><h3>1.xvi. Changes since 3.0.RC1</h3>
<ul>
<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li>

View file

@ -273,7 +273,7 @@
<p>This package is meant for those wanting to only replace changed files from a previous version to the latest version. This package normally contains the changed files from up to five previous versions.</p>
<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.5</samp> you should select the phpBB-3.0.5_to_3.0.6.zip/tar.gz file.</p>
<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.6</samp> you should select the phpBB-3.0.6_to_3.0.7.zip/tar.gz file.</p>
<p>The directory structure has been preserved enabling you (if you wish) to simply upload the contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any MODs these files will overwrite the originals possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p>
@ -285,7 +285,7 @@
<p>The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the recommended update method.</p>
<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.5 you need the phpBB-3.0.5_to_3.0.6.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.6 you need the phpBB-3.0.6_to_3.0.7.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
<p>If you do get failures you should look at using the <a href="#update_files">Changed files only</a> package to replace the files which failed to patch, please note that you will need to manually re-add any Modifications (MODs) to these particular files. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p>

View file

@ -69,7 +69,7 @@
<li><a href="#general">General Guidelines</a></li>
</ol>
</li>
<li><a href="#styling">Styling</a></li>
<li><a href="#styling">Styling</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#cfgfiles">Style Config Files</a></li>
<li><a href="#genstyling">General Styling Rules</a></li>
@ -125,7 +125,7 @@
<p>If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.</p>
<h3>Linefeeds:</h3>
<p>Ensure that your editor is saving files in the UNIX (LF) line ending format. This means that lines are terminated with a newline, not with Windows Line endings (CR/LF combo) as they are on Win32 or Classic Mac (CR) Line endings. Any decent editor should be able to do this, but it might not always be the default setting. Know your editor. If you want advice for an editor for your Operating System, just ask one of the developers. Some of them do their editing on Win32.
<p>Ensure that your editor is saving files in the UNIX (LF) line ending format. This means that lines are terminated with a newline, not with Windows Line endings (CR/LF combo) as they are on Win32 or Classic Mac (CR) Line endings. Any decent editor should be able to do this, but it might not always be the default setting. Know your editor. If you want advice for an editor for your Operating System, just ask one of the developers. Some of them do their editing on Win32.</p>
<a name="fileheader"></a><h3>1.ii. File Header</h3>
@ -203,7 +203,7 @@ class ...
<li><code>/includes/db/firebird.php</code><br />Firebird/Interbase Database Abstraction Layer</li>
<li><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer</li>
<li><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL</li>
<li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x/4.1.x/5.x
<li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x/4.1.x/5.x</li>
<li><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer</li>
<li><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li>
<li><code>/includes/db/postgres.php</code><br />PostgreSQL Database Abstraction Layer</li>
@ -224,7 +224,7 @@ class ...
<li><strong>styles</strong><br /><code>/styles</code>, <code>style.php</code><br />phpBB Styles/Templates/Themes/Imagesets</li>
</ul>
<a name="constants"></a></h3>1.iv. Special Constants</h3>
<a name="constants"></a><h3>1.iv. Special Constants</h3>
<p>There are some special constants application developers are able to utilize to bend some of phpBB's internal functionality to suit their needs.</p>
@ -1170,24 +1170,13 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<span class="comment">&lt;!-- INCLUDE {FILE_VAR} --&gt;</span>
</pre></div>
<p>Template defined variables can also be utilised.
<p>Template defined variables can also be utilised.</p>
<div class="codebox"><pre>
<span class="comment">&lt;!-- DEFINE $SOME_VAR = 'my_file.html' --&gt;</span>
<span class="comment">&lt;!-- INCLUDE {$SOME_VAR} --&gt;</span>
</pre></div>
<!-- no longer added in 3.0.6
<p>Also added in <strong>3.0.6</strong> is the ability to increment or decrement a variable on use. This can be used for instances like tabindexes, where the amount of entries is not statically known.
The INC (for incrementing) and DEC (for decrementing) commands will print the <strong>current</strong> state of a defined var and then increment/decrement it by one (postincrement/postdecrement).</p>
<div class="codebox"><pre>
<span class="comment">&lt;!-- DEFINE $SOME_VAR = 1 --&gt;</span>
<span class="comment">&lt;!-- INC $SOME_VAR --&gt;</span>
Result: 1<br />
<span class="comment">{$SOME_VAR}</span>
Result: 2<br />
</pre></div>
//-->
<h4>PHP</h4>
<p>A contentious decision has seen the ability to include PHP within the template introduced. This is achieved by enclosing the PHP within relevant tags:</p>
@ -1541,11 +1530,11 @@ div
&lt;form method=&quot;post&quot; id=&quot;mcp&quot; action=&quot;{U_POST_ACTION}&quot;&gt;
&lt;fieldset class="submit-buttons"&gt;
&lt;input type=&quot;reset&quot; value=&quot;{L_RESET}&quot; name=&quot;reset&quot; class=&quot;button2&quot; /&gt&nbsp;
&lt;input type=&quot;submit&quot; name=&quot;action[add_warning]&quot; value=&quot;{L_SUBMIT}&quot; class=&quot;button1&quot; /&gt
&lt;input type=&quot;reset&quot; value=&quot;{L_RESET}&quot; name=&quot;reset&quot; class=&quot;button2&quot; /&gt;&nbsp;
&lt;input type=&quot;submit&quot; name=&quot;action[add_warning]&quot; value=&quot;{L_SUBMIT}&quot; class=&quot;button1&quot; /&gt;
{S_FORM_TOKEN}
&lt;/fieldset&gt
&lt;/form&gt
&lt;/fieldset&gt;
&lt;/form&gt;
</pre></div><br />
<a name="inheritance"></a><h3>4.ii. Template Inheritance</h3>
@ -2337,7 +2326,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="content">
<p>The version control system for phpBB3 is subversion. The repository is available at <a href="http://code.phpbb.com/svn/phpbb" title="repository">http://code.phpbb.com/svn/phpbb</a>.
<p>The version control system for phpBB3 is subversion. The repository is available at <a href="http://code.phpbb.com/svn/phpbb" title="repository">http://code.phpbb.com/svn/phpbb</a>.</p>
<a name="repostruct"></a><h3>7.i. Repository Structure</h3>

File diff suppressed because it is too large Load diff

View file

@ -410,7 +410,7 @@ class acm
{
if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
{
return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field] : false;
return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++][$field] : false;
}
return false;

View file

@ -50,6 +50,8 @@ class acm_memory
if (isset($this->function) && !function_exists($this->function))
{
global $acm_type;
trigger_error("The required function [{$this->function}] is not available for the ACM module $acm_type.", E_USER_ERROR);
}
}
@ -364,7 +366,7 @@ class acm_memory
{
if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
{
return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field] : false;
return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++][$field] : false;
}
return false;

View file

@ -124,11 +124,11 @@ class acp_attachments
'legend2' => $l_legend_cat_images,
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' px'),
'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'string', 'type' => 'text:20:200', 'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="' . $this->u_action . '&amp;action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'),
'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' px'),
'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' px'),
'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
)
);

View file

@ -124,6 +124,9 @@ class acp_bbcodes
case 'modify':
case 'create':
$warn_text = preg_match('%<[^>]*\{text[\d]*\}[^>]*>%i', $bbcode_tpl);
if (!$warn_text || confirm_box(true))
{
$data = $this->build_regexp($bbcode_match, $bbcode_tpl);
// Make sure the user didn't pick a "bad" name for the BBCode tag.
@ -238,6 +241,19 @@ class acp_bbcodes
add_log('admin', $log_action, $data['bbcode_tag']);
trigger_error($user->lang[$lang] . adm_back_link($this->u_action));
}
else
{
confirm_box(false, $user->lang['BBCODE_DANGER'], build_hidden_fields(array(
'action' => $action,
'bbcode' => $bbcode_id,
'bbcode_match' => $bbcode_match,
'bbcode_tpl' => htmlspecialchars($bbcode_tpl),
'bbcode_helpline' => $bbcode_helpline,
'display_on_posting' => $display_on_posting,
))
, 'confirm_bbcode.html');
}
break;
@ -299,6 +315,18 @@ class acp_bbcodes
{
$bbcode_match = trim($bbcode_match);
$bbcode_tpl = trim($bbcode_tpl);
$utf8 = strpos($bbcode_match, 'INTTEXT') !== false;
// make sure we have utf8 support
$utf8_pcre_properties = false;
if (version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>=')))
{
// While this is the proper range of PHP versions, PHP may not be linked with the bundled PCRE lib and instead with an older version
if (@preg_match('/\p{L}/u', 'a') !== false)
{
$utf8_pcre_properties = true;
}
}
$fp_match = preg_quote($bbcode_match, '!');
$fp_replace = preg_replace('#^\[(.*?)\]#', '[$1:$uid]', $bbcode_match);
@ -326,6 +354,9 @@ class acp_bbcodes
'SIMPLETEXT' => array(
'!([a-zA-Z0-9-+.,_ ]+)!' => "$1"
),
'INTTEXT' => array(
($utf8_pcre_properties) ? '!([\p{L}\p{N}\-+,_. ]+)!u' : '!([a-zA-Z0-9\-+,_. ]+)!u' => "$1"
),
'IDENTIFIER' => array(
'!([a-zA-Z0-9-_]+)!' => "$1"
),
@ -343,6 +374,7 @@ class acp_bbcodes
'EMAIL' => '(' . get_preg_expression('email') . ')',
'TEXT' => '(.*?)',
'SIMPLETEXT' => '([a-zA-Z0-9-+.,_ ]+)',
'INTTEXT' => ($utf8_pcre_properties) ? '([\p{L}\p{N}\-+,_. ]+)' : '([a-zA-Z0-9\-+,_. ]+)',
'IDENTIFIER' => '([a-zA-Z0-9-_]+)',
'COLOR' => '([a-zA-Z]+|#[0-9abcdefABCDEF]+)',
'NUMBER' => '([0-9]+)',
@ -350,6 +382,7 @@ class acp_bbcodes
$pad = 0;
$modifiers = 'i';
$modifiers .= ($utf8 && $utf8_pcre_properties) ? 'u' : '';
if (preg_match_all('/\{(' . implode('|', array_keys($tokens)) . ')[0-9]*\}/i', $bbcode_match, $m))
{
@ -398,7 +431,7 @@ class acp_bbcodes
}
$fp_match = '!' . $fp_match . '!' . $modifiers;
$sp_match = '!' . $sp_match . '!s';
$sp_match = '!' . $sp_match . '!s' . (($utf8) ? 'u' : '');
if (strpos($fp_match, 'e') !== false)
{

View file

@ -29,11 +29,12 @@ class acp_board
{
global $db, $user, $auth, $template;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
global $cache;
$user->add_lang('acp/board');
$action = request_var('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
$submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false;
$form_key = 'acp_board';
add_form_key($form_key);
@ -88,7 +89,7 @@ class acp_board
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_birthdays' => array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
'legend2' => 'ACP_LOAD_SETTINGS',
'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
@ -172,7 +173,7 @@ class acp_board
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
'legend2' => 'POSTING',
'bump_type' => false,
@ -266,14 +267,22 @@ class acp_board
'legend1' => 'ACP_FEED_GENERAL',
'feed_enable' => array('lang' => 'ACP_FEED_ENABLE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_item_statistics' => array('lang' => 'ACP_FEED_ITEM_STATISTICS', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
'feed_limit' => array('lang' => 'ACP_FEED_LIMIT', 'validate' => 'int:5', 'type' => 'text:3:4', 'explain' => true),
'feed_overall_forums' => array('lang' => 'ACP_FEED_OVERALL_FORUMS', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_overall_forums_limit' => array('lang' => 'ACP_FEED_OVERALL_FORUMS_LIMIT', 'validate' => 'int:5', 'type' => 'text:3:4', 'explain' => false),
'feed_overall_topics' => array('lang' => 'ACP_FEED_OVERALL_TOPIC', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_overall_topics_limit' => array('lang' => 'ACP_FEED_OVERALL_TOPIC_LIMIT', 'validate' => 'int:5', 'type' => 'text:3:4', 'explain' => false),
'feed_http_auth' => array('lang' => 'ACP_FEED_HTTP_AUTH', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
'legend2' => 'ACP_FEED_POST_BASED',
'feed_limit_post' => array('lang' => 'ACP_FEED_LIMIT', 'validate' => 'int:5', 'type' => 'text:3:4', 'explain' => true),
'feed_overall' => array('lang' => 'ACP_FEED_OVERALL', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_forum' => array('lang' => 'ACP_FEED_FORUM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_topic' => array('lang' => 'ACP_FEED_TOPIC', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'legend3' => 'ACP_FEED_TOPIC_BASED',
'feed_limit_topic' => array('lang' => 'ACP_FEED_LIMIT', 'validate' => 'int:5', 'type' => 'text:3:4', 'explain' => true),
'feed_topics_new' => array('lang' => 'ACP_FEED_TOPICS_NEW', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_topics_active' => array('lang' => 'ACP_FEED_TOPICS_ACTIVE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_news_id' => array('lang' => 'ACP_FEED_NEWS', 'validate' => 'string', 'type' => 'custom', 'method' => 'select_news_forums', 'explain' => true),
'legend4' => 'ACP_FEED_SETTINGS_OTHER',
'feed_overall_forums' => array('lang' => 'ACP_FEED_OVERALL_FORUMS', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_exclude_id' => array('lang' => 'ACP_FEED_EXCLUDE_ID', 'validate' => 'string', 'type' => 'custom', 'method' => 'select_exclude_forums', 'explain' => true),
)
);
@ -463,12 +472,20 @@ class acp_board
if ($submit)
{
set_config($config_name, $config_value);
if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
{
enable_bitfield_column_flag(FORUMS_TABLE, 'forum_flags', log(FORUM_FLAG_QUICK_REPLY, 2));
}
}
}
// Store news and exclude ids
if ($mode == 'feed' && $submit)
{
$cache->destroy('_feed_news_forum_ids');
$cache->destroy('_feed_excluded_forum_ids');
$this->store_feed_forums(FORUM_OPTION_FEED_NEWS, 'feed_news_id');
$this->store_feed_forums(FORUM_OPTION_FEED_EXCLUDE, 'feed_exclude_id');
}
@ -846,6 +863,20 @@ class acp_board
return h_radio('config[board_disable]', $radio_ary, $value) . '<br /><input id="' . $key . '" type="text" name="config[board_disable_msg]" maxlength="255" size="40" value="' . $this->new_config['board_disable_msg'] . '" />';
}
/**
* Global quick reply enable/disable setting and button to enable in all forums
*/
function quick_reply($value, $key)
{
global $user;
$radio_ary = array(1 => 'YES', 0 => 'NO');
return h_radio('config[allow_quick_reply]', $radio_ary, $value) .
'<br /><br /><input class="button2" type="submit" id="' . $key . '_enable" name="' . $key . '_enable" value="' . $user->lang['ALLOW_QUICK_REPLY_BUTTON'] . '" />';
}
/**
* Select default dateformat
*/
@ -910,7 +941,7 @@ class acp_board
{
global $user, $config;
$forum_list = make_forum_select(false, false, true, false, false, false, true);
$forum_list = make_forum_select(false, false, true, true, true, false, true);
// Build forum options
$s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';

View file

@ -56,6 +56,7 @@ class acp_captcha
'enable_post_confirm' => array('tpl' => 'POST_ENABLE', 'default' => false),
'confirm_refresh' => array('tpl' => 'CONFIRM_REFRESH', 'default' => false),
'max_reg_attempts' => array('tpl' => 'REG_LIMIT', 'default' => 0),
'max_login_attempts' => array('tpl' => 'MAX_LOGIN_ATTEMPTS', 'default' => 0),
);
$this->tpl_name = 'acp_captcha';

View file

@ -109,6 +109,7 @@ class acp_database
case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':
$extractor = new mssql_extractor($download, $store, $format, $filename, $time);
break;
@ -138,6 +139,7 @@ class acp_database
case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':
$extractor->flush('TRUNCATE TABLE ' . $table_name . "GO\n");
break;
@ -435,7 +437,7 @@ class acp_database
{
if (in_array($matches[2], $methods))
{
$backup_files[gmdate("d-m-Y H:i:s", $matches[1])] = $file;
$backup_files[(int) $matches[1]] = $file;
}
}
}
@ -450,7 +452,7 @@ class acp_database
{
$template->assign_block_vars('files', array(
'FILE' => $file,
'NAME' => $name,
'NAME' => $user->format_date($name, 'd-m-Y H:i:s', true),
'SUPPORTED' => true,
));
}
@ -1509,6 +1511,10 @@ class mssql_extractor extends base_extractor
{
$this->write_data_mssql($table_name);
}
else if($db->sql_layer === 'mssqlnative')
{
$this->write_data_mssqlnative($table_name);
}
else
{
$this->write_data_odbc($table_name);
@ -1609,6 +1615,102 @@ class mssql_extractor extends base_extractor
$this->flush($sql_data);
}
function write_data_mssqlnative($table_name)
{
global $db;
$ary_type = $ary_name = $meta_array = array();
$ident_set = false;
$sql_data = '';
// Grab all of the data from current table.
$sql = "SELECT * FROM $table_name";
$result = $db->sql_query($sql);
$retrieved_data = $db->mssqlnative_num_rows($result);
$meta_array = sqlsrv_field_metadata($result);
$i_num_fields = sqlsrv_num_fields($result);
for ($i = 0; $i < $i_num_fields; $i++)
{
$info = $db->mssqlnative_fieldInfo($table_name, $meta_array[$i]['Name']);
$ary_type[$i] = $info->type();
$ary_name[$i] = $info->name();
}
if ($retrieved_data)
{
$sql = "SELECT 1 as has_identity
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
$result2 = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result2);
if (!empty($row2['has_identity']))
{
$sql_data .= "\nSET IDENTITY_INSERT $table_name ON\nGO\n";
$ident_set = true;
}
$db->sql_freeresult($result2);
}
while ($row = $db->sql_fetchrow($result))
{
$schema_vals = $schema_fields = array();
// Build the SQL statement to recreate the data.
for ($i = 0; $i < $i_num_fields; $i++)
{
$str_val = $row[$ary_name[$i]];
if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
{
$str_quote = '';
$str_empty = "''";
$str_val = sanitize_data_mssql(str_replace("'", "''", $str_val));
}
else if (preg_match('#date|timestamp#i', $ary_type[$i]))
{
if (empty($str_val))
{
$str_quote = '';
}
else
{
$str_quote = "'";
}
}
else
{
$str_quote = '';
$str_empty = 'NULL';
}
if (empty($str_val) && $str_val !== '0' && !(is_int($str_val) || is_float($str_val)))
{
$str_val = $str_empty;
}
$schema_vals[$i] = $str_quote . $str_val . $str_quote;
$schema_fields[$i] = $ary_name[$i];
}
// Take the ordered fields and their associated data and build it
// into a valid sql statement to recreate that field in the data.
$sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\nGO\n";
$this->flush($sql_data);
$sql_data = '';
}
$db->sql_freeresult($result);
if ($retrieved_data && $ident_set)
{
$sql_data .= "\nSET IDENTITY_INSERT $table_name OFF\nGO\n";
}
$this->flush($sql_data);
}
function write_data_odbc($table_name)
{
global $db;

View file

@ -941,11 +941,12 @@ class acp_icons
{
global $db;
$sql = "SELECT COUNT(*) AS count
$sql = "SELECT COUNT(*) AS item_count
FROM $table";
$result = $db->sql_query($sql);
$item_count = (int) $db->sql_fetchfield('count');
$item_count = (int) $db->sql_fetchfield('item_count');
$db->sql_freeresult($result);
return $item_count;
}
}

View file

@ -1120,6 +1120,11 @@ class acp_language
{
while (($file = readdir($dp)) !== false)
{
if (!is_dir($phpbb_root_path . 'language/' . $file))
{
continue;
}
if ($file[0] != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt"))
{
if (!in_array($file, $installed))

View file

@ -398,6 +398,14 @@ class acp_main
// Version check
$user->add_lang('install');
if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.2.0', '<'))
{
$template->assign_vars(array(
'S_PHP_VERSION_OLD' => true,
'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '<a href="http://www.phpbb.com/community/viewtopic.php?f=14&amp;t=1958605">', '</a>'),
));
}
$latest_version_info = false;
if (($latest_version_info = obtain_latest_version_info(request_var('versioncheck_force', false))) === false)
{

View file

@ -643,6 +643,11 @@ parse_css_file = {PARSE_CSS_FILE}
{
while (($file = readdir($dp)) !== false)
{
if (!is_dir($phpbb_root_path . 'styles/' . $file))
{
continue;
}
$subpath = ($mode != 'style') ? "$mode/" : '';
if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
{

View file

@ -62,16 +62,22 @@ function login_db(&$username, &$password)
'user_row' => array('user_id' => ANONYMOUS),
);
}
$show_captcha = $config['max_login_attempts'] && $row['user_login_attempts'] >= $config['max_login_attempts'];
// If there are too much login attempts, we need to check for an confirm image
// Every auth module is able to define what to do by itself...
if ($config['max_login_attempts'] && $row['user_login_attempts'] >= $config['max_login_attempts'])
if ($show_captcha)
{
// Visual Confirmation handling
if (!class_exists('phpbb_captcha_factory'))
{
global $phpbb_root_path, $phpEx;
include ($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
}
$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_LOGIN);
$vc_response = $captcha->validate();
$vc_response = $captcha->validate($row);
if ($vc_response)
{
return array(
@ -80,6 +86,10 @@ function login_db(&$username, &$password)
'user_row' => $row,
);
}
else
{
$captcha->reset();
}
}
@ -189,8 +199,8 @@ function login_db(&$username, &$password)
// Give status about wrong password...
return array(
'status' => LOGIN_ERROR_PASSWORD,
'error_msg' => 'LOGIN_ERROR_PASSWORD',
'status' => ($show_captcha) ? LOGIN_ERROR_ATTEMPTS : LOGIN_ERROR_PASSWORD,
'error_msg' => ($show_captcha) ? 'LOGIN_ERROR_ATTEMPTS' : 'LOGIN_ERROR_PASSWORD',
'user_row' => $row,
);
}

View file

@ -137,7 +137,7 @@ class bbcode
if (!@file_exists($this->template_filename))
{
if (isset($template->orig_tpl_inherits_id) && $template->orig_tpl_inherits_id)
if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
{
$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template/bbcode.html';
if (!@file_exists($this->template_filename))
@ -360,7 +360,7 @@ class bbcode
// In order to use templates with custom bbcodes we need
// to replace all {VARS} to corresponding backreferences
// Note that backreferences are numbered from bbcode_match
if (preg_match_all('/\{(URL|LOCAL_URL|EMAIL|TEXT|SIMPLETEXT|IDENTIFIER|COLOR|NUMBER)[0-9]*\}/', $rowset[$bbcode_id]['bbcode_match'], $m))
if (preg_match_all('/\{(URL|LOCAL_URL|EMAIL|TEXT|SIMPLETEXT|INTTEXT|IDENTIFIER|COLOR|NUMBER)[0-9]*\}/', $rowset[$bbcode_id]['bbcode_match'], $m))
{
foreach ($m[0] as $i => $tok)
{

View file

@ -82,9 +82,11 @@ class cache extends acm
$result = $db->sql_query($sql);
$censors = array();
$unicode = ((version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) && @preg_match('/\p{L}/u', 'a') !== false) ? true : false;
while ($row = $db->sql_fetchrow($result))
{
if ((version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) && @preg_match('/\p{L}/u', 'a') !== false)
if ($unicode)
{
$censors['match'][] = '#(?<![\p{Nd}\p{L}_])(' . str_replace('\*', '[\p{Nd}\p{L}_]*?', preg_quote($row['word'], '#')) . ')(?![\p{Nd}\p{L}_])#iu';
}
@ -297,6 +299,7 @@ class cache extends acm
{
case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':
$sql = 'SELECT user_id, bot_agent, bot_ip
FROM ' . BOTS_TABLE . '
WHERE bot_active = 1

View file

@ -193,6 +193,11 @@ class phpbb_default_captcha
{
global $config, $db, $user;
if (empty($user->lang))
{
$user->setup();
}
$error = '';
if (!$this->confirm_id)
{

View file

@ -88,8 +88,8 @@ class phpbb_captcha_qa
$db->sql_freeresult($result);
}
// okay, if there is a confirm_id, we try to load that confirm's state
if (!strlen($this->confirm_id) || !$this->load_answer())
// okay, if there is a confirm_id, we try to load that confirm's state. If not, we try to find one
if (!$this->load_answer() && (!$this->load_confirm_id() || !$this->load_answer()))
{
// we have no valid confirm ID, better get ready to ask something
$this->select_question();
@ -137,14 +137,14 @@ class phpbb_captcha_qa
return false;
}
$sql = 'SELECT COUNT(question_id) as count
$sql = 'SELECT COUNT(question_id) AS question_count
FROM ' . CAPTCHA_QUESTIONS_TABLE . "
WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
return ((bool) $row['count']);
return ((bool) $row['question_count']);
}
/**
@ -214,6 +214,22 @@ class phpbb_captcha_qa
*/
function get_demo_template()
{
global $config, $db, $template;
if ($this->is_available())
{
$sql = 'SELECT question_text
FROM ' . CAPTCHA_QUESTIONS_TABLE . "
WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
$result = $db->sql_query_limit($sql, 1);
if ($row = $db->sql_fetchrow($result))
{
$template->assign_vars(array(
'QA_CONFIRM_QUESTION' => $row['question_text'],
));
}
$db->sql_freeresult($result);
}
return 'captcha_qa_acp_demo.html';
}
@ -237,11 +253,11 @@ class phpbb_captcha_qa
/**
* API function
*/
function garbage_collect($type)
function garbage_collect($type = 0)
{
global $db, $config;
$sql = 'SELECT DISTINCT c.session_id
$sql = 'SELECT c.confirm_id
FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' c
LEFT JOIN ' . SESSIONS_TABLE . ' s
ON (c.session_id = s.session_id)
@ -255,14 +271,14 @@ class phpbb_captcha_qa
do
{
$sql_in[] = (string) $row['session_id'];
$sql_in[] = (string) $row['confirm_id'];
}
while ($row = $db->sql_fetchrow($result));
if (sizeof($sql_in))
{
$sql = 'DELETE FROM ' . CAPTCHA_QA_CONFIRM_TABLE . '
WHERE ' . $db->sql_in_set('session_id', $sql_in);
WHERE ' . $db->sql_in_set('confirm_id', $sql_in);
$db->sql_query($sql);
}
}
@ -393,7 +409,6 @@ class phpbb_captcha_qa
{
global $db, $user;
if (!sizeof($this->question_ids))
{
return false;
@ -458,6 +473,32 @@ class phpbb_captcha_qa
$this->load_answer();
}
/**
* See if there is already an entry for the current session.
*/
function load_confirm_id()
{
global $db, $user;
$sql = 'SELECT confirm_id
FROM ' . CAPTCHA_QA_CONFIRM_TABLE . "
WHERE
session_id = '" . $db->sql_escape($user->session_id) . "'
AND lang_iso = '" . $db->sql_escape($this->question_lang) . "'
AND confirm_type = " . $this->type;
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row)
{
$this->confirm_id = $row['confirm_id'];
return true;
}
return false;
}
/**
* Look up everything we need and populate the instance variables.
*/
@ -465,7 +506,7 @@ class phpbb_captcha_qa
{
global $db, $user;
if (!sizeof($this->question_ids))
if (!strlen($this->confirm_id) || !sizeof($this->question_ids))
{
return false;
}
@ -616,6 +657,8 @@ class phpbb_captcha_qa
$this->acp_question_list($module);
}
else if ($question_id && $action == 'delete')
{
if ($this->get_class_name() !== $config['captcha_plugin'] || !$this->acp_is_last($question_id))
{
if (confirm_box(true))
{
@ -635,6 +678,11 @@ class phpbb_captcha_qa
}
}
else
{
trigger_error($user->lang['QA_LAST_QUESTION'] . adm_back_link($list_url), E_USER_WARNING);
}
}
else
{
// okay, show the editor
$error = false;
@ -711,7 +759,7 @@ class phpbb_captcha_qa
}
else if ($submit)
{
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url));
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url), E_USER_WARNING);
}
}
}
@ -942,6 +990,33 @@ class phpbb_captcha_qa
return $langs;
}
/**
* See if there is a question other than the one we have
*/
function acp_is_last($question_id)
{
global $config, $db;
if ($question_id)
{
$sql = 'SELECT question_id
FROM ' . CAPTCHA_QUESTIONS_TABLE . "
WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'
AND question_id <> " . (int) $question_id;
$result = $db->sql_query_limit($sql, 1);
$question = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$question)
{
return true;
}
return false;
}
}
}
?>

View file

@ -28,10 +28,17 @@ if (!class_exists('phpbb_default_captcha'))
class phpbb_recaptcha extends phpbb_default_captcha
{
var $recaptcha_server = 'http://api.recaptcha.net';
var $recaptcha_server_secure = 'https://api-secure.recaptcha.net'; // class constants :(
var $recaptcha_verify_server = 'api-verify.recaptcha.net';
var $challenge;
var $response;
// PHP4 Constructor
function phpbb_recaptcha()
{
$this->recaptcha_server = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? $this->recaptcha_server_secure : $this->recaptcha_server;
}
function init($type)
{
global $config, $db, $user;

View file

@ -25,7 +25,7 @@ if (!defined('IN_PHPBB'))
*/
// phpBB Version
define('PHPBB_VERSION', '3.0.6');
define('PHPBB_VERSION', '3.0.7');
// QA-related
// define('PHPBB_QA', 1);

View file

@ -160,6 +160,36 @@ class phpbb_db_tools
'VARBINARY' => '[varchar] (255)',
),
'mssqlnative' => array(
'INT:' => '[int]',
'BINT' => '[float]',
'UINT' => '[int]',
'UINT:' => '[int]',
'TINT:' => '[int]',
'USINT' => '[int]',
'BOOL' => '[int]',
'VCHAR' => '[varchar] (255)',
'VCHAR:' => '[varchar] (%d)',
'CHAR:' => '[char] (%d)',
'XSTEXT' => '[varchar] (1000)',
'STEXT' => '[varchar] (3000)',
'TEXT' => '[varchar] (8000)',
'MTEXT' => '[text]',
'XSTEXT_UNI'=> '[varchar] (100)',
'STEXT_UNI' => '[varchar] (255)',
'TEXT_UNI' => '[varchar] (4000)',
'MTEXT_UNI' => '[text]',
'TIMESTAMP' => '[int]',
'DECIMAL' => '[float]',
'DECIMAL:' => '[float]',
'PDECIMAL' => '[float]',
'PDECIMAL:' => '[float]',
'VCHAR_UNI' => '[varchar] (255)',
'VCHAR_UNI:'=> '[varchar] (%d)',
'VCHAR_CI' => '[varchar] (255)',
'VARBINARY' => '[varchar] (255)',
),
'oracle' => array(
'INT:' => 'number(%d)',
'BINT' => 'number(20)',
@ -261,7 +291,7 @@ class phpbb_db_tools
* A list of supported DBMS. We change this class to support more DBMS, the DBMS itself only need to follow some rules.
* @var array
*/
var $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
var $supported_dbms = array('firebird', 'mssql', 'mssqlnative', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
/**
* This is set to true if user only wants to return the 'to-be-executed' SQL statement(s) (as an array).
@ -307,6 +337,10 @@ class phpbb_db_tools
$this->sql_layer = 'mssql';
break;
case 'mssqlnative':
$this->sql_layer = 'mssqlnative';
break;
default:
$this->sql_layer = $this->db->sql_layer;
break;
@ -368,6 +402,7 @@ class phpbb_db_tools
switch ($this->sql_layer)
{
case 'mssql':
case 'mssqlnative':
$table_sql = 'CREATE TABLE [' . $table_name . '] (' . "\n";
break;
@ -386,6 +421,7 @@ class phpbb_db_tools
switch ($this->sql_layer)
{
case 'mssql':
case 'mssqlnative':
$columns[] = "\t [{$column_name}] " . $prepared_column['column_type_sql_default'];
break;
@ -425,6 +461,7 @@ class phpbb_db_tools
break;
case 'mssql':
case 'mssqlnative':
$table_sql .= "\n) ON [PRIMARY]" . (($create_textimage) ? ' TEXTIMAGE_ON [PRIMARY]' : '');
$statements[] = $table_sql;
break;
@ -453,6 +490,7 @@ class phpbb_db_tools
case 'firebird':
case 'mssql':
case 'mssqlnative':
// We need the data here
$old_return_statements = $this->return_statements;
$this->return_statements = true;
@ -970,6 +1008,7 @@ class phpbb_db_tools
// same deal with PostgreSQL, we must perform more complex operations than
// we technically could
case 'mssql':
case 'mssqlnative':
$sql = "SELECT c.name
FROM syscolumns c
LEFT JOIN sysobjects o ON c.id = o.id
@ -1187,6 +1226,7 @@ class phpbb_db_tools
break;
case 'mssql':
case 'mssqlnative':
$sql .= " {$column_type} ";
$sql_default = " {$column_type} ";
@ -1335,6 +1375,7 @@ class phpbb_db_tools
break;
case 'mssql':
case 'mssqlnative':
$statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default'];
break;
@ -1348,7 +1389,29 @@ class phpbb_db_tools
break;
case 'postgres':
if (version_compare($this->db->sql_server_info(true), '8.0', '>='))
{
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql'];
}
else
{
// old versions cannot add columns with default and null information
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type'] . ' ' . $column_data['constraint'];
if (isset($column_data['null']))
{
if ($column_data['null'] == 'NOT NULL')
{
$statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET NOT NULL';
}
}
if (isset($column_data['default']))
{
$statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $column_data['default'];
}
}
break;
case 'sqlite':
@ -1433,6 +1496,7 @@ class phpbb_db_tools
break;
case 'mssql':
case 'mssqlnative':
$statements[] = 'ALTER TABLE [' . $table_name . '] DROP COLUMN [' . $column_name . ']';
break;
@ -1527,6 +1591,7 @@ class phpbb_db_tools
switch ($this->sql_layer)
{
case 'mssql':
case 'mssqlnative':
$statements[] = 'DROP INDEX ' . $table_name . '.' . $index_name;
break;
@ -1630,6 +1695,7 @@ class phpbb_db_tools
break;
case 'mssql':
case 'mssqlnative':
$sql = "ALTER TABLE [{$table_name}] WITH NOCHECK ADD ";
$sql .= "CONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED (";
$sql .= '[' . implode("],\n\t\t[", $column) . ']';
@ -1723,6 +1789,7 @@ class phpbb_db_tools
break;
case 'mssql':
case 'mssqlnative':
$statements[] = 'CREATE UNIQUE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ') ON [PRIMARY]';
break;
}
@ -1752,6 +1819,7 @@ class phpbb_db_tools
break;
case 'mssql':
case 'mssqlnative':
$statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ') ON [PRIMARY]';
break;
}
@ -1769,7 +1837,7 @@ class phpbb_db_tools
{
$index_array = array();
if ($this->sql_layer == 'mssql')
if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
{
$sql = "EXEC sp_statistics '$table_name'";
$result = $this->db->sql_query($sql);
@ -1878,6 +1946,7 @@ class phpbb_db_tools
break;
case 'mssql':
case 'mssqlnative':
$statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];
if (!empty($column_data['default']))

View file

@ -429,6 +429,24 @@ class dbal
return $column_name . ' & ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
}
/**
* Run binary OR operator on DB column.
* Results in sql statement: "{$column_name} | (1 << {$bit}) {$compare}"
*
* @param string $column_name The column name to use
* @param int $bit The value to use for the OR operator, will be converted to (1 << $bit). Is used by options, using the number schema... 0, 1, 2...29
* @param string $compare Any custom SQL code after the check (for example "= 0")
*/
function sql_bit_or($column_name, $bit, $compare = '')
{
if (method_exists($this, '_sql_bit_or'))
{
return $this->_sql_bit_or($column_name, $bit, $compare);
}
return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
}
/**
* Run more than one insert statement.
*

View file

@ -451,6 +451,11 @@ class dbal_firebird extends dbal
return 'BIN_AND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
}
function _sql_bit_or($column_name, $bit, $compare = '')
{
return 'BIN_OR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
}
/**
* return sql error array
* @access private

View file

@ -0,0 +1,610 @@
<?php
/**
*
* @package dbal
* @version $Id$
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
* This is the MS SQL Server Native database abstraction layer.
* PHP mssql native driver required.
* @author Chris Pucci
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
/**
* Prior to version 1.1 the SQL Server Native PHP driver didn't support sqlsrv_num_rows, or cursor based seeking so we recall all rows into an array
* and maintain our own cursor index into that array.
*/
class result_mssqlnative
{
public function result_mssqlnative($queryresult = false)
{
$this->m_cursor = 0;
$this->m_rows = array();
$this->m_num_fields = sqlsrv_num_fields($queryresult);
$this->m_field_meta = sqlsrv_field_metadata($queryresult);
while ($row = sqlsrv_fetch_array($queryresult, SQLSRV_FETCH_ASSOC))
{
if ($row !== null)
{
foreach($row as $k => $v)
{
if (is_object($v) && method_exists($v, 'format'))
{
$row[$k] = $v->format("Y-m-d\TH:i:s\Z");
}
}
$this->m_rows[] = $row;//read results into memory, cursors are not supported
}
}
$this->m_row_count = count($this->m_rows);
sqlsrv_free_stmt($queryresult);
}
private function array_to_obj($array, &$obj)
{
foreach ($array as $key => $value)
{
if (is_array($value))
{
$obj->$key = new stdClass();
array_to_obj($value, $obj->$key);
}
else
{
$obj->$key = $value;
}
}
return $obj;
}
public function fetch($mode = SQLSRV_FETCH_BOTH, $object_class = 'stdClass')
{
if ($this->m_cursor >= $this->m_row_count || $this->m_row_count == 0)
{
return false;
}
$ret = false;
$arr_num = array();
if ($mode == SQLSRV_FETCH_NUMERIC || $mode == SQLSRV_FETCH_BOTH)
{
foreach($this->m_rows[$this->m_cursor] as $key => $value)
{
$arr_num[] = $value;
}
}
switch ($mode)
{
case SQLSRV_FETCH_ASSOC:
$ret = $this->m_rows[$this->m_cursor];
break;
case SQLSRV_FETCH_NUMERIC:
$ret = $arr_num;
break;
case 'OBJECT':
$ret = $this->array_to_obj($this->m_rows[$this->m_cursor], $o = new $object_class);
break;
case SQLSRV_FETCH_BOTH:
default:
$ret = $this->m_rows[$this->m_cursor] + $arr_num;
break;
}
$this->m_cursor++;
return $ret;
}
public function get($pos, $fld)
{
return $this->m_rows[$pos][$fld];
}
public function num_rows()
{
return $this->m_row_count;
}
public function seek($iRow)
{
$this->m_cursor = min($iRow, $this->m_row_count);
}
public function num_fields()
{
return $this->m_num_fields;
}
public function field_name($nr)
{
$arr_keys = array_keys($this->m_rows[0]);
return $arr_keys[$nr];
}
public function field_type($nr)
{
$i = 0;
$int_type = -1;
$str_type = '';
foreach ($this->m_field_meta as $meta)
{
if ($nr == $i)
{
$int_type = $meta['Type'];
break;
}
$i++;
}
//http://msdn.microsoft.com/en-us/library/cc296183.aspx contains type table
switch ($int_type)
{
case SQLSRV_SQLTYPE_BIGINT: $str_type = 'bigint'; break;
case SQLSRV_SQLTYPE_BINARY: $str_type = 'binary'; break;
case SQLSRV_SQLTYPE_BIT: $str_type = 'bit'; break;
case SQLSRV_SQLTYPE_CHAR: $str_type = 'char'; break;
case SQLSRV_SQLTYPE_DATETIME: $str_type = 'datetime'; break;
case SQLSRV_SQLTYPE_DECIMAL/*($precision, $scale)*/: $str_type = 'decimal'; break;
case SQLSRV_SQLTYPE_FLOAT: $str_type = 'float'; break;
case SQLSRV_SQLTYPE_IMAGE: $str_type = 'image'; break;
case SQLSRV_SQLTYPE_INT: $str_type = 'int'; break;
case SQLSRV_SQLTYPE_MONEY: $str_type = 'money'; break;
case SQLSRV_SQLTYPE_NCHAR/*($charCount)*/: $str_type = 'nchar'; break;
case SQLSRV_SQLTYPE_NUMERIC/*($precision, $scale)*/: $str_type = 'numeric'; break;
case SQLSRV_SQLTYPE_NVARCHAR/*($charCount)*/: $str_type = 'nvarchar'; break;
case SQLSRV_SQLTYPE_NTEXT: $str_type = 'ntext'; break;
case SQLSRV_SQLTYPE_REAL: $str_type = 'real'; break;
case SQLSRV_SQLTYPE_SMALLDATETIME: $str_type = 'smalldatetime'; break;
case SQLSRV_SQLTYPE_SMALLINT: $str_type = 'smallint'; break;
case SQLSRV_SQLTYPE_SMALLMONEY: $str_type = 'smallmoney'; break;
case SQLSRV_SQLTYPE_TEXT: $str_type = 'text'; break;
case SQLSRV_SQLTYPE_TIMESTAMP: $str_type = 'timestamp'; break;
case SQLSRV_SQLTYPE_TINYINT: $str_type = 'tinyint'; break;
case SQLSRV_SQLTYPE_UNIQUEIDENTIFIER: $str_type = 'uniqueidentifier'; break;
case SQLSRV_SQLTYPE_UDT: $str_type = 'UDT'; break;
case SQLSRV_SQLTYPE_VARBINARY/*($byteCount)*/: $str_type = 'varbinary'; break;
case SQLSRV_SQLTYPE_VARCHAR/*($charCount)*/: $str_type = 'varchar'; break;
case SQLSRV_SQLTYPE_XML: $str_type = 'xml'; break;
default: $str_type = $int_type;
}
return $str_type;
}
public function free()
{
unset($this->m_rows);
return;
}
}
/**
* @package dbal
*/
class dbal_mssqlnative extends dbal
{
var $m_insert_id = NULL;
var $last_query_text = '';
/**
* Connect to server
*/
function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
{
# Test for driver support, to avoid suppressed fatal error
if (!function_exists('sqlsrv_connect'))
{
trigger_error('Native MS SQL Server driver for PHP is missing or needs to be updated. Version 1.1 or later is required to install phpBB3. You can download the driver from: http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx\n', E_USER_ERROR);
}
//set up connection variables
$this->persistency = $persistency;
$this->user = $sqluser;
$this->dbname = $database;
$port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
$this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
//connect to database
error_reporting(E_ALL);
$this->db_connect_id = sqlsrv_connect($this->server, array(
'Database' => $this->dbname,
'UID' => $this->user,
'PWD' => $sqlpassword
));
return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
}
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
* @return string sql server version
*/
function sql_server_info($raw = false)
{
global $cache;
if (empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
{
$arr_server_info = sqlsrv_server_info($this->db_connect_id);
$this->sql_server_version = $arr_server_info['SQLServerVersion'];
if (!empty($cache))
{
$cache->put('mssql_version', $this->sql_server_version);
}
}
if ($raw)
{
return $this->sql_server_version;
}
return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
}
/**
* SQL Transaction
* @access private
*/
function _sql_transaction($status = 'begin')
{
switch ($status)
{
case 'begin':
return sqlsrv_begin_transaction($this->db_connect_id);
break;
case 'commit':
return sqlsrv_commit($this->db_connect_id);
break;
case 'rollback':
return sqlsrv_rollback($this->db_connect_id);
break;
}
return true;
}
/**
* Base query method
*
* @param string $query Contains the SQL query which shall be executed
* @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
* @return mixed When casted to bool the returned value returns true on success and false on failure
*
* @access public
*/
function sql_query($query = '', $cache_ttl = 0)
{
if ($query != '')
{
global $cache;
// EXPLAIN only in extra debug mode
if (defined('DEBUG_EXTRA'))
{
$this->sql_report('start', $query);
}
$this->last_query_text = $query;
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
if ($this->query_result === false)
{
if (($this->query_result = @sqlsrv_query($this->db_connect_id, $query)) === false)
{
$this->sql_error($query);
}
if (defined('DEBUG_EXTRA'))
{
$this->sql_report('stop', $query);
}
if ($cache_ttl && method_exists($cache, 'sql_save'))
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
$cache->sql_save($query, $this->query_result, $cache_ttl);
}
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
}
else if (defined('DEBUG_EXTRA'))
{
$this->sql_report('fromcache', $query);
}
}
else
{
return false;
}
return $this->query_result;
}
/**
* Build LIMIT query
*/
function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
$this->query_result = false;
if ($offset === false || $offset == 0)
{
if (strpos($query, "SELECT") === false)
{
$query = "TOP {$total} " . $query;
}
else
{
$query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP '.$total, $query);
}
}
else
{
$query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP(10000000) ', $query);
$query = 'SELECT *
FROM (SELECT sub2.*, ROW_NUMBER() OVER(ORDER BY sub2.line2) AS line3
FROM (SELECT 1 AS line2, sub1.* FROM (' . $query . ') AS sub1) as sub2) AS sub3
WHERE line3 BETWEEN ' . ($offset+1) . ' AND ' . ($offset + $total);
}
$result = $this->sql_query($query, $cache_ttl);
return $result;
}
/**
* Return number of affected rows
*/
function sql_affectedrows()
{
return ($this->db_connect_id) ? @sqlsrv_rows_affected($this->db_connect_id) : false;
}
/**
* Fetch current row
*/
function sql_fetchrow($query_id = false)
{
global $cache;
if ($query_id === false)
{
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
{
return $cache->sql_fetchrow($query_id);
}
if ($query_id === false)
{
return false;
}
$row = @sqlsrv_fetch_array($query_id, SQLSRV_FETCH_ASSOC);
// I hope i am able to remove this later... hopefully only a PHP or MSSQL bug
if ($row)
{
foreach ($row as $key => $value)
{
$row[$key] = ($value === ' ' || $value === NULL) ? '' : $value;
}
}
return $row;
}
/**
* Seek to given row number
* rownum is zero-based
*/
function sql_rowseek($rownum, &$query_id)
{
global $cache;
if (isset($cache->sql_rowset[$query_id]))
{
return $cache->sql_rowseek($rownum, $query_id);
}
$seek = new result_mssqlnative($query_id);
$row = $seek->seek($rownum);
return ($row = $seek->fetch()) ? $row : false;
}
/**
* Get last inserted id after insert statement
*/
function sql_nextid()
{
$result_id = @sqlsrv_query($this->db_connect_id, 'SELECT @@IDENTITY');
if ($result_id !== false)
{
$row = @sqlsrv_fetch_array($result_id);
$id = $row[0];
@sqlsrv_free_stmt($result_id);
return $id;
}
else
{
return false;
}
}
/**
* Free sql result
*/
function sql_freeresult($query_id = false)
{
global $cache;
if ($query_id === false)
{
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
{
return $cache->sql_freeresult($query_id);
}
if (isset($this->open_queries[$query_id]))
{
unset($this->open_queries[$query_id]);
return @sqlsrv_free_stmt($query_id);
}
return false;
}
/**
* Escape string used in sql query
*/
function sql_escape($msg)
{
return str_replace(array("'", "\0"), array("''", ''), $msg);
}
/**
* Build LIKE expression
* @access private
*/
function _sql_like_expression($expression)
{
return $expression . " ESCAPE '\\'";
}
/**
* return sql error array
* @access private
*/
function _sql_error()
{
$errors = @sqlsrv_errors(SQLSRV_ERR_ERRORS);
$error_message = '';
if ($errors != null)
{
foreach ($errors as $error)
{
$error_message .= "SQLSTATE: ".$error[ 'SQLSTATE']."\n";
$error_message .= "code: ".$error[ 'code']."\n";
$error_message .= "message: ".$error[ 'message']."\n";
}
$this->last_error_result = $error_message;
$error = $this->last_error_result;
}
else
{
$error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array();
}
return $error;
}
/**
* Build db-specific query data
* @access private
*/
function _sql_custom_build($stage, $data)
{
return $data;
}
/**
* Close sql connection
* @access private
*/
function _sql_close()
{
return @sqlsrv_close($this->db_connect_id);
}
/**
* Build db-specific report
* @access private
*/
function _sql_report($mode, $query = '')
{
switch ($mode)
{
case 'start':
$html_table = false;
@sqlsrv_query($this->db_connect_id, 'SET SHOWPLAN_TEXT ON;');
if ($result = @sqlsrv_query($this->db_connect_id, $query))
{
@sqlsrv_next_result($result);
while ($row = @sqlsrv_fetch_array($result))
{
$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
}
}
@sqlsrv_query($this->db_connect_id, 'SET SHOWPLAN_TEXT OFF;');
@sqlsrv_free_stmt($result);
if ($html_table)
{
$this->html_hold .= '</table>';
}
break;
case 'fromcache':
$endtime = explode(' ', microtime());
$endtime = $endtime[0] + $endtime[1];
$result = @sqlsrv_query($this->db_connect_id, $query);
while ($void = @sqlsrv_fetch_array($result))
{
// Take the time spent on parsing rows into account
}
@sqlsrv_free_stmt($result);
$splittime = explode(' ', microtime());
$splittime = $splittime[0] + $splittime[1];
$this->sql_report('record_fromcache', $query, $endtime, $splittime);
break;
}
}
/**
* Utility method used to retrieve number of rows
* Emulates mysql_num_rows
* Used in acp_database.php -> write_data_mssqlnative()
*/
function mssqlnative_num_rows($res)
{
if ($res !== false)
{
$row = new result_mssqlnative($res);
$num_rows = $row->num_rows();
return $num_rows;
}
else
{
return false;
}
}
}
?>

View file

@ -44,7 +44,7 @@ class dbal_mysql extends dbal
$this->sql_layer = 'mysql4';
$this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mysql_connect($this->server, $this->user, $sqlpassword, $new_link);
$this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword) : @mysql_connect($this->server, $this->user, $sqlpassword, $new_link);
if ($this->db_connect_id && $this->dbname != '')
{

View file

@ -622,6 +622,11 @@ class dbal_oracle extends dbal
return 'BITAND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
}
function _sql_bit_or($column_name, $bit, $compare = '')
{
return 'BITOR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
}
/**
* return sql error array
* @access private

View file

@ -202,7 +202,7 @@ function set_config_count($config_name, $increment, $is_dynamic = false)
function gen_rand_string($num_chars = 8)
{
$rand_str = unique_id();
$rand_str = str_replace('0', 'Z', strtoupper(base_convert($rand_str, 16, 35)));
$rand_str = str_replace(array('0', 'O'), array('Z', 'Y'), strtoupper(base_convert($rand_str, 16, 34)));
return substr($rand_str, 0, $num_chars);
}
@ -556,11 +556,11 @@ function _hash_crypt_private($password, $setting, &$itoa64)
*
* @param string $email Email address
*
* @return string Big Integer
* @return string Unsigned Big Integer
*/
function phpbb_email_hash($email)
{
return crc32(strtolower($email)) . strlen($email);
return sprintf('%u', crc32(strtolower($email))) . strlen($email);
}
/**
@ -2336,6 +2336,19 @@ function redirect($url, $return = false, $disable_cd_check = false)
// Relative uri
$pathinfo = pathinfo($url);
if (!$disable_cd_check && !file_exists($pathinfo['dirname']))
{
$url = str_replace('../', '', $url);
$pathinfo = pathinfo($url);
if (!file_exists($pathinfo['dirname']))
{
// fallback to "last known user page"
$url = generate_board_url() . '/' . $user->page['page'];
break;
}
}
// Is the uri pointing to the current directory?
if ($pathinfo['dirname'] == '.')
{
@ -3531,7 +3544,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
}
}
if (defined('DEBUG') || defined('IN_CRON') || defined('IMAGE_OUTPUT'))
if ((defined('DEBUG') || defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db))
{
// let's avoid loops
$db->sql_return_on_error(true);
@ -3920,6 +3933,108 @@ function phpbb_optionset($bit, $set, $data)
return $data;
}
/**
* Login using http authenticate.
*
* @param array $param Parameter array, see $param_defaults array.
*
* @return void
*/
function phpbb_http_login($param)
{
global $auth, $user;
global $config;
$param_defaults = array(
'auth_message' => '',
'autologin' => false,
'viewonline' => true,
'admin' => false,
);
// Overwrite default values with passed values
$param = array_merge($param_defaults, $param);
// User is already logged in
// We will not overwrite his session
if (!empty($user->data['is_registered']))
{
return;
}
// $_SERVER keys to check
$username_keys = array(
'PHP_AUTH_USER',
'Authorization',
'REMOTE_USER', 'REDIRECT_REMOTE_USER',
'HTTP_AUTHORIZATION', 'REDIRECT_HTTP_AUTHORIZATION',
'REMOTE_AUTHORIZATION', 'REDIRECT_REMOTE_AUTHORIZATION',
'AUTH_USER',
);
$password_keys = array(
'PHP_AUTH_PW',
'REMOTE_PASSWORD',
'AUTH_PASSWORD',
);
$username = null;
foreach ($username_keys as $k)
{
if (isset($_SERVER[$k]))
{
$username = $_SERVER[$k];
break;
}
}
$password = null;
foreach ($password_keys as $k)
{
if (isset($_SERVER[$k]))
{
$password = $_SERVER[$k];
break;
}
}
// Decode encoded information (IIS, CGI, FastCGI etc.)
if (!is_null($username) && is_null($password) && strpos($username, 'Basic ') === 0)
{
list($username, $password) = explode(':', base64_decode(substr($username, 6)), 2);
}
if (!is_null($username) && !is_null($password))
{
set_var($username, $username, 'string', true);
set_var($password, $password, 'string', true);
$auth_result = $auth->login($username, $password, $param['autologin'], $param['viewonline'], $param['admin']);
if ($auth_result['status'] == LOGIN_SUCCESS)
{
return;
}
else if ($auth_result['status'] == LOGIN_ERROR_ATTEMPTS)
{
header('HTTP/1.0 401 Unauthorized');
trigger_error('NOT_AUTHORISED');
}
}
// Prepend sitename to auth_message
$param['auth_message'] = ($param['auth_message'] === '') ? $config['sitename'] : $config['sitename'] . ' - ' . $param['auth_message'];
// We should probably filter out non-ASCII characters - RFC2616
$param['auth_message'] = preg_replace('/[\x80-\xFF]/', '?', $param['auth_message']);
header('WWW-Authenticate: Basic realm="' . $param['auth_message'] . '"');
header('HTTP/1.0 401 Unauthorized');
trigger_error('NOT_AUTHORISED');
}
/**
* Generate page header
*/
@ -4139,8 +4254,10 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_LOGIN_REDIRECT' => build_hidden_fields(array('redirect' => str_replace('&amp;', '&', build_url()))),
'S_ENABLE_FEEDS' => ($config['feed_enable']) ? true : false,
'S_ENABLE_FEEDS_OVERALL' => ($config['feed_overall']) ? true : false,
'S_ENABLE_FEEDS_FORUMS' => ($config['feed_overall_forums']) ? true : false,
'S_ENABLE_FEEDS_TOPICS' => ($config['feed_overall_topics']) ? true : false,
'S_ENABLE_FEEDS_TOPICS' => ($config['feed_topics_new']) ? true : false,
'S_ENABLE_FEEDS_TOPICS_ACTIVE' => ($config['feed_topics_active']) ? true : false,
'S_ENABLE_FEEDS_NEWS' => ($s_feed_news) ? true : false,
'T_THEME_PATH' => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme',

View file

@ -66,8 +66,6 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl =
{
global $db, $user, $auth;
$acl = ($ignore_acl) ? '' : (($only_acl_post) ? 'f_post' : array('f_list', 'a_forum', 'a_forumadd', 'a_forumdel'));
// This query is identical to the jumpbox one
$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, forum_flags, forum_options, left_id, right_id
FROM ' . FORUMS_TABLE . '
@ -98,18 +96,21 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl =
$right = $row['right_id'];
$disabled = false;
if ($acl && !$auth->acl_gets($acl, $row['forum_id']))
if (!$ignore_acl && $auth->acl_get('f_list', $row['forum_id']))
{
// List permission?
if ($auth->acl_get('f_list', $row['forum_id']))
if ($only_acl_post && !$auth->acl_get('f_post', $row['forum_id']) || (!$auth->acl_get('m_approve', $row['forum_id']) && !$auth->acl_get('f_noapprove', $row['forum_id'])))
{
$disabled = true;
}
else
else if (!$only_acl_post && !$auth->acl_gets(array('f_list', 'a_forum', 'a_forumadd', 'a_forumdel'), $row['forum_id']))
{
$disabled = true;
}
}
else if (!$ignore_acl)
{
continue;
}
}
if (
((is_array($ignore_id) && in_array($row['forum_id'], $ignore_id)) || $row['forum_id'] == $ignore_id)
@ -912,7 +913,13 @@ function delete_attachments($mode, $ids, $resync = true)
{
global $db, $config;
if (is_array($ids) && sizeof($ids))
// 0 is as bad as an empty array
if (empty($ids))
{
return false;
}
if (is_array($ids))
{
$ids = array_unique($ids);
$ids = array_map('intval', $ids);
@ -922,11 +929,6 @@ function delete_attachments($mode, $ids, $resync = true)
$ids = array((int) $ids);
}
if (!sizeof($ids))
{
return false;
}
$sql_where = '';
switch ($mode)
@ -3040,6 +3042,7 @@ function get_database_size()
case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':
$sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
FROM sysfiles';
$result = $db->sql_query($sql, 7200);
@ -3307,4 +3310,24 @@ function obtain_latest_version_info($force_update = false, $warn_fail = false, $
return $info;
}
/**
* Enables a particular flag in a bitfield column of a given table.
*
* @param string $table_name The table to update
* @param string $column_name The column containing a bitfield to update
* @param int $flag The binary flag which is OR-ed with the current column value
* @param string $sql_more This string is attached to the sql query generated to update the table.
*
* @return void
*/
function enable_bitfield_column_flag($table_name, $column_name, $flag, $sql_more = '')
{
global $db;
$sql = 'UPDATE ' . $table_name . '
SET ' . $column_name . ' = ' . $db->sql_bit_or($column_name, $flag) . '
' . $sql_more;
$db->sql_query($sql);
}
?>

View file

@ -80,6 +80,11 @@ class compress
}
}
}
else
{
// $src does not exist
return false;
}
return true;
}
@ -89,6 +94,11 @@ class compress
*/
function add_custom_file($src, $filename)
{
if (!file_exists($src))
{
return false;
}
$this->data($filename, file_get_contents($src), false, stat($src));
return true;
}

View file

@ -1107,9 +1107,10 @@ function extension_allowed($forum_id, $extension, &$extensions)
* @param int $max_length Maximum length of string (multibyte character count as 1 char / Html entity count as 1 char)
* @param int $max_store_length Maximum character length of string (multibyte character count as 1 char / Html entity count as entity chars).
* @param bool $allow_reply Allow Re: in front of string
* NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_legnth) and is deprecated.
* @param string $append String to be appended
*/
function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = true, $append = '')
function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '')
{
$chars = array();

View file

@ -205,10 +205,12 @@ function get_group_id($group_name)
/**
* Generate the email hash stored in the users table
*
* Note: Deprecated, calls should directly go to phpbb_email_hash()
*/
function gen_email_hash($email)
{
return (crc32(strtolower($email)) . strlen($email));
return phpbb_email_hash($email);
}
/**
@ -1232,6 +1234,11 @@ function get_config()
$convert->p_master->error($user->lang['FILE_NOT_FOUND'] . ': ' . $filename, __LINE__, __FILE__);
}
if (isset($convert->config_schema['array_name']))
{
unset($convert->config_schema['array_name']);
}
$convert_config = extract_variables_from_file($filename);
if (!empty($convert->config_schema['array_name']))
{
@ -1264,6 +1271,7 @@ function restore_config($schema)
global $db, $config;
$convert_config = get_config();
foreach ($schema['settings'] as $config_name => $src)
{
if (preg_match('/(.*)\((.*)\)/', $src, $m))
@ -1273,9 +1281,17 @@ function restore_config($schema)
eval($exec);
}
else
{
if ($schema['table_format'] != 'file' || empty($schema['array_name']))
{
$config_value = (isset($convert_config[$src])) ? $convert_config[$src] : '';
}
else if (!empty($schema['array_name']))
{
$src_ary = $schema['array_name'];
$config_value = (isset($convert_config[$src_ary][$src])) ? $convert_config[$src_ary][$src] : '';
}
}
if ($config_value !== '')
{
@ -1629,6 +1645,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO)
case 'mssql':
case 'sqlite':
case 'mssqlnative':
$sql = implode(' UNION ALL ', preg_replace('#^(.*?)$#', 'SELECT \1', $sql_subary));
break;

View file

@ -594,7 +594,7 @@ function generate_forum_nav(&$forum_data)
'FORUM_NAME' => $forum_data['forum_name'],
'FORUM_DESC' => generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options']),
'S_ENABLE_FEEDS_FORUM' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $forum_data['forum_options'])) ? true : false,
'S_ENABLE_FEEDS_FORUM' => ($config['feed_forum'] && $forum_data['forum_type'] == FORUM_POST && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $forum_data['forum_options'])) ? true : false,
));
return;

View file

@ -23,7 +23,14 @@ function can_load_dll($dll)
{
// SQLite2 is a tricky thing, from 5.0.0 it requires PDO; if PDO is not loaded we must state that SQLite is unavailable
// as the installer doesn't understand that the extension has a prerequisite.
if ($dll == 'sqlite' && version_compare(PHP_VERSION, '5.0.0', '>=') && !extension_loaded('pdo'))
//
// On top of this sometimes the SQLite extension is compiled for a different version of PDO
// by some Linux distributions which causes phpBB to bomb out with a blank page.
//
// Net result we'll disable automatic inclusion of SQLite support
//
// See: r9618 and #56105
if ($dll == 'sqlite')
{
return false;
}
@ -88,6 +95,16 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'AVAILABLE' => true,
'2.0.x' => true,
),
'mssqlnative' => array(
'LABEL' => 'MS SQL Server 2005+ [ Native ]',
'SCHEMA' => 'mssql',
'MODULE' => 'sqlsrv',
'DELIM' => 'GO',
'COMMENTS' => 'remove_comments',
'DRIVER' => 'mssqlnative',
'AVAILABLE' => true,
'2.0.x' => false,
),
'oracle' => array(
'LABEL' => 'Oracle',
'SCHEMA' => 'oracle',
@ -213,6 +230,7 @@ function get_tables($db)
case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':
$sql = "SELECT name
FROM sysobjects
WHERE type='U'";
@ -306,6 +324,7 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':
$prefix_length = 90;
break;

View file

@ -184,6 +184,9 @@ class messenger
if (!trim($template_lang))
{
// fall back to board default language if the user's language is
// missing $template_file. If this does not exist either,
// $tpl->set_custom_template will do a trigger_error
$template_lang = basename($config['default_lang']);
}
@ -193,13 +196,23 @@ class messenger
$this->tpl_msg[$template_lang . $template_file] = new template();
$tpl = &$this->tpl_msg[$template_lang . $template_file];
$fallback_template_path = false;
if (!$template_path)
{
$template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
$template_path .= $template_lang . '/email';
// we can only specify default language fallback when the path is not a custom one for which we
// do not know the default language alternative
if ($template_lang !== basename($config['default_lang']))
{
$fallback_template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
$fallback_template_path .= basename($config['default_lang']) . '/email';
}
}
$tpl->set_custom_template($template_path, $template_lang . '_email', 'email');
$tpl->set_custom_template($template_path, $template_lang . '_email', $fallback_template_path);
$tpl->set_filenames(array(
'body' => $template_file . '.txt',

View file

@ -46,7 +46,7 @@ function generate_smilies($mode, $forum_id)
page_header($user->lang['SMILIES']);
$sql = 'SELECT COUNT(smiley_id) AS count
$sql = 'SELECT COUNT(smiley_id) AS item_count
FROM ' . SMILIES_TABLE . '
GROUP BY smiley_url';
$result = $db->sql_query($sql, 3600);
@ -85,10 +85,10 @@ function generate_smilies($mode, $forum_id)
if ($mode == 'window')
{
$sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height
$sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height, MIN(smiley_order) AS min_smiley_order
FROM ' . SMILIES_TABLE . '
GROUP BY smiley_url, smiley_width, smiley_height
ORDER BY smiley_order';
ORDER BY min_smiley_order';
$result = $db->sql_query_limit($sql, $config['smilies_per_page'], $start, 3600);
}
else
@ -2525,7 +2525,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
VALUES (' . $user->data['user_id'] . ', ' . $data['topic_id'] . ')';
$db->sql_query($sql);
}
else if ($data['notify_set'] && !$data['notify'])
else if (($config['email_enable'] || $config['jab_enable']) && $data['notify_set'] && !$data['notify'])
{
$sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . '
WHERE user_id = ' . $user->data['user_id'] . '

View file

@ -175,7 +175,7 @@ class mcp_logs
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
'TOTAL' => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
'L_TITLE' => $user->lang['MCP_LOGS'],

View file

@ -568,7 +568,7 @@ function mcp_move_topic($topic_ids)
{
$additional_msg = $user->lang['FORUM_NOT_POSTABLE'];
}
else if (!$auth->acl_get('f_post', $to_forum_id))
else if (!$auth->acl_get('f_post', $to_forum_id) || (!$auth->acl_get('m_approve', $to_forum_id) && !$auth->acl_get('f_noapprove', $to_forum_id)))
{
$additional_msg = $user->lang['USER_CANNOT_POST'];
}

View file

@ -198,7 +198,7 @@ class mcp_notes
$log_data = array();
$log_count = 0;
view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort, $keywords);
view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort, $keywords);
if ($log_count)
{
@ -226,8 +226,8 @@ class mcp_notes
'L_TITLE' => $user->lang['MCP_NOTES_USER'],
'PAGE_NUMBER' => on_page($log_count, $config['posts_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true),
'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
'TOTAL_REPORTS' => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count),
'RANK_TITLE' => $rank_title,

View file

@ -105,9 +105,16 @@ function mcp_topic_view($id, $mode, $action)
$limit_time_sql = ($sort_days) ? 'AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
if ($total == -1)
{
if ($auth->acl_get('m_approve', $topic_info['forum_id']))
{
$total = $topic_info['topic_replies_real'] + 1;
}
else
{
$total = $topic_info['topic_replies'] + 1;
}
}
$posts_per_page = max(0, request_var('posts_per_page', intval($config['posts_per_page'])));
if ($posts_per_page == 0)

View file

@ -1284,6 +1284,7 @@ class parse_message extends bbcode_firstpass
{
case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':
$sql = 'SELECT *
FROM ' . SMILIES_TABLE . '
ORDER BY LEN(code) DESC';

View file

@ -162,7 +162,28 @@ class phpbb_questionnaire_system_data_provider
$server_address = $_SERVER['LOCAL_ADDR'];
}
$ip_address_ary = explode('.', $server_address);
return array(
'os' => PHP_OS,
'httpd' => $_SERVER['SERVER_SOFTWARE'],
// we don't want the real IP address (for privacy policy reasons) but only
// a network address to see whether your installation is running on a private or public network.
'private_ip' => $this->is_private_ip($server_address),
'ipv6' => strpos($server_address, ':') !== false,
);
}
/**
* Checks whether the given IP is in a private network.
*
* @param string $ip IP in v4 dot-decimal or v6 hex format
* @return bool true if the IP is from a private network, else false
*/
function is_private_ip($ip)
{
// IPv4
if (strpos($ip, ':') === false)
{
$ip_address_ary = explode('.', $ip);
// build ip
if (!isset($ip_address_ary[0]) || !isset($ip_address_ary[1]))
@ -170,17 +191,30 @@ class phpbb_questionnaire_system_data_provider
$ip_address_ary = explode('.', '0.0.0.0');
}
return array(
'os' => PHP_OS,
'httpd' => $_SERVER['SERVER_SOFTWARE'],
// we don't want the real IP address (for privacy policy reasons) but only
// a network address to see whether your installation is running on a private or public network.
// IANA reserved addresses for private networks (RFC 1918) are:
// - 10.0.0.0/8
// - 172.16.0.0/12
// - 192.168.0.0/16
'ip' => $ip_address_ary[0] . '.' . $ip_address_ary[1] . '.XXX.YYY',
);
if ($ip_address_ary[0] == '10' ||
($ip_address_ary[0] == '172' && intval($ip_address_ary[1]) > 15 && intval($ip_address_ary[1]) < 32) ||
($ip_address_ary[0] == '192' && $ip_address_ary[1] == '168') ||
($ip_address_ary[0] == '192' && $ip_address_ary[1] == '168'))
{
return true;
}
}
// IPv6
else
{
// unique local unicast
$prefix = substr($ip, 0, 2);
if ($prefix == 'fc' || $prefix == 'fd')
{
return true;
}
}
return false;
}
}
@ -233,6 +267,7 @@ class phpbb_questionnaire_phpbb_data_provider
{
global $phpbb_root_path, $phpEx;
include("{$phpbb_root_path}config.$phpEx");
unset($dbhost, $dbport, $dbname, $dbuser, $dbpasswd); // Just a precaution
// Only send certain config vars
$config_vars = array(
@ -315,13 +350,15 @@ class phpbb_questionnaire_phpbb_data_provider
'enable_pm_icons' => true,
'enable_post_confirm' => true,
'feed_enable' => true,
'feed_limit' => true,
'feed_http_auth' => true,
'feed_limit_post' => true,
'feed_limit_topic' => true,
'feed_overall' => true,
'feed_overall_forums' => true,
'feed_overall_forums_limit' => true,
'feed_overall_topics' => true,
'feed_overall_topics_limit' => true,
'feed_forum' => true,
'feed_topic' => true,
'feed_topics_new' => true,
'feed_topics_active' => true,
'feed_item_statistics' => true,
'flood_interval' => true,
'force_server_vars' => true,
@ -445,10 +482,13 @@ class phpbb_questionnaire_phpbb_data_provider
}
}
global $db;
$result['dbms'] = $dbms;
$result['acm_type'] = $acm_type;
$result['load_extensions'] = $load_extensions;
$result['user_agent'] = 'Unknown';
$result['dbms_version'] = $db->sql_server_info(true);
// Try to get user agent vendor and version
$match = array();

View file

@ -473,7 +473,7 @@ class fulltext_mysql extends search_backend
while ($row = $db->sql_fetchrow($result))
{
$id_ary[] = $row[$field];
$id_ary[] = (int) $row[$field];
}
$db->sql_freeresult($result);
@ -650,7 +650,7 @@ class fulltext_mysql extends search_backend
while ($row = $db->sql_fetchrow($result))
{
$id_ary[] = $row[$field];
$id_ary[] = (int) $row[$field];
}
$db->sql_freeresult($result);

View file

@ -202,7 +202,8 @@ class fulltext_native extends search_backend
{
$sql = 'SELECT word_id, word_text, word_common
FROM ' . SEARCH_WORDLIST_TABLE . '
WHERE ' . $db->sql_in_set('word_text', $exact_words);
WHERE ' . $db->sql_in_set('word_text', $exact_words) . '
ORDER BY word_count ASC';
$result = $db->sql_query($sql);
// store an array of words and ids, remove common words
@ -377,10 +378,6 @@ class fulltext_native extends search_backend
return false;
}
sort($this->must_contain_ids);
sort($this->must_not_contain_ids);
sort($this->must_exclude_one_ids);
if (!empty($this->search_query))
{
return true;
@ -420,11 +417,19 @@ class fulltext_native extends search_backend
return false;
}
$must_contain_ids = $this->must_contain_ids;
$must_not_contain_ids = $this->must_not_contain_ids;
$must_exclude_one_ids = $this->must_exclude_one_ids;
sort($must_contain_ids);
sort($must_not_contain_ids);
sort($must_exclude_one_ids);
// generate a search_key from all the options to identify the results
$search_key = md5(implode('#', array(
serialize($this->must_contain_ids),
serialize($this->must_not_contain_ids),
serialize($this->must_exclude_one_ids),
serialize($must_contain_ids),
serialize($must_not_contain_ids),
serialize($must_exclude_one_ids),
$type,
$fields,
$terms,
@ -739,7 +744,7 @@ class fulltext_native extends search_backend
while ($row = $db->sql_fetchrow($result))
{
$id_ary[] = $row[(($type == 'posts') ? 'post_id' : 'topic_id')];
$id_ary[] = (int) $row[(($type == 'posts') ? 'post_id' : 'topic_id')];
}
$db->sql_freeresult($result);
@ -981,7 +986,7 @@ class fulltext_native extends search_backend
while ($row = $db->sql_fetchrow($result))
{
$id_ary[] = $row[$field];
$id_ary[] = (int) $row[$field];
}
$db->sql_freeresult($result);

View file

@ -1361,7 +1361,7 @@ class session
WHERE user_id = ' . (int) $user_id;
$db->sql_query($sql);
// Update last visit info first before deleting sessions
// If the user is logged in, update last visit info first before deleting sessions
$sql = 'SELECT session_time, session_page
FROM ' . SESSIONS_TABLE . '
WHERE session_user_id = ' . (int) $user_id . '
@ -1370,10 +1370,13 @@ class session
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_lastvisit = ' . (int) $row['session_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "'
WHERE user_id = " . (int) $user_id;
$db->sql_query($sql);
}
// Let's also clear any current sessions for the specified user_id
// If it's the current user then we'll leave this session intact

View file

@ -90,7 +90,7 @@ class template
* Set custom template location (able to use directory outside of phpBB)
* @access public
*/
function set_custom_template($template_path, $template_name, $template_mode = 'template')
function set_custom_template($template_path, $template_name, $fallback_template_path = false)
{
global $phpbb_root_path, $user;
@ -103,13 +103,25 @@ class template
$this->root = $template_path;
$this->cachepath = $phpbb_root_path . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_';
// As the template-engine is used for more than the template (emails, etc.), we should not set $user->theme in all cases, but only on the real template.
if ($template_mode == 'template')
if ($fallback_template_path !== false)
{
$user->theme['template_storedb'] = false;
$user->theme['template_inherits_id'] = false;
if (substr($fallback_template_path, -1) == '/')
{
$fallback_template_path = substr($fallback_template_path, 0, -1);
}
$this->inherit_root = $fallback_template_path;
$this->orig_tpl_inherits_id = true;
}
else
{
$this->orig_tpl_inherits_id = false;
}
// the database does not store the path or name of a custom template
// so there is no way we can properly store custom templates there
$this->orig_tpl_storedb = false;
$this->_rootref = &$this->_tpldata['.'][0];
return true;
@ -254,6 +266,12 @@ class template
trigger_error("template->_tpl_load(): No file specified for handle $handle", E_USER_ERROR);
}
// reload these settings to have the values they had when this object was initialised
// using set_template or set_custom_template, they might otherwise have been overwritten
// by other template class instances in between.
$user->theme['template_storedb'] = $this->orig_tpl_storedb;
$user->theme['template_inherits_id'] = $this->orig_tpl_inherits_id;
$filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . $phpEx;
$this->files_template[$handle] = (isset($user->theme['template_id'])) ? $user->theme['template_id'] : 0;

View file

@ -637,12 +637,29 @@ function define_action_option($hardcoded, $action_option, $action_lang, $folder)
function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary)
{
global $template;
global $module;
$exclude = array();
if (!$module->loaded('zebra', 'friends'))
{
$exclude[RULE_IS_FRIEND] = true;
}
if (!$module->loaded('zebra', 'foes'))
{
$exclude[RULE_IS_FOE] = true;
}
$s_rule_options = '';
if (!$hardcoded)
{
foreach ($check_ary as $value => $_check)
{
if (isset($exclude[$value]))
{
continue;
}
$s_rule_options .= '<option value="' . $value . '"' . (($value == $rule_option) ? ' selected="selected"' : '') . '>' . $rule_lang[$value] . '</option>';
}
}

View file

@ -133,7 +133,7 @@ class ucp_profile
$message = 'PROFILE_UPDATED';
if ($config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN))
if ($auth->acl_get('u_chgemail') && $config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN))
{
$message = ($config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN';

View file

@ -333,6 +333,12 @@ class ucp_register
trigger_error('NO_USER', E_USER_ERROR);
}
// Okay, captcha, your job is done.
if ($config['enable_confirm'] && isset($captcha))
{
$captcha->reset();
}
if ($coppa && $config['email_enable'])
{
$message = $user->lang['ACCOUNT_COPPA'];

View file

@ -77,11 +77,12 @@ class ucp_remind
$server_url = generate_board_url();
$key_len = 54 - strlen($server_url);
$key_len = max(6, $key_len); // we want at least 6
$key_len = ($config['max_pass_chars']) ? min($key_len, $config['max_pass_chars']) : $key_len; // we want at most $config['max_pass_chars']
$user_actkey = substr(gen_rand_string(10), 0, $key_len);
$user_password = gen_rand_string(8);
// Make password at least 8 characters long, make it longer if admin wants to.
// gen_rand_string() however has a limit of 12 or 13.
$user_password = gen_rand_string(max(8, rand((int) $config['min_pass_chars'], (int) $config['max_pass_chars'])));
// For the activation key a random length between 6 and 10 will do.
$user_actkey = gen_rand_string(rand(6, 10));
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_newpasswd = '" . $db->sql_escape(phpbb_hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'

View file

@ -32,7 +32,7 @@ unset($dbpasswd);
$convertor_data = array(
'forum_name' => 'phpBB 2.0.x',
'version' => '1.0.3',
'phpbb_version' => '3.0.6',
'phpbb_version' => '3.0.7',
'author' => '<a href="http://www.phpbb.com/">phpBB Group</a>',
'dbms' => $dbms,
'dbhost' => $dbhost,
@ -78,6 +78,15 @@ $tables = array(
*
* 'table_format' can take the value 'file' to indicate a config file. In this case array_name
* is set to indicate the name of the array the config values are stored in
* Example of using a file:
* $config_schema = array(
* 'table_format' => 'file',
* 'filename' => 'NAME OF FILE', // If the file is not in the root directory, the path needs to be added with no leading slash
* 'array_name' => 'NAME OF ARRAY', // Only used if the configuration file stores the setting in an array.
* 'settings' => array(
* 'board_email' => 'SUPPORT_EMAIL', // target config name => source target name
* )
* );
* 'table_format' can be an array if the values are stored in a table which is an assosciative array
* (as per phpBB 2.0.x)
* If left empty, values are assumed to be stored in a table where each config setting is

View file

@ -8,7 +8,7 @@
*
*/
$updates_to_version = '3.0.6';
$updates_to_version = '3.0.8-dev';
// Enter any version to update from to test updates. The version within the db will not be updated.
$debug_from_version = false;
@ -885,18 +885,32 @@ function database_update_info()
),
),
),
// Changes from 3.0.6-RC1 to 3.0.6-RC2
'3.0.6-RC1' => array(
'drop_keys' => array(
LOG_TABLE => array('log_time'),
),
),
// No changes from 3.0.6-RC1 to 3.0.6-RC2
'3.0.6-RC1' => array(),
// No changes from 3.0.6-RC2 to 3.0.6-RC3
'3.0.6-RC2' => array(),
// No changes from 3.0.6-RC3 to 3.0.6-RC4
'3.0.6-RC3' => array(),
// No changes from 3.0.6-RC4 to 3.0.6
'3.0.6-RC4' => array(),
// Changes from 3.0.6 to 3.0.7-RC1
'3.0.6' => array(
'drop_keys' => array(
LOG_TABLE => array('log_time'),
),
'add_index' => array(
TOPICS_TRACK_TABLE => array(
'topic_id' => array('topic_id'),
),
),
),
// No changes from 3.0.7-RC1 to 3.0.7-RC2
'3.0.7-RC1' => array(),
// No changes from 3.0.7-RC2 to 3.0.7
'3.0.7-RC2' => array(),
);
}
@ -1569,6 +1583,65 @@ function change_database_data(&$no_updates, $version)
// No changes from 3.0.6-RC4 to 3.0.6
case '3.0.6-RC4':
break;
// Changes from 3.0.6 to 3.0.7-RC1
case '3.0.6':
// ATOM Feeds
set_config('feed_overall', '1');
set_config('feed_http_auth', '0');
set_config('feed_limit_post', (string) (isset($config['feed_limit']) ? (int) $config['feed_limit'] : 15));
set_config('feed_limit_topic', (string) (isset($config['feed_overall_topics_limit']) ? (int) $config['feed_overall_topics_limit'] : 10));
set_config('feed_topics_new', (!empty($config['feed_overall_topics']) ? '1' : '0'));
set_config('feed_topics_active', (!empty($config['feed_overall_topics']) ? '1' : '0'));
// Delete all text-templates from the template_data
$sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
WHERE template_filename ' . $db->sql_like_expression($db->any_char . '.txt');
_sql($sql, $errored, $error_ary);
$no_updates = false;
break;
// Changes from 3.0.7-RC1 to 3.0.7-RC2
case '3.0.7-RC1':
$sql = 'SELECT user_id, user_email, user_email_hash
FROM ' . USERS_TABLE . '
WHERE user_type <> ' . USER_IGNORE . "
AND user_email <> ''";
$result = $db->sql_query($sql);
$i = 0;
while ($row = $db->sql_fetchrow($result))
{
// Snapshot of the phpbb_email_hash() function
// We cannot call it directly because the auto updater updates the DB first. :/
$user_email_hash = sprintf('%u', crc32(strtolower($row['user_email']))) . strlen($row['user_email']);
if ($user_email_hash != $row['user_email_hash'])
{
$sql_ary = array(
'user_email_hash' => $user_email_hash,
);
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (int) $row['user_id'];
_sql($sql, $errored, $error_ary, ($i % 100 == 0));
++$i;
}
}
$db->sql_freeresult($result);
$no_updates = false;
break;
// No changes from 3.0.7-RC2 to 3.0.7
case '3.0.7-RC2':
break;
}
}
@ -1716,6 +1789,36 @@ class updater_db_tools
'VARBINARY' => '[varchar] (255)',
),
'mssqlnative' => array(
'INT:' => '[int]',
'BINT' => '[float]',
'UINT' => '[int]',
'UINT:' => '[int]',
'TINT:' => '[int]',
'USINT' => '[int]',
'BOOL' => '[int]',
'VCHAR' => '[varchar] (255)',
'VCHAR:' => '[varchar] (%d)',
'CHAR:' => '[char] (%d)',
'XSTEXT' => '[varchar] (1000)',
'STEXT' => '[varchar] (3000)',
'TEXT' => '[varchar] (8000)',
'MTEXT' => '[text]',
'XSTEXT_UNI'=> '[varchar] (100)',
'STEXT_UNI' => '[varchar] (255)',
'TEXT_UNI' => '[varchar] (4000)',
'MTEXT_UNI' => '[text]',
'TIMESTAMP' => '[int]',
'DECIMAL' => '[float]',
'DECIMAL:' => '[float]',
'PDECIMAL' => '[float]',
'PDECIMAL:' => '[float]',
'VCHAR_UNI' => '[varchar] (255)',
'VCHAR_UNI:'=> '[varchar] (%d)',
'VCHAR_CI' => '[varchar] (255)',
'VARBINARY' => '[varchar] (255)',
),
'oracle' => array(
'INT:' => 'number(%d)',
'BINT' => 'number(20)',
@ -1817,7 +1920,7 @@ class updater_db_tools
* A list of supported DBMS. We change this class to support more DBMS, the DBMS itself only need to follow some rules.
* @var array
*/
var $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
var $supported_dbms = array('firebird', 'mssql', 'mssqlnative', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
/**
* This is set to true if user only wants to return the 'to-be-executed' SQL statement(s) (as an array).
@ -1863,6 +1966,10 @@ class updater_db_tools
$this->sql_layer = 'mssql';
break;
case 'mssqlnative':
$this->sql_layer = 'mssqlnative';
break;
default:
$this->sql_layer = $this->db->sql_layer;
break;
@ -2294,6 +2401,7 @@ class updater_db_tools
// same deal with PostgreSQL, we must perform more complex operations than
// we technically could
case 'mssql':
case 'mssqlnative':
$sql = "SELECT c.name
FROM syscolumns c
LEFT JOIN sysobjects o ON c.id = o.id
@ -2397,7 +2505,7 @@ class updater_db_tools
*/
function sql_index_exists($table_name, $index_name)
{
if ($this->sql_layer == 'mssql')
if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
{
$sql = "EXEC sp_statistics '$table_name'";
$result = $this->db->sql_query($sql);
@ -2502,7 +2610,7 @@ class updater_db_tools
*/
function sql_unique_index_exists($table_name, $index_name)
{
if ($this->sql_layer == 'mssql')
if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
{
$sql = "EXEC sp_statistics '$table_name'";
$result = $this->db->sql_query($sql);
@ -2741,6 +2849,7 @@ class updater_db_tools
break;
case 'mssql':
case 'mssqlnative':
$sql .= " {$column_type} ";
$sql_default = " {$column_type} ";
@ -2890,6 +2999,7 @@ class updater_db_tools
break;
case 'mssql':
case 'mssqlnative':
// Does not support AFTER, only through temporary table
$statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default'];
break;
@ -2907,7 +3017,29 @@ class updater_db_tools
case 'postgres':
// Does not support AFTER, only through temporary table
if (version_compare($this->db->sql_server_info(true), '8.0', '>='))
{
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql'];
}
else
{
// old versions cannot add columns with default and null information
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type'] . ' ' . $column_data['constraint'];
if (isset($column_data['null']))
{
if ($column_data['null'] == 'NOT NULL')
{
$statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET NOT NULL';
}
}
if (isset($column_data['default']))
{
$statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $column_data['default'];
}
}
break;
case 'sqlite':
@ -2992,6 +3124,7 @@ class updater_db_tools
break;
case 'mssql':
case 'mssqlnative':
$statements[] = 'ALTER TABLE [' . $table_name . '] DROP COLUMN [' . $column_name . ']';
break;
@ -3086,6 +3219,7 @@ class updater_db_tools
switch ($this->sql_layer)
{
case 'mssql':
case 'mssqlnative':
$statements[] = 'DROP INDEX ' . $table_name . '.' . $index_name;
break;
@ -3122,6 +3256,7 @@ class updater_db_tools
break;
case 'mssql':
case 'mssqlnative':
$sql = "ALTER TABLE [{$table_name}] WITH NOCHECK ADD ";
$sql .= "CONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED (";
$sql .= '[' . implode("],\n\t\t[", $column) . ']';
@ -3215,6 +3350,7 @@ class updater_db_tools
break;
case 'mssql':
case 'mssqlnative':
$statements[] = 'CREATE UNIQUE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ') ON [PRIMARY]';
break;
}
@ -3244,6 +3380,7 @@ class updater_db_tools
break;
case 'mssql':
case 'mssqlnative':
$statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ') ON [PRIMARY]';
break;
}
@ -3276,6 +3413,7 @@ class updater_db_tools
break;
case 'mssql':
case 'mssqlnative':
$statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];
if (!empty($column_data['default']))

View file

@ -1248,6 +1248,7 @@ class install_convert extends module
{
case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':
$db->sql_query('SET IDENTITY_INSERT ' . $schema['target'] . ' ON');
break;
}
@ -1375,6 +1376,7 @@ class install_convert extends module
{
case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':
$db->sql_query('SET IDENTITY_INSERT ' . $schema['target'] . ' OFF');
break;

View file

@ -1203,6 +1203,7 @@ class install_install extends module
{
case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':
$sql_query = preg_replace('#\# MSSQL IDENTITY (phpbb_[a-z_]+) (ON|OFF) \##s', 'SET IDENTITY_INSERT \1 \2;', $sql_query);
break;

View file

@ -240,6 +240,7 @@ class install_update extends module
// Make sure the update list is destroyed.
$cache->destroy('_update_list');
$cache->destroy('_diff_files');
$cache->destroy('_expected_files');
break;
case 'version_check':
@ -312,7 +313,14 @@ class install_update extends module
case 'file_check':
// Make sure the previous file collection is no longer valid...
// retrieve info on what changes should have already been made to the files.
$expected_files = $cache->get('_expected_files');
if (!$expected_files)
{
$expected_files = array();
}
// Now make sure the previous file collection is no longer valid...
$cache->destroy('_diff_files');
$this->page_title = 'STAGE_FILE_CHECK';
@ -349,7 +357,7 @@ class install_update extends module
if ($get_new_list)
{
$this->get_update_structure($update_list);
$this->get_update_structure($update_list, $expected_files);
$cache->put('_update_list', $update_list);
// Refresh the page if we are still not finished...
@ -384,6 +392,8 @@ class install_update extends module
);
}
$new_expected_files = array();
// Now assign the list to the template
foreach ($update_list as $status => $filelist)
{
@ -419,6 +429,12 @@ class install_update extends module
$diff_url = append_sid($this->p_master->module_url, "mode=$mode&amp;sub=file_check&amp;action=diff&amp;status=$status&amp;file=" . urlencode($file_struct['filename']));
if (isset($file_struct['as_expected']) && $file_struct['as_expected'])
{
$new_expected_files[$file_struct['filename']] = $expected_files[$file_struct['filename']];
}
else
{
$template->assign_block_vars($status, array(
'STATUS' => $status,
@ -441,6 +457,9 @@ class install_update extends module
));
}
}
}
$cache->put('_expected_files', $new_expected_files);
$all_up_to_date = true;
foreach ($update_list as $status => $filelist)
@ -617,6 +636,7 @@ class install_update extends module
// Before we do anything, let us diff the files and store the raw file information "somewhere"
$get_files = false;
$file_list = $cache->get('_diff_files');
$expected_files = $cache->get('_expected_files');
if ($file_list === false || $file_list['status'] != -1)
{
@ -632,6 +652,11 @@ class install_update extends module
);
}
if (!isset($expected_files) || $expected_files === false)
{
$expected_files = array();
}
$processed = 0;
foreach ($update_list as $status => $files)
{
@ -645,6 +670,7 @@ class install_update extends module
// Skip this file if the user selected to not update it
if (in_array($file_struct['filename'], $no_update))
{
$expected_files[$file_struct['filename']] = false;
continue;
}
@ -676,6 +702,15 @@ class install_update extends module
return;
}
if (file_exists($phpbb_root_path . $file_struct['filename']))
{
$contents = file_get_contents($phpbb_root_path . $file_struct['filename']);
if (isset($expected_files[$file_struct['filename']]) && md5($contents) == $expected_files[$file_struct['filename']])
{
continue;
}
}
$original_filename = ($file_struct['custom']) ? $file_struct['original'] : $file_struct['filename'];
switch ($status)
@ -702,6 +737,7 @@ class install_update extends module
break;
}
$expected_files[$file_struct['filename']] = md5($contents);
$file_list[$file_struct['filename']] = '_file_' . md5($file_struct['filename']);
$cache->put($file_list[$file_struct['filename']], base64_encode($contents));
@ -747,6 +783,7 @@ class install_update extends module
break;
}
$expected_files[$file_struct['filename']] = md5($contents);
$file_list[$file_struct['filename']] = '_file_' . md5($file_struct['filename']);
$cache->put($file_list[$file_struct['filename']], base64_encode($contents));
@ -757,6 +794,7 @@ class install_update extends module
}
}
}
$cache->put('_expected_files', $expected_files);
}
$file_list['status'] = -1;
@ -1217,7 +1255,7 @@ class install_update extends module
/**
* Collect all file status infos we need for the update by diffing all files
*/
function get_update_structure(&$update_list)
function get_update_structure(&$update_list, $expected_files)
{
global $phpbb_root_path, $phpEx, $user;
@ -1303,7 +1341,7 @@ class install_update extends module
else
{
// not modified?
$this->make_update_diff($update_list, $file, $file);
$this->make_update_diff($update_list, $file, $file, $expected_files);
}
$num_bytes_processed += (file_exists($this->new_location . $file)) ? filesize($this->new_location . $file) : 100 * 1024;
@ -1344,17 +1382,34 @@ class install_update extends module
/**
* Compare files for storage in update_list
*/
function make_update_diff(&$update_list, $original_file, $file, $custom = false)
function make_update_diff(&$update_list, $original_file, $file, $expected_files, $custom = false)
{
global $phpbb_root_path, $user;
$update_ary = array('filename' => $file, 'custom' => $custom);
$update_ary = array('filename' => $file, 'custom' => $custom, 'as_expected' => false);
if ($custom)
{
$update_ary['original'] = $original_file;
}
if (file_exists($phpbb_root_path . $file))
{
$content = file_get_contents($phpbb_root_path . $file);
if (isset($expected_files[$file]) && // the user already selected what to do with this file
($expected_files[$file] === false || // the user wanted this file to stay the same, so just assume it's alright
$expected_files[$file] === md5($content)))
{
// the file contains what it was supposed to contain after the merge
$update_ary['as_expected'] = true;
$update_ary['was_ignored'] = ($expected_files[$file] === false);
$update_list['up_to_date'][] = $update_ary;
return;
}
}
// we only want to know if the files are successfully merged and newlines could result in errors (duplicate addition of lines and such things)
// Therefore we check for empty diffs with two methods, preserving newlines and not preserving them (which mostly works best, therefore the first option)
@ -1364,7 +1419,7 @@ class install_update extends module
{
$tmp = array(
'file1' => file_get_contents($this->new_location . $original_file),
'file2' => file_get_contents($phpbb_root_path . $file),
'file2' => $content,
);
// We need to diff the contents here to make sure the file is really the one we expect
@ -1403,7 +1458,7 @@ class install_update extends module
{
$tmp = array(
'file1' => file_get_contents($this->old_location . $original_file),
'file2' => file_get_contents($phpbb_root_path . $file),
'file2' => $content,
);
// We need to diff the contents here to make sure the file is really the one we expect
@ -1414,7 +1469,7 @@ class install_update extends module
$tmp = array(
'file1' => file_get_contents($this->new_location . $original_file),
'file2' => file_get_contents($phpbb_root_path . $file),
'file2' => $content,
);
$diff = new diff($tmp['file1'], $tmp['file2'], $preserve_cr);

View file

@ -1263,6 +1263,7 @@ CREATE TABLE phpbb_topics_track (
ALTER TABLE phpbb_topics_track ADD PRIMARY KEY (user_id, topic_id);;
CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track(topic_id);;
CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track(forum_id);;
# Table: 'phpbb_topics_posted'

View file

@ -4,9 +4,6 @@
*/
BEGIN TRANSACTION
GO
/*
Table: 'phpbb_attachments'
*/
@ -1509,6 +1506,9 @@ ALTER TABLE [phpbb_topics_track] WITH NOCHECK ADD
) ON [PRIMARY]
GO
CREATE INDEX [topic_id] ON [phpbb_topics_track]([topic_id]) ON [PRIMARY]
GO
CREATE INDEX [forum_id] ON [phpbb_topics_track]([forum_id]) ON [PRIMARY]
GO
@ -1733,8 +1733,3 @@ ALTER TABLE [phpbb_zebra] WITH NOCHECK ADD
) ON [PRIMARY]
GO
COMMIT
GO

View file

@ -862,6 +862,7 @@ CREATE TABLE phpbb_topics_track (
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (user_id, topic_id),
KEY topic_id (topic_id),
KEY forum_id (forum_id)
);

View file

@ -862,6 +862,7 @@ CREATE TABLE phpbb_topics_track (
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (user_id, topic_id),
KEY topic_id (topic_id),
KEY forum_id (forum_id)
) CHARACTER SET `utf8` COLLATE `utf8_bin`;

View file

@ -1667,6 +1667,8 @@ CREATE TABLE phpbb_topics_track (
)
/
CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id)
/
CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id)
/

View file

@ -1117,6 +1117,7 @@ CREATE TABLE phpbb_topics_track (
PRIMARY KEY (user_id, topic_id)
);
CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id);
CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id);
/*

View file

@ -99,13 +99,15 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_post_confirm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_enable', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit', '10');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_forums', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_forums_limit', '15');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_topics', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_topics_limit', '15');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_http_auth', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit_post', '15');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit_topic', '10');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_forums', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_forum', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topic', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topics_new', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topics_active', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_item_statistics', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('flood_interval', '15');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('force_server_vars', '0');
@ -239,7 +241,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.6');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.8-dev');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');

View file

@ -834,6 +834,7 @@ CREATE TABLE phpbb_topics_track (
PRIMARY KEY (user_id, topic_id)
);
CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id);
CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id);
# Table: 'phpbb_topics_posted'

View file

@ -73,7 +73,8 @@ $lang = array_merge($lang, array(
'ALLOW_PM_REPORT' => 'Allow users to report private messages',
'ALLOW_PM_REPORT_EXPLAIN' => 'If this setting is enabled, users have the option of reporting a private message they have received or sent to the boards moderators. These private messages will then be visible in the Moderator Control Panel.',
'ALLOW_QUICK_REPLY' => 'Allow quick reply',
'ALLOW_QUICK_REPLY_EXPLAIN' => 'This setting defines if quick reply is enabled or not. If this setting is enabled, forums need to have their quick reply option enabled too.',
'ALLOW_QUICK_REPLY_EXPLAIN' => 'This switch allows for the quick reply to be disabled board-wide. When enabled, forum specific settings will be used to determine whether the quick reply is displayed in individual forums.',
'ALLOW_QUICK_REPLY_BUTTON' => 'Submit and enable quick reply in all forums',
'ALLOW_SIG' => 'Allow signatures',
'ALLOW_SIG_BBCODE' => 'Allow BBCode in user signatures',
'ALLOW_SIG_FLASH' => 'Allow use of <code>[FLASH]</code> BBCode tag in user signatures',
@ -84,7 +85,7 @@ $lang = array_merge($lang, array(
'ALLOW_SMILIES' => 'Allow smilies',
'ALLOW_TOPIC_NOTIFY' => 'Allow subscribing to topics',
'BOARD_PM' => 'Private messaging',
'BOARD_PM_EXPLAIN' => 'Enable or disable private messaging for all users.',
'BOARD_PM_EXPLAIN' => 'Enable private messaging for all users.',
));
// Avatar Settings
@ -149,7 +150,7 @@ $lang = array_merge($lang, array(
'ALLOW_POST_FLASH_EXPLAIN' => 'If disallowed the <code>[FLASH]</code> BBCode tag is disabled in posts. Otherwise the permission system controls which users can use the <code>[FLASH]</code> BBCode tag.',
'BUMP_INTERVAL' => 'Bump interval',
'BUMP_INTERVAL_EXPLAIN' => 'Number of minutes, hours or days between the last post to a topic and the ability to bump this topic.',
'BUMP_INTERVAL_EXPLAIN' => 'Number of minutes, hours or days between the last post to a topic and the ability to bump this topic. Setting the value to 0 disables this feature.',
'CHAR_LIMIT' => 'Maximum characters per post/message',
'CHAR_LIMIT_EXPLAIN' => 'The number of characters allowed within a post/private message. Set to 0 for unlimited characters.',
'DELETE_TIME' => 'Limit deleting time',
@ -246,32 +247,40 @@ $lang = array_merge($lang, array(
// Feeds
$lang = array_merge($lang, array(
'ACP_FEED_MANAGEMENT' => 'General Syndication Feeds settings',
'ACP_FEED_MANAGEMENT_EXPLAIN' => 'This Module makes available various ATOM Feeds, parsing any BBCode in posts to make them readable in external feeds.',
'ACP_FEED_MANAGEMENT' => 'General syndication feeds settings',
'ACP_FEED_MANAGEMENT_EXPLAIN' => 'This module makes available various ATOM feeds, parsing any BBCode in posts to make them readable in external feeds.',
'ACP_FEED_ENABLE' => 'Enable Feeds',
'ACP_FEED_ENABLE_EXPLAIN' => 'Turns on or off ATOM Feeds for the entire board.<br />Disabling this switches off all Feeds, no matter how the options below are set.',
'ACP_FEED_GENERAL' => 'General feed settings',
'ACP_FEED_POST_BASED' => 'Post-based feed settings',
'ACP_FEED_TOPIC_BASED' => 'Topic-based feed settings',
'ACP_FEED_SETTINGS_OTHER' => 'Other feeds and settings',
'ACP_FEED_ENABLE' => 'Enable feeds',
'ACP_FEED_ENABLE_EXPLAIN' => 'Turns on or off ATOM feeds for the entire board.<br />Disabling this switches off all feeds, no matter how the options below are set.',
'ACP_FEED_LIMIT' => 'Number of items',
'ACP_FEED_LIMIT_EXPLAIN' => 'The maximum number of feed items to display.',
'ACP_FEED_OVERALL_FORUMS' => 'Enable overall forums feed',
'ACP_FEED_OVERALL_FORUMS_EXPLAIN' => 'This feed displays the latest posts from all forums topics.',
'ACP_FEED_OVERALL_FORUMS_LIMIT' => 'Number of items per page to display in the forums feed',
'ACP_FEED_OVERALL_TOPIC' => 'Enable overall topics feed',
'ACP_FEED_OVERALL_TOPIC_EXPLAIN' => 'Enables the “All Topics” feed',
'ACP_FEED_OVERALL_TOPIC_LIMIT' => 'Number of items per page to display in the topics feed',
'ACP_FEED_FORUM' => 'Enable Per-Forum Feeds',
'ACP_FEED_FORUM_EXPLAIN' => 'Single forum new posts.',
'ACP_FEED_TOPIC' => 'Enable Per-Topic Feeds',
'ACP_FEED_OVERALL' => 'Enable board-wide feed',
'ACP_FEED_OVERALL_EXPLAIN' => 'Board-wide new posts.',
'ACP_FEED_FORUM' => 'Enable per-forum feeds',
'ACP_FEED_FORUM_EXPLAIN' => 'Single forum and subforums new posts.',
'ACP_FEED_TOPIC' => 'Enable per-topic feeds',
'ACP_FEED_TOPIC_EXPLAIN' => 'Single topics new posts.',
'ACP_FEED_NEWS' => 'News Feeds',
'ACP_FEED_TOPICS_NEW' => 'Enable new topics feed',
'ACP_FEED_TOPICS_NEW_EXPLAIN' => 'Enables the “New Topics” feed, which displays the last created topics including the first post.',
'ACP_FEED_TOPICS_ACTIVE' => 'Enable active topics feed',
'ACP_FEED_TOPICS_ACTIVE_EXPLAIN' => 'Enables the “Active Topics” feed, which displays the last active topics including the last post.',
'ACP_FEED_NEWS' => 'News feed',
'ACP_FEED_NEWS_EXPLAIN' => 'Pull the first post from these forums. Select no forums to disable news feed.<br />Select multiple forums by holding <samp>CTRL</samp> and clicking.',
'ACP_FEED_GENERAL' => 'General Feed Settings',
'ACP_FEED_OVERALL_FORUMS' => 'Enable forums feed',
'ACP_FEED_OVERALL_FORUMS_EXPLAIN' => 'Enables the “All forums” feed, which displays a list of forums.',
'ACP_FEED_HTTP_AUTH' => 'Allow HTTP Authentication',
'ACP_FEED_HTTP_AUTH_EXPLAIN' => 'Enables HTTP authentication, which allows users to receive content that is hidden to guest users by adding the <samp>auth=http</samp> parameter to the feed URL. Please note that some PHP setups require additional changes to the .htaccess file. Instructions can be found in that file.',
'ACP_FEED_ITEM_STATISTICS' => 'Item statistics',
'ACP_FEED_ITEM_STATISTICS_EXPLAIN' => 'Display individual statistics underneath feed items<br />(Posted by, date and time, Replies, Views)',
'ACP_FEED_ITEM_STATISTICS_EXPLAIN' => 'Display individual statistics underneath feed items<br />(e.g. posted by, date and time, replies, views)',
'ACP_FEED_EXCLUDE_ID' => 'Exclude these forums',
'ACP_FEED_EXCLUDE_ID_EXPLAIN' => 'Content from these will be <strong>not included in feeds</strong>. Select no forum to pull data from all forums.<br />Select/Deselect multiple forums by holding <samp>CTRL</samp> and clicking.',
));
@ -383,7 +392,7 @@ $lang = array_merge($lang, array(
'LDAP_NO_EMAIL' => 'The specified e-mail attribute does not exist.',
'LDAP_NO_IDENTITY' => 'Could not find a login identity for %s.',
'LDAP_PASSWORD' => 'LDAP password',
'LDAP_PASSWORD_EXPLAIN' => 'Leave blank to use anonymous binding. Else fill in the password for the above user. Required for Active Directory Servers. <strong>WARNING:</strong> This password will be stored as plain text in the database visible to everybody who can access your database or who can view this configuration page.',
'LDAP_PASSWORD_EXPLAIN' => 'Leave blank to use anonymous binding. Else fill in the password for the above user. Required for Active Directory Servers.<br /><em><strong>Warning:</strong> This password will be stored as plain text in the database visible to everybody who can access your database or who can view this configuration page.</em>',
'LDAP_PORT' => 'LDAP server port',
'LDAP_PORT_EXPLAIN' => 'Optionally you can specify a port which should be used to connect to the LDAP server instead of the default port 389.',
'LDAP_SERVER' => 'LDAP server name',
@ -495,7 +504,7 @@ $lang = array_merge($lang, array(
'SMTP_DIGEST_MD5' => 'DIGEST-MD5',
'SMTP_LOGIN' => 'LOGIN',
'SMTP_PASSWORD' => 'SMTP password',
'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your SMTP server requires it.',
'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your SMTP server requires it.<br /><em><strong>Warning:</strong> This password will be stored as plain text in the database visible to everybody who can access your database or who can view this configuration page.</em>',
'SMTP_PLAIN' => 'PLAIN',
'SMTP_POP_BEFORE_SMTP' => 'POP-BEFORE-SMTP',
'SMTP_PORT' => 'SMTP server port',
@ -518,6 +527,7 @@ $lang = array_merge($lang, array(
'JAB_PACKAGE_SIZE' => 'Jabber package size',
'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and will not be queued for later sending.',
'JAB_PASSWORD' => 'Jabber password',
'JAB_PASSWORD_EXPLAIN' => '<em><strong>Warning:</strong> This password will be stored as plain text in the database visible to everybody who can access your database or who can view this configuration page.</em>',
'JAB_PORT' => 'Jabber port',
'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not port 5222.',
'JAB_SERVER' => 'Jabber server',

View file

@ -267,7 +267,6 @@ $lang = array_merge($lang, array(
'PARSE_URLS' => 'Parse links',
'PERMISSIONS_TRANSFERRED' => 'Permissions transferred',
'PERMISSIONS_TRANSFERRED_EXPLAIN' => 'You currently have the permissions from %1$s. You are able to browse the board with this users permissions, but not access the administration control panel since admin permissions were not transferred. You can <a href="%2$s"><strong>revert to your permission set</strong></a> at any time.',
'PIXEL' => 'px',
'PROCEED_TO_ACP' => '%sProceed to the ACP%s',
'REMIND' => 'Remind',
@ -340,6 +339,8 @@ $lang = array_merge($lang, array(
'NUMBER_USERS' => 'Number of users',
'NUMBER_ORPHAN' => 'Orphan attachments',
'PHP_VERSION_OLD' => 'The version of PHP on this server will no longer be supported by future versions of phpBB. %sDetails%s',
'POSTS_PER_DAY' => 'Posts per day',
'PURGE_CACHE' => 'Purge the cache',

View file

@ -66,7 +66,7 @@ $lang = array_merge($lang, array(
'ENABLE_POST_REVIEW' => 'Enable post review',
'ENABLE_POST_REVIEW_EXPLAIN' => 'If set to yes users are able to review their post if new posts were made to the topic while users wrote theirs. This should be disabled for chat forums.',
'ENABLE_QUICK_REPLY' => 'Enable quick reply',
'ENABLE_QUICK_REPLY_EXPLAIN' => 'If set to yes users get a quick reply box for this forum. If the global option for quick reply is disabled or the forum not postable to the quick reply box will not be displayed, even if set to yes here.',
'ENABLE_QUICK_REPLY_EXPLAIN' => 'Enables the quick reply in this forum. This setting is not considered if the quick reply is disabled board wide. The quick reply will only be displayed for users who have permission to post in this forum.',
'ENABLE_RECENT' => 'Display active topics',
'ENABLE_RECENT_EXPLAIN' => 'If set to yes topics made to this forum will be shown in the active topics list.',
'ENABLE_TOPIC_ICONS' => 'Enable topic icons',
@ -99,7 +99,7 @@ $lang = array_merge($lang, array(
'FORUM_PASSWORD_EXPLAIN' => 'Defines a password for this forum, use the permission system in preference.',
'FORUM_PASSWORD_UNSET' => 'Remove forum password',
'FORUM_PASSWORD_UNSET_EXPLAIN' => 'Check here if you want to remove the forum password.',
'FORUM_PASSWORD_OLD' => 'The forum password is using an old encryption and should be changed.',
'FORUM_PASSWORD_OLD' => 'The forum password is using an old hashing method and should be changed.',
'FORUM_PASSWORD_MISMATCH' => 'The passwords you entered did not match.',
'FORUM_PRUNE_SETTINGS' => 'Forum prune settings',
'FORUM_RESYNCED' => 'Forum “%s” successfully resynced',

View file

@ -41,6 +41,9 @@ $lang = array_merge($lang, array(
'ACP_BBCODES_EXPLAIN' => 'BBCode is a special implementation of HTML offering greater control over what and how something is displayed. From this page you can add, remove and edit custom BBCodes.',
'ADD_BBCODE' => 'Add a new BBCode',
'BBCODE_DANGER' => 'The BBCode you are trying to add seems to use a {TEXT} token inside a HTML attribute. This is a possible XSS security issue. Try using the more restrictive {SIMPLETEXT} or {INTTEXT} types instead. Only proceed if you understand the risks involved and you consider the use of {TEXT} absolutely unavoidable.',
'BBCODE_DANGER_PROCEED' => 'Proceed', //'I understand the risk',
'BBCODE_ADDED' => 'BBCode added successfully.',
'BBCODE_EDITED' => 'BBCode edited successfully.',
'BBCODE_NOT_EXIST' => 'The BBCode you selected does not exist.',
@ -73,8 +76,9 @@ $lang = array_merge($lang, array(
'TOO_MANY_BBCODES' => 'You cannot create any more BBCodes. Please remove one or more BBCodes then try again.',
'tokens' => array(
'TEXT' => 'Any text, including foreign characters, numbers, etc… You should not use this token in HTML tags. Instead try to use IDENTIFIER or SIMPLETEXT.',
'TEXT' => 'Any text, including foreign characters, numbers, etc… You should not use this token in HTML tags. Instead try to use IDENTIFIER, INTTEXT or SIMPLETEXT.',
'SIMPLETEXT' => 'Characters from the latin alphabet (A-Z), numbers, spaces, commas, dots, minus, plus, hyphen and underscore',
'INTTEXT' => 'Unicode letter characters, numbers, spaces, commas, dots, minus, plus, hyphen, underscore and whitespaces.',
'IDENTIFIER' => 'Characters from the latin alphabet (A-Z), numbers, hyphen and underscore',
'NUMBER' => 'Any series of digits',
'EMAIL' => 'A valid e-mail address',

View file

@ -58,6 +58,8 @@ $lang = array_merge($lang, array(
'QUESTION_TEXT_EXPLAIN' => 'The question that will be asked on registration.',
'QA_ERROR_MSG' => 'Please fill in all fields and enter at least one answer.',
'QA_LAST_QUESTION' => 'You cannot delete all questions while the plugin is active.',
));
?>

View file

@ -124,7 +124,7 @@ $lang = array_merge($lang, array(
'COMMA_SEPARATOR' => ', ', // Used in pagination of ACP & prosilver, use localised comma if appropriate, eg: Ideographic or Arabic
'CONFIRM' => 'Confirm',
'CONFIRM_CODE' => 'Confirmation code',
'CONFIRM_CODE_EXPLAIN' => 'Enter the code exactly as it appears. All letters are case insensitive, there is no zero.',
'CONFIRM_CODE_EXPLAIN' => 'Enter the code exactly as it appears. All letters are case insensitive.',
'CONFIRM_CODE_WRONG' => 'The confirmation code you entered was incorrect.',
'CONFIRM_OPERATION' => 'Are you sure you wish to carry out this operation?',
'CONGRATULATIONS' => 'Congratulations to',
@ -417,6 +417,7 @@ $lang = array_merge($lang, array(
'PAGE_OF' => 'Page <strong>%1$d</strong> of <strong>%2$d</strong>',
'PASSWORD' => 'Password',
'PIXEL' => 'px',
'PLAY_QUICKTIME_FILE' => 'Play Quicktime file',
'PM' => 'PM',
'POSTING_MESSAGE' => 'Posting message in %s',
@ -491,6 +492,8 @@ $lang = array_merge($lang, array(
'RETURN_TO' => 'Return to',
'FEED' => 'Feed',
'FEED_NEWS' => 'News',
'FEED_TOPICS_ACTIVE' => 'Active Topics',
'FEED_TOPICS_NEW' => 'New Topics',
'RULES_ATTACH_CAN' => 'You <strong>can</strong> post attachments in this forum',
'RULES_ATTACH_CANNOT' => 'You <strong>cannot</strong> post attachments in this forum',
'RULES_DELETE_CAN' => 'You <strong>can</strong> delete your posts in this forum',

View file

@ -10,7 +10,7 @@ Username: {USERNAME}
Board URL: {U_BOARD}
----------------------------
Your account is currently inactive and will need to be approved by an administrator before you can log in. Another email will be sent when this has occured.
Your account is currently inactive and will need to be approved by an administrator before you can log in. Another email will be sent when this has occurred.
Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.

View file

@ -95,8 +95,8 @@ $help = array(
1 => 'Either the administrator has not installed your language or nobody has translated this board into your language. Try asking the board administrator if they can install the language pack you need. If the language pack does not exist, feel free to create a new translation. More information can be found at the phpBB website (see link at the bottom of board pages).'
),
array(
0 => 'How do I show an image below my username?',
1 => 'There are two images which may appear below a username when viewing posts. One of them may be an image associated with your rank, generally in the form of stars, blocks or dots, indicating how many posts you have made or your status on the board. Another, usually a larger image, is known as an avatar and is generally unique or personal to each user. It is up to the board administrators to enable avatars and to choose the way in which avatars can be made available. If you are unable to use avatars, contact a board administrators and ask them for their reasons.'
0 => 'How do I show an image along with my username?',
1 => 'There are two images which may appear along with a username when viewing posts. One of them may be an image associated with your rank, generally in the form of stars, blocks or dots, indicating how many posts you have made or your status on the board. Another, usually a larger image, is known as an avatar and is generally unique or personal to each user. It is up to the board administrator to enable avatars and to choose the way in which avatars can be made available. If you are unable to use avatars, contact a board administrator and ask them for their reasons.'
),
array(
0 => 'What is my rank and how do I change it?',
@ -116,7 +116,7 @@ $help = array(
),
array(
0 => 'How do I edit or delete a post?',
1 => 'Unless you are a board administrator or moderator, you can only edit or delete your own posts. You can edit a post by clicking the edit button for the relevant post, sometimes for only a limited time after the post was made. If someone has already replied to the post, you will find a small piece of text output below the post when you return to the topic which lists the number of times you edited it along with the date and time. This will only appear if someone has made a reply; it will not appear if a moderator or administrator edited the post, though they may leave a note as to why theyve edited the post at their own digression. Please note that normal users cannot delete a post once someone has replied.'
1 => 'Unless you are a board administrator or moderator, you can only edit or delete your own posts. You can edit a post by clicking the edit button for the relevant post, sometimes for only a limited time after the post was made. If someone has already replied to the post, you will find a small piece of text output below the post when you return to the topic which lists the number of times you edited it along with the date and time. This will only appear if someone has made a reply; it will not appear if a moderator or administrator edited the post, though they may leave a note as to why theyve edited the post at their own discretion. Please note that normal users cannot delete a post once someone has replied.'
),
array(
0 => 'How do I add a signature to my post?',

View file

@ -147,6 +147,7 @@ $lang = array_merge($lang, array(
'DLL_MBSTRING' => 'Multi-byte character support',
'DLL_MSSQL' => 'MSSQL Server 2000+',
'DLL_MSSQL_ODBC' => 'MSSQL Server 2000+ via ODBC',
'DLL_MSSQLNATIVE' => 'MSSQL Server 2005+ [ Native ]',
'DLL_MYSQL' => 'MySQL',
'DLL_MYSQLI' => 'MySQL with MySQLi Extension',
'DLL_ORACLE' => 'Oracle',
@ -214,6 +215,7 @@ $lang = array_merge($lang, array(
<li>SQLite 2.8.2+</li>
<li>Firebird 2.1+</li>
<li>MS SQL Server 2000 or above (directly or via ODBC)</li>
<li>MS SQL Server 2005 or above (native)</li>
<li>Oracle</li>
</ul>

View file

@ -329,6 +329,7 @@ $lang = array_merge($lang, array(
'SPLIT_TOPIC_BEYOND_CONFIRM' => 'Are you sure you want to split this topic at the selected post?',
'SPLIT_TOPIC_EXPLAIN' => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post.',
'THIS_PM_IP' => 'IP for this private message',
'THIS_POST_IP' => 'IP for this post',
'TOPICS_APPROVED_SUCCESS' => 'The selected topics have been approved.',
'TOPICS_DELETED_SUCCESS' => 'The selected topics have been successfully removed from the database.',

View file

@ -430,22 +430,72 @@ switch ($mode)
$user_id = (int) $member['user_id'];
// Get group memberships
// Also get visiting user's groups to determine hidden group memberships if necessary.
$auth_hidden_groups = ($user_id === (int) $user->data['user_id'] || $auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? true : false;
$sql_uid_ary = ($auth_hidden_groups) ? array($user_id) : array($user_id, (int) $user->data['user_id']);
// Do the SQL thang
$sql = 'SELECT g.group_id, g.group_name, g.group_type
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug
WHERE ug.user_id = $user_id
AND g.group_id = ug.group_id" . ((!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? ' AND g.group_type <> ' . GROUP_HIDDEN : '') . '
AND ug.user_pending = 0
ORDER BY g.group_type, g.group_name';
$sql = 'SELECT g.group_id, g.group_name, g.group_type, ug.user_id
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug
WHERE ' . $db->sql_in_set('ug.user_id', $sql_uid_ary) . '
AND g.group_id = ug.group_id
AND ug.user_pending = 0';
$result = $db->sql_query($sql);
$group_options = '';
// Divide data into profile data and current user data
$profile_groups = $user_groups = array();
while ($row = $db->sql_fetchrow($result))
{
$group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
$row['user_id'] = (int) $row['user_id'];
$row['group_id'] = (int) $row['group_id'];
if ($row['user_id'] == $user_id)
{
$profile_groups[] = $row;
}
else
{
$user_groups[$row['group_id']] = $row['group_id'];
}
}
$db->sql_freeresult($result);
// Filter out hidden groups and sort groups by name
$group_data = $group_sort = array();
foreach ($profile_groups as $row)
{
if ($row['group_type'] == GROUP_SPECIAL)
{
// Lookup group name in language dictionary
if (isset($user->lang['G_' . $row['group_name']]))
{
$row['group_name'] = $user->lang['G_' . $row['group_name']];
}
}
else if (!$auth_hidden_groups && $row['group_type'] == GROUP_HIDDEN && !isset($user_groups[$row['group_id']]))
{
// Skip over hidden groups the user cannot see
continue;
}
$group_sort[$row['group_id']] = utf8_clean_string($row['group_name']);
$group_data[$row['group_id']] = $row;
}
unset($profile_groups);
unset($user_groups);
asort($group_sort);
$group_options = '';
foreach ($group_sort as $group_id => $null)
{
$row = $group_data[$group_id];
$group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . $row['group_name'] . '</option>';
}
unset($group_data);
unset($group_sort);
// What colour is the zebra
$sql = 'SELECT friend, foe
FROM ' . ZEBRA_TABLE . "

View file

@ -992,7 +992,7 @@ if ($submit || $preview || $refresh)
$forum_type = (int) $db->sql_fetchfield('forum_type');
$db->sql_freeresult($result);
if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id))
if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id) || (!$auth->acl_get('m_approve', $to_forum_id) && !$auth->acl_get('f_noapprove', $to_forum_id)))
{
$to_forum_id = 0;
}
@ -1113,7 +1113,7 @@ if ($submit || $preview || $refresh)
}
// Check the permissions for post approval. Moderators are not affected.
if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) || !empty($post_data['force_approved_state']))
if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id']) && empty($data['force_approved_state'])) || (isset($data['force_approved_state']) && !$data['force_approved_state']))
{
meta_refresh(10, $redirect_url);
$message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD'];
@ -1152,7 +1152,7 @@ if (!sizeof($error) && $preview)
$parse_sig->bbcode_bitfield = $preview_signature_bitfield;
// Not sure about parameters for bbcode/smilies/urls... in signatures
$parse_sig->format_display($config['allow_sig_bbcode'], true, $config['allow_sig_smilies']);
$parse_sig->format_display($config['allow_sig_bbcode'], $config['allow_sig_links'], $config['allow_sig_smilies']);
$preview_signature = $parse_sig->message;
unset($parse_sig);
}

View file

@ -47,6 +47,26 @@ $sort_dir = request_var('sd', 'd');
$return_chars = request_var('ch', ($topic_id) ? -1 : 300);
$search_forum = request_var('fid', array(0));
// We put login boxes for the case if search_id is egosearch or unreadposts
// because a guest should be able to log in even if guests search is not permitted
// Egosearch is an author search
if ($search_id == 'egosearch')
{
$author_id = $user->data['user_id'];
if ($user->data['user_id'] == ANONYMOUS)
{
login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
}
}
// Search for unread posts needs user to be logged in if topics tracking for guests is disabled
if ($search_id == 'unreadposts' && !$config['load_anon_lastread'] && !$user->data['is_registered'])
{
login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
}
// Is user able to search? Has search been disabled?
if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$config['load_search'])
{
@ -84,24 +104,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// clear arrays
$id_ary = array();
// egosearch is an author search
if ($search_id == 'egosearch')
{
$author_id = $user->data['user_id'];
if ($user->data['user_id'] == ANONYMOUS)
{
login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
}
}
// search for unread posts needs user to be logged in
// if topics tracking for guests is disabled
if ($search_id == 'unreadposts' && !$config['load_anon_lastread'] && !$user->data['is_registered'])
{
login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
}
// If we are looking for authors get their ids
$author_id_ary = array();
$sql_author_match = '';

View file

@ -19,7 +19,7 @@
# General Information about this style
name = prosilver
copyright = &copy; phpBB Group, 2007
version = 3.0.6
version = 3.0.7
# Images
img_site_logo = site_logo.gif*52*139

View file

@ -19,4 +19,4 @@
# General Information about this style
name = prosilver
copyright = &copy; phpBB Group, 2007
version = 3.0.6
version = 3.0.7

View file

@ -157,7 +157,7 @@ function insert_text(text, spaces, popup)
var sel_start = textarea.selectionStart;
var sel_end = textarea.selectionEnd;
mozWrap(textarea, text, '')
mozWrap(textarea, text, '');
textarea.selectionStart = sel_start + text.length;
textarea.selectionEnd = sel_end + text.length;
}
@ -259,7 +259,7 @@ function addquote(post_id, username)
var lines = split_lines(theSelection);
for (i = 0; i < lines.length; i++)
{
insert_text('> ' + lines[i] + '\n')
insert_text('> ' + lines[i] + '\n');
}
}
}
@ -289,7 +289,7 @@ function split_lines(text)
if (splitAt == -1)
{
splitLines[j] = line;
j++
j++;
}
else
{
@ -298,7 +298,7 @@ function split_lines(text)
j++;
}
}
while(splitAt != -1)
while(splitAt != -1);
}
}
return splitLines;
@ -319,12 +319,12 @@ function mozWrap(txtarea, open, close)
}
var s1 = (txtarea.value).substring(0,selStart);
var s2 = (txtarea.value).substring(selStart, selEnd)
var s2 = (txtarea.value).substring(selStart, selEnd);
var s3 = (txtarea.value).substring(selEnd, selLength);
txtarea.value = s1 + open + s2 + close + s3;
txtarea.selectionStart = selEnd + open.length + close.length;
txtarea.selectionEnd = txtarea.selectionStart;
txtarea.selectionStart = selStart + open.length;
txtarea.selectionEnd = selEnd + open.length;
txtarea.focus();
txtarea.scrollTop = scrollTop;

Some files were not shown because too many files have changed in this diff Show more