mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into feature/passwords
Conflicts: phpBB/develop/create_schema_files.php
This commit is contained in:
commit
663b4b2eb7
590 changed files with 10934 additions and 7523 deletions
|
@ -3,8 +3,8 @@
|
|||
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
|
||||
<!-- a few settings for the build -->
|
||||
<property name="newversion" value="3.1.0-dev" />
|
||||
<property name="prevversion" value="3.0.11" />
|
||||
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9, 3.0.10" />
|
||||
<property name="prevversion" value="3.0.12-RC3" />
|
||||
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9, 3.0.10, 3.0.11" />
|
||||
<!-- no configuration should be needed beyond this point -->
|
||||
|
||||
<property name="oldversions" value="${olderversions}, ${prevversion}" />
|
||||
|
|
|
@ -1,12 +1,30 @@
|
|||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
|
||||
#
|
||||
# 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>
|
||||
|
||||
#
|
||||
# The following 3 lines will rewrite URLs passed through the front controller
|
||||
# to not require app.php in the actual URL. In other words, a controller is
|
||||
# by default accessed at /app.php/my/controller, but can also be accessed at
|
||||
# /my/controller
|
||||
#
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)$ app.php [QSA,L]
|
||||
|
||||
#
|
||||
# If symbolic links are not already being followed,
|
||||
# uncomment the line below.
|
||||
# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/
|
||||
#
|
||||
#Options +FollowSymLinks
|
||||
</IfModule>
|
||||
|
||||
<Files "config.php">
|
||||
Order Allow,Deny
|
||||
|
|
|
@ -50,7 +50,7 @@ $module_id = request_var('i', '');
|
|||
$mode = request_var('mode', '');
|
||||
|
||||
// Set custom style for admin area
|
||||
$phpbb_style->set_custom_style('admin', $phpbb_admin_path . 'style', array(), '');
|
||||
$template->set_custom_style('adm', $phpbb_admin_path . 'style');
|
||||
$template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets');
|
||||
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
|
||||
|
||||
|
|
|
@ -752,6 +752,10 @@ optgroup, select {
|
|||
color: #000;
|
||||
}
|
||||
|
||||
select:focus {
|
||||
outline-style: none;
|
||||
}
|
||||
|
||||
optgroup {
|
||||
font-size: 1.00em;
|
||||
font-weight: bold;
|
||||
|
@ -997,6 +1001,7 @@ input:focus, textarea:focus {
|
|||
border: 1px solid #BC2A4D;
|
||||
background-color: #E9E9E2;
|
||||
color: #BC2A4D;
|
||||
outline-style: none;
|
||||
}
|
||||
|
||||
/* Submit button fieldset or paragraph
|
||||
|
@ -1091,6 +1096,11 @@ input.disabled {
|
|||
color: #666666;
|
||||
}
|
||||
|
||||
/* Focus states */
|
||||
input.button1:focus, input.button2:focus, input.button3:focus {
|
||||
outline-style: none;
|
||||
}
|
||||
|
||||
/* jQuery popups
|
||||
---------------------------------------- */
|
||||
.phpbb_alert {
|
||||
|
|
17
phpBB/adm/style/auth_provider_oauth.html
Normal file
17
phpBB/adm/style/auth_provider_oauth.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<h2>{L_AUTH_PROVIDER_OAUTH_TITLE}</h2>
|
||||
|
||||
<p>{L_AUTH_PROVIDER_OAUTH_EXPLAIN}</p>
|
||||
|
||||
<!-- BEGIN oauth_services -->
|
||||
<fieldset>
|
||||
<legend>{oauth_services.ACTUAL_NAME}</legend>
|
||||
<dl>
|
||||
<dt><label for="oauth_service_{oauth_services.NAME}_key">{L_AUTH_PROVIDER_OAUTH_KEY}{L_COLON}</label></dt>
|
||||
<dd><input type="text" id="oauth_service_{oauth_services.NAME}_key" size="40" name="config[auth_oauth_{oauth_services.NAME}_key]" value="{oauth_services.KEY}" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="oauth_service_{oauth_services.NAME}_secret">{L_AUTH_PROVIDER_OAUTH_SECRET}{L_COLON}</label></dt>
|
||||
<dd><input type="text" id="oauth_service_{oauth_services.NAME}_secret" size="40" name="config[auth_oauth_{oauth_services.NAME}_secret]" value="{oauth_services.SECRET}" /></dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
<!-- END oauth_services -->
|
|
@ -12,7 +12,7 @@
|
|||
var jump_page = '{LA_JUMP_PAGE}{L_COLON}';
|
||||
var on_page = '{ON_PAGE}';
|
||||
var per_page = '{PER_PAGE}';
|
||||
var base_url = '{A_BASE_URL}';
|
||||
var base_url = '{BASE_URL|e('js')}';
|
||||
|
||||
var menu_state = 'shown';
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
var jump_page = '{LA_JUMP_PAGE}{L_COLON}';
|
||||
var on_page = '{ON_PAGE}';
|
||||
var per_page = '{PER_PAGE}';
|
||||
var base_url = '{A_BASE_URL}';
|
||||
var base_url = '{BASE_URL|e('js')}';
|
||||
|
||||
/**
|
||||
* Window popup
|
||||
|
|
|
@ -22,7 +22,7 @@ $auth->acl($user->data);
|
|||
$user->setup();
|
||||
|
||||
// Set custom template for admin area
|
||||
$phpbb_style->set_custom_style('admin', $phpbb_admin_path . 'style', array(), '');
|
||||
$template->set_custom_style('adm', $phpbb_admin_path . 'style');
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'colour_swatch.html')
|
||||
|
|
|
@ -24,7 +24,6 @@ $user->session_begin();
|
|||
$auth->acl($user->data);
|
||||
$user->setup('app');
|
||||
|
||||
$symfony_request = phpbb_create_symfony_request($request);
|
||||
$http_kernel = $phpbb_container->get('http_kernel');
|
||||
$response = $http_kernel->handle($symfony_request);
|
||||
$response->send();
|
||||
|
|
|
@ -47,7 +47,19 @@ if (!defined('PHPBB_INSTALLED'))
|
|||
|
||||
// Eliminate . and .. from the path
|
||||
require($phpbb_root_path . 'phpbb/filesystem.' . $phpEx);
|
||||
$phpbb_filesystem = new phpbb_filesystem();
|
||||
require($phpbb_root_path . 'phpbb/symfony_request.' . $phpEx);
|
||||
require($phpbb_root_path . 'phpbb/request/deactivated_super_global.' . $phpEx);
|
||||
require($phpbb_root_path . 'phpbb/request/type_cast_helper_interface.' . $phpEx);
|
||||
require($phpbb_root_path . 'phpbb/request/type_cast_helper.' . $phpEx);
|
||||
require($phpbb_root_path . 'phpbb/request/request_interface.' . $phpEx);
|
||||
require($phpbb_root_path . 'phpbb/request/request.' . $phpEx);
|
||||
$phpbb_filesystem = new phpbb\filesystem(
|
||||
new phpbb\symfony_request(
|
||||
new phpbb\request\request()
|
||||
),
|
||||
$phpbb_root_path,
|
||||
$phpEx
|
||||
);
|
||||
$script_path = $phpbb_filesystem->clean_path($script_path);
|
||||
|
||||
$url = (($secure) ? 'https://' : 'http://') . $server_name;
|
||||
|
@ -85,9 +97,9 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
|||
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
||||
|
||||
// Setup class loader first
|
||||
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader->register();
|
||||
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
|
||||
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
|
||||
$phpbb_class_loader_ext->register();
|
||||
|
||||
// Set up container
|
||||
|
@ -109,6 +121,10 @@ $db = $phpbb_container->get('dbal.conn');
|
|||
// make sure request_var uses this request instance
|
||||
request_var('', 0, false, false, $request); // "dependency injection" for a function
|
||||
|
||||
// Create a Symfony Request object from our phpbb_request object
|
||||
$symfony_request = $phpbb_container->get('symfony_request');
|
||||
$phpbb_filesystem = $phpbb_container->get('filesystem');
|
||||
|
||||
// Grab global variables, re-cache if necessary
|
||||
$config = $phpbb_container->get('config');
|
||||
set_config(null, null, null, $config);
|
||||
|
@ -121,11 +137,10 @@ $phpbb_extension_manager = $phpbb_container->get('ext.manager');
|
|||
$phpbb_subscriber_loader = $phpbb_container->get('event.subscriber_loader');
|
||||
|
||||
$template = $phpbb_container->get('template');
|
||||
$phpbb_style = $phpbb_container->get('style');
|
||||
|
||||
// Add own hook handler
|
||||
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
||||
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('phpbb_template', 'display')));
|
||||
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('\phpbb\template\template', 'display')));
|
||||
$phpbb_hook_finder = $phpbb_container->get('hook_finder');
|
||||
|
||||
foreach ($phpbb_hook_finder->find() as $hook)
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
{
|
||||
"minimum-stability": "beta",
|
||||
"require": {
|
||||
"symfony/config": "2.1.*",
|
||||
"symfony/dependency-injection": "2.1.*",
|
||||
"symfony/event-dispatcher": "2.1.*",
|
||||
"symfony/http-kernel": "2.1.*",
|
||||
"symfony/routing": "2.1.*",
|
||||
"symfony/yaml": "2.1.*",
|
||||
"lusitanian/oauth": "0.2.*",
|
||||
"symfony/config": "2.3.*",
|
||||
"symfony/dependency-injection": "2.3.*",
|
||||
"symfony/event-dispatcher": "2.3.*",
|
||||
"symfony/http-kernel": "2.3.*",
|
||||
"symfony/routing": "2.3.*",
|
||||
"symfony/yaml": "2.3.*",
|
||||
"twig/twig": "1.13.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"fabpot/goutte": "v0.1.0",
|
||||
"fabpot/goutte": "1.0.*",
|
||||
"phpunit/dbunit": "1.2.*",
|
||||
"phpunit/phpunit": "3.7.*",
|
||||
"phing/phing": "2.4.*"
|
||||
|
|
899
phpBB/composer.lock
generated
899
phpBB/composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,12 +1,12 @@
|
|||
services:
|
||||
auth.provider_collection:
|
||||
class: phpbb_di_service_collection
|
||||
class: phpbb\di\service_collection
|
||||
arguments:
|
||||
- @service_container
|
||||
tags:
|
||||
- { name: service_collection, tag: auth.provider }
|
||||
auth.provider.db:
|
||||
class: phpbb_auth_provider_db
|
||||
class: phpbb\auth\provider\db
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- @config
|
||||
|
@ -17,7 +17,7 @@ services:
|
|||
tags:
|
||||
- { name: auth.provider }
|
||||
auth.provider.apache:
|
||||
class: phpbb_auth_provider_apache
|
||||
class: phpbb\auth\provider\apache
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- @config
|
||||
|
@ -28,10 +28,52 @@ services:
|
|||
tags:
|
||||
- { name: auth.provider }
|
||||
auth.provider.ldap:
|
||||
class: phpbb_auth_provider_ldap
|
||||
class: phpbb\auth\provider\ldap
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- @config
|
||||
- @user
|
||||
tags:
|
||||
- { name: auth.provider }
|
||||
auth.provider.oauth:
|
||||
class: phpbb\auth\provider\oauth\oauth
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- @config
|
||||
- @request
|
||||
- @user
|
||||
- %tables.auth_provider_oauth_token_storage%
|
||||
- %tables.auth_provider_oauth_account_assoc%
|
||||
- @auth.provider.oauth.service_collection
|
||||
- %tables.users%
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
tags:
|
||||
- { name: auth.provider }
|
||||
auth.provider.oauth.service_collection:
|
||||
class: phpbb\di\service_collection
|
||||
arguments:
|
||||
- @service_container
|
||||
tags:
|
||||
- { name: service_collection, tag: auth.provider.oauth.service }
|
||||
auth.provider.oauth.service.bitly:
|
||||
class: phpbb\auth\provider\oauth\service\bitly
|
||||
arguments:
|
||||
- @config
|
||||
- @request
|
||||
tags:
|
||||
- { name: auth.provider.oauth.service }
|
||||
auth.provider.oauth.service.facebook:
|
||||
class: phpbb\auth\provider\oauth\service\facebook
|
||||
arguments:
|
||||
- @config
|
||||
- @request
|
||||
tags:
|
||||
- { name: auth.provider.oauth.service }
|
||||
auth.provider.oauth.service.google:
|
||||
class: phpbb\auth\provider\oauth\service\google
|
||||
arguments:
|
||||
- @config
|
||||
- @request
|
||||
tags:
|
||||
- { name: auth.provider.oauth.service }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
services:
|
||||
avatar.driver.gravatar:
|
||||
class: phpbb_avatar_driver_gravatar
|
||||
class: phpbb\avatar\driver\gravatar
|
||||
arguments:
|
||||
- @config
|
||||
- %core.root_path%
|
||||
|
@ -12,7 +12,7 @@ services:
|
|||
- { name: avatar.driver }
|
||||
|
||||
avatar.driver.local:
|
||||
class: phpbb_avatar_driver_local
|
||||
class: phpbb\avatar\driver\local
|
||||
arguments:
|
||||
- @config
|
||||
- %core.root_path%
|
||||
|
@ -24,7 +24,7 @@ services:
|
|||
- { name: avatar.driver }
|
||||
|
||||
avatar.driver.remote:
|
||||
class: phpbb_avatar_driver_remote
|
||||
class: phpbb\avatar\driver\remote
|
||||
arguments:
|
||||
- @config
|
||||
- %core.root_path%
|
||||
|
@ -36,7 +36,7 @@ services:
|
|||
- { name: avatar.driver }
|
||||
|
||||
avatar.driver.upload:
|
||||
class: phpbb_avatar_driver_upload
|
||||
class: phpbb\avatar\driver\upload
|
||||
arguments:
|
||||
- @config
|
||||
- %core.root_path%
|
||||
|
@ -48,7 +48,7 @@ services:
|
|||
- { name: avatar.driver }
|
||||
|
||||
avatar.driver_collection:
|
||||
class: phpbb_di_service_collection
|
||||
class: phpbb\di\service_collection
|
||||
arguments:
|
||||
- @service_container
|
||||
tags:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
services:
|
||||
cron.task.core.prune_all_forums:
|
||||
class: phpbb_cron_task_core_prune_all_forums
|
||||
class: phpbb\cron\task\core\prune_all_forums
|
||||
arguments:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
|
@ -12,7 +12,7 @@ services:
|
|||
- { name: cron.task }
|
||||
|
||||
cron.task.core.prune_forum:
|
||||
class: phpbb_cron_task_core_prune_forum
|
||||
class: phpbb\cron\task\core\prune_forum
|
||||
arguments:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
|
@ -24,7 +24,7 @@ services:
|
|||
- { name: cron.task }
|
||||
|
||||
cron.task.core.queue:
|
||||
class: phpbb_cron_task_core_queue
|
||||
class: phpbb\cron\task\core\queue
|
||||
arguments:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
|
@ -35,7 +35,7 @@ services:
|
|||
- { name: cron.task }
|
||||
|
||||
cron.task.core.tidy_cache:
|
||||
class: phpbb_cron_task_core_tidy_cache
|
||||
class: phpbb\cron\task\core\tidy_cache
|
||||
arguments:
|
||||
- @config
|
||||
- @cache.driver
|
||||
|
@ -45,7 +45,7 @@ services:
|
|||
- { name: cron.task }
|
||||
|
||||
cron.task.core.tidy_database:
|
||||
class: phpbb_cron_task_core_tidy_database
|
||||
class: phpbb\cron\task\core\tidy_database
|
||||
arguments:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
|
@ -56,7 +56,7 @@ services:
|
|||
- { name: cron.task }
|
||||
|
||||
cron.task.core.tidy_search:
|
||||
class: phpbb_cron_task_core_tidy_search
|
||||
class: phpbb\cron\task\core\tidy_search
|
||||
arguments:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
|
@ -70,7 +70,7 @@ services:
|
|||
- { name: cron.task }
|
||||
|
||||
cron.task.core.tidy_sessions:
|
||||
class: phpbb_cron_task_core_tidy_sessions
|
||||
class: phpbb\cron\task\core\tidy_sessions
|
||||
arguments:
|
||||
- @config
|
||||
- @user
|
||||
|
@ -80,7 +80,7 @@ services:
|
|||
- { name: cron.task }
|
||||
|
||||
cron.task.core.tidy_warnings:
|
||||
class: phpbb_cron_task_core_tidy_warnings
|
||||
class: phpbb\cron\task\core\tidy_warnings
|
||||
arguments:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
services:
|
||||
feed.helper:
|
||||
class: phpbb_feed_helper
|
||||
class: phpbb\feed\helper
|
||||
arguments:
|
||||
- @config
|
||||
- @user
|
||||
- %core.root_path%
|
||||
|
||||
feed.factory:
|
||||
class: phpbb_feed_factory
|
||||
class: phpbb\feed\factory
|
||||
arguments:
|
||||
- @service_container
|
||||
- @config
|
||||
- @dbal.conn
|
||||
|
||||
feed.forum:
|
||||
class: phpbb_feed_forum
|
||||
class: phpbb\feed\forum
|
||||
scope: prototype
|
||||
arguments:
|
||||
- @feed.helper
|
||||
|
@ -27,7 +27,7 @@ services:
|
|||
- %core.php_ext%
|
||||
|
||||
feed.forums:
|
||||
class: phpbb_feed_forums
|
||||
class: phpbb\feed\forums
|
||||
scope: prototype
|
||||
arguments:
|
||||
- @feed.helper
|
||||
|
@ -40,7 +40,7 @@ services:
|
|||
- %core.php_ext%
|
||||
|
||||
feed.news:
|
||||
class: phpbb_feed_news
|
||||
class: phpbb\feed\news
|
||||
scope: prototype
|
||||
arguments:
|
||||
- @feed.helper
|
||||
|
@ -53,7 +53,7 @@ services:
|
|||
- %core.php_ext%
|
||||
|
||||
feed.overall:
|
||||
class: phpbb_feed_overall
|
||||
class: phpbb\feed\overall
|
||||
scope: prototype
|
||||
arguments:
|
||||
- @feed.helper
|
||||
|
@ -66,7 +66,7 @@ services:
|
|||
- %core.php_ext%
|
||||
|
||||
feed.topic:
|
||||
class: phpbb_feed_topic
|
||||
class: phpbb\feed\topic
|
||||
scope: prototype
|
||||
arguments:
|
||||
- @feed.helper
|
||||
|
@ -79,7 +79,7 @@ services:
|
|||
- %core.php_ext%
|
||||
|
||||
feed.topics:
|
||||
class: phpbb_feed_topics
|
||||
class: phpbb\feed\topics
|
||||
scope: prototype
|
||||
arguments:
|
||||
- @feed.helper
|
||||
|
@ -92,7 +92,7 @@ services:
|
|||
- %core.php_ext%
|
||||
|
||||
feed.topics_active:
|
||||
class: phpbb_feed_topics_active
|
||||
class: phpbb\feed\topics_active
|
||||
scope: prototype
|
||||
arguments:
|
||||
- @feed.helper
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
services:
|
||||
migrator:
|
||||
class: phpbb_db_migrator
|
||||
class: phpbb\db\migrator
|
||||
arguments:
|
||||
- @config
|
||||
- @dbal.conn
|
||||
|
@ -12,21 +12,21 @@ services:
|
|||
- @migrator.tool_collection
|
||||
|
||||
migrator.tool_collection:
|
||||
class: phpbb_di_service_collection
|
||||
class: phpbb\di\service_collection
|
||||
arguments:
|
||||
- @service_container
|
||||
tags:
|
||||
- { name: service_collection, tag: migrator.tool }
|
||||
|
||||
migrator.tool.config:
|
||||
class: phpbb_db_migration_tool_config
|
||||
class: phpbb\db\migration\tool\config
|
||||
arguments:
|
||||
- @config
|
||||
tags:
|
||||
- { name: migrator.tool }
|
||||
|
||||
migrator.tool.module:
|
||||
class: phpbb_db_migration_tool_module
|
||||
class: phpbb\db\migration\tool\module
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- @cache
|
||||
|
@ -38,7 +38,7 @@ services:
|
|||
- { name: migrator.tool }
|
||||
|
||||
migrator.tool.permission:
|
||||
class: phpbb_db_migration_tool_permission
|
||||
class: phpbb\db\migration\tool\permission
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- @cache
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
services:
|
||||
notification.type_collection:
|
||||
class: phpbb_di_service_collection
|
||||
class: phpbb\di\service_collection
|
||||
arguments:
|
||||
- @service_container
|
||||
tags:
|
||||
- { name: service_collection, tag: notification.type }
|
||||
|
||||
notification.method_collection:
|
||||
class: phpbb_di_service_collection
|
||||
class: phpbb\di\service_collection
|
||||
arguments:
|
||||
- @service_container
|
||||
tags:
|
||||
- { name: service_collection, tag: notification.method }
|
||||
|
||||
notification.type.approve_post:
|
||||
class: phpbb_notification_type_approve_post
|
||||
class: phpbb\notification\type\approve_post
|
||||
scope: prototype # scope MUST be prototype for this to work! # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -32,7 +32,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.approve_topic:
|
||||
class: phpbb_notification_type_approve_topic
|
||||
class: phpbb\notification\type\approve_topic
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -50,7 +50,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.bookmark:
|
||||
class: phpbb_notification_type_bookmark
|
||||
class: phpbb\notification\type\bookmark
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -68,7 +68,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.disapprove_post:
|
||||
class: phpbb_notification_type_disapprove_post
|
||||
class: phpbb\notification\type\disapprove_post
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -86,7 +86,43 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.disapprove_topic:
|
||||
class: phpbb_notification_type_disapprove_topic
|
||||
class: phpbb\notification\type\disapprove_topic
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
- @dbal.conn
|
||||
- @cache.driver
|
||||
- @user
|
||||
- @auth
|
||||
- @config
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
- %tables.notification_types%
|
||||
- %tables.notifications%
|
||||
- %tables.user_notifications%
|
||||
tags:
|
||||
- { name: notification.type }
|
||||
|
||||
notification.type.group_request:
|
||||
class: phpbb\notification\type\group_request
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
- @dbal.conn
|
||||
- @cache.driver
|
||||
- @user
|
||||
- @auth
|
||||
- @config
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
- %tables.notification_types%
|
||||
- %tables.notifications%
|
||||
- %tables.user_notifications%
|
||||
tags:
|
||||
- { name: notification.type }
|
||||
|
||||
notification.type.group_request_approved:
|
||||
class: phpbb\notification\type\group_request_approved
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -104,7 +140,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.pm:
|
||||
class: phpbb_notification_type_pm
|
||||
class: phpbb\notification\type\pm
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -122,7 +158,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.post:
|
||||
class: phpbb_notification_type_post
|
||||
class: phpbb\notification\type\post
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -140,7 +176,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.post_in_queue:
|
||||
class: phpbb_notification_type_post_in_queue
|
||||
class: phpbb\notification\type\post_in_queue
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -158,7 +194,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.quote:
|
||||
class: phpbb_notification_type_quote
|
||||
class: phpbb\notification\type\quote
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -176,7 +212,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.report_pm:
|
||||
class: phpbb_notification_type_report_pm
|
||||
class: phpbb\notification\type\report_pm
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -194,7 +230,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.report_pm_closed:
|
||||
class: phpbb_notification_type_report_pm_closed
|
||||
class: phpbb\notification\type\report_pm_closed
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -212,7 +248,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.report_post:
|
||||
class: phpbb_notification_type_report_post
|
||||
class: phpbb\notification\type\report_post
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -230,7 +266,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.report_post_closed:
|
||||
class: phpbb_notification_type_report_post
|
||||
class: phpbb\notification\type\report_post
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -248,7 +284,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.topic:
|
||||
class: phpbb_notification_type_topic
|
||||
class: phpbb\notification\type\topic
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -266,7 +302,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.type.topic_in_queue:
|
||||
class: phpbb_notification_type_topic_in_queue
|
||||
class: phpbb\notification\type\topic_in_queue
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -284,7 +320,7 @@ services:
|
|||
- { name: notification.type }
|
||||
|
||||
notification.method.email:
|
||||
class: phpbb_notification_method_email
|
||||
class: phpbb\notification\method\email
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
@ -299,7 +335,7 @@ services:
|
|||
- { name: notification.method }
|
||||
|
||||
notification.method.jabber:
|
||||
class: phpbb_notification_method_jabber
|
||||
class: phpbb\notification\method\jabber
|
||||
scope: prototype # scope MUST be prototype for this to work!
|
||||
arguments:
|
||||
- @user_loader
|
||||
|
|
|
@ -10,23 +10,23 @@ imports:
|
|||
|
||||
services:
|
||||
acl.permissions:
|
||||
class: phpbb_permissions
|
||||
class: phpbb\permissions
|
||||
arguments:
|
||||
- @dispatcher
|
||||
- @user
|
||||
|
||||
auth:
|
||||
class: phpbb_auth
|
||||
class: phpbb\auth\auth
|
||||
|
||||
avatar.manager:
|
||||
class: phpbb_avatar_manager
|
||||
class: phpbb\avatar\manager
|
||||
arguments:
|
||||
- @config
|
||||
- @avatar.driver_collection
|
||||
- @service_container
|
||||
|
||||
cache:
|
||||
class: phpbb_cache_service
|
||||
class: phpbb\cache\service
|
||||
arguments:
|
||||
- @cache.driver
|
||||
- @config
|
||||
|
@ -38,12 +38,12 @@ services:
|
|||
class: %cache.driver.class%
|
||||
|
||||
cache.driver.install:
|
||||
class: phpbb_cache_driver_file
|
||||
class: phpbb\cache\driver\file
|
||||
|
||||
class_loader:
|
||||
class: phpbb_class_loader
|
||||
class: phpbb\class_loader
|
||||
arguments:
|
||||
- phpbb_
|
||||
- phpbb\
|
||||
- %core.root_path%includes/
|
||||
- %core.php_ext%
|
||||
calls:
|
||||
|
@ -51,9 +51,9 @@ services:
|
|||
- [set_cache, [@cache.driver]]
|
||||
|
||||
class_loader.ext:
|
||||
class: phpbb_class_loader
|
||||
class: phpbb\class_loader
|
||||
arguments:
|
||||
- phpbb_ext_
|
||||
- \
|
||||
- %core.root_path%ext/
|
||||
- %core.php_ext%
|
||||
calls:
|
||||
|
@ -61,20 +61,20 @@ services:
|
|||
- [set_cache, [@cache.driver]]
|
||||
|
||||
config:
|
||||
class: phpbb_config_db
|
||||
class: phpbb\config\db
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- @cache.driver
|
||||
- %tables.config%
|
||||
|
||||
config_text:
|
||||
class: phpbb_config_db_text
|
||||
class: phpbb\config\db_text
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- %tables.config_text%
|
||||
|
||||
content.visibility:
|
||||
class: phpbb_content_visibility
|
||||
class: phpbb\content_visibility
|
||||
arguments:
|
||||
- @auth
|
||||
- @dbal.conn
|
||||
|
@ -87,43 +87,44 @@ services:
|
|||
- %tables.users%
|
||||
|
||||
controller.helper:
|
||||
class: phpbb_controller_helper
|
||||
class: phpbb\controller\helper
|
||||
arguments:
|
||||
- @template
|
||||
- @user
|
||||
- @config
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
|
||||
controller.resolver:
|
||||
class: phpbb_controller_resolver
|
||||
class: phpbb\controller\resolver
|
||||
arguments:
|
||||
- @user
|
||||
- @service_container
|
||||
- @style
|
||||
- @template
|
||||
|
||||
cron.task_collection:
|
||||
class: phpbb_di_service_collection
|
||||
class: phpbb\di\service_collection
|
||||
arguments:
|
||||
- @service_container
|
||||
tags:
|
||||
- { name: service_collection, tag: cron.task }
|
||||
|
||||
cron.manager:
|
||||
class: phpbb_cron_manager
|
||||
class: phpbb\cron\manager
|
||||
arguments:
|
||||
- @cron.task_collection
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
|
||||
cron.lock_db:
|
||||
class: phpbb_lock_db
|
||||
class: phpbb\lock\db
|
||||
arguments:
|
||||
- cron_lock
|
||||
- @config
|
||||
- @dbal.conn
|
||||
|
||||
dispatcher:
|
||||
class: phpbb_event_dispatcher
|
||||
class: phpbb\event\dispatcher
|
||||
arguments:
|
||||
- @service_container
|
||||
|
||||
|
@ -133,12 +134,12 @@ services:
|
|||
- [sql_connect, [%dbal.dbhost%, %dbal.dbuser%, %dbal.dbpasswd%, %dbal.dbname%, %dbal.dbport%, false, %dbal.new_link%]]
|
||||
|
||||
dbal.tools:
|
||||
class: phpbb_db_tools
|
||||
class: phpbb\db\tools
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
|
||||
event.subscriber_loader:
|
||||
class: phpbb_event_extension_subscriber_loader
|
||||
class: phpbb\event\extension_subscriber_loader
|
||||
arguments:
|
||||
- @dispatcher
|
||||
- @ext.manager
|
||||
|
@ -146,7 +147,7 @@ services:
|
|||
- [load, []]
|
||||
|
||||
ext.manager:
|
||||
class: phpbb_extension_manager
|
||||
class: phpbb\extension\manager
|
||||
arguments:
|
||||
- @service_container
|
||||
- @dbal.conn
|
||||
|
@ -158,7 +159,7 @@ services:
|
|||
- @cache.driver
|
||||
|
||||
ext.finder:
|
||||
class: phpbb_extension_finder
|
||||
class: phpbb\extension\finder
|
||||
arguments:
|
||||
- @ext.manager
|
||||
- @filesystem
|
||||
|
@ -168,16 +169,21 @@ services:
|
|||
- _ext_finder
|
||||
|
||||
filesystem:
|
||||
class: phpbb_filesystem
|
||||
class: phpbb\filesystem
|
||||
arguments:
|
||||
- @symfony_request
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
- %core.adm_relative_path%
|
||||
|
||||
groupposition.legend:
|
||||
class: phpbb_groupposition_legend
|
||||
class: phpbb\groupposition\legend
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- @user
|
||||
|
||||
groupposition.teampage:
|
||||
class: phpbb_groupposition_teampage
|
||||
class: phpbb\groupposition\teampage
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- @user
|
||||
|
@ -190,14 +196,14 @@ services:
|
|||
- @controller.resolver
|
||||
|
||||
hook_finder:
|
||||
class: phpbb_hook_finder
|
||||
class: phpbb\hook\finder
|
||||
arguments:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
- @cache.driver
|
||||
|
||||
kernel_request_subscriber:
|
||||
class: phpbb_event_kernel_request_subscriber
|
||||
class: phpbb\event\kernel_request_subscriber
|
||||
arguments:
|
||||
- @ext.finder
|
||||
- %core.root_path%
|
||||
|
@ -206,7 +212,7 @@ services:
|
|||
- { name: kernel.event_subscriber }
|
||||
|
||||
kernel_exception_subscriber:
|
||||
class: phpbb_event_kernel_exception_subscriber
|
||||
class: phpbb\event\kernel_exception_subscriber
|
||||
arguments:
|
||||
- @template
|
||||
- @user
|
||||
|
@ -214,12 +220,12 @@ services:
|
|||
- { name: kernel.event_subscriber }
|
||||
|
||||
kernel_terminate_subscriber:
|
||||
class: phpbb_event_kernel_terminate_subscriber
|
||||
class: phpbb\event\kernel_terminate_subscriber
|
||||
tags:
|
||||
- { name: kernel.event_subscriber }
|
||||
|
||||
log:
|
||||
class: phpbb_log
|
||||
class: phpbb\log\log
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- @user
|
||||
|
@ -231,7 +237,7 @@ services:
|
|||
- %tables.log%
|
||||
|
||||
notification_manager:
|
||||
class: phpbb_notification_manager
|
||||
class: phpbb\notification\manager
|
||||
arguments:
|
||||
- @notification.type_collection
|
||||
- @notification.method_collection
|
||||
|
@ -247,54 +253,33 @@ services:
|
|||
- %tables.user_notifications%
|
||||
|
||||
php_ini:
|
||||
class: phpbb_php_ini
|
||||
class: phpbb\php\ini
|
||||
|
||||
request:
|
||||
class: phpbb_request
|
||||
class: phpbb\request\request
|
||||
|
||||
style:
|
||||
class: phpbb_style
|
||||
symfony_request:
|
||||
class: phpbb\symfony_request
|
||||
arguments:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
- @config
|
||||
- @user
|
||||
- @style.resource_locator
|
||||
- @style.path_provider_ext
|
||||
- @template
|
||||
|
||||
style.resource_locator:
|
||||
class: phpbb_style_resource_locator
|
||||
|
||||
style.path_provider_ext:
|
||||
class: phpbb_style_extension_path_provider
|
||||
arguments:
|
||||
- @ext.manager
|
||||
- @style.path_provider
|
||||
- %core.root_path%
|
||||
|
||||
style.path_provider:
|
||||
class: phpbb_style_path_provider
|
||||
- @request
|
||||
|
||||
template:
|
||||
class: phpbb_template_twig
|
||||
class: phpbb\template\twig\twig
|
||||
arguments:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
- @filesystem
|
||||
- @config
|
||||
- @user
|
||||
- @template_context
|
||||
- @ext.manager
|
||||
- %core.adm_relative_path%
|
||||
|
||||
template_context:
|
||||
class: phpbb_template_context
|
||||
class: phpbb\template\context
|
||||
|
||||
user:
|
||||
class: phpbb_user
|
||||
class: phpbb\user
|
||||
|
||||
user_loader:
|
||||
class: phpbb_user_loader
|
||||
class: phpbb\user_loader
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- %core.root_path%
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
parameters:
|
||||
tables.auth_provider_oauth_token_storage: %core.table_prefix%oauth_tokens
|
||||
tables.auth_provider_oauth_account_assoc: %core.table_prefix%oauth_accounts
|
||||
tables.config: %core.table_prefix%config
|
||||
tables.config_text: %core.table_prefix%config_text
|
||||
tables.ext: %core.table_prefix%ext
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// FILENAME : compile_template.php
|
||||
// STARTED : Sun Apr 24, 2011
|
||||
// COPYRIGHT : © 2011 phpBB Group
|
||||
// WWW : http://www.phpbb.com/
|
||||
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
define('ANONYMOUS', 1);
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
$phpbb_root_path = './../';
|
||||
|
||||
include($phpbb_root_path . 'includes/template_compile.'.$phpEx);
|
||||
|
||||
$file = $argv[1];
|
||||
|
||||
$compile = new phpbb_template_compile(false);
|
||||
echo $compile->compile_file($file);
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
189
phpBB/develop/namespacify.php
Normal file
189
phpBB/develop/namespacify.php
Normal file
|
@ -0,0 +1,189 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* @copyright (c) 2012 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
$namespace_dir = realpath(__DIR__ . '/../phpbb/');
|
||||
$code_dir = realpath(__DIR__ . '/../');
|
||||
$test_dir = realpath(__DIR__ . '/../../tests/');
|
||||
$config_dir = realpath(__DIR__ . '/../config/');
|
||||
|
||||
function map_class_name($old_class_name, $code_dir)
|
||||
{
|
||||
$parts = explode('_', $old_class_name);
|
||||
$cur_dir = array();
|
||||
$cur_name = array();
|
||||
$in_name = false;
|
||||
foreach ($parts as $i => $part)
|
||||
{
|
||||
if (empty($part))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!$in_name)
|
||||
{
|
||||
$new_dir = array_merge($cur_dir, array($part));
|
||||
$path = $code_dir . '/' . implode('/', $new_dir);
|
||||
|
||||
if (file_exists($path) && is_dir($path))
|
||||
{
|
||||
$cur_dir = $new_dir;
|
||||
}
|
||||
else
|
||||
{
|
||||
$in_name = true;
|
||||
$cur_name[] = $part;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$cur_name[] = $part;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($cur_name) && !empty($cur_dir))
|
||||
{
|
||||
$cur_name[] = $cur_dir[count($cur_dir) - 1];
|
||||
}
|
||||
|
||||
if (file_exists($code_dir . '/' . implode('/', $cur_dir) . '/' . implode('_', $cur_name) . '.php'))
|
||||
{
|
||||
return implode('\\', $cur_dir) . '\\' . implode('_', $cur_name);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
$iterator = new \AppendIterator();
|
||||
$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($code_dir)));
|
||||
$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($test_dir)));
|
||||
$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($config_dir)));
|
||||
|
||||
foreach ($iterator as $file)
|
||||
{
|
||||
if (substr($file->getPath(), 0, 6) === 'vendor')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($file->getExtension() == 'php')
|
||||
{
|
||||
$code = file_get_contents($file->getPathname());
|
||||
$namespaced_file = false;
|
||||
|
||||
if (preg_match('#^' . preg_quote($namespace_dir, '#') . '#', $file->getPath()))
|
||||
{
|
||||
if (preg_match('#^(?:interface|(?:abstract )?class) (phpbb_[a-z0-9_]+)#m', $code, $matches))
|
||||
{
|
||||
$old_class_name = $matches[1];
|
||||
$dirs = explode(DIRECTORY_SEPARATOR, preg_replace('#^' . preg_quote(dirname($namespace_dir) . DIRECTORY_SEPARATOR, '#') . '#', '', $file->getPath()));
|
||||
|
||||
$namespace = implode('\\', $dirs);
|
||||
|
||||
if ($dirs[count($dirs) - 1] == substr($file->getFilename(), 0, -4))
|
||||
{
|
||||
$class_name = preg_replace('#^' . preg_quote(implode('_', $dirs), '#') . '#', $dirs[count($dirs) - 1], $old_class_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$class_name = preg_replace('#^' . preg_quote(implode('_', $dirs), '#') . '_#', '', $old_class_name);
|
||||
}
|
||||
|
||||
$code = preg_replace("#^\*/$#m", "*/\n\nnamespace $namespace;", $code, 1, $count);
|
||||
if ($count != 1)
|
||||
{
|
||||
die("Incorrect replacement count for namespace of $old_class_name");
|
||||
}
|
||||
$code = preg_replace("#^(interface|(?:abstract )?class) $old_class_name#m", "\\1 $class_name", $code, -1, $count);
|
||||
if ($count != 1)
|
||||
{
|
||||
die("Incorrect replacement count for $old_class_name");
|
||||
}
|
||||
|
||||
$namespaced_file = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match_all('#[^a-z0-9_$](phpbb_[a-z0-9_]+)#', $code, $matches))
|
||||
{
|
||||
foreach ($matches[1] as $old_class_name)
|
||||
{
|
||||
$class_name = map_class_name($old_class_name, $code_dir);
|
||||
if ($class_name)
|
||||
{
|
||||
$code = preg_replace("#([^a-z0-9_\$>])$old_class_name([^a-z0-9_])#", '\\1\\\\' . $class_name . '\\2', $code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($namespaced_file)
|
||||
{
|
||||
$code = preg_replace('#new ([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)#', 'new \\\\\\1', $code);
|
||||
$code = preg_replace('#([^a-zA-Z0-9_\\\\$])([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)::#', '\\1\\\\\\2::', $code);
|
||||
$code = preg_replace('#catch \(([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)#', 'catch (\\\\\\1', $code);
|
||||
$code = preg_replace('#(\(|, )([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)(\s\$)#', '\\1\\\\\\2\\3', $code);
|
||||
$code = preg_replace('#(implements |extends )([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)(?=\s*(?:,|\n))#', '\\1\\\\\\2', $code);
|
||||
$abs_classes = array(
|
||||
'Countable',
|
||||
'IteratorAggregate',
|
||||
'ArrayAccess',
|
||||
);
|
||||
$code = preg_replace('#(\s+)(' . implode('|', $abs_classes) . ')#', '\\1\\\\\\2', $code);
|
||||
$rel_classes = array(
|
||||
'ContainerBuilder',
|
||||
'YamlFileLoader',
|
||||
'FileLocator',
|
||||
'Extension',
|
||||
'CompilerPassInterface',
|
||||
'EventSubscriberInterface',
|
||||
'EventDispatcherInterface',
|
||||
'ContainerAwareEventDispatcher',
|
||||
'ContainerInterface',
|
||||
'KernelEvents',
|
||||
'RouteCollection',
|
||||
'ControllerResolverInterface',
|
||||
'Request',
|
||||
'include',
|
||||
'array',
|
||||
'parent',
|
||||
'self',
|
||||
);
|
||||
$code = preg_replace('#([^a-zA-Z0-9_])\\\\((?:' . implode('|', $rel_classes) . ')(?:\s|\(|::|;))#', '\\1\\2', $code);
|
||||
}
|
||||
|
||||
file_put_contents($file->getPathname(), $code);
|
||||
}
|
||||
|
||||
if ($file->getExtension() == 'yml')
|
||||
{
|
||||
$code = file_get_contents($file->getPathname());
|
||||
|
||||
if (preg_match_all('#\s*class:\s*(phpbb_[a-z0-9_]+)\s+#', $code, $matches))
|
||||
{
|
||||
foreach ($matches[1] as $old_class_name)
|
||||
{
|
||||
$class_name = map_class_name($old_class_name, $code_dir);
|
||||
if ($class_name)
|
||||
{
|
||||
$code = preg_replace("#(\s*class:\s*)$old_class_name(\s+)#", "\\1$class_name\\2", $code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
file_put_contents($file->getPathname(), $code);
|
||||
}
|
||||
}
|
||||
|
51
phpBB/develop/rename_interfaces.php
Normal file
51
phpBB/develop/rename_interfaces.php
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* @copyright (c) 2012 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
$code_dir = realpath(__DIR__ . '/../');
|
||||
$test_dir = realpath(__DIR__ . '/../../tests/');
|
||||
$iterator = new \AppendIterator();
|
||||
$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($code_dir)));
|
||||
$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($test_dir)));
|
||||
|
||||
$map = array(
|
||||
'phpbb\request\request_interface' => 'phpbb\request\request_interface',
|
||||
'phpbb\auth\provider\provider_interface' => 'phpbb\auth\provider\provider_interface',
|
||||
'phpbb\avatar\driver\driver_interface' => 'phpbb\avatar\driver\driver_interface',
|
||||
'phpbb\cache\driver\driver_interface' => 'phpbb\cache\driver\driver_interface',
|
||||
'phpbb\db\migration\tool\tool_interface' => 'phpbb\db\migration\tool\tool_interface',
|
||||
'phpbb\extension\extension_interface' => 'phpbb\extension\extension_interface',
|
||||
'phpbb\groupposition\groupposition_interface' => 'phpbb\groupposition\groupposition_interface',
|
||||
'phpbb\log\log_interface' => 'phpbb\log\log_interface',
|
||||
'phpbb\notification\method\method_interface' => 'phpbb\notification\method\method_interface',
|
||||
'phpbb\notification\type\type_interface' => 'phpbb\notification\type\type_interface',
|
||||
'phpbb\request\request_interface' => 'phpbb\request\request_interface',
|
||||
'phpbb\tree\tree_interface' => 'phpbb\tree\tree_interface',
|
||||
);
|
||||
|
||||
foreach ($iterator as $file)
|
||||
{
|
||||
if ($file->getExtension() == 'php')
|
||||
{
|
||||
$code = file_get_contents($file->getPathname());
|
||||
|
||||
foreach ($map as $orig => $new)
|
||||
{
|
||||
$code = preg_replace("#([^a-z0-9_\$])$orig([^a-z0-9_])#i", '\\1' . $new . '\\2', $code);
|
||||
}
|
||||
file_put_contents($file->getPathname(), $code);
|
||||
}
|
||||
}
|
|
@ -145,7 +145,6 @@
|
|||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11265">PHPBB3-11265</a>] - Functional tests do not assert that board installation succeeded</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11269">PHPBB3-11269</a>] - Travis functional test case errors</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11278">PHPBB3-11278</a>] - Firebird tables are not removed correctly on 3.0.9-rc1 update</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11288">PHPBB3-11288</a>] - Search fooled by hyphens</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11291">PHPBB3-11291</a>] - "Could not open input file: ../composer.phar" error during phing's create-package</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11292">PHPBB3-11292</a>] - Newlines removed in display of PM reports, no clickable links in PM reports</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11301">PHPBB3-11301</a>] - "String offset cast occured" error on PHP 5.4</li>
|
||||
|
@ -185,6 +184,9 @@
|
|||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11674">PHPBB3-11674</a>] - Do not include vendor folder if there are no dependencies.</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11524">PHPBB3-11524</a>] - MySQL Upgrader throws warnings on PHP 5.4</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11720">PHPBB3-11720</a>] - Reporting posts leads to white page error</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11769">PHPBB3-11769</a>] - Wrong poster in subscription email when poster is using the Quote button</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11775">PHPBB3-11775</a>] - Error while moving posts to a new topic</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11802">PHPBB3-11802</a>] - Undefined variable $browser in /download/file.php</li>
|
||||
</ul>
|
||||
<h4>Improvement</h4>
|
||||
<ul>
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
<p>To use any methods contained with the <code>auth</code> class it first needs to be instantiated. This is best achieved early in the execution of the script in the following manner:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
$auth = new phpbb_auth();
|
||||
$auth = new phpbb\auth\auth();
|
||||
</pre></div>
|
||||
|
||||
<p>Once an instance of the class has been created you are free to call the various methods it contains. Please note that should you wish to use the <code>auth_admin</code> methods you will need to instantiate this separately but in the same way.</p>
|
||||
|
|
|
@ -179,6 +179,66 @@ ucp_pm_viewmessage_print_head_append
|
|||
* Location: styles/prosilver/template/ucp_pm_viewmessage_print.html
|
||||
* Purpose: Add asset calls directly before the `</head>` tag of the Print PM screen
|
||||
|
||||
ucp_prefs_personal_prepend
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_prefs_personal.html
|
||||
+ styles/subsilver2/template/ucp_prefs_personal.html
|
||||
* Purpose: Add user options to the top of the Edit Global Settings block
|
||||
|
||||
ucp_prefs_personal_append
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_prefs_personal.html
|
||||
+ styles/subsilver2/template/ucp_prefs_personal.html
|
||||
* Purpose: Add user options to the bottom of the Edit Global Settings block
|
||||
|
||||
ucp_prefs_post_prepend
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_prefs_post.html
|
||||
+ styles/subsilver2/template/ucp_prefs_post.html
|
||||
* Purpose: Add user options to the top of the Edit Posting Defaults block
|
||||
|
||||
ucp_prefs_post_append
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_prefs_post.html
|
||||
+ styles/subsilver2/template/ucp_prefs_post.html
|
||||
* Purpose: Add user options to the bottom of the Edit Posting Defaults block
|
||||
|
||||
ucp_prefs_view_radio_buttons_prepend
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_prefs_view.html
|
||||
+ styles/subsilver2/template/ucp_prefs_view.html
|
||||
* Purpose: Add options to the top of the radio buttons block of the Edit
|
||||
Display Options screen
|
||||
|
||||
ucp_prefs_view_radio_buttons_append
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_prefs_view.html
|
||||
+ styles/subsilver2/template/ucp_prefs_view.html
|
||||
* Purpose: Add options to the bottom of the radio buttons block of the Edit
|
||||
Display Options screen
|
||||
|
||||
ucp_prefs_view_select_menu_prepend
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_prefs_view.html
|
||||
+ styles/subsilver2/template/ucp_prefs_view.html
|
||||
* Purpose: Add options to the top of the drop-down lists block of the Edit
|
||||
Display Options screen
|
||||
|
||||
ucp_prefs_view_select_menu_append
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_prefs_view.html
|
||||
+ styles/subsilver2/template/ucp_prefs_view.html
|
||||
* Purpose: Add options to the bottom of the drop-down lists block of the Edit
|
||||
Display Options screen
|
||||
|
||||
viewtopic_print_head_append
|
||||
===
|
||||
* Location: styles/prosilver/template/viewtopic_print.html
|
||||
|
|
|
@ -50,9 +50,9 @@ if (isset($_GET['avatar']))
|
|||
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
||||
|
||||
// Setup class loader first
|
||||
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader->register();
|
||||
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
|
||||
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
|
||||
$phpbb_class_loader_ext->register();
|
||||
|
||||
// Set up container
|
||||
|
|
|
@ -1472,7 +1472,7 @@ class acp_attachments
|
|||
$ip_list = array_unique(explode("\n", $ips));
|
||||
$ip_list_log = implode(', ', $ip_list);
|
||||
|
||||
$ip_exclude = (int) $request->variable('ipexclude', false, false, phpbb_request_interface::POST);
|
||||
$ip_exclude = (int) $request->variable('ipexclude', false, false, \phpbb\request\request_interface::POST);
|
||||
|
||||
$iplist = array();
|
||||
$hostlist = array();
|
||||
|
|
|
@ -275,7 +275,7 @@ class acp_bbcodes
|
|||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $user->lang['BBCODE_DELETED'],
|
||||
|
|
|
@ -328,6 +328,7 @@ class acp_board
|
|||
'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int:60:9999999999', 'type' => 'number:60:9999999999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
|
||||
'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
|
||||
'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
|
||||
'read_notification_expire_days' => array('lang' => 'READ_NOTIFICATION_EXPIRE_DAYS', 'validate' => 'int:0', 'type' => 'number:0', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
|
||||
|
||||
'legend2' => 'GENERAL_OPTIONS',
|
||||
'load_notifications' => array('lang' => 'LOAD_NOTIFICATIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
@ -375,6 +376,7 @@ class acp_board
|
|||
'use_system_cron' => array('lang' => 'USE_SYSTEM_CRON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
||||
'legend2' => 'PATH_SETTINGS',
|
||||
'enable_mod_rewrite' => array('lang' => 'MOD_REWRITE_ENABLE', 'validate' => 'bool', 'type' => 'custom', 'method' => 'enable_mod_rewrite', 'explain' => true),
|
||||
'smilies_path' => array('lang' => 'SMILIES_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
'icons_path' => array('lang' => 'ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
|
@ -658,6 +660,13 @@ class acp_board
|
|||
$auth_tpl = $provider->get_acp_template($this->new_config);
|
||||
if ($auth_tpl)
|
||||
{
|
||||
if (array_key_exists('BLOCK_VAR_NAME', $auth_tpl))
|
||||
{
|
||||
foreach ($auth_tpl['BLOCK_VARS'] as $block_vars)
|
||||
{
|
||||
$template->assign_block_vars($auth_tpl['BLOCK_VAR_NAME'], $block_vars);
|
||||
}
|
||||
}
|
||||
$template->assign_vars($auth_tpl['TEMPLATE_VARS']);
|
||||
$template->assign_block_vars('auth_tpl', array(
|
||||
'TEMPLATE_FILE' => $auth_tpl['TEMPLATE_FILE'],
|
||||
|
@ -679,7 +688,7 @@ class acp_board
|
|||
|
||||
foreach ($auth_providers as $key => $value)
|
||||
{
|
||||
if (!($value instanceof phpbb_auth_provider_interface))
|
||||
if (!($value instanceof \phpbb\auth\provider\provider_interface))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -994,4 +1003,51 @@ class acp_board
|
|||
$cache->destroy('sql', FORUMS_TABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Option to enable/disable removal of 'app.php' from URLs
|
||||
*
|
||||
* Note that if mod_rewrite is on, URLs without app.php will still work,
|
||||
* but any paths generated by the controller helper url() method will not
|
||||
* contain app.php.
|
||||
*
|
||||
* @param int $value The current config value
|
||||
* @param string $key The config key
|
||||
* @return string The HTML for the form field
|
||||
*/
|
||||
function enable_mod_rewrite($value, $key)
|
||||
{
|
||||
global $user, $config;
|
||||
|
||||
// Determine whether mod_rewrite is enabled on the server
|
||||
// NOTE: This only works on Apache servers on which PHP is NOT
|
||||
// installed as CGI. In that case, there is no way for PHP to
|
||||
// determine whether or not the Apache module is enabled.
|
||||
//
|
||||
// To be clear on the value of $mod_rewite:
|
||||
// null = Cannot determine whether or not the server has mod_rewrite
|
||||
// enabled
|
||||
// false = Can determine that the server does NOT have mod_rewrite
|
||||
// enabled
|
||||
// true = Can determine that the server DOES have mod_rewrite_enabled
|
||||
$mod_rewrite = null;
|
||||
if (function_exists('apache_get_modules'))
|
||||
{
|
||||
$mod_rewrite = (bool) in_array('mod_rewrite', apache_get_modules());
|
||||
}
|
||||
|
||||
// If $message is false, mod_rewrite is enabled.
|
||||
// Otherwise, it is not and we need to:
|
||||
// 1) disable the form field
|
||||
// 2) make sure the config value is set to 0
|
||||
// 3) append the message to the return
|
||||
$value = ($mod_rewrite === false) ? 0 : $value;
|
||||
$message = $mod_rewrite === null ? 'MOD_REWRITE_INFORMATION_UNAVAILABLE' : ($mod_rewrite === false ? 'MOD_REWRITE_DISABLED' : false);
|
||||
|
||||
// Let's do some friendly HTML injection if we want to disable the
|
||||
// form field because h_radio() has no pretty way of doing so
|
||||
$field_name = 'config[enable_mod_rewrite]' . ($message === 'MOD_REWRITE_DISABLED' ? '" disabled="disabled' : '');
|
||||
|
||||
return h_radio($field_name, array(1 => 'YES', 0 => 'NO'), $value) .
|
||||
($message !== false ? '<br /><span>' . $user->lang($message) . '</span>' : '');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@ class acp_bots
|
|||
|
||||
if ($request->is_ajax() && ($action == 'activate' || $action == 'deactivate'))
|
||||
{
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'text' => $user->lang['BOT_' . (($action == 'activate') ? 'DE' : '') . 'ACTIVATE'],
|
||||
));
|
||||
|
|
|
@ -28,7 +28,7 @@ class acp_database
|
|||
global $cache, $db, $user, $auth, $template, $table_prefix;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
|
||||
$this->db_tools = new phpbb_db_tools($db);
|
||||
$this->db_tools = new \phpbb\db\tools($db);
|
||||
|
||||
$user->add_lang('acp/database');
|
||||
|
||||
|
|
|
@ -58,13 +58,13 @@ class acp_extensions
|
|||
// If they've specified an extension, let's load the metadata manager and validate it.
|
||||
if ($ext_name)
|
||||
{
|
||||
$md_manager = new phpbb_extension_metadata_manager($ext_name, $config, $phpbb_extension_manager, $template, $phpbb_root_path);
|
||||
$md_manager = new \phpbb\extension\metadata_manager($ext_name, $config, $phpbb_extension_manager, $template, $phpbb_root_path);
|
||||
|
||||
try
|
||||
{
|
||||
$md_manager->get_metadata('all');
|
||||
}
|
||||
catch(phpbb_extension_exception $e)
|
||||
catch(\phpbb\extension\exception $e)
|
||||
{
|
||||
trigger_error($e);
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ class acp_extensions
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (phpbb_db_migration_exception $e)
|
||||
catch (\phpbb\db\migration\exception $e)
|
||||
{
|
||||
$template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($user));
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ class acp_extensions
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (phpbb_db_migration_exception $e)
|
||||
catch (\phpbb\db\migration\exception $e)
|
||||
{
|
||||
$template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($user));
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ class acp_extensions
|
|||
* @param $phpbb_extension_manager An instance of the extension manager
|
||||
* @return null
|
||||
*/
|
||||
public function list_enabled_exts(phpbb_extension_manager $phpbb_extension_manager)
|
||||
public function list_enabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
|
||||
{
|
||||
foreach ($phpbb_extension_manager->all_enabled() as $name => $location)
|
||||
{
|
||||
|
@ -236,7 +236,7 @@ class acp_extensions
|
|||
'PURGE' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name),
|
||||
));
|
||||
}
|
||||
catch(phpbb_extension_exception $e)
|
||||
catch(\phpbb\extension\exception $e)
|
||||
{
|
||||
$this->template->assign_block_vars('disabled', array(
|
||||
'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
|
||||
|
@ -251,7 +251,7 @@ class acp_extensions
|
|||
* @param $phpbb_extension_manager An instance of the extension manager
|
||||
* @return null
|
||||
*/
|
||||
public function list_disabled_exts(phpbb_extension_manager $phpbb_extension_manager)
|
||||
public function list_disabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
|
||||
{
|
||||
foreach ($phpbb_extension_manager->all_disabled() as $name => $location)
|
||||
{
|
||||
|
@ -270,7 +270,7 @@ class acp_extensions
|
|||
'PURGE' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name),
|
||||
));
|
||||
}
|
||||
catch(phpbb_extension_exception $e)
|
||||
catch(\phpbb\extension\exception $e)
|
||||
{
|
||||
$this->template->assign_block_vars('disabled', array(
|
||||
'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
|
||||
|
@ -285,7 +285,7 @@ class acp_extensions
|
|||
* @param $phpbb_extension_manager An instance of the extension manager
|
||||
* @return null
|
||||
*/
|
||||
public function list_available_exts(phpbb_extension_manager $phpbb_extension_manager)
|
||||
public function list_available_exts(\phpbb\extension\manager $phpbb_extension_manager)
|
||||
{
|
||||
$uninstalled = array_diff_key($phpbb_extension_manager->all_available(), $phpbb_extension_manager->all_configured());
|
||||
|
||||
|
@ -305,7 +305,7 @@ class acp_extensions
|
|||
'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name),
|
||||
));
|
||||
}
|
||||
catch(phpbb_extension_exception $e)
|
||||
catch(\phpbb\extension\exception $e)
|
||||
{
|
||||
$this->template->assign_block_vars('disabled', array(
|
||||
'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
|
||||
|
|
|
@ -55,7 +55,6 @@ class acp_forums
|
|||
$total = request_var('total', 0);
|
||||
|
||||
$this->display_progress_bar($start, $total);
|
||||
exit;
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
@ -269,7 +268,7 @@ class acp_forums
|
|||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array('success' => ($move_forum_name !== false)));
|
||||
}
|
||||
|
||||
|
|
|
@ -324,7 +324,7 @@ class acp_groups
|
|||
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
|
||||
|
||||
// This is normalised data, without the group_ prefix
|
||||
$avatar_data = phpbb_avatar_manager::clean_row($group_row);
|
||||
$avatar_data = \phpbb\avatar\manager::clean_row($group_row);
|
||||
}
|
||||
|
||||
|
||||
|
@ -891,7 +891,7 @@ class acp_groups
|
|||
break;
|
||||
}
|
||||
}
|
||||
catch (phpbb_groupposition_exception $exception)
|
||||
catch (\phpbb\groupposition\exception $exception)
|
||||
{
|
||||
trigger_error($user->lang($exception->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
@ -919,7 +919,7 @@ class acp_groups
|
|||
break;
|
||||
}
|
||||
}
|
||||
catch (phpbb_groupposition_exception $exception)
|
||||
catch (\phpbb\groupposition\exception $exception)
|
||||
{
|
||||
trigger_error($user->lang($exception->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
@ -943,7 +943,7 @@ class acp_groups
|
|||
|
||||
if (($action == 'move_up' || $action == 'move_down') && $request->is_ajax())
|
||||
{
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array('success' => true));
|
||||
}
|
||||
|
||||
|
@ -961,7 +961,7 @@ class acp_groups
|
|||
$template->assign_block_vars('legend', array(
|
||||
'GROUP_NAME' => $group_name,
|
||||
'GROUP_COLOUR' => ($row['group_colour']) ? '#' . $row['group_colour'] : '',
|
||||
'GROUP_TYPE' => $user->lang[phpbb_groupposition_legend::group_type_language($row['group_type'])],
|
||||
'GROUP_TYPE' => $user->lang[\phpbb\groupposition\legend::group_type_language($row['group_type'])],
|
||||
|
||||
'U_MOVE_DOWN' => "{$this->u_action}&field=legend&action=move_down&g=" . $row['group_id'],
|
||||
'U_MOVE_UP' => "{$this->u_action}&field=legend&action=move_up&g=" . $row['group_id'],
|
||||
|
@ -1004,7 +1004,7 @@ class acp_groups
|
|||
if ($row['group_id'])
|
||||
{
|
||||
$group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
|
||||
$group_type = $user->lang[phpbb_groupposition_teampage::group_type_language($row['group_type'])];
|
||||
$group_type = $user->lang[\phpbb\groupposition\teampage::group_type_language($row['group_type'])];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -338,7 +338,7 @@ class acp_icons
|
|||
$image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array('' => 0)) : array();
|
||||
|
||||
// Ok, add the relevant bits if we are adding new codes to existing emoticons...
|
||||
if ($request->variable('add_additional_code', false, false, phpbb_request_interface::POST))
|
||||
if ($request->variable('add_additional_code', false, false, \phpbb\request\request_interface::POST))
|
||||
{
|
||||
$add_image = request_var('add_image', '');
|
||||
$add_code = utf8_normalize_nfc(request_var('add_code', '', true));
|
||||
|
@ -354,7 +354,7 @@ class acp_icons
|
|||
$image_width[$add_image] = request_var('add_width', 0);
|
||||
$image_height[$add_image] = request_var('add_height', 0);
|
||||
|
||||
if ($request->variable('add_display_on_posting', false, false, phpbb_request_interface::POST))
|
||||
if ($request->variable('add_display_on_posting', false, false, \phpbb\request\request_interface::POST))
|
||||
{
|
||||
$image_display_on_posting[$add_image] = 1;
|
||||
}
|
||||
|
@ -785,7 +785,7 @@ class acp_icons
|
|||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $notice,
|
||||
|
|
|
@ -161,7 +161,7 @@ class acp_language
|
|||
'method' => $method)
|
||||
);
|
||||
|
||||
$hidden_data .= build_hidden_fields(array('entry' => $request->variable('entry', $request_default, true, phpbb_request_interface::POST)));
|
||||
$hidden_data .= build_hidden_fields(array('entry' => $request->variable('entry', $request_default, true, \phpbb\request\request_interface::POST)));
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_UPLOAD' => true,
|
||||
|
@ -218,7 +218,7 @@ class acp_language
|
|||
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$entry_value = $request->variable('entry', $request_default, true, phpbb_request_interface::POST);
|
||||
$entry_value = $request->variable('entry', $request_default, true, \phpbb\request\request_interface::POST);
|
||||
|
||||
if (!$lang_id || !$entry_value)
|
||||
{
|
||||
|
|
|
@ -35,8 +35,8 @@ class acp_logs
|
|||
$forum_id = request_var('f', 0);
|
||||
$topic_id = request_var('t', 0);
|
||||
$start = request_var('start', 0);
|
||||
$deletemark = $request->variable('delmarked', false, false, phpbb_request_interface::POST);
|
||||
$deleteall = $request->variable('delall', false, false, phpbb_request_interface::POST);
|
||||
$deletemark = $request->variable('delmarked', false, false, \phpbb\request\request_interface::POST);
|
||||
$deleteall = $request->variable('delall', false, false, \phpbb\request\request_interface::POST);
|
||||
$marked = request_var('mark', array(0));
|
||||
|
||||
// Sort keys
|
||||
|
|
|
@ -375,7 +375,7 @@ class acp_modules
|
|||
{
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang('ERROR'),
|
||||
'MESSAGE_TEXT' => implode('<br />', $errors),
|
||||
|
@ -565,7 +565,7 @@ class acp_modules
|
|||
{
|
||||
// Skip entries we do not need if we know the module we are
|
||||
// looking for
|
||||
if ($module && strpos($cur_module, $module) === false)
|
||||
if ($module && strpos(str_replace('\\', '_', $cur_module), $module) === false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -679,7 +679,7 @@ class acp_permissions
|
|||
list($ug_id, ) = each($psubmit);
|
||||
list($forum_id, ) = each($psubmit[$ug_id]);
|
||||
|
||||
$settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, phpbb_request_interface::POST);
|
||||
$settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, \phpbb\request\request_interface::POST);
|
||||
if (empty($settings) || empty($settings[$ug_id]) || empty($settings[$ug_id][$forum_id]))
|
||||
{
|
||||
trigger_error('WRONG_PERMISSION_SETTING_FORMAT', E_USER_WARNING);
|
||||
|
@ -688,7 +688,7 @@ class acp_permissions
|
|||
$auth_settings = $settings[$ug_id][$forum_id];
|
||||
|
||||
// Do we have a role we want to set?
|
||||
$roles = $request->variable('role', array(0 => array(0 => 0)), false, phpbb_request_interface::POST);
|
||||
$roles = $request->variable('role', array(0 => array(0 => 0)), false, \phpbb\request\request_interface::POST);
|
||||
$assigned_role = (isset($roles[$ug_id][$forum_id])) ? (int) $roles[$ug_id][$forum_id] : 0;
|
||||
|
||||
// Do the admin want to set these permissions to other items too?
|
||||
|
@ -760,8 +760,8 @@ class acp_permissions
|
|||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$auth_settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, phpbb_request_interface::POST);
|
||||
$auth_roles = $request->variable('role', array(0 => array(0 => 0)), false, phpbb_request_interface::POST);
|
||||
$auth_settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, \phpbb\request\request_interface::POST);
|
||||
$auth_roles = $request->variable('role', array(0 => array(0 => 0)), false, \phpbb\request\request_interface::POST);
|
||||
$ug_ids = $forum_ids = array();
|
||||
|
||||
// We need to go through the auth settings
|
||||
|
@ -1103,7 +1103,7 @@ class acp_permissions
|
|||
{
|
||||
if ($user_id != $user->data['user_id'])
|
||||
{
|
||||
$auth2 = new phpbb_auth();
|
||||
$auth2 = new \phpbb\auth\auth();
|
||||
$auth2->acl($userdata);
|
||||
$auth_setting = $auth2->acl_get($permission);
|
||||
}
|
||||
|
|
|
@ -245,7 +245,7 @@ class acp_profile
|
|||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new phpbb_json_response();
|
||||
$json_response = new \phpbb\json_response();
|
||||
$json_response->send(array(
|
||||
'text' => $user->lang('DEACTIVATE'),
|
||||
));
|
||||
|
@ -277,7 +277,7 @@ class acp_profile
|
|||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new phpbb_json_response();
|
||||
$json_response = new \phpbb\json_response();
|
||||
$json_response->send(array(
|
||||
'text' => $user->lang('ACTIVATE'),
|
||||
));
|
||||
|
@ -510,7 +510,7 @@ class acp_profile
|
|||
$cp->vars['field_default_value_month'] = $now['mon'];
|
||||
$cp->vars['field_default_value_year'] = $now['year'];
|
||||
$var = 'now';
|
||||
$request->overwrite('field_default_value', $var, phpbb_request_interface::POST);
|
||||
$request->overwrite('field_default_value', $var, \phpbb\request\request_interface::POST);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -520,7 +520,7 @@ class acp_profile
|
|||
$cp->vars['field_default_value_month'] = request_var('field_default_value_month', 0);
|
||||
$cp->vars['field_default_value_year'] = request_var('field_default_value_year', 0);
|
||||
$var = sprintf('%2d-%2d-%4d', $cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']);
|
||||
$request->overwrite('field_default_value', $var, phpbb_request_interface::POST);
|
||||
$request->overwrite('field_default_value', $var, \phpbb\request\request_interface::POST);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -125,7 +125,7 @@ class acp_ranks
|
|||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $user->lang['RANK_REMOVED'],
|
||||
|
|
|
@ -1604,7 +1604,7 @@ class acp_users
|
|||
|| $user_row['user_allow_viewonline'] && !$sql_ary['user_allow_viewonline'])
|
||||
{
|
||||
// We also need to check if the user has the permission to cloak.
|
||||
$user_auth = new phpbb_auth();
|
||||
$user_auth = new \phpbb\auth\auth();
|
||||
$user_auth->acl($user_row);
|
||||
|
||||
$session_sql_ary = array(
|
||||
|
@ -1742,7 +1742,7 @@ class acp_users
|
|||
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
|
||||
|
||||
// This is normalised data, without the user_ prefix
|
||||
$avatar_data = phpbb_avatar_manager::clean_row($user_row);
|
||||
$avatar_data = \phpbb\avatar\manager::clean_row($user_row);
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
|
|||
* ACP Permission/Auth class
|
||||
* @package phpBB3
|
||||
*/
|
||||
class auth_admin extends phpbb_auth
|
||||
class auth_admin extends \phpbb\auth\auth
|
||||
{
|
||||
/**
|
||||
* Init auth settings
|
||||
|
@ -130,7 +130,7 @@ class auth_admin extends phpbb_auth
|
|||
{
|
||||
if ($user->data['user_id'] != $userdata['user_id'])
|
||||
{
|
||||
$auth2 = new phpbb_auth();
|
||||
$auth2 = new \phpbb\auth\auth();
|
||||
$auth2->acl($userdata);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -126,17 +126,14 @@ class bbcode
|
|||
*/
|
||||
function bbcode_cache_init()
|
||||
{
|
||||
global $phpbb_root_path, $phpEx, $config, $user, $phpbb_extension_manager;
|
||||
global $phpbb_root_path, $phpEx, $config, $user, $phpbb_extension_manager, $phpbb_filesystem;
|
||||
|
||||
if (empty($this->template_filename))
|
||||
{
|
||||
$this->template_bitfield = new bitfield($user->style['bbcode_bitfield']);
|
||||
|
||||
$style_resource_locator = new phpbb_style_resource_locator();
|
||||
$style_path_provider = new phpbb_style_extension_path_provider($phpbb_extension_manager, new phpbb_style_path_provider(), $phpbb_root_path);
|
||||
$template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context(), $phpbb_extension_manager);
|
||||
$style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, $style_path_provider, $template);
|
||||
$style->set_style();
|
||||
$template = new phpbb\template\twig\twig($phpbb_filesystem, $config, $user, new phpbb\template\context(), $phpbb_extension_manager);
|
||||
$template->set_style();
|
||||
$template->set_filenames(array('bbcode.html' => 'bbcode.html'));
|
||||
$this->template_filename = $template->get_source_file_for_handle('bbcode.html');
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ class phpbb_captcha_gd extends phpbb_default_captcha
|
|||
|
||||
$config_old = $config;
|
||||
|
||||
$config = new phpbb_config(array());
|
||||
$config = new \phpbb\config\config(array());
|
||||
foreach ($config_old as $key => $value)
|
||||
{
|
||||
$config->set($key, $value);
|
||||
|
|
|
@ -112,7 +112,7 @@ class phpbb_captcha_qa
|
|||
{
|
||||
global $db;
|
||||
|
||||
$db_tool = new phpbb_db_tools($db);
|
||||
$db_tool = new \phpbb\db\tools($db);
|
||||
|
||||
return $db_tool->sql_table_exists(CAPTCHA_QUESTIONS_TABLE);
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ class phpbb_captcha_qa
|
|||
{
|
||||
global $db;
|
||||
|
||||
$db_tool = new phpbb_db_tools($db);
|
||||
$db_tool = new \phpbb\db\tools($db);
|
||||
|
||||
$tables = array(CAPTCHA_QUESTIONS_TABLE, CAPTCHA_ANSWERS_TABLE, CAPTCHA_QA_CONFIRM_TABLE);
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ define('LOGIN_CONTINUE', 1);
|
|||
define('LOGIN_BREAK', 2);
|
||||
define('LOGIN_SUCCESS', 3);
|
||||
define('LOGIN_SUCCESS_CREATE_PROFILE', 20);
|
||||
define('LOGIN_SUCCESS_LINK_PROFILE', 21);
|
||||
define('LOGIN_ERROR_USERNAME', 10);
|
||||
define('LOGIN_ERROR_PASSWORD', 11);
|
||||
define('LOGIN_ERROR_ACTIVE', 12);
|
||||
|
|
1219
phpBB/includes/db/schema_data.php
Normal file
1219
phpBB/includes/db/schema_data.php
Normal file
File diff suppressed because it is too large
Load diff
|
@ -7,8 +7,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
|
@ -26,13 +24,13 @@ if (!defined('IN_PHPBB'))
|
|||
function set_var(&$result, $var, $type, $multibyte = false)
|
||||
{
|
||||
// no need for dependency injection here, if you have the object, call the method yourself!
|
||||
$type_cast_helper = new phpbb_request_type_cast_helper();
|
||||
$type_cast_helper = new \phpbb\request\type_cast_helper();
|
||||
$type_cast_helper->set_var($result, $var, $type, $multibyte);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper function of phpbb_request::variable which exists for backwards compatability.
|
||||
* See {@link phpbb_request_interface::variable phpbb_request_interface::variable} for
|
||||
* Wrapper function of \phpbb\request\request::variable which exists for backwards compatability.
|
||||
* See {@link \phpbb\request\request_interface::variable \phpbb\request\request_interface::variable} for
|
||||
* documentation of this function's use.
|
||||
*
|
||||
* @deprecated
|
||||
|
@ -40,20 +38,20 @@ function set_var(&$result, $var, $type, $multibyte = false)
|
|||
* If the value is an array this may be an array of indizes which will give
|
||||
* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
|
||||
* then specifying array("var", 1) as the name will return "a".
|
||||
* If you pass an instance of {@link phpbb_request_interface phpbb_request_interface}
|
||||
* If you pass an instance of {@link \phpbb\request\request_interface phpbb_request_interface}
|
||||
* as this parameter it will overwrite the current request class instance. If you do
|
||||
* not do so, it will create its own instance (but leave superglobals enabled).
|
||||
* @param mixed $default A default value that is returned if the variable was not set.
|
||||
* This function will always return a value of the same type as the default.
|
||||
* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
|
||||
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
|
||||
* @param bool $cookie This param is mapped to phpbb_request_interface::COOKIE as the last param for
|
||||
* phpbb_request_interface::variable for backwards compatability reasons.
|
||||
* @param phpbb_request_interface|null|false If an instance of phpbb_request_interface is given the instance is stored in
|
||||
* @param bool $cookie This param is mapped to \phpbb\request\request_interface::COOKIE as the last param for
|
||||
* \phpbb\request\request_interface::variable for backwards compatability reasons.
|
||||
* @param \phpbb\request\request_interface|null|false If an instance of \phpbb\request\request_interface is given the instance is stored in
|
||||
* a static variable and used for all further calls where this parameters is null. Until
|
||||
* the function is called with an instance it automatically creates a new phpbb_request
|
||||
* the function is called with an instance it automatically creates a new \phpbb\request\request
|
||||
* instance on every call. By passing false this per-call instantiation can be restored
|
||||
* after having passed in a phpbb_request_interface instance.
|
||||
* after having passed in a \phpbb\request\request_interface instance.
|
||||
*
|
||||
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
|
||||
* the same as that of $default. If the variable is not set $default is returned.
|
||||
|
@ -64,7 +62,7 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false, $
|
|||
// the only real code is the function call which maps this function to a method.
|
||||
static $static_request = null;
|
||||
|
||||
if ($request instanceof phpbb_request_interface)
|
||||
if ($request instanceof \phpbb\request\request_interface)
|
||||
{
|
||||
$static_request = $request;
|
||||
|
||||
|
@ -90,10 +88,10 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false, $
|
|||
{
|
||||
// false param: enable super globals, so the created request class does not
|
||||
// make super globals inaccessible everywhere outside this function.
|
||||
$tmp_request = new phpbb_request(new phpbb_request_type_cast_helper(), false);
|
||||
$tmp_request = new \phpbb\request\request(new \phpbb\request\type_cast_helper(), false);
|
||||
}
|
||||
|
||||
return $tmp_request->variable($var_name, $default, $multibyte, ($cookie) ? phpbb_request_interface::COOKIE : phpbb_request_interface::REQUEST);
|
||||
return $tmp_request->variable($var_name, $default, $multibyte, ($cookie) ? \phpbb\request\request_interface::COOKIE : \phpbb\request\request_interface::REQUEST);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,7 +110,7 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false, $
|
|||
*
|
||||
* @deprecated
|
||||
*/
|
||||
function set_config($config_name, $config_value, $is_dynamic = false, phpbb_config $set_config = null)
|
||||
function set_config($config_name, $config_value, $is_dynamic = false, \phpbb\config\config $set_config = null)
|
||||
{
|
||||
static $config = null;
|
||||
|
||||
|
@ -142,7 +140,7 @@ function set_config($config_name, $config_value, $is_dynamic = false, phpbb_conf
|
|||
*
|
||||
* @deprecated
|
||||
*/
|
||||
function set_config_count($config_name, $increment, $is_dynamic = false, phpbb_config $set_config = null)
|
||||
function set_config_count($config_name, $increment, $is_dynamic = false, \phpbb\config\config $set_config = null)
|
||||
{
|
||||
static $config = null;
|
||||
|
||||
|
@ -1067,12 +1065,19 @@ function phpbb_clean_path($path)
|
|||
else
|
||||
{
|
||||
// The container is not yet loaded, use a new instance
|
||||
if (!class_exists('phpbb_filesystem'))
|
||||
if (!class_exists('\phpbb\filesystem'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
require($phpbb_root_path . 'includes/filesystem.' . $phpEx);
|
||||
}
|
||||
$phpbb_filesystem = new phpbb_filesystem();
|
||||
|
||||
$phpbb_filesystem = new phpbb\filesystem(
|
||||
new phpbb\symfony_request(
|
||||
new phpbb\request\request()
|
||||
),
|
||||
$phpbb_root_path,
|
||||
$phpEx
|
||||
);
|
||||
}
|
||||
|
||||
return $phpbb_filesystem->clean_path($path);
|
||||
|
@ -1253,7 +1258,7 @@ function tz_select($default = '', $truncate = false)
|
|||
/**
|
||||
* Options to pick a timezone and date/time
|
||||
*
|
||||
* @param phpbb_user $user Object of the current user
|
||||
* @param \phpbb\user $user Object of the current user
|
||||
* @param string $default A timezone to select
|
||||
* @param boolean $truncate Shall we truncate the options text
|
||||
*
|
||||
|
@ -1272,7 +1277,7 @@ function phpbb_timezone_select($user, $default = '', $truncate = false)
|
|||
foreach ($unsorted_timezones as $timezone)
|
||||
{
|
||||
$tz = new DateTimeZone($timezone);
|
||||
$dt = new phpbb_datetime($user, 'now', $tz);
|
||||
$dt = new \phpbb\datetime($user, 'now', $tz);
|
||||
$offset = $dt->getOffset();
|
||||
$current_time = $dt->format($user->lang['DATETIME_FORMAT'], true);
|
||||
$offset_string = phpbb_format_timezone_offset($offset);
|
||||
|
@ -1391,7 +1396,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
|||
}
|
||||
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||
{
|
||||
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
|
||||
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
|
||||
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
|
||||
|
||||
unset($tracking_topics['tf']);
|
||||
|
@ -1400,7 +1405,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
|||
$tracking_topics['l'] = base_convert($post_time - $config['board_startdate'], 10, 36);
|
||||
|
||||
$user->set_cookie('track', tracking_serialize($tracking_topics), $post_time + 31536000);
|
||||
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking_topics), phpbb_request_interface::COOKIE);
|
||||
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking_topics), \phpbb\request\request_interface::COOKIE);
|
||||
|
||||
unset($tracking_topics);
|
||||
|
||||
|
@ -1503,7 +1508,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
|||
}
|
||||
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||
{
|
||||
$tracking = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
|
||||
$tracking = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
|
||||
$tracking = ($tracking) ? tracking_unserialize($tracking) : array();
|
||||
|
||||
foreach ($forum_id as $f_id)
|
||||
|
@ -1534,7 +1539,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
|||
}
|
||||
|
||||
$user->set_cookie('track', tracking_serialize($tracking), $post_time + 31536000);
|
||||
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), phpbb_request_interface::COOKIE);
|
||||
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), \phpbb\request\request_interface::COOKIE);
|
||||
|
||||
unset($tracking);
|
||||
}
|
||||
|
@ -1591,7 +1596,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
|||
}
|
||||
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||
{
|
||||
$tracking = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
|
||||
$tracking = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
|
||||
$tracking = ($tracking) ? tracking_unserialize($tracking) : array();
|
||||
|
||||
$topic_id36 = base_convert($topic_id, 10, 36);
|
||||
|
@ -1605,7 +1610,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
|||
|
||||
// If the cookie grows larger than 10000 characters we will remove the smallest value
|
||||
// This can result in old topics being unread - but most of the time it should be accurate...
|
||||
if (strlen($request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE)) > 10000)
|
||||
if (strlen($request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE)) > 10000)
|
||||
{
|
||||
//echo 'Cookie grown too large' . print_r($tracking, true);
|
||||
|
||||
|
@ -1650,7 +1655,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
|||
}
|
||||
|
||||
$user->set_cookie('track', tracking_serialize($tracking), $post_time + 31536000);
|
||||
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), phpbb_request_interface::COOKIE);
|
||||
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), \phpbb\request\request_interface::COOKIE);
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -1788,7 +1793,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
|
|||
|
||||
if (!isset($tracking_topics) || !sizeof($tracking_topics))
|
||||
{
|
||||
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
|
||||
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
|
||||
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
|
||||
}
|
||||
|
||||
|
@ -1985,7 +1990,7 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
|
|||
}
|
||||
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||
{
|
||||
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
|
||||
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
|
||||
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
|
||||
|
||||
if (!$user->data['is_registered'])
|
||||
|
@ -2200,6 +2205,32 @@ function tracking_unserialize($string, $max_depth = 3)
|
|||
}
|
||||
|
||||
// Pagination functions
|
||||
/**
|
||||
* Generate a pagination link based on the url and the page information
|
||||
*
|
||||
* @param string $base_url is url prepended to all links generated within the function
|
||||
* If you use page numbers inside your controller route, base_url should contains a placeholder (%d)
|
||||
* for the page. Also be sure to specify the pagination path information into the start_name argument
|
||||
* @param string $on_page is the page for which we want to generate the link
|
||||
* @param string $start_name is the name of the parameter containing the first item of the given page (example: start=20)
|
||||
* If you use page numbers inside your controller route, start name should be the string
|
||||
* that should be removed for the first page (example: /page/%d)
|
||||
* @param int $per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce
|
||||
* @return URL for the requested page
|
||||
*/
|
||||
function phpbb_generate_page_link($base_url, $on_page, $start_name, $per_page)
|
||||
{
|
||||
|
||||
if (strpos($start_name, '%d') !== false)
|
||||
{
|
||||
return ($on_page > 1) ? sprintf($base_url, (int) $on_page) : str_replace($start_name, '', $base_url);
|
||||
}
|
||||
else
|
||||
{
|
||||
$url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&');
|
||||
return ($on_page > 1) ? $base_url . $url_delim . $start_name . '=' . (($on_page - 1) * $per_page) : $base_url;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate template rendered pagination
|
||||
|
@ -2207,8 +2238,12 @@ function tracking_unserialize($string, $max_depth = 3)
|
|||
*
|
||||
* @param object $template the template object
|
||||
* @param string $base_url is url prepended to all links generated within the function
|
||||
* If you use page numbers inside your controller route, base_url should contains a placeholder (%d)
|
||||
* for the page. Also be sure to specify the pagination path information into the start_name argument
|
||||
* @param string $block_var_name is the name assigned to the pagination data block within the template (example: <!-- BEGIN pagination -->)
|
||||
* @param string $start_name is the name of the parameter containing the first item of the given page (example: start=20)
|
||||
* If you use page numbers inside your controller route, start name should be the string
|
||||
* that should be removed for the first page (example: /page/%d)
|
||||
* @param int $num_items the total number of items, posts, etc., used to determine the number of pages to produce
|
||||
* @param int $per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce
|
||||
* @param int $start_item the item which should be considered currently active, used to determine the page we're on
|
||||
|
@ -2228,7 +2263,6 @@ function phpbb_generate_template_pagination($template, $base_url, $block_var_nam
|
|||
}
|
||||
|
||||
$on_page = floor($start_item / $per_page) + 1;
|
||||
$url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&');
|
||||
|
||||
if ($reverse_count)
|
||||
{
|
||||
|
@ -2256,11 +2290,14 @@ function phpbb_generate_template_pagination($template, $base_url, $block_var_nam
|
|||
$end_page = ($total_pages > 5) ? max(min($total_pages, $on_page + 3), 5) : $total_pages;
|
||||
}
|
||||
|
||||
$u_previous_page = $u_next_page = '';
|
||||
if ($on_page != 1)
|
||||
{
|
||||
$u_previous_page = phpbb_generate_page_link($base_url, $on_page - 1, $start_name, $per_page);
|
||||
|
||||
$template->assign_block_vars($block_var_name, array(
|
||||
'PAGE_NUMBER' => '',
|
||||
'PAGE_URL' => $base_url . $url_delim . $start_name . '=' . (($on_page - 2) * $per_page),
|
||||
'PAGE_URL' => $u_previous_page,
|
||||
'S_IS_CURRENT' => false,
|
||||
'S_IS_PREV' => true,
|
||||
'S_IS_NEXT' => false,
|
||||
|
@ -2274,15 +2311,13 @@ function phpbb_generate_template_pagination($template, $base_url, $block_var_nam
|
|||
$at_page = 1;
|
||||
do
|
||||
{
|
||||
$page_url = $base_url . (($at_page == 1) ? '' : $url_delim . $start_name . '=' . (($at_page - 1) * $per_page));
|
||||
|
||||
// We decide whether to display the ellipsis during the loop. The ellipsis is always
|
||||
// displayed as either the second or penultimate item in the list. So are we at either
|
||||
// of those points and of course do we even need to display it, i.e. is the list starting
|
||||
// on at least page 3 and ending three pages before the final item.
|
||||
$template->assign_block_vars($block_var_name, array(
|
||||
'PAGE_NUMBER' => $at_page,
|
||||
'PAGE_URL' => $page_url,
|
||||
'PAGE_URL' => phpbb_generate_page_link($base_url, $at_page, $start_name, $per_page),
|
||||
'S_IS_CURRENT' => (!$ignore_on_page && $at_page == $on_page),
|
||||
'S_IS_NEXT' => false,
|
||||
'S_IS_PREV' => false,
|
||||
|
@ -2312,9 +2347,11 @@ function phpbb_generate_template_pagination($template, $base_url, $block_var_nam
|
|||
|
||||
if ($on_page != $total_pages)
|
||||
{
|
||||
$u_next_page = phpbb_generate_page_link($base_url, $on_page + 1, $start_name, $per_page);
|
||||
|
||||
$template->assign_block_vars($block_var_name, array(
|
||||
'PAGE_NUMBER' => '',
|
||||
'PAGE_URL' => $base_url . $url_delim . $start_name . '=' . ($on_page * $per_page),
|
||||
'PAGE_URL' => $u_next_page,
|
||||
'S_IS_CURRENT' => false,
|
||||
'S_IS_PREV' => false,
|
||||
'S_IS_NEXT' => true,
|
||||
|
@ -2339,14 +2376,11 @@ function phpbb_generate_template_pagination($template, $base_url, $block_var_nam
|
|||
}
|
||||
$tpl_prefix = ($tpl_prefix == 'PAGINATION') ? '' : $tpl_prefix . '_';
|
||||
|
||||
$previous_page = ($on_page != 1) ? $base_url . $url_delim . $start_name . '=' . (($on_page - 2) * $per_page) : '';
|
||||
|
||||
$template_array = array(
|
||||
$tpl_prefix . 'BASE_URL' => $base_url,
|
||||
'A_' . $tpl_prefix . 'BASE_URL' => addslashes($base_url),
|
||||
$tpl_prefix . 'PER_PAGE' => $per_page,
|
||||
'U_' . $tpl_prefix . 'PREVIOUS_PAGE' => $previous_page,
|
||||
'U_' . $tpl_prefix . 'NEXT_PAGE' => ($on_page != $total_pages) ? $base_url . $url_delim . $start_name . '=' . ($on_page * $per_page) : '',
|
||||
'U_' . $tpl_prefix . 'PREVIOUS_PAGE' => ($on_page != 1) ? $u_previous_page : '',
|
||||
'U_' . $tpl_prefix . 'NEXT_PAGE' => ($on_page != $total_pages) ? $u_next_page : '',
|
||||
$tpl_prefix . 'TOTAL_PAGES' => $total_pages,
|
||||
$tpl_prefix . 'CURRENT_PAGE' => $on_page,
|
||||
);
|
||||
|
@ -2383,7 +2417,7 @@ function phpbb_on_page($template, $user, $base_url, $num_items, $per_page, $star
|
|||
$template->assign_vars(array(
|
||||
'PER_PAGE' => $per_page,
|
||||
'ON_PAGE' => $on_page,
|
||||
'A_BASE_URL' => addslashes($base_url),
|
||||
'BASE_URL' => $base_url,
|
||||
));
|
||||
|
||||
return sprintf($user->lang['PAGE_OF'], $on_page, max(ceil($num_items / $per_page), 1));
|
||||
|
@ -2411,7 +2445,7 @@ function phpbb_on_page($template, $user, $base_url, $num_items, $per_page, $star
|
|||
*/
|
||||
function append_sid($url, $params = false, $is_amp = true, $session_id = false)
|
||||
{
|
||||
global $_SID, $_EXTRA_URL, $phpbb_hook;
|
||||
global $_SID, $_EXTRA_URL, $phpbb_hook, $phpbb_filesystem;
|
||||
global $phpbb_dispatcher;
|
||||
|
||||
if ($params === '' || (is_array($params) && empty($params)))
|
||||
|
@ -2420,6 +2454,12 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
|
|||
$params = false;
|
||||
}
|
||||
|
||||
// Update the root path with the correct relative web path
|
||||
if ($phpbb_filesystem instanceof \phpbb\filesystem)
|
||||
{
|
||||
$url = $phpbb_filesystem->update_web_root_path($url);
|
||||
}
|
||||
|
||||
$append_sid_overwrite = false;
|
||||
|
||||
/**
|
||||
|
@ -2809,8 +2849,22 @@ function build_url($strip_vars = false)
|
|||
{
|
||||
global $user, $phpbb_root_path;
|
||||
|
||||
$page = $user->page['page'];
|
||||
|
||||
// We need to be cautious here.
|
||||
// On some situations, the redirect path is an absolute URL, sometimes a relative path
|
||||
// For a relative path, let's prefix it with $phpbb_root_path to point to the correct location,
|
||||
// else we use the URL directly.
|
||||
$url_parts = parse_url($page);
|
||||
|
||||
// URL
|
||||
if ($url_parts !== false && !empty($url_parts['scheme']) && !empty($url_parts['host']))
|
||||
{
|
||||
$page = $phpbb_root_path . $page;
|
||||
}
|
||||
|
||||
// Append SID
|
||||
$redirect = append_sid($user->page['page'], false, false);
|
||||
$redirect = append_sid($page, false, false);
|
||||
|
||||
// Add delimiter if not there...
|
||||
if (strpos($redirect, '?') === false)
|
||||
|
@ -2865,19 +2919,7 @@ function build_url($strip_vars = false)
|
|||
$redirect .= ($query) ? '?' . $query : '';
|
||||
}
|
||||
|
||||
// We need to be cautious here.
|
||||
// On some situations, the redirect path is an absolute URL, sometimes a relative path
|
||||
// For a relative path, let's prefix it with $phpbb_root_path to point to the correct location,
|
||||
// else we use the URL directly.
|
||||
$url_parts = @parse_url($redirect);
|
||||
|
||||
// URL
|
||||
if ($url_parts !== false && !empty($url_parts['scheme']) && !empty($url_parts['host']))
|
||||
{
|
||||
return str_replace('&', '&', $redirect);
|
||||
}
|
||||
|
||||
return $phpbb_root_path . str_replace('&', '&', $redirect);
|
||||
return str_replace('&', '&', $redirect);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3094,7 +3136,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
|
|||
return false;
|
||||
}
|
||||
|
||||
$confirm = ($user->lang['YES'] === $request->variable('confirm', '', true, phpbb_request_interface::POST));
|
||||
$confirm = ($user->lang['YES'] === $request->variable('confirm', '', true, \phpbb\request\request_interface::POST));
|
||||
|
||||
if ($check && $confirm)
|
||||
{
|
||||
|
@ -3171,7 +3213,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
|
|||
if ($request->is_ajax())
|
||||
{
|
||||
$u_action .= '&confirm_uid=' . $user->data['user_id'] . '&sess=' . $user->session_id . '&sid=' . $user->session_id;
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_BODY' => $template->assign_display('body'),
|
||||
'MESSAGE_TITLE' => (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title],
|
||||
|
@ -3199,7 +3241,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
|
|||
function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)
|
||||
{
|
||||
global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config;
|
||||
global $request;
|
||||
global $request, $phpbb_container;
|
||||
|
||||
if (!class_exists('phpbb_captcha_factory', false))
|
||||
{
|
||||
|
@ -3226,7 +3268,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
|||
trigger_error('NO_AUTH_ADMIN');
|
||||
}
|
||||
|
||||
if (isset($_POST['login']))
|
||||
if ($request->is_set_post('login') || ($request->is_set('login') && $request->variable('login', '') == 'external'))
|
||||
{
|
||||
// Get credential
|
||||
if ($admin)
|
||||
|
@ -3367,6 +3409,29 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
|||
$s_hidden_fields['credential'] = $credential;
|
||||
}
|
||||
|
||||
$auth_provider = $phpbb_container->get('auth.provider.' . $config['auth_method']);
|
||||
|
||||
$auth_provider_data = $auth_provider->get_login_data();
|
||||
if ($auth_provider_data)
|
||||
{
|
||||
if (isset($auth_provider_data['VARS']))
|
||||
{
|
||||
$template->assign_vars($auth_provider_data['VARS']);
|
||||
}
|
||||
|
||||
if (isset($auth_provider_data['BLOCK_VAR_NAME']))
|
||||
{
|
||||
foreach ($auth_provider_data['BLOCK_VARS'] as $block_vars)
|
||||
{
|
||||
$template->assign_block_vars($auth_provider_data['BLOCK_VAR_NAME'], $block_vars);
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PROVIDER_TEMPLATE_FILE' => $auth_provider_data['TEMPLATE_FILE'],
|
||||
));
|
||||
}
|
||||
|
||||
$s_hidden_fields = build_hidden_fields($s_hidden_fields);
|
||||
|
||||
$template->assign_vars(array(
|
||||
|
@ -4390,7 +4455,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
|||
{
|
||||
global $refresh_data;
|
||||
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $msg_title,
|
||||
'MESSAGE_TEXT' => $msg_text,
|
||||
|
@ -4896,7 +4961,7 @@ function phpbb_http_login($param)
|
|||
$username = null;
|
||||
foreach ($username_keys as $k)
|
||||
{
|
||||
if ($request->is_set($k, phpbb_request_interface::SERVER))
|
||||
if ($request->is_set($k, \phpbb\request\request_interface::SERVER))
|
||||
{
|
||||
$username = htmlspecialchars_decode($request->server($k));
|
||||
break;
|
||||
|
@ -4906,7 +4971,7 @@ function phpbb_http_login($param)
|
|||
$password = null;
|
||||
foreach ($password_keys as $k)
|
||||
{
|
||||
if ($request->is_set($k, phpbb_request_interface::SERVER))
|
||||
if ($request->is_set($k, \phpbb\request\request_interface::SERVER))
|
||||
{
|
||||
$password = htmlspecialchars_decode($request->server($k));
|
||||
break;
|
||||
|
@ -5007,13 +5072,13 @@ function phpbb_quoteattr($data, $entities = null)
|
|||
*
|
||||
* sid is always omitted.
|
||||
*
|
||||
* @param phpbb_request $request Request object
|
||||
* @param \phpbb\request\request $request Request object
|
||||
* @param array $exclude A list of variable names that should not be forwarded
|
||||
* @return string HTML with hidden fields
|
||||
*/
|
||||
function phpbb_build_hidden_fields_for_query_params($request, $exclude = null)
|
||||
{
|
||||
$names = $request->variable_names(phpbb_request_interface::GET);
|
||||
$names = $request->variable_names(\phpbb\request\request_interface::GET);
|
||||
$hidden = '';
|
||||
foreach ($names as $name)
|
||||
{
|
||||
|
@ -5035,7 +5100,7 @@ function phpbb_build_hidden_fields_for_query_params($request, $exclude = null)
|
|||
// here. To avoid exposing cookies, skip variables that are
|
||||
// overwritten somewhere other than GET entirely.
|
||||
$value = $request->variable($name, '', true);
|
||||
$get_value = $request->variable($name, '', true, phpbb_request_interface::GET);
|
||||
$get_value = $request->variable($name, '', true, \phpbb\request\request_interface::GET);
|
||||
if ($value === $get_value)
|
||||
{
|
||||
$escaped_value = phpbb_quoteattr($value);
|
||||
|
@ -5051,7 +5116,7 @@ function phpbb_build_hidden_fields_for_query_params($request, $exclude = null)
|
|||
function page_header($page_title = '', $display_online_list = true, $item_id = 0, $item = 'forum')
|
||||
{
|
||||
global $db, $config, $template, $SID, $_SID, $_EXTRA_URL, $user, $auth, $phpEx, $phpbb_root_path;
|
||||
global $phpbb_dispatcher, $request, $phpbb_container;
|
||||
global $phpbb_dispatcher, $request, $phpbb_container, $adm_relative_path;
|
||||
|
||||
if (defined('HEADER_INC'))
|
||||
{
|
||||
|
@ -5208,7 +5273,12 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
|||
|
||||
// Determine board url - we may need it later
|
||||
$board_url = generate_board_url() . '/';
|
||||
$web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $phpbb_root_path;
|
||||
// This path is sent with the base template paths in the assign_vars()
|
||||
// call below. We need to correct it in case we are accessing from a
|
||||
// controller because the web paths will be incorrect otherwise.
|
||||
$phpbb_filesystem = $phpbb_container->get('filesystem');
|
||||
$corrected_path = $phpbb_filesystem->get_web_root_path();
|
||||
$web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $corrected_path;
|
||||
|
||||
// Send a proper content-language to the output
|
||||
$user_lang = $user->lang['USER_LANG'];
|
||||
|
@ -5232,7 +5302,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
|||
}
|
||||
}
|
||||
|
||||
$dt = new phpbb_datetime($user, 'now', $user->timezone);
|
||||
$dt = new \phpbb\datetime($user, 'now', $user->timezone);
|
||||
$timezone_offset = 'GMT' . phpbb_format_timezone_offset($dt->getOffset());
|
||||
$timezone_name = $user->timezone->getName();
|
||||
if (isset($user->lang['timezones'][$timezone_name]))
|
||||
|
@ -5289,7 +5359,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
|||
'SID' => $SID,
|
||||
'_SID' => $_SID,
|
||||
'SESSION_ID' => $user->session_id,
|
||||
'ROOT_PATH' => $phpbb_root_path,
|
||||
'ROOT_PATH' => $web_path,
|
||||
'BOARD_URL' => $board_url,
|
||||
|
||||
'L_LOGIN_LOGOUT' => $l_login_logout,
|
||||
|
@ -5300,7 +5370,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
|||
'U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'),
|
||||
'U_RETURN_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'),
|
||||
'U_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=popup'),
|
||||
'UA_POPUP_PM' => addslashes(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=popup')),
|
||||
'U_MEMBERLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"),
|
||||
'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$phpbb_root_path}viewonline.$phpEx") : '',
|
||||
'U_LOGIN_LOGOUT' => $u_login_logout,
|
||||
|
@ -5346,7 +5415,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
|||
'S_FORUM_ID' => $forum_id,
|
||||
'S_TOPIC_ID' => $topic_id,
|
||||
|
||||
'S_LOGIN_ACTION' => ((!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx", false, true, $user->session_id)),
|
||||
'S_LOGIN_ACTION' => ((!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("{$phpbb_root_path}{$adm_relative_path}index.$phpEx", false, true, $user->session_id)),
|
||||
'S_LOGIN_REDIRECT' => build_hidden_fields(array('redirect' => build_url())),
|
||||
|
||||
'S_ENABLE_FEEDS' => ($config['feed_enable']) ? true : false,
|
||||
|
@ -5581,7 +5650,7 @@ function exit_handler()
|
|||
}
|
||||
|
||||
/**
|
||||
* Handler for init calls in phpBB. This function is called in phpbb_user::setup();
|
||||
* Handler for init calls in phpBB. This function is called in \phpbb\user::setup();
|
||||
* This function supports hooks.
|
||||
*/
|
||||
function phpbb_user_session_handler()
|
||||
|
@ -5632,7 +5701,7 @@ function phpbb_to_numeric($input)
|
|||
* Convert either 3.0 dbms or 3.1 db driver class name to 3.1 db driver class name.
|
||||
*
|
||||
* If $dbms is a valid 3.1 db driver class name, returns it unchanged.
|
||||
* Otherwise prepends phpbb_db_driver_ to the dbms to convert a 3.0 dbms
|
||||
* Otherwise prepends phpbb\db\driver\ to the dbms to convert a 3.0 dbms
|
||||
* to 3.1 db driver class name.
|
||||
*
|
||||
* @param string $dbms dbms parameter
|
||||
|
@ -5645,24 +5714,24 @@ function phpbb_convert_30_dbms_to_31($dbms)
|
|||
// true for mysqli class.
|
||||
// However, per the docblock any valid 3.1 driver name should be
|
||||
// recognized by this function, and have priority over 3.0 dbms.
|
||||
if (class_exists('phpbb_db_driver_' . $dbms))
|
||||
if (class_exists('phpbb\db\driver\\' . $dbms))
|
||||
{
|
||||
return 'phpbb_db_driver_' . $dbms;
|
||||
return 'phpbb\db\driver\\' . $dbms;
|
||||
}
|
||||
|
||||
if (class_exists($dbms))
|
||||
{
|
||||
// Additionally we could check that $dbms extends phpbb_db_driver.
|
||||
// Additionally we could check that $dbms extends phpbb\db\driver\driver.
|
||||
// http://php.net/manual/en/class.reflectionclass.php
|
||||
// Beware of possible performance issues:
|
||||
// http://stackoverflow.com/questions/294582/php-5-reflection-api-performance
|
||||
// We could check for interface implementation in all paths or
|
||||
// only when we do not prepend phpbb_db_driver_.
|
||||
// only when we do not prepend phpbb\db\driver\.
|
||||
|
||||
/*
|
||||
$reflection = new \ReflectionClass($dbms);
|
||||
|
||||
if ($reflection->isSubclassOf('phpbb_db_driver'))
|
||||
if ($reflection->isSubclassOf('phpbb\db\driver\driver'))
|
||||
{
|
||||
return $dbms;
|
||||
}
|
||||
|
@ -5673,49 +5742,3 @@ function phpbb_convert_30_dbms_to_31($dbms)
|
|||
|
||||
throw new \RuntimeException("You have specified an invalid dbms driver: $dbms");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Symfony Request object from phpbb_request object
|
||||
*
|
||||
* @param phpbb_request $request Request object
|
||||
* @return Request A Symfony Request object
|
||||
*/
|
||||
function phpbb_create_symfony_request(phpbb_request $request)
|
||||
{
|
||||
// This function is meant to sanitize the global input arrays
|
||||
$sanitizer = function(&$value, $key) {
|
||||
$type_cast_helper = new phpbb_request_type_cast_helper();
|
||||
$type_cast_helper->set_var($value, $value, gettype($value), true);
|
||||
};
|
||||
|
||||
// We need to re-enable the super globals so we can access them here
|
||||
$request->enable_super_globals();
|
||||
$get_parameters = $_GET;
|
||||
$post_parameters = $_POST;
|
||||
$server_parameters = $_SERVER;
|
||||
$files_parameters = $_FILES;
|
||||
$cookie_parameters = $_COOKIE;
|
||||
// And now disable them again for security
|
||||
$request->disable_super_globals();
|
||||
|
||||
array_walk_recursive($get_parameters, $sanitizer);
|
||||
array_walk_recursive($post_parameters, $sanitizer);
|
||||
|
||||
// Until we fix the issue with relative paths, we have to fake path info
|
||||
// to allow urls like app.php?controller=foo/bar
|
||||
$controller = $request->variable('controller', '');
|
||||
$path_info = '/' . $controller;
|
||||
$request_uri = $server_parameters['REQUEST_URI'];
|
||||
|
||||
// Remove the query string from REQUEST_URI
|
||||
if ($pos = strpos($request_uri, '?'))
|
||||
{
|
||||
$request_uri = substr($request_uri, 0, $pos);
|
||||
}
|
||||
|
||||
// Add the path info (i.e. controller route) to the REQUEST_URI
|
||||
$server_parameters['REQUEST_URI'] = $request_uri . $path_info;
|
||||
$server_parameters['SCRIPT_NAME'] = '';
|
||||
|
||||
return new Request($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters);
|
||||
}
|
||||
|
|
|
@ -2348,9 +2348,9 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr
|
|||
* via admin_permissions. Changes of usernames and group names
|
||||
* must be carried through for the moderators table.
|
||||
*
|
||||
* @param phpbb_db_driver $db Database connection
|
||||
* @param phpbb_cache_driver_interface Cache driver
|
||||
* @param phpbb_auth $auth Authentication object
|
||||
* @param \phpbb\db\driver\driver $db Database connection
|
||||
* @param \phpbb\cache\driver\driver_interface Cache driver
|
||||
* @param \phpbb\auth\auth $auth Authentication object
|
||||
* @return null
|
||||
*/
|
||||
function phpbb_cache_moderators($db, $cache, $auth)
|
||||
|
@ -2571,8 +2571,8 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
|||
/**
|
||||
* Removes moderators and administrators from foe lists.
|
||||
*
|
||||
* @param phpbb_db_driver $db Database connection
|
||||
* @param phpbb_auth $auth Authentication object
|
||||
* @param \phpbb\db\driver\driver $db Database connection
|
||||
* @param \phpbb\auth\auth $auth Authentication object
|
||||
* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
|
||||
* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
|
||||
* @return null
|
||||
|
|
|
@ -26,7 +26,7 @@ if (!defined('IN_PHPBB'))
|
|||
* Used to bootstrap the container.
|
||||
*
|
||||
* @param string $config_file
|
||||
* @return phpbb_db_driver
|
||||
* @return \phpbb\db\driver\driver
|
||||
*/
|
||||
function phpbb_bootstrap_db_connection($config_file)
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ function phpbb_create_install_container($phpbb_root_path, $php_ext)
|
|||
$other_config_path = $phpbb_root_path . 'install/update/new/config/';
|
||||
$config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $phpbb_root_path . 'config/';
|
||||
|
||||
$core = new phpbb_di_extension_core($config_path);
|
||||
$core = new \phpbb\di\extension\core($config_path);
|
||||
$container = phpbb_create_container(array($core), $phpbb_root_path, $php_ext);
|
||||
|
||||
$container->setParameter('core.root_path', $phpbb_root_path);
|
||||
|
@ -152,12 +152,12 @@ function phpbb_create_update_container($phpbb_root_path, $php_ext, $config_path)
|
|||
return phpbb_create_compiled_container(
|
||||
$config_file,
|
||||
array(
|
||||
new phpbb_di_extension_config($config_file),
|
||||
new phpbb_di_extension_core($config_path),
|
||||
new phpbb\di\extension\config($config_file),
|
||||
new phpbb\di\extension\core($config_path),
|
||||
),
|
||||
array(
|
||||
new phpbb_di_pass_collection_pass(),
|
||||
new phpbb_di_pass_kernel_pass(),
|
||||
new phpbb\di\pass\collection_pass(),
|
||||
new phpbb\di\pass\kernel_pass(),
|
||||
),
|
||||
$phpbb_root_path,
|
||||
$php_ext
|
||||
|
@ -260,13 +260,13 @@ function phpbb_create_default_container($phpbb_root_path, $php_ext)
|
|||
return phpbb_create_dumped_container_unless_debug(
|
||||
$config_file,
|
||||
array(
|
||||
new phpbb_di_extension_config($config_file),
|
||||
new phpbb_di_extension_core($phpbb_root_path . 'config'),
|
||||
new phpbb_di_extension_ext($installed_exts),
|
||||
new \phpbb\di\extension\config($config_file),
|
||||
new \phpbb\di\extension\core($phpbb_root_path . 'config'),
|
||||
new \phpbb\di\extension\ext($installed_exts),
|
||||
),
|
||||
array(
|
||||
new phpbb_di_pass_collection_pass(),
|
||||
new phpbb_di_pass_kernel_pass(),
|
||||
new \phpbb\di\pass\collection_pass(),
|
||||
new \phpbb\di\pass\kernel_pass(),
|
||||
),
|
||||
$phpbb_root_path,
|
||||
$php_ext
|
||||
|
|
|
@ -727,37 +727,58 @@ function make_clickable($text, $server_url = false, $class = 'postlink')
|
|||
$server_url = generate_board_url();
|
||||
}
|
||||
|
||||
static $magic_url_match;
|
||||
static $magic_url_replace;
|
||||
static $static_class;
|
||||
static $magic_url_match_args;
|
||||
|
||||
if (!is_array($magic_url_match) || $static_class != $class)
|
||||
if (!is_array($magic_url_match_args) || $static_class != $class)
|
||||
{
|
||||
$static_class = $class;
|
||||
$class = ($static_class) ? ' class="' . $static_class . '"' : '';
|
||||
$local_class = ($static_class) ? ' class="' . $static_class . '-local"' : '';
|
||||
|
||||
$magic_url_match = $magic_url_replace = array();
|
||||
// Be sure to not let the matches cross over. ;)
|
||||
$magic_url_match_args = array();
|
||||
|
||||
// relative urls for this board
|
||||
$magic_url_match[] = '#(^|[\n\t (>.])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#ie';
|
||||
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_LOCAL, '\$1', '\$2', '\$3', '$local_class')";
|
||||
$magic_url_match_args[] = array(
|
||||
'#(^|[\n\t (>.])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#i',
|
||||
MAGIC_URL_LOCAL,
|
||||
$local_class,
|
||||
);
|
||||
|
||||
// matches a xxxx://aaaaa.bbb.cccc. ...
|
||||
$magic_url_match[] = '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#ie';
|
||||
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_FULL, '\$1', '\$2', '', '$class')";
|
||||
$magic_url_match_args[] = array(
|
||||
'#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#i',
|
||||
MAGIC_URL_FULL,
|
||||
$class,
|
||||
);
|
||||
|
||||
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
|
||||
$magic_url_match[] = '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#ie';
|
||||
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_WWW, '\$1', '\$2', '', '$class')";
|
||||
$magic_url_match_args[] = array(
|
||||
'#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#i',
|
||||
MAGIC_URL_WWW,
|
||||
$class,
|
||||
);
|
||||
|
||||
// matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode.
|
||||
$magic_url_match[] = '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/ie';
|
||||
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_EMAIL, '\$1', '\$2', '', '')";
|
||||
$magic_url_match_args[] = array(
|
||||
'/(^|[\n\t (>])(' . get_preg_expression('email') . ')/i',
|
||||
MAGIC_URL_EMAIL,
|
||||
'',
|
||||
);
|
||||
}
|
||||
|
||||
return preg_replace($magic_url_match, $magic_url_replace, $text);
|
||||
foreach ($magic_url_match_args as $magic_args)
|
||||
{
|
||||
if (preg_match($magic_args[0], $text, $matches))
|
||||
{
|
||||
$text = preg_replace_callback($magic_args[0], function($matches) use ($magic_args)
|
||||
{
|
||||
return make_clickable_callback($magic_args[1], $matches[1], $matches[2], $matches[3], $magic_args[2]);
|
||||
}, $text);
|
||||
}
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -813,7 +834,7 @@ function bbcode_nl2br($text)
|
|||
*/
|
||||
function smiley_text($text, $force_option = false)
|
||||
{
|
||||
global $config, $user, $phpbb_root_path;
|
||||
global $config, $user, $phpbb_filesystem;
|
||||
|
||||
if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies'))
|
||||
{
|
||||
|
@ -821,7 +842,7 @@ function smiley_text($text, $force_option = false)
|
|||
}
|
||||
else
|
||||
{
|
||||
$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
|
||||
$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_filesystem->get_web_root_path();
|
||||
return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img class="smilies" src="' . $root_path . $config['smilies_path'] . '/\2 />', $text);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,14 +22,14 @@ if (!defined('IN_PHPBB'))
|
|||
*
|
||||
* The only supported table is bookmarks.
|
||||
*
|
||||
* @param phpbb_db_driver $db Database object
|
||||
* @param \phpbb\db\driver\driver $db Database object
|
||||
* @param string $table Table on which to perform the update
|
||||
* @param string $column Column whose values to change
|
||||
* @param array $from_values An array of values that should be changed
|
||||
* @param int $to_value The new value
|
||||
* @return null
|
||||
*/
|
||||
function phpbb_update_rows_avoiding_duplicates(phpbb_db_driver $db, $table, $column, $from_values, $to_value)
|
||||
function phpbb_update_rows_avoiding_duplicates(\phpbb\db\driver\driver $db, $table, $column, $from_values, $to_value)
|
||||
{
|
||||
$sql = "SELECT $column, user_id
|
||||
FROM $table
|
||||
|
@ -107,14 +107,14 @@ function phpbb_update_rows_avoiding_duplicates(phpbb_db_driver $db, $table, $col
|
|||
*
|
||||
* The only supported table is topics_watch.
|
||||
*
|
||||
* @param phpbb_db_driver $db Database object
|
||||
* @param \phpbb\db\driver\driver $db Database object
|
||||
* @param string $table Table on which to perform the update
|
||||
* @param string $column Column whose values to change
|
||||
* @param array $from_values An array of values that should be changed
|
||||
* @param int $to_value The new value
|
||||
* @return null
|
||||
*/
|
||||
function phpbb_update_rows_avoiding_duplicates_notify_status(phpbb_db_driver $db, $table, $column, $from_values, $to_value)
|
||||
function phpbb_update_rows_avoiding_duplicates_notify_status(\phpbb\db\driver\driver $db, $table, $column, $from_values, $to_value)
|
||||
{
|
||||
$sql = "SELECT $column, user_id, notify_status
|
||||
FROM $table
|
||||
|
|
|
@ -71,7 +71,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED']
|
||||
);
|
||||
$json_response = new phpbb_json_response();
|
||||
$json_response = new \phpbb\json_response();
|
||||
$json_response->send($data);
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
}
|
||||
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||
{
|
||||
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
|
||||
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
|
||||
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
|
||||
|
||||
if (!$user->data['is_registered'])
|
||||
|
@ -346,7 +346,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED']
|
||||
);
|
||||
$json_response = new phpbb_json_response();
|
||||
$json_response = new \phpbb\json_response();
|
||||
$json_response->send($data);
|
||||
}
|
||||
|
||||
|
@ -1164,7 +1164,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
|||
|
||||
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
|
||||
{
|
||||
if ($uid != $user_id || $request->variable('unwatch', '', false, phpbb_request_interface::GET) != $mode)
|
||||
if ($uid != $user_id || $request->variable('unwatch', '', false, \phpbb\request\request_interface::GET) != $mode)
|
||||
{
|
||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
||||
$message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||
|
@ -1229,7 +1229,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
|||
|
||||
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
|
||||
{
|
||||
if ($uid != $user_id || $request->variable('watch', '', false, phpbb_request_interface::GET) != $mode)
|
||||
if ($uid != $user_id || $request->variable('watch', '', false, \phpbb\request\request_interface::GET) != $mode)
|
||||
{
|
||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
||||
$message = $user->lang['ERR_WATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||
|
@ -1272,8 +1272,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((isset($_GET['unwatch']) && $request->variable('unwatch', '', false, phpbb_request_interface::GET) == $mode) ||
|
||||
(isset($_GET['watch']) && $request->variable('watch', '', false, phpbb_request_interface::GET) == $mode))
|
||||
if ((isset($_GET['unwatch']) && $request->variable('unwatch', '', false, \phpbb\request\request_interface::GET) == $mode) ||
|
||||
(isset($_GET['watch']) && $request->variable('watch', '', false, \phpbb\request\request_interface::GET) == $mode))
|
||||
{
|
||||
login_box();
|
||||
}
|
||||
|
@ -1352,7 +1352,7 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
|
|||
*/
|
||||
function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = false)
|
||||
{
|
||||
$row = phpbb_avatar_manager::clean_row($user_row);
|
||||
$row = \phpbb\avatar\manager::clean_row($user_row);
|
||||
return phpbb_get_avatar($row, $alt, $ignore_config);
|
||||
}
|
||||
|
||||
|
@ -1367,14 +1367,14 @@ function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config =
|
|||
*/
|
||||
function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config = false)
|
||||
{
|
||||
$row = phpbb_avatar_manager::clean_row($user_row);
|
||||
$row = \phpbb\avatar\manager::clean_row($user_row);
|
||||
return phpbb_get_avatar($row, $alt, $ignore_config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get avatar
|
||||
*
|
||||
* @param array $row Row cleaned by phpbb_avatar_driver::clean_row
|
||||
* @param array $row Row cleaned by \phpbb\avatar\driver\driver::clean_row
|
||||
* @param string $alt Optional language string for alt tag within image, can be a language key or text
|
||||
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
|
||||
*
|
||||
|
|
|
@ -596,7 +596,7 @@ function phpbb_parse_range_request($request_array, $filesize)
|
|||
/**
|
||||
* Increments the download count of all provided attachments
|
||||
*
|
||||
* @param phpbb_db_driver $db The database object
|
||||
* @param \phpbb\db\driver\driver $db The database object
|
||||
* @param array|int $ids The attach_id of each attachment
|
||||
*
|
||||
* @return null
|
||||
|
@ -617,8 +617,8 @@ function phpbb_increment_downloads($db, $ids)
|
|||
/**
|
||||
* Handles authentication when downloading attachments from a post or topic
|
||||
*
|
||||
* @param phpbb_db_driver $db The database object
|
||||
* @param phpbb_auth $auth The authentication object
|
||||
* @param \phpbb\db\driver\driver $db The database object
|
||||
* @param \phpbb\auth\auth $auth The authentication object
|
||||
* @param int $topic_id The id of the topic that we are downloading from
|
||||
*
|
||||
* @return null
|
||||
|
@ -651,8 +651,8 @@ function phpbb_download_handle_forum_auth($db, $auth, $topic_id)
|
|||
/**
|
||||
* Handles authentication when downloading attachments from PMs
|
||||
*
|
||||
* @param phpbb_db_driver $db The database object
|
||||
* @param phpbb_auth $auth The authentication object
|
||||
* @param \phpbb\db\driver\driver $db The database object
|
||||
* @param \phpbb\auth\auth $auth The authentication object
|
||||
* @param int $user_id The user id
|
||||
* @param int $msg_id The id of the PM that we are downloading from
|
||||
*
|
||||
|
@ -678,7 +678,7 @@ function phpbb_download_handle_pm_auth($db, $auth, $user_id, $msg_id)
|
|||
/**
|
||||
* Checks whether a user can download from a particular PM
|
||||
*
|
||||
* @param phpbb_db_driver $db The database object
|
||||
* @param \phpbb\db\driver\driver $db The database object
|
||||
* @param int $user_id The user id
|
||||
* @param int $msg_id The id of the PM that we are downloading from
|
||||
*
|
||||
|
|
|
@ -28,7 +28,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||
'SCHEMA' => 'firebird',
|
||||
'MODULE' => 'interbase',
|
||||
'DELIM' => ';;',
|
||||
'DRIVER' => 'phpbb_db_driver_firebird',
|
||||
'DRIVER' => 'phpbb\db\driver\firebird',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => false,
|
||||
),
|
||||
|
@ -39,7 +39,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||
'SCHEMA' => 'mysql_41',
|
||||
'MODULE' => 'mysqli',
|
||||
'DELIM' => ';',
|
||||
'DRIVER' => 'phpbb_db_driver_mysqli',
|
||||
'DRIVER' => 'phpbb\db\driver\mysqli',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => true,
|
||||
),
|
||||
|
@ -48,7 +48,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||
'SCHEMA' => 'mysql',
|
||||
'MODULE' => 'mysql',
|
||||
'DELIM' => ';',
|
||||
'DRIVER' => 'phpbb_db_driver_mysql',
|
||||
'DRIVER' => 'phpbb\db\driver\mysql',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => true,
|
||||
),
|
||||
|
@ -57,7 +57,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||
'SCHEMA' => 'mssql',
|
||||
'MODULE' => 'mssql',
|
||||
'DELIM' => 'GO',
|
||||
'DRIVER' => 'phpbb_db_driver_mssql',
|
||||
'DRIVER' => 'phpbb\db\driver\mssql',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => true,
|
||||
),
|
||||
|
@ -66,7 +66,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||
'SCHEMA' => 'mssql',
|
||||
'MODULE' => 'odbc',
|
||||
'DELIM' => 'GO',
|
||||
'DRIVER' => 'phpbb_db_driver_mssql_odbc',
|
||||
'DRIVER' => 'phpbb\db\driver\mssql_odbc',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => true,
|
||||
),
|
||||
|
@ -75,7 +75,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||
'SCHEMA' => 'mssql',
|
||||
'MODULE' => 'sqlsrv',
|
||||
'DELIM' => 'GO',
|
||||
'DRIVER' => 'phpbb_db_driver_mssqlnative',
|
||||
'DRIVER' => 'phpbb\db\driver\mssqlnative',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => false,
|
||||
),
|
||||
|
@ -84,7 +84,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||
'SCHEMA' => 'oracle',
|
||||
'MODULE' => 'oci8',
|
||||
'DELIM' => '/',
|
||||
'DRIVER' => 'phpbb_db_driver_oracle',
|
||||
'DRIVER' => 'phpbb\db\driver\oracle',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => false,
|
||||
),
|
||||
|
@ -93,7 +93,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||
'SCHEMA' => 'postgres',
|
||||
'MODULE' => 'pgsql',
|
||||
'DELIM' => ';',
|
||||
'DRIVER' => 'phpbb_db_driver_postgres',
|
||||
'DRIVER' => 'phpbb\db\driver\postgres',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => true,
|
||||
),
|
||||
|
@ -102,7 +102,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||
'SCHEMA' => 'sqlite',
|
||||
'MODULE' => 'sqlite',
|
||||
'DELIM' => ';',
|
||||
'DRIVER' => 'phpbb_db_driver_sqlite',
|
||||
'DRIVER' => 'phpbb\db\driver\sqlite',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => false,
|
||||
),
|
||||
|
@ -184,7 +184,7 @@ function dbms_select($default = '', $only_20x_options = false)
|
|||
*/
|
||||
function get_tables(&$db)
|
||||
{
|
||||
$db_tools = new phpbb_db_tools($db);
|
||||
$db_tools = new \phpbb\db\tools($db);
|
||||
|
||||
return $db_tools->sql_list_tables();
|
||||
}
|
||||
|
@ -206,14 +206,14 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
|||
$db->sql_return_on_error(true);
|
||||
|
||||
// Check that we actually have a database name before going any further.....
|
||||
if ($dbms_details['DRIVER'] != 'phpbb_db_driver_sqlite' && $dbms_details['DRIVER'] != 'phpbb_db_driver_oracle' && $dbname === '')
|
||||
if ($dbms_details['DRIVER'] != 'phpbb\db\driver\sqlite' && $dbms_details['DRIVER'] != 'phpbb\db\driver\oracle' && $dbname === '')
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_NAME'];
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure we don't have a daft user who thinks having the SQLite database in the forum directory is a good idea
|
||||
if ($dbms_details['DRIVER'] == 'phpbb_db_driver_sqlite' && stripos(phpbb_realpath($dbhost), phpbb_realpath('../')) === 0)
|
||||
if ($dbms_details['DRIVER'] == 'phpbb\db\driver\sqlite' && stripos(phpbb_realpath($dbhost), phpbb_realpath('../')) === 0)
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_FORUM_PATH'];
|
||||
return false;
|
||||
|
@ -222,8 +222,8 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
|||
// Check the prefix length to ensure that index names are not too long and does not contain invalid characters
|
||||
switch ($dbms_details['DRIVER'])
|
||||
{
|
||||
case 'phpbb_db_driver_mysql':
|
||||
case 'phpbb_db_driver_mysqli':
|
||||
case 'phpbb\db\driver\mysql':
|
||||
case 'phpbb\db\driver\mysqli':
|
||||
if (strspn($table_prefix, '-./\\') !== 0)
|
||||
{
|
||||
$error[] = $lang['INST_ERR_PREFIX_INVALID'];
|
||||
|
@ -232,22 +232,22 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
|||
|
||||
// no break;
|
||||
|
||||
case 'phpbb_db_driver_postgres':
|
||||
case 'phpbb\db\driver\postgres':
|
||||
$prefix_length = 36;
|
||||
break;
|
||||
|
||||
case 'phpbb_db_driver_mssql':
|
||||
case 'phpbb_db_driver_mssql_odbc':
|
||||
case 'phpbb_db_driver_mssqlnative':
|
||||
case 'phpbb\db\driver\mssql':
|
||||
case 'phpbb\db\driver\mssql_odbc':
|
||||
case 'phpbb\db\driver\mssqlnative':
|
||||
$prefix_length = 90;
|
||||
break;
|
||||
|
||||
case 'phpbb_db_driver_sqlite':
|
||||
case 'phpbb\db\driver\sqlite':
|
||||
$prefix_length = 200;
|
||||
break;
|
||||
|
||||
case 'phpbb_db_driver_firebird':
|
||||
case 'phpbb_db_driver_oracle':
|
||||
case 'phpbb\db\driver\firebird':
|
||||
case 'phpbb\db\driver\oracle':
|
||||
$prefix_length = 6;
|
||||
break;
|
||||
}
|
||||
|
@ -285,21 +285,21 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
|||
// Make sure that the user has selected a sensible DBAL for the DBMS actually installed
|
||||
switch ($dbms_details['DRIVER'])
|
||||
{
|
||||
case 'phpbb_db_driver_mysqli':
|
||||
case 'phpbb\db\driver\mysqli':
|
||||
if (version_compare(mysqli_get_server_info($db->db_connect_id), '4.1.3', '<'))
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_MYSQLI'];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'phpbb_db_driver_sqlite':
|
||||
case 'phpbb\db\driver\sqlite':
|
||||
if (version_compare(sqlite_libversion(), '2.8.2', '<'))
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_SQLITE'];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'phpbb_db_driver_firebird':
|
||||
case 'phpbb\db\driver\firebird':
|
||||
// check the version of FB, use some hackery if we can't get access to the server info
|
||||
if ($db->service_handle !== false && function_exists('ibase_server_info'))
|
||||
{
|
||||
|
@ -380,7 +380,7 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
|||
}
|
||||
break;
|
||||
|
||||
case 'phpbb_db_driver_oracle':
|
||||
case 'phpbb\db\driver\oracle':
|
||||
if ($unicode_check)
|
||||
{
|
||||
$sql = "SELECT *
|
||||
|
@ -402,7 +402,7 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
|||
}
|
||||
break;
|
||||
|
||||
case 'phpbb_db_driver_postgres':
|
||||
case 'phpbb\db\driver\postgres':
|
||||
if ($unicode_check)
|
||||
{
|
||||
$sql = "SHOW server_encoding;";
|
||||
|
@ -507,7 +507,7 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test
|
|||
|
||||
'adm_relative_path' => 'adm/',
|
||||
|
||||
'acm_type' => 'phpbb_cache_driver_file',
|
||||
'acm_type' => 'phpbb\cache\driver\file',
|
||||
);
|
||||
|
||||
foreach ($config_data_array as $key => $value)
|
||||
|
|
|
@ -21,13 +21,13 @@ if (!defined('IN_PHPBB'))
|
|||
*/
|
||||
class messenger
|
||||
{
|
||||
var $vars, $msg, $extra_headers, $replyto, $from, $subject;
|
||||
var $msg, $extra_headers, $replyto, $from, $subject;
|
||||
var $addresses = array();
|
||||
|
||||
var $mail_priority = MAIL_NORMAL_PRIORITY;
|
||||
var $use_queue = true;
|
||||
|
||||
/** @var phpbb_template */
|
||||
/** @var \phpbb\template\template */
|
||||
protected $template;
|
||||
|
||||
var $eol = "\n";
|
||||
|
@ -53,7 +53,7 @@ class messenger
|
|||
function reset()
|
||||
{
|
||||
$this->addresses = $this->extra_headers = array();
|
||||
$this->vars = $this->msg = $this->replyto = $this->from = '';
|
||||
$this->msg = $this->replyto = $this->from = '';
|
||||
$this->mail_priority = MAIL_NORMAL_PRIORITY;
|
||||
}
|
||||
|
||||
|
@ -258,8 +258,6 @@ class messenger
|
|||
'body' => $template_file . '.txt',
|
||||
));
|
||||
|
||||
$this->vars = $this->template->get_template_vars();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -288,26 +286,11 @@ class messenger
|
|||
global $config, $user;
|
||||
|
||||
// We add some standard variables we always use, no need to specify them always
|
||||
if (!isset($this->vars['U_BOARD']))
|
||||
{
|
||||
$this->assign_vars(array(
|
||||
'U_BOARD' => generate_board_url(),
|
||||
));
|
||||
}
|
||||
|
||||
if (!isset($this->vars['EMAIL_SIG']))
|
||||
{
|
||||
$this->assign_vars(array(
|
||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])),
|
||||
));
|
||||
}
|
||||
|
||||
if (!isset($this->vars['SITENAME']))
|
||||
{
|
||||
$this->assign_vars(array(
|
||||
'SITENAME' => htmlspecialchars_decode($config['sitename']),
|
||||
));
|
||||
}
|
||||
$this->assign_vars(array(
|
||||
'U_BOARD' => generate_board_url(),
|
||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])),
|
||||
'SITENAME' => htmlspecialchars_decode($config['sitename']),
|
||||
));
|
||||
|
||||
// Parse message through template
|
||||
$this->msg = trim($this->template->assign_display('body'));
|
||||
|
@ -643,14 +626,14 @@ class messenger
|
|||
*/
|
||||
protected function setup_template()
|
||||
{
|
||||
global $config, $phpbb_root_path, $phpEx, $user, $phpbb_extension_manager;
|
||||
global $config, $phpbb_filesystem, $user, $phpbb_extension_manager;
|
||||
|
||||
if ($this->template instanceof phpbb_template)
|
||||
if ($this->template instanceof \phpbb\template\template)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context(), $phpbb_extension_manager);
|
||||
$this->template = new \phpbb\template\twig\twig($phpbb_filesystem, $config, $user, new \phpbb\template\context(), $phpbb_extension_manager);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -660,7 +643,7 @@ class messenger
|
|||
{
|
||||
$this->setup_template();
|
||||
|
||||
$this->template->set_style_names(array($path_name), $paths);
|
||||
$this->template->set_custom_style($path_name, $paths);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -717,7 +700,7 @@ class queue
|
|||
{
|
||||
global $db, $config, $phpEx, $phpbb_root_path, $user;
|
||||
|
||||
$lock = new phpbb_lock_flock($this->cache_file);
|
||||
$lock = new \phpbb\lock\flock($this->cache_file);
|
||||
$lock->acquire();
|
||||
|
||||
// avoid races, check file existence once
|
||||
|
@ -887,7 +870,7 @@ class queue
|
|||
return;
|
||||
}
|
||||
|
||||
$lock = new phpbb_lock_flock($this->cache_file);
|
||||
$lock = new \phpbb\lock\flock($this->cache_file);
|
||||
$lock->acquire();
|
||||
|
||||
if (file_exists($this->cache_file))
|
||||
|
@ -1004,12 +987,12 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
|
|||
$smtp->add_backtrace('Connecting to ' . $config['smtp_host'] . ':' . $config['smtp_port']);
|
||||
|
||||
// Ok we have error checked as much as we can to this point let's get on it already.
|
||||
if (!class_exists('phpbb_error_collector'))
|
||||
if (!class_exists('\phpbb\error_collector'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include($phpbb_root_path . 'includes/error_collector.' . $phpEx);
|
||||
}
|
||||
$collector = new phpbb_error_collector;
|
||||
$collector = new \phpbb\error_collector;
|
||||
$collector->install();
|
||||
$smtp->socket = fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 20);
|
||||
$collector->uninstall();
|
||||
|
@ -1723,12 +1706,12 @@ function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg)
|
|||
// Reference: http://bugs.php.net/bug.php?id=15841
|
||||
$headers = implode($eol, $headers);
|
||||
|
||||
if (!class_exists('phpbb_error_collector'))
|
||||
if (!class_exists('\phpbb\error_collector'))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/error_collector.' . $phpEx);
|
||||
}
|
||||
|
||||
$collector = new phpbb_error_collector;
|
||||
$collector = new \phpbb\error_collector;
|
||||
$collector->install();
|
||||
|
||||
// On some PHP Versions mail() *may* fail if there are newlines within the subject.
|
||||
|
|
|
@ -455,7 +455,7 @@ class p_master
|
|||
*/
|
||||
function load_active($mode = false, $module_url = false, $execute_module = true)
|
||||
{
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $phpbb_style;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $template;
|
||||
|
||||
$module_path = $this->include_path . $this->p_class;
|
||||
$icat = request_var('icat', '');
|
||||
|
@ -499,16 +499,16 @@ class p_master
|
|||
* the style paths for the extension (the ext author can change them
|
||||
* if necessary).
|
||||
*/
|
||||
$module_dir = explode('_', get_class($this->module));
|
||||
$module_dir = explode('\\', get_class($this->module));
|
||||
|
||||
// 0 phpbb, 1 ext, 2 vendor, 3 extension name, ...
|
||||
if (isset($module_dir[3]) && $module_dir[1] === 'ext')
|
||||
// 0 vendor, 1 extension name, ...
|
||||
if (isset($module_dir[1]))
|
||||
{
|
||||
$module_style_dir = $phpbb_root_path . 'ext/' . $module_dir[2] . '/' . $module_dir[3] . '/adm/style';
|
||||
$module_style_dir = $phpbb_root_path . 'ext/' . $module_dir[0] . '/' . $module_dir[1] . '/adm/style';
|
||||
|
||||
if (is_dir($module_style_dir))
|
||||
{
|
||||
$phpbb_style->set_custom_style('admin', array($module_style_dir, $phpbb_admin_path . 'style'), array(), '');
|
||||
$template->set_custom_style('adm', array($module_style_dir, $phpbb_admin_path . 'style'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -537,7 +537,7 @@ class p_master
|
|||
|
||||
if (is_dir($phpbb_root_path . $module_style_dir))
|
||||
{
|
||||
$phpbb_style->set_style(array($module_style_dir, 'styles'));
|
||||
$template->set_style(array($module_style_dir, 'styles'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -973,7 +973,7 @@ class p_master
|
|||
*/
|
||||
protected function get_short_name($basename)
|
||||
{
|
||||
if (substr($basename, 0, 6) === 'phpbb_')
|
||||
if (substr($basename, 0, 6) === 'phpbb\\' || strpos($basename, '\\') !== false)
|
||||
{
|
||||
return $basename;
|
||||
}
|
||||
|
@ -990,6 +990,6 @@ class p_master
|
|||
*/
|
||||
protected function is_full_class($basename)
|
||||
{
|
||||
return (preg_match('/^(phpbb|ucp|mcp|acp)_/', $basename));
|
||||
return (strpos($basename, '\\') !== false || preg_match('/^(ucp|mcp|acp)_/', $basename));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2166,6 +2166,11 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
|||
update_forum_tracking_info($data['forum_id'], $forum_last_post_time, $f_mark_time, false);
|
||||
}
|
||||
|
||||
// If a username was supplied or the poster is a guest, we will use the supplied username.
|
||||
// Doing it this way we can use "...post by guest-username..." in notifications when
|
||||
// "guest-username" is supplied or ommit the username if it is not.
|
||||
$username = ($username !== '' || !$user->data['is_registered']) ? $username : $user->data['username'];
|
||||
|
||||
// Send Notifications
|
||||
$notification_data = array_merge($data, array(
|
||||
'topic_title' => (isset($data['topic_title'])) ? $data['topic_title'] : $subject,
|
||||
|
|
|
@ -343,7 +343,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
|
|||
$userdata = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$auth2 = new phpbb_auth();
|
||||
$auth2 = new \phpbb\auth\auth();
|
||||
$auth2->acl($userdata);
|
||||
|
||||
if (!$auth2->acl_get('a_') && !$auth2->acl_get('m_') && !$auth2->acl_getf_global('m_'))
|
||||
|
|
|
@ -713,7 +713,7 @@ class fileupload
|
|||
}
|
||||
|
||||
$this->common_checks($file);
|
||||
$request->overwrite('local', $upload, phpbb_request_interface::FILES);
|
||||
$request->overwrite('local', $upload, \phpbb\request\request_interface::FILES);
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
|
|
@ -22,13 +22,13 @@ if (!defined('IN_PHPBB'))
|
|||
/**
|
||||
* Create a new UrlMatcher class and dump it into the cache file
|
||||
*
|
||||
* @param phpbb_extension_finder $finder Extension finder
|
||||
* @param \phpbb\extension\finder $finder Extension finder
|
||||
* @param RequestContext $context Symfony RequestContext object
|
||||
* @param string $root_path Root path
|
||||
* @param string $php_ext PHP extension
|
||||
* @return null
|
||||
*/
|
||||
function phpbb_get_url_matcher(phpbb_extension_finder $finder, RequestContext $context, $root_path, $php_ext)
|
||||
function phpbb_get_url_matcher(\phpbb\extension\finder $finder, RequestContext $context, $root_path, $php_ext)
|
||||
{
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
|
@ -46,14 +46,14 @@ function phpbb_get_url_matcher(phpbb_extension_finder $finder, RequestContext $c
|
|||
/**
|
||||
* Create a new UrlMatcher class and dump it into the cache file
|
||||
*
|
||||
* @param phpbb_extension_finder $finder Extension finder
|
||||
* @param \phpbb\extension\finder $finder Extension finder
|
||||
* @param string $root_path Root path
|
||||
* @param string $php_ext PHP extension
|
||||
* @return null
|
||||
*/
|
||||
function phpbb_create_dumped_url_matcher(phpbb_extension_finder $finder, $root_path, $php_ext)
|
||||
function phpbb_create_dumped_url_matcher(\phpbb\extension\finder $finder, $root_path, $php_ext)
|
||||
{
|
||||
$provider = new phpbb_controller_provider();
|
||||
$provider = new \phpbb\controller\provider();
|
||||
$routes = $provider->import_paths_from_finder($finder)->find();
|
||||
$dumper = new PhpMatcherDumper($routes);
|
||||
$cached_url_matcher_dump = $dumper->dump(array(
|
||||
|
@ -66,13 +66,13 @@ function phpbb_create_dumped_url_matcher(phpbb_extension_finder $finder, $root_p
|
|||
/**
|
||||
* Create a non-cached UrlMatcher
|
||||
*
|
||||
* @param phpbb_extension_finder $finder Extension finder
|
||||
* @param \phpbb\extension\finder $finder Extension finder
|
||||
* @param RequestContext $context Symfony RequestContext object
|
||||
* @return UrlMatcher
|
||||
*/
|
||||
function phpbb_create_url_matcher(phpbb_extension_finder $finder, RequestContext $context)
|
||||
function phpbb_create_url_matcher(\phpbb\extension\finder $finder, RequestContext $context)
|
||||
{
|
||||
$provider = new phpbb_controller_provider();
|
||||
$provider = new \phpbb\controller\provider();
|
||||
$routes = $provider->import_paths_from_finder($finder)->find();
|
||||
return new UrlMatcher($routes, $context);
|
||||
}
|
||||
|
|
|
@ -2150,8 +2150,8 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
|||
|
||||
if (!sizeof($error))
|
||||
{
|
||||
$current_legend = phpbb_groupposition_legend::GROUP_DISABLED;
|
||||
$current_teampage = phpbb_groupposition_teampage::GROUP_DISABLED;
|
||||
$current_legend = \phpbb\groupposition\legend::GROUP_DISABLED;
|
||||
$current_teampage = \phpbb\groupposition\teampage::GROUP_DISABLED;
|
||||
|
||||
$legend = $phpbb_container->get('groupposition.legend');
|
||||
$teampage = $phpbb_container->get('groupposition.teampage');
|
||||
|
@ -2162,7 +2162,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
|||
$current_legend = $legend->get_group_value($group_id);
|
||||
$current_teampage = $teampage->get_group_value($group_id);
|
||||
}
|
||||
catch (phpbb_groupposition_exception $exception)
|
||||
catch (\phpbb\groupposition\exception $exception)
|
||||
{
|
||||
trigger_error($user->lang($exception->getMessage()));
|
||||
}
|
||||
|
@ -2170,7 +2170,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
|||
|
||||
if (!empty($group_attributes['group_legend']))
|
||||
{
|
||||
if (($group_id && ($current_legend == phpbb_groupposition_legend::GROUP_DISABLED)) || !$group_id)
|
||||
if (($group_id && ($current_legend == \phpbb\groupposition\legend::GROUP_DISABLED)) || !$group_id)
|
||||
{
|
||||
// Old group currently not in the legend or new group, add at the end.
|
||||
$group_attributes['group_legend'] = 1 + $legend->get_group_count();
|
||||
|
@ -2181,22 +2181,22 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
|||
$group_attributes['group_legend'] = $current_legend;
|
||||
}
|
||||
}
|
||||
else if ($group_id && ($current_legend != phpbb_groupposition_legend::GROUP_DISABLED))
|
||||
else if ($group_id && ($current_legend != \phpbb\groupposition\legend::GROUP_DISABLED))
|
||||
{
|
||||
// Group is removed from the legend
|
||||
try
|
||||
{
|
||||
$legend->delete_group($group_id, true);
|
||||
}
|
||||
catch (phpbb_groupposition_exception $exception)
|
||||
catch (\phpbb\groupposition\exception $exception)
|
||||
{
|
||||
trigger_error($user->lang($exception->getMessage()));
|
||||
}
|
||||
$group_attributes['group_legend'] = phpbb_groupposition_legend::GROUP_DISABLED;
|
||||
$group_attributes['group_legend'] = \phpbb\groupposition\legend::GROUP_DISABLED;
|
||||
}
|
||||
else
|
||||
{
|
||||
$group_attributes['group_legend'] = phpbb_groupposition_legend::GROUP_DISABLED;
|
||||
$group_attributes['group_legend'] = \phpbb\groupposition\legend::GROUP_DISABLED;
|
||||
}
|
||||
|
||||
// Unset the objects, we don't need them anymore.
|
||||
|
@ -2296,13 +2296,13 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
|||
|
||||
// Remove the group from the teampage, only if unselected and we are editing a group,
|
||||
// which is currently displayed.
|
||||
if (!$group_teampage && $group_id && $current_teampage != phpbb_groupposition_teampage::GROUP_DISABLED)
|
||||
if (!$group_teampage && $group_id && $current_teampage != \phpbb\groupposition\teampage::GROUP_DISABLED)
|
||||
{
|
||||
try
|
||||
{
|
||||
$teampage->delete_group($group_id);
|
||||
}
|
||||
catch (phpbb_groupposition_exception $exception)
|
||||
catch (\phpbb\groupposition\exception $exception)
|
||||
{
|
||||
trigger_error($user->lang($exception->getMessage()));
|
||||
}
|
||||
|
@ -2320,24 +2320,24 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
|||
|
||||
try
|
||||
{
|
||||
if ($group_teampage && $current_teampage == phpbb_groupposition_teampage::GROUP_DISABLED)
|
||||
if ($group_teampage && $current_teampage == \phpbb\groupposition\teampage::GROUP_DISABLED)
|
||||
{
|
||||
$teampage->add_group($group_id);
|
||||
}
|
||||
|
||||
if ($group_teampage)
|
||||
{
|
||||
if ($current_teampage == phpbb_groupposition_teampage::GROUP_DISABLED)
|
||||
if ($current_teampage == \phpbb\groupposition\teampage::GROUP_DISABLED)
|
||||
{
|
||||
$teampage->add_group($group_id);
|
||||
}
|
||||
}
|
||||
else if ($group_id && ($current_teampage != phpbb_groupposition_teampage::GROUP_DISABLED))
|
||||
else if ($group_id && ($current_teampage != \phpbb\groupposition\teampage::GROUP_DISABLED))
|
||||
{
|
||||
$teampage->delete_group($group_id);
|
||||
}
|
||||
}
|
||||
catch (phpbb_groupposition_exception $exception)
|
||||
catch (\phpbb\groupposition\exception $exception)
|
||||
{
|
||||
trigger_error($user->lang($exception->getMessage()));
|
||||
}
|
||||
|
@ -2472,7 +2472,7 @@ function group_delete($group_id, $group_name = false)
|
|||
$legend->delete_group($group_id);
|
||||
unset($legend);
|
||||
}
|
||||
catch (phpbb_groupposition_exception $exception)
|
||||
catch (\phpbb\groupposition\exception $exception)
|
||||
{
|
||||
// The group we want to delete does not exist.
|
||||
// No reason to worry, we just continue the deleting process.
|
||||
|
@ -2485,7 +2485,7 @@ function group_delete($group_id, $group_name = false)
|
|||
$teampage->delete_group($group_id);
|
||||
unset($teampage);
|
||||
}
|
||||
catch (phpbb_groupposition_exception $exception)
|
||||
catch (\phpbb\groupposition\exception $exception)
|
||||
{
|
||||
// The group we want to delete does not exist.
|
||||
// No reason to worry, we just continue the deleting process.
|
||||
|
@ -2534,7 +2534,7 @@ function group_delete($group_id, $group_name = false)
|
|||
*/
|
||||
function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0, $pending = 0, $group_attributes = false)
|
||||
{
|
||||
global $db, $auth;
|
||||
global $db, $auth, $phpbb_container;
|
||||
|
||||
// We need both username and user_id info
|
||||
$result = user_get_id_name($user_id_ary, $username_ary);
|
||||
|
@ -2622,6 +2622,20 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
|
|||
|
||||
group_update_listings($group_id);
|
||||
|
||||
if ($pending)
|
||||
{
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
foreach ($add_id_ary as $user_id)
|
||||
{
|
||||
$phpbb_notifications->add_notifications('group_request', array(
|
||||
'group_id' => $group_id,
|
||||
'user_id' => $user_id,
|
||||
'group_name' => $group_name,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// Return false - no error
|
||||
return false;
|
||||
}
|
||||
|
@ -2635,7 +2649,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
|
|||
*/
|
||||
function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false)
|
||||
{
|
||||
global $db, $auth, $config, $phpbb_dispatcher;
|
||||
global $db, $auth, $config, $phpbb_dispatcher, $phpbb_container;
|
||||
|
||||
if ($config['coppa_enable'])
|
||||
{
|
||||
|
@ -2769,6 +2783,10 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
|
|||
|
||||
group_update_listings($group_id);
|
||||
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
$phpbb_notifications->delete_notifications('group_request', $user_id_ary, $group_id);
|
||||
|
||||
// Return false - no error
|
||||
return false;
|
||||
}
|
||||
|
@ -2858,7 +2876,7 @@ function remove_default_rank($group_id, $user_ids)
|
|||
*/
|
||||
function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false)
|
||||
{
|
||||
global $db, $auth, $phpbb_root_path, $phpEx, $config;
|
||||
global $db, $auth, $phpbb_root_path, $phpEx, $config, $phpbb_container;
|
||||
|
||||
// We need both username and user_id info
|
||||
$result = user_get_id_name($user_id_ary, $username_ary);
|
||||
|
@ -2911,11 +2929,10 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
|||
AND ' . $db->sql_in_set('ug.user_id', $user_id_ary);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$user_id_ary = $email_users = array();
|
||||
$user_id_ary = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$user_id_ary[] = $row['user_id'];
|
||||
$email_users[] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
@ -2930,26 +2947,14 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
|||
AND " . $db->sql_in_set('user_id', $user_id_ary);
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Send approved email to users...
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
$messenger = new messenger();
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
foreach ($email_users as $row)
|
||||
{
|
||||
$messenger->template('group_approved', $row['user_lang']);
|
||||
|
||||
$messenger->set_addresses($row);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($row['username']),
|
||||
'GROUP_NAME' => htmlspecialchars_decode($group_name),
|
||||
'U_GROUP' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=membership")
|
||||
);
|
||||
|
||||
$messenger->send($row['user_notify_type']);
|
||||
}
|
||||
|
||||
$messenger->save_queue();
|
||||
$phpbb_notifications->add_notifications('group_request_approved', array(
|
||||
'user_ids' => $user_id_ary,
|
||||
'group_id' => $group_id,
|
||||
'group_name' => $group_name,
|
||||
));
|
||||
$phpbb_notifications->delete_notifications('group_request', $user_id_ary, $group_id);
|
||||
|
||||
$log = 'LOG_USERS_APPROVED';
|
||||
break;
|
||||
|
|
|
@ -36,8 +36,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
|
|||
// Fixes a "bug" that makes forum_view use the same ordering as topic_view
|
||||
$request->overwrite('sk', null);
|
||||
$request->overwrite('sd', null);
|
||||
$request->overwrite('sk', null, phpbb_request_interface::POST);
|
||||
$request->overwrite('sd', null, phpbb_request_interface::POST);
|
||||
$request->overwrite('sk', null, \phpbb\request\request_interface::POST);
|
||||
$request->overwrite('sd', null, \phpbb\request\request_interface::POST);
|
||||
}
|
||||
|
||||
$forum_id = $forum_info['forum_id'];
|
||||
|
|
|
@ -462,7 +462,7 @@ function mcp_move_topic($topic_ids)
|
|||
|
||||
if (!$to_forum_id || $additional_msg)
|
||||
{
|
||||
$request->overwrite('confirm', null, phpbb_request_interface::POST);
|
||||
$request->overwrite('confirm', null, \phpbb\request\request_interface::POST);
|
||||
$request->overwrite('confirm_key', null);
|
||||
}
|
||||
|
||||
|
@ -694,7 +694,7 @@ function mcp_restore_topic($topic_ids)
|
|||
}
|
||||
|
||||
$topic_id = $request->variable('t', 0);
|
||||
if (!$request->is_set('quickmod', phpbb_request_interface::REQUEST))
|
||||
if (!$request->is_set('quickmod', \phpbb\request\request_interface::REQUEST))
|
||||
{
|
||||
$redirect = $request->variable('redirect', "index.$phpEx");
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
@ -823,7 +823,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
|
|||
}
|
||||
|
||||
$topic_id = $request->variable('t', 0);
|
||||
if (!$request->is_set('quickmod', phpbb_request_interface::REQUEST))
|
||||
if (!$request->is_set('quickmod', \phpbb\request\request_interface::REQUEST))
|
||||
{
|
||||
$redirect = $request->variable('redirect', "index.$phpEx");
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
@ -1136,7 +1136,7 @@ function mcp_fork_topic($topic_ids)
|
|||
|
||||
if ($additional_msg)
|
||||
{
|
||||
$request->overwrite('confirm', null, phpbb_request_interface::POST);
|
||||
$request->overwrite('confirm', null, \phpbb\request\request_interface::POST);
|
||||
$request->overwrite('confirm_key', null);
|
||||
}
|
||||
|
||||
|
|
|
@ -161,6 +161,7 @@ class mcp_pm_reports
|
|||
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $report_id),
|
||||
'S_CAN_VIEWIP' => $auth->acl_getf_global('m_info'),
|
||||
'S_POST_REPORTED' => $pm_info['message_reported'],
|
||||
'S_REPORT_CLOSED' => $report['report_closed'],
|
||||
'S_USER_NOTES' => true,
|
||||
|
||||
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $report_id),
|
||||
|
|
|
@ -729,7 +729,7 @@ class mcp_queue
|
|||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $message,
|
||||
|
@ -877,7 +877,7 @@ class mcp_queue
|
|||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $message,
|
||||
|
@ -937,9 +937,9 @@ class mcp_queue
|
|||
{
|
||||
$additional_msg = $user->lang['NO_REASON_DISAPPROVAL'];
|
||||
|
||||
$request->overwrite('confirm', null, phpbb_request_interface::POST);
|
||||
$request->overwrite('confirm_key', null, phpbb_request_interface::POST);
|
||||
$request->overwrite('confirm_key', null, phpbb_request_interface::REQUEST);
|
||||
$request->overwrite('confirm', null, \phpbb\request\request_interface::POST);
|
||||
$request->overwrite('confirm_key', null, \phpbb\request\request_interface::POST);
|
||||
$request->overwrite('confirm_key', null, \phpbb\request\request_interface::REQUEST);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1212,7 +1212,7 @@ class mcp_queue
|
|||
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
|
||||
'MESSAGE_TEXT' => $message,
|
||||
|
|
|
@ -189,6 +189,7 @@ class mcp_reports
|
|||
'S_POST_REPORTED' => $post_info['post_reported'],
|
||||
'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED),
|
||||
'S_POST_LOCKED' => $post_info['post_edit_locked'],
|
||||
'S_REPORT_CLOSED' => $report['report_closed'],
|
||||
'S_USER_NOTES' => true,
|
||||
|
||||
'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '',
|
||||
|
|
|
@ -253,7 +253,7 @@ class mcp_warn
|
|||
// Check if can send a notification
|
||||
if ($config['allow_privmsg'])
|
||||
{
|
||||
$auth2 = new phpbb_auth();
|
||||
$auth2 = new \phpbb\auth\auth();
|
||||
$auth2->acl($user_row);
|
||||
$s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
|
||||
unset($auth2);
|
||||
|
@ -365,7 +365,7 @@ class mcp_warn
|
|||
// Check if can send a notification
|
||||
if ($config['allow_privmsg'])
|
||||
{
|
||||
$auth2 = new phpbb_auth();
|
||||
$auth2 = new \phpbb\auth\auth();
|
||||
$auth2->acl($user_row);
|
||||
$s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
|
||||
unset($auth2);
|
||||
|
|
|
@ -1545,7 +1545,7 @@ class parse_message extends bbcode_firstpass
|
|||
global $request;
|
||||
|
||||
$this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true));
|
||||
$attachment_data = $request->variable('attachment_data', array(0 => array('' => '')), true, phpbb_request_interface::POST);
|
||||
$attachment_data = $request->variable('attachment_data', array(0 => array('' => '')), true, \phpbb\request\request_interface::POST);
|
||||
$this->attachment_data = array();
|
||||
|
||||
$check_user_id = ($check_user_id === false) ? $user->data['user_id'] : $check_user_id;
|
||||
|
|
34
phpBB/includes/ucp/info/ucp_auth_link.php
Normal file
34
phpBB/includes/ucp/info/ucp_auth_link.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* @package ucp
|
||||
* @copyright (c) 2013 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @package module_install
|
||||
*/
|
||||
class ucp_auth_link_info
|
||||
{
|
||||
function module()
|
||||
{
|
||||
return array(
|
||||
'filename' => 'ucp_auth_link',
|
||||
'title' => 'UCP_AUTH_LINK',
|
||||
'version' => '1.0.0',
|
||||
'modes' => array(
|
||||
'auth_link' => array('title' => 'UCP_AUTH_LINK_MANAGE', 'auth' => '', 'cat' => array('UCP_PROFILE')),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function install()
|
||||
{
|
||||
}
|
||||
|
||||
function uninstall()
|
||||
{
|
||||
}
|
||||
}
|
142
phpBB/includes/ucp/ucp_auth_link.php
Normal file
142
phpBB/includes/ucp/ucp_auth_link.php
Normal file
|
@ -0,0 +1,142 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* @package ucp
|
||||
* @copyright (c) 2013 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
class ucp_auth_link
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $u_action;
|
||||
|
||||
/**
|
||||
* Generates the ucp_auth_link page and handles the auth link process
|
||||
*
|
||||
* @param int $id
|
||||
* @param string $mode
|
||||
*/
|
||||
public function main($id, $mode)
|
||||
{
|
||||
global $config, $request, $template, $phpbb_container, $user;
|
||||
|
||||
$error = array();
|
||||
|
||||
$auth_provider = $phpbb_container->get('auth.provider.' . $config['auth_method']);
|
||||
|
||||
// confirm that the auth provider supports this page
|
||||
$provider_data = $auth_provider->get_auth_link_data();
|
||||
if ($provider_data === null)
|
||||
{
|
||||
$error[] = 'UCP_AUTH_LINK_NOT_SUPPORTED';
|
||||
}
|
||||
|
||||
$s_hidden_fields = array();
|
||||
add_form_key('ucp_auth_link');
|
||||
|
||||
$submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST);
|
||||
|
||||
// This path is only for primary actions
|
||||
if (!sizeof($error) && $submit)
|
||||
{
|
||||
if (!check_form_key('ucp_auth_link'))
|
||||
{
|
||||
$error[] = 'FORM_INVALID';
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
{
|
||||
// Any post data could be necessary for auth (un)linking
|
||||
$link_data = $request->get_super_global(\phpbb\request\request_interface::POST);
|
||||
|
||||
// The current user_id is also necessary
|
||||
$link_data['user_id'] = $user->data['user_id'];
|
||||
|
||||
// Tell the provider that the method is auth_link not login_link
|
||||
$link_data['link_method'] = 'auth_link';
|
||||
|
||||
if ($request->variable('link', 0, false, \phpbb\request\request_interface::POST))
|
||||
{
|
||||
$error[] = $auth_provider->link_account($link_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$error[] = $auth_provider->unlink_account($link_data);
|
||||
}
|
||||
|
||||
// Template data may have changed, get new data
|
||||
$provider_data = $auth_provider->get_auth_link_data();
|
||||
}
|
||||
}
|
||||
|
||||
// In some cases, a request to an external server may be required. In
|
||||
// these cases, the GET parameter 'link' should exist and should be true
|
||||
if ($request->variable('link', false))
|
||||
{
|
||||
// In this case the link data should only be populated with the
|
||||
// link_method as the provider dictates how data is returned to it.
|
||||
$link_data = array('link_method' => 'auth_link');
|
||||
|
||||
$error[] = $auth_provider->link_account($link_data);
|
||||
|
||||
// Template data may have changed, get new data
|
||||
$provider_data = $auth_provider->get_auth_link_data();
|
||||
}
|
||||
|
||||
if (isset($provider_data['VARS']))
|
||||
{
|
||||
// Handle hidden fields separately
|
||||
if (isset($provider_data['VARS']['HIDDEN_FIELDS']))
|
||||
{
|
||||
$s_hidden_fields = array_merge($s_hidden_fields, $provider_data['VARS']['HIDDEN_FIELDS']);
|
||||
unset($provider_data['VARS']['HIDDEN_FIELDS']);
|
||||
}
|
||||
|
||||
$template->assign_vars($provider_data['VARS']);
|
||||
}
|
||||
|
||||
if (isset($provider_data['BLOCK_VAR_NAME']))
|
||||
{
|
||||
foreach ($provider_data['BLOCK_VARS'] as $block_vars)
|
||||
{
|
||||
// See if there are additional hidden fields. This should be an associative array
|
||||
if (isset($block_vars['HIDDEN_FIELDS']))
|
||||
{
|
||||
$block_vars['HIDDEN_FIELDS'] = build_hidden_fields($block_vars['HIDDEN_FIELDS']);
|
||||
}
|
||||
|
||||
$template->assign_block_vars($provider_data['BLOCK_VAR_NAME'], $block_vars);
|
||||
}
|
||||
}
|
||||
|
||||
$s_hidden_fields = build_hidden_fields($s_hidden_fields);
|
||||
|
||||
// Replace "error" strings with their real, localised form
|
||||
$error = array_map(array($user, 'lang'), $error);
|
||||
$error = implode('<br />', $error);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ERROR' => $error,
|
||||
|
||||
'PROVIDER_TEMPLATE_FILE' => $provider_data['TEMPLATE_FILE'],
|
||||
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||
'S_UCP_ACTION' => $this->u_action,
|
||||
));
|
||||
|
||||
$this->tpl_name = 'ucp_auth_link';
|
||||
$this->page_title = 'UCP_AUTH_LINK';
|
||||
}
|
||||
}
|
|
@ -34,8 +34,8 @@ class ucp_groups
|
|||
$return_page = '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '">', '</a>');
|
||||
|
||||
$mark_ary = request_var('mark', array(0));
|
||||
$submit = $request->variable('submit', false, false, phpbb_request_interface::POST);
|
||||
$delete = $request->variable('delete', false, false, phpbb_request_interface::POST);
|
||||
$submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST);
|
||||
$delete = $request->variable('delete', false, false, \phpbb\request\request_interface::POST);
|
||||
$error = $data = array();
|
||||
|
||||
switch ($mode)
|
||||
|
@ -197,37 +197,6 @@ class ucp_groups
|
|||
else
|
||||
{
|
||||
group_user_add($group_id, $user->data['user_id'], false, false, false, 0, 1);
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
$messenger = new messenger();
|
||||
|
||||
$sql = 'SELECT u.username, u.username_clean, u.user_email, u.user_notify_type, u.user_jabber, u.user_lang
|
||||
FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . " u
|
||||
WHERE ug.user_id = u.user_id
|
||||
AND ug.group_leader = 1
|
||||
AND ug.group_id = $group_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$messenger->template('group_request', $row['user_lang']);
|
||||
|
||||
$messenger->set_addresses($row);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($row['username']),
|
||||
'GROUP_NAME' => htmlspecialchars_decode($group_row[$group_id]['group_name']),
|
||||
'REQUEST_USERNAME' => $user->data['username'],
|
||||
|
||||
'U_PENDING' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=manage&action=list&g=$group_id",
|
||||
'U_GROUP' => generate_board_url() . "/memberlist.$phpEx?mode=group&g=$group_id")
|
||||
);
|
||||
|
||||
$messenger->send($row['user_notify_type']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$messenger->save_queue();
|
||||
}
|
||||
|
||||
add_log('user', $user->data['user_id'], 'LOG_USER_GROUP_JOIN' . (($group_row[$group_id]['group_type'] == GROUP_FREE) ? '' : '_PENDING'), $group_row[$group_id]['group_name']);
|
||||
|
@ -496,7 +465,7 @@ class ucp_groups
|
|||
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
|
||||
|
||||
// This is normalised data, without the group_ prefix
|
||||
$avatar_data = phpbb_avatar_manager::clean_row($group_row);
|
||||
$avatar_data = \phpbb\avatar\manager::clean_row($group_row);
|
||||
}
|
||||
|
||||
// Did we submit?
|
||||
|
|
243
phpBB/includes/ucp/ucp_login_link.php
Normal file
243
phpBB/includes/ucp/ucp_login_link.php
Normal file
|
@ -0,0 +1,243 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* @package ucp
|
||||
* @copyright (c) 2013 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* ucp_login_link
|
||||
* Allows users of external accounts link those accounts to their phpBB accounts
|
||||
* during an attempted login.
|
||||
* @package ucp
|
||||
*/
|
||||
class ucp_login_link
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $u_action;
|
||||
|
||||
/**
|
||||
* Generates the ucp_login_link page and handles login link process
|
||||
*
|
||||
* @param int $id
|
||||
* @param string $mode
|
||||
*/
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $phpbb_container, $request, $template, $user;
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
// Initialize necessary variables
|
||||
$login_error = null;
|
||||
$login_link_error = null;
|
||||
$login_username = null;
|
||||
|
||||
// Build the data array
|
||||
$data = $this->get_login_link_data_array();
|
||||
|
||||
// Ensure the person was sent here with login_link data
|
||||
if (empty($data))
|
||||
{
|
||||
$login_link_error = $user->lang['LOGIN_LINK_NO_DATA_PROVIDED'];
|
||||
}
|
||||
|
||||
// Use the auth_provider requested even if different from configured
|
||||
$auth_provider = 'auth.provider.' . $request->variable('auth_provider', $config['auth_method']);
|
||||
$auth_provider = $phpbb_container->get($auth_provider);
|
||||
|
||||
// Set the link_method to login_link
|
||||
$data['link_method'] = 'login_link';
|
||||
|
||||
// Have the authentication provider check that all necessary data is available
|
||||
$result = $auth_provider->login_link_has_necessary_data($data);
|
||||
if ($result !== null)
|
||||
{
|
||||
$login_link_error = $user->lang[$result];
|
||||
}
|
||||
|
||||
// Perform link action if there is no error
|
||||
if (!$login_link_error)
|
||||
{
|
||||
if ($request->is_set_post('login'))
|
||||
{
|
||||
$login_username = $request->variable('login_username', '', false, \phpbb\request\request_interface::POST);
|
||||
$login_password = $request->untrimmed_variable('login_password', '', true, \phpbb\request\request_interface::POST);
|
||||
|
||||
$login_result = $auth_provider->login($login_username, $login_password);
|
||||
|
||||
// We only care if there is or is not an error
|
||||
$login_error = $this->process_login_result($login_result);
|
||||
|
||||
if (!$login_error)
|
||||
{
|
||||
// Give the user_id to the data
|
||||
$data['user_id'] = $login_result['user_row']['user_id'];
|
||||
|
||||
// The user is now logged in, attempt to link the user to the external account
|
||||
$result = $auth_provider->link_account($data);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$login_link_error = $user->lang[$result];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Finish login
|
||||
$result = $user->session_create($login_result['user_row']['user_id'], false, false, true);
|
||||
|
||||
// Perform a redirect as the account has been linked
|
||||
$this->perform_redirect();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
// Common template elements
|
||||
'LOGIN_LINK_ERROR' => $login_link_error,
|
||||
'PASSWORD_CREDENTIAL' => 'login_password',
|
||||
'USERNAME_CREDENTIAL' => 'login_username',
|
||||
'S_HIDDEN_FIELDS' => $this->get_hidden_fields($data),
|
||||
|
||||
// Registration elements
|
||||
'REGISTER_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
|
||||
|
||||
// Login elements
|
||||
'LOGIN_ERROR' => $login_error,
|
||||
'LOGIN_USERNAME' => $login_username,
|
||||
));
|
||||
|
||||
$this->tpl_name = 'ucp_login_link';
|
||||
$this->page_title = 'UCP_LOGIN_LINK';
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the hidden fields string from the data array.
|
||||
*
|
||||
* @param array $data This function only includes data in the array
|
||||
* that has a key that begins with 'login_link_'
|
||||
* @return string A string of hidden fields that can be included in the
|
||||
* template
|
||||
*/
|
||||
protected function get_hidden_fields($data)
|
||||
{
|
||||
$fields = array();
|
||||
|
||||
foreach ($data as $key => $value)
|
||||
{
|
||||
$fields['login_link_' . $key] = $value;
|
||||
}
|
||||
|
||||
return build_hidden_fields($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the login_link data array
|
||||
*
|
||||
* @return array All login_link data. This is all GET data whose names
|
||||
* begin with 'login_link_'
|
||||
*/
|
||||
protected function get_login_link_data_array()
|
||||
{
|
||||
global $request;
|
||||
|
||||
$var_names = $request->variable_names(\phpbb\request\request_interface::GET);
|
||||
$login_link_data = array();
|
||||
$string_start_length = strlen('login_link_');
|
||||
|
||||
foreach ($var_names as $var_name)
|
||||
{
|
||||
if (strpos($var_name, 'login_link_') === 0)
|
||||
{
|
||||
$key_name = substr($var_name, $string_start_length);
|
||||
$login_link_data[$key_name] = $request->variable($var_name, '', false, \phpbb\request\request_interface::GET);
|
||||
}
|
||||
}
|
||||
|
||||
return $login_link_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the result array from the login process
|
||||
* @param array $result The login result array
|
||||
* @return string|null If there was an error in the process, a string is
|
||||
* returned. If the login was successful, then null is
|
||||
* returned.
|
||||
*/
|
||||
protected function process_login_result($result)
|
||||
{
|
||||
global $config, $request, $template, $user;
|
||||
|
||||
$login_error = null;
|
||||
|
||||
if ($result['status'] != LOGIN_SUCCESS)
|
||||
{
|
||||
// Handle all errors first
|
||||
if ($result['status'] == LOGIN_BREAK)
|
||||
{
|
||||
trigger_error($result['error_msg']);
|
||||
}
|
||||
|
||||
switch ($result['status'])
|
||||
{
|
||||
case LOGIN_ERROR_ATTEMPTS:
|
||||
|
||||
$captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
||||
$captcha->init(CONFIRM_LOGIN);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'CAPTCHA_TEMPLATE' => $captcha->get_template(),
|
||||
));
|
||||
|
||||
$login_error = $user->lang[$result['error_msg']];
|
||||
break;
|
||||
|
||||
case LOGIN_ERROR_PASSWORD_CONVERT:
|
||||
$login_error = sprintf(
|
||||
$user->lang[$result['error_msg']],
|
||||
($config['email_enable']) ? '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') . '">' : '',
|
||||
($config['email_enable']) ? '</a>' : '',
|
||||
($config['board_contact']) ? '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">' : '',
|
||||
($config['board_contact']) ? '</a>' : ''
|
||||
);
|
||||
break;
|
||||
|
||||
// Username, password, etc...
|
||||
default:
|
||||
$login_error = $user->lang[$result['error_msg']];
|
||||
|
||||
// Assign admin contact to some error messages
|
||||
if ($result['error_msg'] == 'LOGIN_ERROR_USERNAME' || $result['error_msg'] == 'LOGIN_ERROR_PASSWORD')
|
||||
{
|
||||
$login_error = (!$config['board_contact']) ? sprintf($user->lang[$result['error_msg']], '', '') : sprintf($user->lang[$result['error_msg']], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $login_error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a post login redirect
|
||||
*/
|
||||
protected function perform_redirect()
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
$url = append_sid($phpbb_root_path . 'index.' . $phpEx);
|
||||
redirect($url);
|
||||
}
|
||||
}
|
|
@ -296,7 +296,7 @@ class ucp_main
|
|||
}
|
||||
else
|
||||
{
|
||||
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
|
||||
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
|
||||
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
|
||||
}
|
||||
|
||||
|
|
|
@ -163,11 +163,11 @@ class ucp_notifications
|
|||
* Output all the notification types to the template
|
||||
*
|
||||
* @param string $block
|
||||
* @param phpbb_notification_manager $phpbb_notifications
|
||||
* @param phpbb_template $template
|
||||
* @param phpbb_user $user
|
||||
* @param \phpbb\notification\manager $phpbb_notifications
|
||||
* @param \phpbb\template\template $template
|
||||
* @param \phpbb\user $user
|
||||
*/
|
||||
public function output_notification_types($subscriptions, $block = 'notification_types', phpbb_notification_manager $phpbb_notifications, phpbb_template $template, phpbb_user $user)
|
||||
public function output_notification_types($subscriptions, $block = 'notification_types', \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user)
|
||||
{
|
||||
$notification_methods = $phpbb_notifications->get_subscription_methods();
|
||||
|
||||
|
@ -210,11 +210,11 @@ class ucp_notifications
|
|||
* Output all the notification methods to the template
|
||||
*
|
||||
* @param string $block
|
||||
* @param phpbb_notification_manager $phpbb_notifications
|
||||
* @param phpbb_template $template
|
||||
* @param phpbb_user $user
|
||||
* @param \phpbb\notification\manager $phpbb_notifications
|
||||
* @param \phpbb\template\template $template
|
||||
* @param \phpbb\user $user
|
||||
*/
|
||||
public function output_notification_methods($block = 'notification_methods', phpbb_notification_manager $phpbb_notifications, phpbb_template $template, phpbb_user $user)
|
||||
public function output_notification_methods($block = 'notification_methods', \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user)
|
||||
{
|
||||
$notification_methods = $phpbb_notifications->get_subscription_methods();
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class ucp_prefs
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
|
||||
global $config, $db, $user, $auth, $template, $phpbb_dispatcher, $phpbb_root_path, $phpEx;
|
||||
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$error = $data = array();
|
||||
|
@ -55,6 +55,20 @@ class ucp_prefs
|
|||
$data['notifymethod'] = NOTIFY_BOTH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add UCP edit global settings data before they are assigned to the template or submitted
|
||||
*
|
||||
* To assign data to the template, use $template->assign_vars()
|
||||
*
|
||||
* @event core.ucp_prefs_personal_data
|
||||
* @var bool submit Do we display the form only
|
||||
* or did the user press submit
|
||||
* @var array data Array with current ucp options data
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('submit', 'data');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_data', compact($vars)));
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
if ($config['override_user_style'])
|
||||
|
@ -93,6 +107,17 @@ class ucp_prefs
|
|||
'user_style' => $data['style'],
|
||||
);
|
||||
|
||||
/**
|
||||
* Update UCP edit global settings data on form submit
|
||||
*
|
||||
* @event core.ucp_prefs_personal_update_data
|
||||
* @var array data Submitted display options data
|
||||
* @var array sql_ary Display options data we udpate
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('data', 'sql_ary');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_update_data', compact($vars)));
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_id = ' . $user->data['user_id'];
|
||||
|
@ -209,6 +234,20 @@ class ucp_prefs
|
|||
'wordcensor' => request_var('wordcensor', (bool) $user->optionget('viewcensors')),
|
||||
);
|
||||
|
||||
/**
|
||||
* Add UCP edit display options data before they are assigned to the template or submitted
|
||||
*
|
||||
* To assign data to the template, use $template->assign_vars()
|
||||
*
|
||||
* @event core.ucp_prefs_view_data
|
||||
* @var bool submit Do we display the form only
|
||||
* or did the user press submit
|
||||
* @var array data Array with current ucp options data
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('submit', 'data');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_data', compact($vars)));
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
$error = validate_data($data, array(
|
||||
|
@ -247,6 +286,17 @@ class ucp_prefs
|
|||
'user_post_show_days' => $data['post_st'],
|
||||
);
|
||||
|
||||
/**
|
||||
* Update UCP edit display options data on form submit
|
||||
*
|
||||
* @event core.ucp_prefs_view_update_data
|
||||
* @var array data Submitted display options data
|
||||
* @var array sql_ary Display options data we udpate
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('data', 'sql_ary');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_update_data', compact($vars)));
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_id = ' . $user->data['user_id'];
|
||||
|
@ -335,6 +385,20 @@ class ucp_prefs
|
|||
);
|
||||
add_form_key('ucp_prefs_post');
|
||||
|
||||
/**
|
||||
* Add UCP edit posting defaults data before they are assigned to the template or submitted
|
||||
*
|
||||
* To assign data to the template, use $template->assign_vars()
|
||||
*
|
||||
* @event core.ucp_prefs_post_data
|
||||
* @var bool submit Do we display the form only
|
||||
* or did the user press submit
|
||||
* @var array data Array with current ucp options data
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('submit', 'data');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_post_data', compact($vars)));
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
if (check_form_key('ucp_prefs_post'))
|
||||
|
@ -348,6 +412,17 @@ class ucp_prefs
|
|||
'user_notify' => $data['notify'],
|
||||
);
|
||||
|
||||
/**
|
||||
* Update UCP edit posting defaults data on form submit
|
||||
*
|
||||
* @event core.ucp_prefs_post_update_data
|
||||
* @var array data Submitted display options data
|
||||
* @var array sql_ary Display options data we udpate
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('data', 'sql_ary');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_post_update_data', compact($vars)));
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_id = ' . $user->data['user_id'];
|
||||
|
|
|
@ -34,9 +34,9 @@ class ucp_profile
|
|||
|
||||
$user->add_lang('posting');
|
||||
|
||||
$preview = $request->variable('preview', false, false, phpbb_request_interface::POST);
|
||||
$submit = $request->variable('submit', false, false, phpbb_request_interface::POST);
|
||||
$delete = $request->variable('delete', false, false, phpbb_request_interface::POST);
|
||||
$preview = $request->variable('preview', false, false, \phpbb\request\request_interface::POST);
|
||||
$submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST);
|
||||
$delete = $request->variable('delete', false, false, \phpbb\request\request_interface::POST);
|
||||
$error = $data = array();
|
||||
$s_hidden_fields = '';
|
||||
|
||||
|
@ -567,7 +567,7 @@ class ucp_profile
|
|||
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
|
||||
|
||||
// This is normalised data, without the user_ prefix
|
||||
$avatar_data = phpbb_avatar_manager::clean_row($user->data);
|
||||
$avatar_data = \phpbb\avatar\manager::clean_row($user->data);
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@ class ucp_register
|
|||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
|
||||
global $request;
|
||||
global $request, $phpbb_container;
|
||||
|
||||
//
|
||||
if ($config['require_activation'] == USER_ACTIVATION_DISABLE)
|
||||
|
@ -78,19 +78,37 @@ class ucp_register
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$cp = new custom_profile();
|
||||
|
||||
$error = $cp_data = $cp_error = array();
|
||||
$s_hidden_fields = array();
|
||||
|
||||
// Handle login_link data added to $_hidden_fields
|
||||
$login_link_data = $this->get_login_link_data_array();
|
||||
|
||||
if (!empty($login_link_data))
|
||||
{
|
||||
// Confirm that we have all necessary data
|
||||
$auth_provider = 'auth.provider.' . $request->variable('auth_provider', $config['auth_method']);
|
||||
$auth_provider = $phpbb_container->get($auth_provider);
|
||||
|
||||
$result = $auth_provider->login_link_has_necessary_data($login_link_data);
|
||||
if ($result !== null)
|
||||
{
|
||||
$error[] = $user->lang[$result];
|
||||
}
|
||||
|
||||
$s_hidden_fields = array_merge($s_hidden_fields, $this->get_login_link_data_for_hidden_fields($login_link_data));
|
||||
}
|
||||
|
||||
if (!$agreed || ($coppa === false && $config['coppa_enable']) || ($coppa && !$config['coppa_enable']))
|
||||
{
|
||||
$add_lang = ($change_lang) ? '&change_lang=' . urlencode($change_lang) : '';
|
||||
$add_coppa = ($coppa !== false) ? '&coppa=' . $coppa : '';
|
||||
|
||||
$s_hidden_fields = array(
|
||||
$s_hidden_fields = array_merge($s_hidden_fields, array(
|
||||
'change_lang' => '',
|
||||
);
|
||||
));
|
||||
|
||||
// If we change the language, we want to pass on some more possible parameter.
|
||||
if ($change_lang)
|
||||
|
@ -398,15 +416,28 @@ class ucp_register
|
|||
}
|
||||
}
|
||||
|
||||
// Perform account linking if necessary
|
||||
if (!empty($login_link_data))
|
||||
{
|
||||
$login_link_data['user_id'] = $user_id;
|
||||
|
||||
$result = $auth_provider->link_account($login_link_data);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$message = $message . '<br /><br />' . $user->lang[$result];
|
||||
}
|
||||
}
|
||||
|
||||
$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
}
|
||||
|
||||
$s_hidden_fields = array(
|
||||
$s_hidden_fields = array_merge($s_hidden_fields, array(
|
||||
'agreed' => 'true',
|
||||
'change_lang' => 0,
|
||||
);
|
||||
));
|
||||
|
||||
if ($config['coppa_enable'])
|
||||
{
|
||||
|
@ -474,4 +505,49 @@ class ucp_register
|
|||
$this->tpl_name = 'ucp_register';
|
||||
$this->page_title = 'UCP_REGISTRATION';
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the login_link data array
|
||||
*
|
||||
* @return array Returns an array of all POST paramaters whose names
|
||||
* begin with 'login_link_'
|
||||
*/
|
||||
protected function get_login_link_data_array()
|
||||
{
|
||||
global $request;
|
||||
|
||||
$var_names = $request->variable_names(\phpbb\request\request_interface::POST);
|
||||
$login_link_data = array();
|
||||
$string_start_length = strlen('login_link_');
|
||||
|
||||
foreach ($var_names as $var_name)
|
||||
{
|
||||
if (strpos($var_name, 'login_link_') === 0)
|
||||
{
|
||||
$key_name = substr($var_name, $string_start_length);
|
||||
$login_link_data[$key_name] = $request->variable($var_name, '', false, \phpbb\request\request_interface::POST);
|
||||
}
|
||||
}
|
||||
|
||||
return $login_link_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepends they key names of an associative array with 'login_link_' for
|
||||
* inclusion on the page as hidden fields.
|
||||
*
|
||||
* @param array $data The array to be modified
|
||||
* @return array The modified array
|
||||
*/
|
||||
protected function get_login_link_data_for_hidden_fields($data)
|
||||
{
|
||||
$new_data = array();
|
||||
|
||||
foreach ($data as $key => $value)
|
||||
{
|
||||
$new_data['login_link_' . $key] = $value;
|
||||
}
|
||||
|
||||
return $new_data;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ class ucp_remind
|
|||
}
|
||||
|
||||
// Check users permissions
|
||||
$auth2 = new phpbb_auth();
|
||||
$auth2 = new \phpbb\auth\auth();
|
||||
$auth2->acl($user_row);
|
||||
|
||||
if (!$auth2->acl_get('u_chgpasswd'))
|
||||
|
@ -101,6 +101,8 @@ class ucp_remind
|
|||
|
||||
$messenger->set_addresses($user_row);
|
||||
|
||||
$messenger->anti_abuse_headers($config, $user);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($user_row['username']),
|
||||
'PASSWORD' => htmlspecialchars_decode($user_password),
|
||||
|
|
|
@ -229,7 +229,7 @@ class ucp_zebra
|
|||
{
|
||||
$message = ($updated) ? $user->lang[$l_mode . '_UPDATED'] : implode('<br />', $error);
|
||||
|
||||
$json_response = new phpbb_json_response;
|
||||
$json_response = new \phpbb\json_response;
|
||||
$json_response->send(array(
|
||||
'success' => $updated,
|
||||
|
||||
|
|
|
@ -77,16 +77,16 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
|||
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
||||
|
||||
// Setup class loader first
|
||||
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader->register();
|
||||
|
||||
// Set up container (must be done here because extensions table may not exist)
|
||||
$container_extensions = array(
|
||||
new phpbb_di_extension_config($phpbb_root_path . 'config.' . $phpEx),
|
||||
new phpbb_di_extension_core($phpbb_root_path . 'config/'),
|
||||
new \phpbb\di\extension\config($phpbb_root_path . 'config.' . $phpEx),
|
||||
new \phpbb\di\extension\core($phpbb_root_path . 'config/'),
|
||||
);
|
||||
$container_passes = array(
|
||||
new phpbb_di_pass_collection_pass(),
|
||||
new \phpbb\di\pass\collection_pass(),
|
||||
);
|
||||
$phpbb_container = phpbb_create_container($container_extensions, $phpbb_root_path, $phpEx);
|
||||
|
||||
|
@ -211,7 +211,7 @@ while (!$migrator->finished())
|
|||
{
|
||||
$migrator->update();
|
||||
}
|
||||
catch (phpbb_db_migration_exception $e)
|
||||
catch (\phpbb\db\migration\exception $e)
|
||||
{
|
||||
echo $e->getLocalisedMessage($user);
|
||||
|
||||
|
|
|
@ -108,11 +108,11 @@ phpbb_include_updated('includes/utf/utf_tools.' . $phpEx);
|
|||
phpbb_require_updated('includes/functions_install.' . $phpEx);
|
||||
|
||||
// Setup class loader first
|
||||
$phpbb_class_loader_new = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}install/update/new/phpbb/", $phpEx);
|
||||
$phpbb_class_loader_new = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}install/update/new/phpbb/", $phpEx);
|
||||
$phpbb_class_loader_new->register();
|
||||
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader->register();
|
||||
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
|
||||
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
|
||||
$phpbb_class_loader_ext->register();
|
||||
|
||||
// Set up container
|
||||
|
@ -219,8 +219,8 @@ $sub = $request->variable('sub', '');
|
|||
// Set PHP error handler to ours
|
||||
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
||||
|
||||
$user = new phpbb_user();
|
||||
$auth = new phpbb_auth();
|
||||
$user = new \phpbb\user();
|
||||
$auth = new \phpbb\auth\auth();
|
||||
|
||||
// Add own hook handler, if present. :o
|
||||
if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
|
||||
|
@ -240,19 +240,15 @@ else
|
|||
}
|
||||
|
||||
// Set some standard variables we want to force
|
||||
$config = new phpbb_config(array(
|
||||
$config = new \phpbb\config\config(array(
|
||||
'load_tplcompile' => '1'
|
||||
));
|
||||
|
||||
$phpbb_style_resource_locator = new phpbb_style_resource_locator();
|
||||
$phpbb_style_path_provider = new phpbb_style_path_provider();
|
||||
$template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context());
|
||||
$phpbb_style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider, $template);
|
||||
$phpbb_style->set_ext_dir_prefix('adm/');
|
||||
|
||||
$phpbb_filesystem = $phpbb_container->get('filesystem');
|
||||
$template = new \phpbb\template\twig\twig($phpbb_filesystem, $config, $user, new \phpbb\template\context());
|
||||
$paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style');
|
||||
$paths = array_filter($paths, 'is_dir');
|
||||
$phpbb_style->set_custom_style('admin', $paths, array(), '');
|
||||
$template->set_custom_style('adm', $paths);
|
||||
|
||||
$template->assign_var('T_ASSETS_PATH', '../assets');
|
||||
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
|
||||
|
|
|
@ -130,7 +130,7 @@ class install_convert extends module
|
|||
unset($dbpasswd);
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
|
@ -345,7 +345,7 @@ class install_convert extends module
|
|||
$this->page_title = $lang['STAGE_SETTINGS'];
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
|
@ -586,7 +586,7 @@ class install_convert extends module
|
|||
unset($dbpasswd);
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
|
@ -739,7 +739,7 @@ class install_convert extends module
|
|||
// For conversions we are a bit less strict and set to a search backend we know exist...
|
||||
if (!class_exists($search_type))
|
||||
{
|
||||
$search_type = 'phpbb_search_fulltext_native';
|
||||
$search_type = '\phpbb\search\fulltext_native';
|
||||
set_config('search_type', $search_type);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ class install_install extends module
|
|||
break;
|
||||
|
||||
case 'final':
|
||||
// Enable super globals to prevent issues with the new phpbb_request object
|
||||
// Enable super globals to prevent issues with the new \phpbb\request\request object
|
||||
$request->enable_super_globals();
|
||||
|
||||
// Create a normal container now
|
||||
|
@ -1179,7 +1179,7 @@ class install_install extends module
|
|||
// Ok tables have been built, let's fill in the basic information
|
||||
$sql_query = file_get_contents('schemas/schema_data.sql');
|
||||
|
||||
// Deal with any special comments
|
||||
// Deal with any special comments and characters
|
||||
switch ($data['dbms'])
|
||||
{
|
||||
case 'mssql':
|
||||
|
@ -1191,6 +1191,11 @@ class install_install extends module
|
|||
case 'postgres':
|
||||
$sql_query = preg_replace('#\# POSTGRES (BEGIN|COMMIT) \##s', '\1; ', $sql_query);
|
||||
break;
|
||||
|
||||
case 'mysql':
|
||||
case 'mysqli':
|
||||
$sql_query = str_replace('\\', '\\\\', $sql_query);
|
||||
break;
|
||||
}
|
||||
|
||||
// Change prefix
|
||||
|
@ -1438,12 +1443,12 @@ class install_install extends module
|
|||
include_once($phpbb_root_path . 'phpbb/search/fulltext_native.' . $phpEx);
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
$error = false;
|
||||
$search = new phpbb_search_fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
$search = new \phpbb\search\fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
|
||||
$sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id
|
||||
FROM ' . POSTS_TABLE;
|
||||
|
@ -1753,7 +1758,7 @@ class install_install extends module
|
|||
$data = $this->get_submitted_data();
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
|
@ -1827,7 +1832,7 @@ class install_install extends module
|
|||
$data = $this->get_submitted_data();
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
|
@ -1892,8 +1897,8 @@ class install_install extends module
|
|||
* "installs" means it adds all migrations to the migrations table, but does not
|
||||
* perform any of the actions in the migrations.
|
||||
*
|
||||
* @param phpbb_extension_manager $extension_manager
|
||||
* @param phpbb_db_migrator $migrator
|
||||
* @param \phpbb\extension\manager $extension_manager
|
||||
* @param \phpbb\db\migrator $migrator
|
||||
*/
|
||||
function populate_migrations($extension_manager, $migrator)
|
||||
{
|
||||
|
|
|
@ -70,7 +70,7 @@ class install_update extends module
|
|||
|
||||
function main($mode, $sub)
|
||||
{
|
||||
global $phpbb_style, $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language;
|
||||
global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language;
|
||||
global $request, $phpbb_admin_path, $phpbb_adm_relative_path, $phpbb_container;
|
||||
|
||||
// We must enable super globals, otherwise creating a new instance of the request class,
|
||||
|
@ -111,7 +111,7 @@ class install_update extends module
|
|||
unset($dbpasswd);
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
|
@ -143,7 +143,7 @@ class install_update extends module
|
|||
// Set custom template again. ;)
|
||||
$paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style');
|
||||
$paths = array_filter($paths, 'is_dir');
|
||||
$phpbb_style->set_custom_style('admin', $paths, array(), '');
|
||||
$template->set_custom_style('adm', $paths);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_USER_LANG' => $user->lang['USER_LANG'],
|
||||
|
@ -250,7 +250,7 @@ class install_update extends module
|
|||
$this->include_file('includes/diff/renderer.' . $phpEx);
|
||||
|
||||
// Make sure we stay at the file check if checking the files again
|
||||
if ($request->variable('check_again', false, false, phpbb_request_interface::POST))
|
||||
if ($request->variable('check_again', false, false, \phpbb\request\request_interface::POST))
|
||||
{
|
||||
$sub = $this->p_master->sub = 'file_check';
|
||||
}
|
||||
|
@ -338,7 +338,7 @@ class install_update extends module
|
|||
$action = request_var('action', '');
|
||||
|
||||
// We are directly within an update. To make sure our update list is correct we check its status.
|
||||
$update_list = ($request->variable('check_again', false, false, phpbb_request_interface::POST)) ? false : $cache->get('_update_list');
|
||||
$update_list = ($request->variable('check_again', false, false, \phpbb\request\request_interface::POST)) ? false : $cache->get('_update_list');
|
||||
$modified = ($update_list !== false) ? @filemtime($cache->get_driver()->cache_dir . 'data_update_list.' . $phpEx) : 0;
|
||||
|
||||
// Make sure the list is up-to-date
|
||||
|
|
|
@ -128,6 +128,27 @@ CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users(user_id);;
|
|||
CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users(auth_option_id);;
|
||||
CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users(auth_role_id);;
|
||||
|
||||
# Table: 'phpbb_oauth_tokens'
|
||||
CREATE TABLE phpbb_oauth_tokens (
|
||||
user_id INTEGER DEFAULT 0 NOT NULL,
|
||||
session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
|
||||
provider VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
|
||||
oauth_token BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
|
||||
);;
|
||||
|
||||
CREATE INDEX phpbb_oauth_tokens_user_id ON phpbb_oauth_tokens(user_id);;
|
||||
CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens(provider);;
|
||||
|
||||
# Table: 'phpbb_oauth_accounts'
|
||||
CREATE TABLE phpbb_oauth_accounts (
|
||||
user_id INTEGER DEFAULT 0 NOT NULL,
|
||||
provider VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
|
||||
oauth_provider_id BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
|
||||
);;
|
||||
|
||||
ALTER TABLE phpbb_oauth_accounts ADD PRIMARY KEY (user_id, provider);;
|
||||
|
||||
|
||||
# Table: 'phpbb_banlist'
|
||||
CREATE TABLE phpbb_banlist (
|
||||
ban_id INTEGER NOT NULL,
|
||||
|
|
|
@ -166,6 +166,43 @@ CREATE INDEX [auth_role_id] ON [phpbb_acl_users]([auth_role_id]) ON [PRIMARY]
|
|||
GO
|
||||
|
||||
|
||||
/*
|
||||
Table: 'phpbb_oauth_tokens'
|
||||
*/
|
||||
CREATE TABLE [phpbb_oauth_tokens] (
|
||||
[user_id] [int] DEFAULT (0) NOT NULL ,
|
||||
[session_id] [char] (32) DEFAULT ('') NOT NULL ,
|
||||
[provider] [varchar] (255) DEFAULT ('') NOT NULL ,
|
||||
[oauth_token] [text] DEFAULT ('') NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE INDEX [user_id] ON [phpbb_oauth_tokens]([user_id]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
CREATE INDEX [provider] ON [phpbb_oauth_tokens]([provider]) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
|
||||
/*
|
||||
Table: 'phpbb_oauth_accounts'
|
||||
*/
|
||||
CREATE TABLE [phpbb_oauth_accounts] (
|
||||
[user_id] [int] DEFAULT (0) NOT NULL ,
|
||||
[provider] [varchar] (255) DEFAULT ('') NOT NULL ,
|
||||
[oauth_provider_id] [varchar] (4000) DEFAULT ('') NOT NULL
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [phpbb_oauth_accounts] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_phpbb_oauth_accounts] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[user_id],
|
||||
[provider]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
|
||||
/*
|
||||
Table: 'phpbb_banlist'
|
||||
*/
|
||||
|
|
|
@ -90,6 +90,26 @@ CREATE TABLE phpbb_acl_users (
|
|||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_oauth_tokens'
|
||||
CREATE TABLE phpbb_oauth_tokens (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
session_id binary(32) DEFAULT '' NOT NULL,
|
||||
provider varbinary(255) DEFAULT '' NOT NULL,
|
||||
oauth_token mediumblob NOT NULL,
|
||||
KEY user_id (user_id),
|
||||
KEY provider (provider)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_oauth_accounts'
|
||||
CREATE TABLE phpbb_oauth_accounts (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
provider varbinary(255) DEFAULT '' NOT NULL,
|
||||
oauth_provider_id blob NOT NULL,
|
||||
PRIMARY KEY (user_id, provider)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_banlist'
|
||||
CREATE TABLE phpbb_banlist (
|
||||
ban_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
|
|
|
@ -90,6 +90,26 @@ CREATE TABLE phpbb_acl_users (
|
|||
) CHARACTER SET `utf8` COLLATE `utf8_bin`;
|
||||
|
||||
|
||||
# Table: 'phpbb_oauth_tokens'
|
||||
CREATE TABLE phpbb_oauth_tokens (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
session_id char(32) DEFAULT '' NOT NULL,
|
||||
provider varchar(255) DEFAULT '' NOT NULL,
|
||||
oauth_token mediumtext NOT NULL,
|
||||
KEY user_id (user_id),
|
||||
KEY provider (provider)
|
||||
) CHARACTER SET `utf8` COLLATE `utf8_bin`;
|
||||
|
||||
|
||||
# Table: 'phpbb_oauth_accounts'
|
||||
CREATE TABLE phpbb_oauth_accounts (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
provider varchar(255) DEFAULT '' NOT NULL,
|
||||
oauth_provider_id text NOT NULL,
|
||||
PRIMARY KEY (user_id, provider)
|
||||
) CHARACTER SET `utf8` COLLATE `utf8_bin`;
|
||||
|
||||
|
||||
# Table: 'phpbb_banlist'
|
||||
CREATE TABLE phpbb_banlist (
|
||||
ban_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
|
|
|
@ -210,6 +210,34 @@ CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id)
|
|||
CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id)
|
||||
/
|
||||
|
||||
/*
|
||||
Table: 'phpbb_oauth_tokens'
|
||||
*/
|
||||
CREATE TABLE phpbb_oauth_tokens (
|
||||
user_id number(8) DEFAULT '0' NOT NULL,
|
||||
session_id char(32) DEFAULT '' ,
|
||||
provider varchar2(255) DEFAULT '' ,
|
||||
oauth_token clob DEFAULT ''
|
||||
)
|
||||
/
|
||||
|
||||
CREATE INDEX phpbb_oauth_tokens_user_id ON phpbb_oauth_tokens (user_id)
|
||||
/
|
||||
CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens (provider)
|
||||
/
|
||||
|
||||
/*
|
||||
Table: 'phpbb_oauth_accounts'
|
||||
*/
|
||||
CREATE TABLE phpbb_oauth_accounts (
|
||||
user_id number(8) DEFAULT '0' NOT NULL,
|
||||
provider varchar2(255) DEFAULT '' ,
|
||||
oauth_provider_id clob DEFAULT '' ,
|
||||
CONSTRAINT pk_phpbb_oauth_accounts PRIMARY KEY (user_id, provider)
|
||||
)
|
||||
/
|
||||
|
||||
|
||||
/*
|
||||
Table: 'phpbb_banlist'
|
||||
*/
|
||||
|
|
|
@ -188,6 +188,30 @@ CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id);
|
|||
CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id);
|
||||
CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id);
|
||||
|
||||
/*
|
||||
Table: 'phpbb_oauth_tokens'
|
||||
*/
|
||||
CREATE TABLE phpbb_oauth_tokens (
|
||||
user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
|
||||
session_id char(32) DEFAULT '' NOT NULL,
|
||||
provider varchar(255) DEFAULT '' NOT NULL,
|
||||
oauth_token TEXT DEFAULT '' NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX phpbb_oauth_tokens_user_id ON phpbb_oauth_tokens (user_id);
|
||||
CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens (provider);
|
||||
|
||||
/*
|
||||
Table: 'phpbb_oauth_accounts'
|
||||
*/
|
||||
CREATE TABLE phpbb_oauth_accounts (
|
||||
user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
|
||||
provider varchar(255) DEFAULT '' NOT NULL,
|
||||
oauth_provider_id varchar(4000) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (user_id, provider)
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
Table: 'phpbb_banlist'
|
||||
*/
|
||||
|
|
|
@ -101,6 +101,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_nam
|
|||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_max_chunk_size', '50');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '20');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_mod_rewrite', '0');
|
||||
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', '1');
|
||||
|
@ -236,7 +237,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_block_size'
|
|||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_gc', '7200');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_interval', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_anonymous_interval', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', 'phpbb_search_fulltext_native');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', 'phpbb\search\fulltext_native');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_store_results', '1800');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_deny', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_empty_referer', '1');
|
||||
|
|
|
@ -89,6 +89,26 @@ CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id);
|
|||
CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id);
|
||||
CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id);
|
||||
|
||||
# Table: 'phpbb_oauth_tokens'
|
||||
CREATE TABLE phpbb_oauth_tokens (
|
||||
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||
session_id char(32) NOT NULL DEFAULT '',
|
||||
provider varchar(255) NOT NULL DEFAULT '',
|
||||
oauth_token mediumtext(16777215) NOT NULL DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE INDEX phpbb_oauth_tokens_user_id ON phpbb_oauth_tokens (user_id);
|
||||
CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens (provider);
|
||||
|
||||
# Table: 'phpbb_oauth_accounts'
|
||||
CREATE TABLE phpbb_oauth_accounts (
|
||||
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||
provider varchar(255) NOT NULL DEFAULT '',
|
||||
oauth_provider_id text(65535) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (user_id, provider)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_banlist'
|
||||
CREATE TABLE phpbb_banlist (
|
||||
ban_id INTEGER PRIMARY KEY NOT NULL ,
|
||||
|
|
|
@ -367,6 +367,8 @@ $lang = array_merge($lang, array(
|
|||
'LOAD_JQUERY_CDN_EXPLAIN' => 'If this setting is enabled, jQuery will be served from Google’s AJAX API CDN instead of the copy included with phpBB on your server. If the CDN fails, phpBB will attempt to fall back to the copy included with phpBB.',
|
||||
'LOAD_USER_ACTIVITY' => 'Show user’s activity',
|
||||
'LOAD_USER_ACTIVITY_EXPLAIN' => 'Displays active topic/forum in user profiles and user control panel. It is recommended to disable this on boards with more than one million posts.',
|
||||
'READ_NOTIFICATION_EXPIRE_DAYS' => 'Read Notification Expiration',
|
||||
'READ_NOTIFICATION_EXPIRE_DAYS_EXPLAIN' => 'Number of days that will elapse before a read notification will automatically be deleted. Set this value to 0 to make notifications permanent.',
|
||||
'RECOMPILE_STYLES' => 'Recompile stale style components',
|
||||
'RECOMPILE_STYLES_EXPLAIN' => 'Check for updated style components on filesystem and recompile.',
|
||||
'YES_ANON_READ_MARKING' => 'Enable topic marking for guests',
|
||||
|
@ -390,10 +392,16 @@ $lang = array_merge($lang, array(
|
|||
|
||||
// Auth settings
|
||||
$lang = array_merge($lang, array(
|
||||
'ACP_AUTH_SETTINGS_EXPLAIN' => 'phpBB supports authentication plug-ins, or modules. These allow you determine how users are authenticated when they log into the board. By default three plug-ins are provided; DB, LDAP and Apache. Not all methods require additional information so only fill out fields if they are relevant to the selected method.',
|
||||
'ACP_AUTH_SETTINGS_EXPLAIN' => 'phpBB supports authentication plug-ins, or modules. These allow you determine how users are authenticated when they log into the board. By default four plug-ins are provided: DB, LDAP, Apache, and OAuth. Not all methods require additional information so only fill out fields if they are relevant to the selected method.',
|
||||
|
||||
'AUTH_METHOD' => 'Select an authentication method',
|
||||
|
||||
'AUTH_PROVIDER_OAUTH_ERROR_ELEMENT_MISSING' => 'Both the key and secret of each enabled OAuth service provider must be provided. Only one was provided for an OAuth service provider.',
|
||||
'AUTH_PROVIDER_OAUTH_EXPLAIN' => 'Each OAuth provider requires a unique secret and key in order to authenticate with the external server.<br />These should be supplied by the OAuth service when you register your website with them and should be entered exactly as provided to you.<br />Any service that does not have both a key and a secret entered here will not be available for use by the forum users.',
|
||||
'AUTH_PROVIDER_OAUTH_KEY' => 'Key',
|
||||
'AUTH_PROVIDER_OAUTH_TITLE' => 'OAuth',
|
||||
'AUTH_PROVIDER_OAUTH_SECRET' => 'Secret',
|
||||
|
||||
'APACHE_SETUP_BEFORE_USE' => 'You have to setup apache authentication before you switch phpBB to this authentication method. Keep in mind that the username you use for apache authentication has to be the same as your phpBB username. Apache authentication can only be used with mod_php (not with a CGI version) and safe_mode disabled.',
|
||||
|
||||
'LDAP_DN' => 'LDAP base <var>dn</var>',
|
||||
|
@ -427,6 +435,10 @@ $lang = array_merge($lang, array(
|
|||
'FORCE_SERVER_VARS_EXPLAIN' => 'If set to yes the server settings defined here will be used in favour of the automatically determined values.',
|
||||
'ICONS_PATH' => 'Post icons storage path',
|
||||
'ICONS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. <samp>images/icons</samp>.',
|
||||
'MOD_REWRITE_ENABLE' => 'Enable URL Rewriting',
|
||||
'MOD_REWRITE_ENABLE_EXPLAIN' => 'When enabled, URLs containing ’app.php’ will be rewritten to remove the filename (i.e. app.php/foo will become /foo). <strong>Apache server’s mod_rewrite module is required for this functionality to work; if this option is enabled without mod_rewrite support, URLs on your board may be broken.</strong>',
|
||||
'MOD_REWRITE_DISABLED' => 'The <strong>mod_rewrite</strong> module on your Apache web server is disabled. Enable the module or contact your web hosting provider if you wish to enable this feature.',
|
||||
'MOD_REWRITE_INFORMATION_UNAVAILABLE' => 'We are unable to determine whether or not this server supports URL rewriting. This setting may be enabled but if URL rewriting is not available, paths generated by this board (such as for use in links) may be broken. Contact your web hosting provider if you are unsure whether or not you can safely enable this feature.',
|
||||
'PATH_SETTINGS' => 'Path settings',
|
||||
'RANKS_PATH' => 'Rank image storage path',
|
||||
'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. <samp>images/ranks</samp>.',
|
||||
|
|
|
@ -88,6 +88,14 @@ $lang = array_merge($lang, array(
|
|||
'ATTACHED_IMAGE_NOT_IMAGE' => 'The image file you tried to attach is invalid.',
|
||||
'AUTHOR' => 'Author',
|
||||
'AUTH_NO_PROFILE_CREATED' => 'The creation of a user profile was unsuccessful.',
|
||||
'AUTH_PROVIDER_OAUTH_ERROR_INVALID_ENTRY' => 'Invalid database entry.',
|
||||
'AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE' => 'Invalid service type provided to OAuth service handler.',
|
||||
'AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED' => 'OAuth service not created',
|
||||
'AUTH_PROVIDER_OAUTH_SERVICE_BITLY' => 'Bitly',
|
||||
'AUTH_PROVIDER_OAUTH_SERVICE_FACEBOOK' => 'Facebook',
|
||||
'AUTH_PROVIDER_OAUTH_SERVICE_GOOGLE' => 'Google',
|
||||
'AUTH_PROVIDER_OAUTH_TOKEN_ERROR_NOT_STORED' => 'OAuth token not stored.',
|
||||
'AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED' => 'OAuth token incorrectly stored.',
|
||||
'AVATAR_DISALLOWED_CONTENT' => 'The upload was rejected because the uploaded file was identified as a possible attack vector.',
|
||||
'AVATAR_DISALLOWED_EXTENSION' => 'This file cannot be displayed because the extension <strong>%s</strong> is not allowed.',
|
||||
'AVATAR_EMPTY_REMOTE_DATA' => 'The specified avatar could not be uploaded because the remote data appears to be invalid or corrupted.',
|
||||
|
@ -351,6 +359,7 @@ $lang = array_merge($lang, array(
|
|||
'LOGIN_CONFIRM_EXPLAIN' => 'To prevent brute forcing accounts the board requires you to enter a confirmation code after a maximum amount of failed logins. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', // unused
|
||||
'LOGIN_ERROR_ATTEMPTS' => 'You exceeded the maximum allowed number of login attempts. In addition to your username and password you now also have to solve the CAPTCHA below.',
|
||||
'LOGIN_ERROR_EXTERNAL_AUTH_APACHE' => 'You have not been authenticated by Apache.',
|
||||
'LOGIN_ERROR_OAUTH_SERVICE_DOES_NOT_EXIST' => 'A non-existant OAuth service has been requested.',
|
||||
'LOGIN_ERROR_PASSWORD' => 'You have specified an incorrect password. Please check your password and try again. If you continue to have problems please contact the %sBoard Administrator%s.',
|
||||
'LOGIN_ERROR_PASSWORD_CONVERT' => 'It was not possible to convert your password when updating this bulletin board’s software. Please %srequest a new password%s. If you continue to have problems please contact the %sBoard Administrator%s.',
|
||||
'LOGIN_ERROR_USERNAME' => 'You have specified an incorrect username. Please check your username and try again. If you continue to have problems please contact the %sBoard Administrator%s.',
|
||||
|
@ -414,6 +423,8 @@ $lang = array_merge($lang, array(
|
|||
2 => '<strong>%d</strong> Notifications',
|
||||
),
|
||||
'NOTIFICATION_BOOKMARK' => '%1$s replied to the topic "%2$s" you have bookmarked.',
|
||||
'NOTIFICATION_GROUP_REQUEST' => '%1$s is requesting to join the group %2$s.',
|
||||
'NOTIFICATION_GROUP_REQUEST_APPROVED' => 'Your request to join the group %1$s has been approved.',
|
||||
'NOTIFICATION_PM' => '%1$s sent you a Private Message "%2$s".',
|
||||
'NOTIFICATION_POST' => '%1$s replied to the topic "%2$s".',
|
||||
'NOTIFICATION_POST_APPROVED' => 'Your post was approved "%2$s".',
|
||||
|
|
|
@ -2,7 +2,7 @@ Subject: Forum post notification - "{FORUM_NAME}"
|
|||
|
||||
Hello {USERNAME},
|
||||
|
||||
You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new reply to the topic "{TOPIC_TITLE}"<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the last unread reply, no more notifications will be sent until you visit the topic.
|
||||
You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new reply to the topic "{TOPIC_TITLE}"<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the last unread reply, no more notifications will be sent until you visit the topic.
|
||||
|
||||
{U_NEWEST_POST}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue