necessary changes...

git-svn-id: file:///svn/phpbb/trunk@8072 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-08-30 21:21:16 +00:00
parent 6f1d6e9246
commit 1d004b925f
23 changed files with 151 additions and 67 deletions

View file

@ -42,7 +42,7 @@ if (!$auth->acl_get('a_'))
// We define the admin variables now, because the user is now able to use the admin related features...
define('IN_ADMIN', true);
$phpbb_admin_path = './';
$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : './';
// Some oft used variables
$safe_mode = (@ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on') ? true : false;
@ -204,11 +204,7 @@ function adm_page_footer($copyright_html = true)
$template->display('body');
garbage_collection();
if (!defined('PHPBB_EMBEDDED'))
{
exit;
}
exit_handler();
}
/**

View file

@ -172,7 +172,7 @@ require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Set PHP error handler to ours
set_error_handler('msg_handler');
+set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
// Instantiate some basic classes
$user = new user();

View file

@ -169,6 +169,7 @@ p a {
<ol class="menu">
<li><a href="#changelog">Changelog</a>
<ol type="i">
<li><a href="#v30rc5">Changes since RC-5</a></li>
<li><a href="#v30rc4">Changes since RC-4</a></li>
<li><a href="#v30rc3">Changes since RC-3</a></li>
<li><a href="#v30rc2">Changes since RC-2</a></li>
@ -182,11 +183,27 @@ p a {
<a name="changelog"></a><h1>1. Changelog</h1>
<a name="v30rc4"></a><b>1.i. Changes since 3.0.RC4</b>
<a name="v30rc5"></a><b>1.i. Changes since 3.0.RC5</b>
<br /><br />
<div class="paragraph">
<p>These fixes/changes are currently only present within CVS and will appear within the next phpBB3 version.</p>
<ul class="menu">
<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li>
<li>[Feature] The new exit_handler() function having a check for the function exit_handler_phpbb_hook().</li>
<li>[Feature] Constant PHPBB_ADMIN_PATH introduced, having the same purpose as PHPBB_ROOT_PATH, but for the ACP.</li>
<li>[Fix] Further fixing user profile view (please do not forget to update/refresh your template and style) (Bug #14230)</li>
<li>[Fix] Adjust google adsense bot information (Bug #14296)</li>
</ul>
</div>
<a href="#top">Top</a>
<br /><br />
<hr />
<a name="v30rc4"></a><b>1.ii. Changes since 3.0.RC4</b>
<br /><br />
<div class="paragraph">
<ul class="menu">
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
@ -243,7 +260,7 @@ p a {
<hr />
<a name="v30rc3"></a><b>1.ii. Changes since 3.0.RC3</b>
<a name="v30rc3"></a><b>1.iii. Changes since 3.0.RC3</b>
<br /><br />
<div class="paragraph">
@ -360,7 +377,7 @@ p a {
<hr />
<a name="v30rc2"></a><b>1.iii. Changes since 3.0.RC2</b>
<a name="v30rc2"></a><b>1.iv. Changes since 3.0.RC2</b>
<br /><br />
<div class="paragraph">
@ -414,7 +431,7 @@ p a {
<hr />
<a name="v30rc1"></a><b>1.iiii. Changes since 3.0.RC1</b>
<a name="v30rc1"></a><b>1.v. Changes since 3.0.RC1</b>
<br /><br />
<div class="paragraph">

View file

@ -46,7 +46,7 @@ class acp_captcha
}
$captcha = new captcha();
$captcha->execute(gen_rand_string(mt_rand(5, 8)), time());
exit;
exit_handler();
}
$config_vars = array(

View file

@ -41,7 +41,7 @@ class acp_forums
$total = request_var('total', 0);
$this->display_progress_bar($start, $total);
exit;
exit_handler();
break;
case 'delete':

View file

@ -36,6 +36,15 @@ function login_apache(&$username, &$password)
{
global $db;
// do not allow empty password
if (!$password)
{
return array(
'status' => LOGIN_BREAK,
'error_msg' => 'NO_PASSWORD_SUPPLIED',
);
}
if (!isset($_SERVER['PHP_AUTH_USER']))
{
return array(

View file

@ -20,6 +20,15 @@ function login_db(&$username, &$password)
{
global $db, $config;
// do not allow empty password
if (!$password)
{
return array(
'status' => LOGIN_BREAK,
'error_msg' => 'NO_PASSWORD_SUPPLIED',
);
}
$sql = 'SELECT user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts
FROM ' . USERS_TABLE . "
WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";

View file

@ -92,6 +92,15 @@ function login_ldap(&$username, &$password)
{
global $db, $config, $user;
// do not allow empty password
if (!$password)
{
return array(
'status' => LOGIN_BREAK,
'error_msg' => 'NO_PASSWORD_SUPPLIED',
);
}
if (!@extension_loaded('ldap'))
{
return array(

View file

@ -9,6 +9,10 @@
*/
/**
* valid external constants:
* PHPBB_MSG_HANDLER
* PHPBB_ROOT_PATH
* PHPBB_ADMIN_PATH
*/
// User related

View file

@ -651,8 +651,10 @@ class dbal
</div>
</body>
</html>';
exit;
break;
exit_handler();
break;
case 'stop':
$endtime = explode(' ', microtime());

View file

@ -1577,6 +1577,8 @@ function on_page($num_items, $per_page, $start)
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2', false);
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", array('t' => 1, 'f' => 2));
* </code>
*
* Ability to use own function <code>append_sid_phpbb_hook</code> as a hook. It is called in favor of this function.
*/
function append_sid($url, $params = false, $is_amp = true, $session_id = false)
{
@ -2107,12 +2109,6 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
trigger_error('NO_AUTH_ADMIN_USER_DIFFER');
}
// do not allow empty password
if (!$password)
{
trigger_error('NO_PASSWORD_SUPPLIED');
}
// If authentication is successful we redirect user to previous page
$result = $auth->login($username, $password, $autologin, $viewonline, $admin);
@ -3572,8 +3568,7 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
}
else
{
$profile_url = ($custom_profile_url !== false) ? $custom_profile_url : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile');
$profile_url .= '&amp;u=' . (int) $user_id;
$profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&amp;u=' . (int) $user_id : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . (int) $user_id);
}
}
else
@ -3794,7 +3789,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
echo '</body>';
echo '</html>';
exit;
exit_handler();
break;
case E_USER_WARNING:
@ -3853,7 +3848,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
page_footer();
}
exit;
exit_handler();
break;
}
@ -4303,11 +4298,7 @@ function page_footer($run_cron = true)
$template->display('body');
garbage_collection();
if (!defined('PHPBB_EMBEDDED'))
{
exit;
}
exit_handler();
}
/**
@ -4331,6 +4322,21 @@ function garbage_collection()
}
}
/**
* Handler for exit calls in phpBB
*
* Ability to use own function <code>exit_handler_phpbb_hook</code> as a hook. It is called in favor of this function.
*/
function exit_handler()
{
if (function_exists('exit_handler_phpbb_hook'))
{
return exit_handler_phpbb_hook();
}
exit;
}
/**
* @package phpBB3
*/

View file

@ -1784,7 +1784,7 @@ function add_bots()
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),
'Francis [Bot]' => array('http://www.neomo.de/', ''),
'Gigabot [Bot]' => array('Gigabot/', ''),
'Google Adsense [Bot]' => array('Mediapartners-Google/', ''),
'Google Adsense [Bot]' => array('Mediapartners-Google', ''),
'Google Desktop' => array('Google Desktop', ''),
'Google Feedfetcher' => array('Feedfetcher-Google', ''),
'Google [Bot]' => array('Googlebot', ''),

View file

@ -8,7 +8,7 @@
*
*/
$updates_to_version = '3.0.RC5';
$updates_to_version = '3.0.RC6';
// Return if we "just include it" to find out for which version the database update is responsuble for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
@ -983,7 +983,7 @@ if ($exit)
</html>
<?php
exit;
exit_handler();
}
// Schema updates
@ -1502,6 +1502,17 @@ if (version_compare($current_version, '3.0.RC4', '<='))
$no_updates = false;
}
if (version_compare($current_version, '3.0.RC5', '<='))
{
// In case the user is having the bot mediapartner google "as is", adjust it.
$sql = 'UPDATE ' . BOTS_TABLE . "
SET bot_agent = '" . $db->sql_escape('Mediapartners-Google') . "'
WHERE bot_agent = '" . $db->sql_escape('Mediapartners-Google/') . "'";
_sql($sql, $errored, $error_ary);
$no_updates = false;
}
_write_result($no_updates, $errored, $error_ary);
$error_ary = array();
@ -1604,7 +1615,7 @@ $cache->purge();
<?php
exit;
exit_handler();
/**

View file

@ -415,7 +415,7 @@ class module
$db->sql_close();
}
exit;
exit_handler();
}
/**
@ -606,7 +606,7 @@ class module
$db->sql_close();
}
exit;
exit_handler();
}
/**

View file

@ -2060,7 +2060,7 @@ class install_install extends module
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),
'Francis [Bot]' => array('http://www.neomo.de/', ''),
'Gigabot [Bot]' => array('Gigabot/', ''),
'Google Adsense [Bot]' => array('Mediapartners-Google/', ''),
'Google Adsense [Bot]' => array('Mediapartners-Google', ''),
'Google Desktop' => array('Google Desktop', ''),
'Google Feedfetcher' => array('Feedfetcher-Google', ''),
'Google [Bot]' => array('Googlebot', ''),

View file

@ -208,7 +208,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.RC5');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.RC6-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

@ -166,7 +166,7 @@ if ($quickmod)
case 'delete_post':
case 'delete_topic':
$module->load('mcp', 'main', 'quickmod');
exit;
exit_handler();
break;
case 'topic_logs':

View file

@ -1154,27 +1154,47 @@ switch ($mode)
// Build a relevant pagination_url
$params = $sort_params = array();
foreach (array('_POST', '_GET') as $global_var)
// We do not use request_var() here directly to save some calls (not all variables are set)
$check_params = array(
'g' => array('g', 0),
'sk' => array('sk', $default_key),
'sd' => array('sd', 'a'),
'form' => array('form', ''),
'field' => array('field', ''),
'select_single' => array('select_single', 0),
'username' => array('username', '', true),
'email' => array('email', ''),
'icq' => array('icq', ''),
'aim' => array('aim', ''),
'yahoo' => array('yahoo', ''),
'msn' => array('msn', ''),
'jabber' => array('jabber', ''),
'search_group_id' => array('search_group_id', 0),
'joined_select' => array('joined_select', 'lt'),
'active_select' => array('active_select', 'lt'),
'count_select' => array('count_select', 'eq'),
'joined' => array('joined', ''),
'active' => array('active', ''),
'count' => ($count !== '') ? array('count', 0) : array('count', ''),
'ipdomain' => array('ip', ''),
'first_char' => array('first_char', ''),
);
foreach ($check_params as $key => $call)
{
foreach ($$global_var as $key => $var)
if (!isset($_REQUEST[$key]))
{
if ($global_var == '_POST')
{
unset($_GET[$key]);
}
continue;
}
if (in_array($key, array('submit', 'start', 'mode', 'char')) || empty($var))
{
continue;
}
$param = call_user_func_array('request_var', $call);
$param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : $param);
$params[] = $param;
$param = urlencode($key) . '=' . urlencode(htmlspecialchars($var));
$params[] = $param;
if (!in_array($key, array('sk', 'sd')))
{
$sort_params[] = $param;
}
if ($key != 'sk' && $key != 'sd')
{
$sort_params[] = $param;
}
}
@ -1405,7 +1425,7 @@ switch ($mode)
'S_MODE_SELECT' => $s_sort_key,
'S_ORDER_SELECT' => $s_sort_dir,
'S_CHAR_OPTIONS' => $s_char_options,
'S_MODE_ACTION' => $pagination_url . "&amp;form=$form")
'S_MODE_ACTION' => $pagination_url)
);
}

View file

@ -114,7 +114,7 @@ switch ($mode)
{
upload_popup();
garbage_collection();
exit;
exit_handler();
}
break;
@ -145,7 +145,7 @@ if (!$post_data)
if ($mode == 'popup')
{
upload_popup($post_data['forum_style']);
exit;
exit_handler();
}
$user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']);
@ -276,7 +276,7 @@ if ($mode == 'edit' && !$auth->acl_get('m_edit', $forum_id))
if ($mode == 'delete')
{
handle_post_delete($forum_id, $topic_id, $post_id, $post_data);
exit;
exit_handler();
}
// Handle bump mode...

View file

@ -164,12 +164,12 @@
}
*:first-child+html dl.details dd {
margin-right: 15em;
margin-right: 35%;
float: none;
}
* html dl.details dd {
margin-right: 15em;
margin-right: 35%;
float: none;
}

View file

@ -459,7 +459,7 @@ dl.details {
dl.details dt {
float: left;
clear: left;
width: 15em;
width: 30%;
text-align: right;
color: #000000;
display: block;
@ -471,6 +471,7 @@ dl.details dd {
margin-bottom: 5px;
color: #828282;
float: left;
width: 65%;
}
/* Pagination

View file

@ -61,12 +61,12 @@ dl.icon {
/* Correctly clear floating for details on profile view */
*:first-child+html dl.details dd {
margin-left: 15em;
margin-left: 30%;
float: none;
}
* html dl.details dd {
margin-left: 15em;
margin-left: 30%;
float: none;
}

View file

@ -69,7 +69,7 @@ switch ($mode)
case 'confirm':
$module->load('ucp', 'confirm');
exit;
exit_handler();
break;
case 'login':