aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2013-09-16 01:24:05 +0200
committerNils Adermann <naderman@naderman.de>2013-09-16 01:24:05 +0200
commit21bbb5850349326464204bdb1bea7ecf5a88c10a (patch)
treec2e2ce66583cf94367301fab73e308c9dd8eddb9
parentbb395bbc50df53bf2e005d95d45f34c7c8934ff0 (diff)
parentae6f37d559a71fb115cdb954452ebab5fb8fc69f (diff)
downloadforums-21bbb5850349326464204bdb1bea7ecf5a88c10a.tar
forums-21bbb5850349326464204bdb1bea7ecf5a88c10a.tar.gz
forums-21bbb5850349326464204bdb1bea7ecf5a88c10a.tar.bz2
forums-21bbb5850349326464204bdb1bea7ecf5a88c10a.tar.xz
forums-21bbb5850349326464204bdb1bea7ecf5a88c10a.zip
Merge remote-tracking branch 'github-phpbb/develop' into ticket/11700
* github-phpbb/develop: (586 commits) [ticket/11735] Display disabled checkbox in subsilver for read notifications [ticket/11735] Display disabled checkbox when notification is already read [ticket/11844] update acp/authentication language var [ticket/11795] Remove PM popup [ticket/11795] Remove outdated comment from forum_fn.js [ticket/11795] Move find user JS to forum_fn [ticket/11795] Replace TWIG with phpBB syntax in ACP [ticket/11795] Move MSN scripts to forum_fn.js [ticket/11795] Use phpBB template syntax instead of TWIG [ticket/11795] Move PM popup JS to forum_fn.js [ticket/11795] Get rid of pagination JS variables [ticket/11795] Get rid of onload_functions [ticket/11795] Use data-reset-on-edit attr to reset elements [ticket/11795] Redo form elements auto-focus [ticket/11811] Remove outline on :focus [ticket/11836] Fix subsilver fatal error [ticket/11837] Replace escaped single quote with utf-8 single quote [ticket/11836] Fix fatal error on unsupported provider for auth link [ticket/11837] Translate UCP_AUTH_LINK_NOT_SUPPORTED [ticket/11809] Ensure code.js is first script included after jQuery ... Conflicts: phpBB/config/services.yml phpBB/develop/create_schema_files.php phpBB/develop/mysql_upgrader.php phpBB/download/file.php phpBB/includes/bbcode.php phpBB/includes/functions_container.php phpBB/install/database_update.php phpBB/install/index.php phpBB/phpbb/controller/helper.php phpBB/phpbb/controller/resolver.php phpBB/phpbb/request/request_interface.php phpBB/phpbb/session.php phpBB/phpbb/style/extension_path_provider.php phpBB/phpbb/style/path_provider.php phpBB/phpbb/style/path_provider_interface.php phpBB/phpbb/style/resource_locator.php phpBB/phpbb/style/style.php phpBB/phpbb/template/locator.php phpBB/phpbb/template/template.php phpBB/phpbb/template/twig/node/includeasset.php phpBB/phpbb/template/twig/node/includecss.php phpBB/phpbb/template/twig/node/includejs.php phpBB/phpbb/template/twig/twig.php tests/controller/helper_url_test.php tests/di/create_container_test.php tests/extension/style_path_provider_test.php tests/notification/notification_test.php tests/session/continue_test.php tests/session/creation_test.php tests/template/template_events_test.php tests/template/template_test_case.php tests/template/template_test_case_with_tree.php tests/test_framework/phpbb_functional_test_case.php
-rw-r--r--build/build.xml4
-rwxr-xr-xbuild/package.php2
-rw-r--r--phpBB/.htaccess24
-rw-r--r--phpBB/adm/index.php2
-rw-r--r--phpBB/adm/style/admin.css10
-rw-r--r--phpBB/adm/style/ajax.js6
-rw-r--r--phpBB/adm/style/auth_provider_oauth.html17
-rw-r--r--phpBB/adm/style/install_update.html55
-rw-r--r--phpBB/adm/style/overall_header.html2
-rw-r--r--phpBB/adm/style/simple_header.html2
-rw-r--r--phpBB/adm/swatch.php2
-rw-r--r--phpBB/app.php1
-rw-r--r--phpBB/common.php4
-rw-r--r--phpBB/composer.json15
-rw-r--r--phpBB/composer.lock855
-rw-r--r--phpBB/config/auth_providers.yml42
-rw-r--r--phpBB/config/notifications.yml36
-rw-r--r--phpBB/config/services.yml36
-rw-r--r--phpBB/config/tables.yml2
-rw-r--r--phpBB/develop/blank.gif0
-rw-r--r--phpBB/develop/blank.jpg0
-rw-r--r--phpBB/develop/create_schema_files.php1403
-rw-r--r--phpBB/develop/mysql_upgrader.php1135
-rw-r--r--phpBB/docs/CHANGELOG.html9
-rw-r--r--phpBB/docs/coding-guidelines.html20
-rw-r--r--phpBB/docs/events.md152
-rw-r--r--phpBB/download/file.php4
-rw-r--r--phpBB/includes/acp/acp_board.php56
-rw-r--r--phpBB/includes/acp/acp_modules.php1
-rw-r--r--phpBB/includes/acp/acp_permission_roles.php19
-rw-r--r--phpBB/includes/acp/acp_permissions.php15
-rw-r--r--phpBB/includes/acp/auth.php37
-rw-r--r--phpBB/includes/bbcode.php7
-rw-r--r--phpBB/includes/captcha/captcha_factory.php3
-rw-r--r--phpBB/includes/constants.php1
-rw-r--r--phpBB/includes/db/schema_data.php1219
-rw-r--r--phpBB/includes/functions.php106
-rw-r--r--phpBB/includes/functions_container.php41
-rw-r--r--phpBB/includes/functions_content.php4
-rw-r--r--phpBB/includes/functions_messenger.php33
-rw-r--r--phpBB/includes/functions_module.php6
-rw-r--r--phpBB/includes/functions_posting.php24
-rw-r--r--phpBB/includes/functions_privmsgs.php13
-rw-r--r--phpBB/includes/functions_user.php53
-rw-r--r--phpBB/includes/mcp/mcp_pm_reports.php13
-rw-r--r--phpBB/includes/mcp/mcp_post.php13
-rw-r--r--phpBB/includes/mcp/mcp_queue.php13
-rw-r--r--phpBB/includes/mcp/mcp_reports.php3
-rw-r--r--phpBB/includes/mcp/mcp_topic.php13
-rw-r--r--phpBB/includes/mcp/mcp_warn.php15
-rw-r--r--phpBB/includes/ucp/info/ucp_auth_link.php34
-rw-r--r--phpBB/includes/ucp/ucp_auth_link.php142
-rw-r--r--phpBB/includes/ucp/ucp_groups.php31
-rw-r--r--phpBB/includes/ucp/ucp_login_link.php243
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php30
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php79
-rw-r--r--phpBB/includes/ucp/ucp_profile.php3
-rw-r--r--phpBB/includes/ucp/ucp_register.php94
-rw-r--r--phpBB/includes/ucp/ucp_remind.php2
-rw-r--r--phpBB/install/database_update.php33
-rw-r--r--phpBB/install/index.php72
-rw-r--r--phpBB/install/install_update.php102
-rw-r--r--phpBB/install/schemas/firebird_schema.sql21
-rw-r--r--phpBB/install/schemas/mssql_schema.sql37
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql20
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql20
-rw-r--r--phpBB/install/schemas/oracle_schema.sql28
-rw-r--r--phpBB/install/schemas/postgres_schema.sql24
-rw-r--r--phpBB/install/schemas/schema_data.sql3
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql20
-rw-r--r--phpBB/language/en/acp/board.php14
-rw-r--r--phpBB/language/en/acp/permissions_phpbb.php336
-rw-r--r--phpBB/language/en/common.php11
-rw-r--r--phpBB/language/en/email/forum_notify.txt2
-rw-r--r--phpBB/language/en/email/group_approved.txt10
-rw-r--r--phpBB/language/en/email/installed.txt2
-rw-r--r--phpBB/language/en/email/newtopic_notify.txt2
-rw-r--r--phpBB/language/en/email/topic_notify.txt2
-rw-r--r--phpBB/language/en/help_faq.php2
-rw-r--r--phpBB/language/en/install.php8
-rw-r--r--phpBB/language/en/ucp.php14
-rw-r--r--phpBB/memberlist.php13
-rw-r--r--phpBB/phpbb/auth/auth.php12
-rw-r--r--phpBB/phpbb/auth/provider/base.php40
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php618
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/base.php55
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/bitly.php98
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/exception.php25
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/facebook.php98
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/google.php109
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/interface.php77
-rw-r--r--phpBB/phpbb/auth/provider/oauth/token_storage.php366
-rw-r--r--phpBB/phpbb/auth/provider/provider_interface.php92
-rw-r--r--phpBB/phpbb/avatar/driver/remote.php2
-rw-r--r--phpBB/phpbb/cache/driver/file.php70
-rw-r--r--phpBB/phpbb/content_visibility.php5
-rw-r--r--phpBB/phpbb/controller/helper.php30
-rw-r--r--phpBB/phpbb/controller/resolver.php16
-rw-r--r--phpBB/phpbb/cron/task/core/prune_notifications.php65
-rw-r--r--phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php71
-rw-r--r--phpBB/phpbb/db/migration/data/310/mod_rewrite.php25
-rw-r--r--phpBB/phpbb/db/migration/data/310/notifications_cron.php25
-rw-r--r--phpBB/phpbb/db/migration/data/310/softdelete_mcp_modules.php55
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php6
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php4
-rw-r--r--phpBB/phpbb/db/migration/data/v310/signature_module_auth.php2
-rw-r--r--phpBB/phpbb/db/tools.php494
-rw-r--r--phpBB/phpbb/di/extension/core.php12
-rw-r--r--phpBB/phpbb/event/extension_subscriber_loader.php1
-rw-r--r--phpBB/phpbb/feed/overall.php2
-rw-r--r--phpBB/phpbb/feed/topic.php4
-rw-r--r--phpBB/phpbb/log/null.php78
-rw-r--r--phpBB/phpbb/notification/manager.php21
-rw-r--r--phpBB/phpbb/notification/type/group_request.php163
-rw-r--r--phpBB/phpbb/notification/type/group_request_approved.php118
-rw-r--r--phpBB/phpbb/permissions.php340
-rw-r--r--phpBB/phpbb/request/request.php8
-rw-r--r--phpBB/phpbb/request/request_interface.php10
-rw-r--r--phpBB/phpbb/search/fulltext_mysql.php2
-rw-r--r--phpBB/phpbb/session.php3
-rw-r--r--phpBB/phpbb/style/extension_path_provider.php139
-rw-r--r--phpBB/phpbb/style/path_provider.php64
-rw-r--r--phpBB/phpbb/style/path_provider_interface.php44
-rw-r--r--phpBB/phpbb/style/resource_locator.php350
-rw-r--r--phpBB/phpbb/style/style.php243
-rw-r--r--phpBB/phpbb/template/base.php148
-rw-r--r--phpBB/phpbb/template/locator.php165
-rw-r--r--phpBB/phpbb/template/template.php28
-rw-r--r--phpBB/phpbb/template/twig/environment.php35
-rw-r--r--phpBB/phpbb/template/twig/lexer.php57
-rw-r--r--phpBB/phpbb/template/twig/loader.php150
-rw-r--r--phpBB/phpbb/template/twig/node/event.php8
-rw-r--r--phpBB/phpbb/template/twig/node/includeasset.php21
-rw-r--r--phpBB/phpbb/template/twig/node/includecss.php11
-rw-r--r--phpBB/phpbb/template/twig/node/includejs.php11
-rw-r--r--phpBB/phpbb/template/twig/twig.php299
-rw-r--r--phpBB/phpbb/user.php28
-rw-r--r--phpBB/posting.php8
-rw-r--r--phpBB/report.php18
-rw-r--r--phpBB/search.php43
-rw-r--r--phpBB/styles/prosilver/template/bbcode.html4
-rw-r--r--phpBB/styles/prosilver/template/editor.js2
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js277
-rw-r--r--phpBB/styles/prosilver/template/login_body.html14
-rw-r--r--phpBB/styles/prosilver/template/login_body_oauth.html8
-rw-r--r--phpBB/styles/prosilver/template/mcp_forum.html15
-rw-r--r--phpBB/styles/prosilver/template/mcp_front.html4
-rw-r--r--phpBB/styles/prosilver/template/mcp_notes_user.html2
-rw-r--r--phpBB/styles/prosilver/template/mcp_post.html12
-rw-r--r--phpBB/styles/prosilver/template/mcp_topic.html20
-rw-r--r--phpBB/styles/prosilver/template/mcp_warn_list.html15
-rw-r--r--phpBB/styles/prosilver/template/memberlist_body.html4
-rw-r--r--phpBB/styles/prosilver/template/memberlist_im.html72
-rw-r--r--phpBB/styles/prosilver/template/memberlist_search.html41
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html2
-rw-r--r--phpBB/styles/prosilver/template/overall_footer.html2
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html39
-rw-r--r--phpBB/styles/prosilver/template/pagination.html3
-rw-r--r--phpBB/styles/prosilver/template/posting_poll_body.html2
-rw-r--r--phpBB/styles/prosilver/template/posting_smilies.html4
-rw-r--r--phpBB/styles/prosilver/template/search_body.html10
-rw-r--r--phpBB/styles/prosilver/template/search_results.html17
-rw-r--r--phpBB/styles/prosilver/template/simple_footer.html6
-rw-r--r--phpBB/styles/prosilver/template/simple_header.html34
-rw-r--r--phpBB/styles/prosilver/template/ucp_auth_link.html15
-rw-r--r--phpBB/styles/prosilver/template/ucp_auth_link_oauth.html29
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html16
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options_remote.html16
-rw-r--r--phpBB/styles/prosilver/template/ucp_login_link.html58
-rw-r--r--phpBB/styles/prosilver/template/ucp_notifications.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewfolder.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_prefs_personal.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_prefs_post.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_prefs_view.html4
-rw-r--r--phpBB/styles/prosilver/template/viewforum_body.html2
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html59
-rw-r--r--phpBB/styles/prosilver/theme/bidi.css9
-rw-r--r--phpBB/styles/prosilver/theme/colours.css31
-rw-r--r--phpBB/styles/prosilver/theme/common.css33
-rw-r--r--phpBB/styles/prosilver/theme/content.css8
-rw-r--r--phpBB/styles/prosilver/theme/en/button_pm_forward.gifbin2168 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/en/button_pm_new.gifbin2005 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/en/button_pm_reply.gifbin2126 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/en/button_topic_locked.gifbin1923 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/en/button_topic_new.gifbin2737 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/en/button_topic_reply.gifbin2135 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/en/stylesheet.css30
-rw-r--r--phpBB/styles/prosilver/theme/forms.css10
-rw-r--r--phpBB/styles/prosilver/theme/imageset.css30
-rw-r--r--phpBB/styles/prosilver/theme/print.css2
-rw-r--r--phpBB/styles/subsilver2/template/bbcode.html4
-rw-r--r--phpBB/styles/subsilver2/template/login_body.html3
-rw-r--r--phpBB/styles/subsilver2/template/login_body_oauth.html7
-rw-r--r--phpBB/styles/subsilver2/template/mcp_post.html2
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_body.html2
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_view.html4
-rw-r--r--phpBB/styles/subsilver2/template/overall_footer.html2
-rw-r--r--phpBB/styles/subsilver2/template/overall_header.html11
-rw-r--r--phpBB/styles/subsilver2/template/posting_smilies.html4
-rw-r--r--phpBB/styles/subsilver2/template/search_results.html2
-rw-r--r--phpBB/styles/subsilver2/template/simple_footer.html3
-rw-r--r--phpBB/styles/subsilver2/template/ucp_auth_link.html19
-rw-r--r--phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html34
-rw-r--r--phpBB/styles/subsilver2/template/ucp_header.html4
-rw-r--r--phpBB/styles/subsilver2/template/ucp_login_link.html74
-rw-r--r--phpBB/styles/subsilver2/template/ucp_notifications.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_history.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_personal.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_post.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_view.html4
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_signature.html43
-rw-r--r--phpBB/styles/subsilver2/template/viewforum_body.html4
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_body.html18
-rw-r--r--phpBB/styles/subsilver2/theme/stylesheet.css13
-rw-r--r--phpBB/ucp.php12
-rw-r--r--phpBB/viewforum.php21
-rw-r--r--phpBB/viewtopic.php70
-rw-r--r--tests/auth/fixtures/oauth_tokens.xml10
-rw-r--r--tests/auth/provider_oauth_token_storage_test.php207
-rw-r--r--tests/controller/helper_url_test.php86
-rw-r--r--tests/di/create_container_test.php6
-rw-r--r--tests/extension/style_path_provider_test.php50
-rw-r--r--tests/extension/subdir/style_path_provider_test.php18
-rw-r--r--tests/functional/avatar_acp_groups_test.php63
-rw-r--r--tests/functional/avatar_acp_users_test.php61
-rw-r--r--tests/functional/avatar_ucp_groups_test.php71
-rw-r--r--tests/functional/avatar_ucp_users_test.php78
-rw-r--r--tests/functional/browse_test.php7
-rw-r--r--tests/functional/common_avatar_test.php80
-rw-r--r--tests/functional/extension_controller_test.php10
-rw-r--r--tests/functional/extension_global_lang_test.php63
-rw-r--r--tests/functional/extension_permission_lang_test.php3
-rw-r--r--tests/functional/fileupload_remote_test.php6
-rw-r--r--tests/functional/fixtures/ext/foo/bar/event/permission.php40
-rw-r--r--tests/functional/fixtures/ext/foo/bar/event/user_setup.php43
-rw-r--r--tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php5
-rw-r--r--tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php3
-rw-r--r--tests/functional/mcp_test.php67
-rw-r--r--tests/functional/report_post_captcha_test.php (renamed from tests/functional/report_post_captcha.php)19
-rw-r--r--tests/mock/auth_provider.php23
-rw-r--r--tests/mock/request.php5
-rw-r--r--tests/mock/session_testable.php4
-rw-r--r--tests/notification/base.php131
-rw-r--r--tests/notification/fixtures/group_request.xml30
-rw-r--r--tests/notification/group_request_test.php109
-rw-r--r--tests/notification/notification_test.php367
-rw-r--r--tests/session/check_ban_test.php78
-rw-r--r--tests/session/check_isvalid_test.php61
-rw-r--r--tests/session/continue_test.php133
-rw-r--r--tests/session/create_test.php43
-rw-r--r--tests/session/creation_test.php69
-rw-r--r--tests/session/extract_hostname_test.php51
-rw-r--r--tests/session/extract_page_test.php115
-rw-r--r--tests/session/fixtures/sessions_banlist.xml66
-rw-r--r--tests/session/fixtures/sessions_full.xml3
-rw-r--r--tests/session/fixtures/sessions_garbage.xml58
-rw-r--r--tests/session/fixtures/sessions_key.xml44
-rw-r--r--tests/session/garbage_collection_test.php53
-rw-r--r--tests/session/session_key_test.php51
-rw-r--r--tests/session/testable_facade.php142
-rw-r--r--tests/session/testable_factory.php40
-rw-r--r--tests/session/unset_admin_test.php48
-rw-r--r--tests/session/validate_referrer_test.php70
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/omega/styles/all/template/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/test.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html (renamed from tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/two.html)0
-rw-r--r--tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html (renamed from tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/test.html)0
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html (renamed from tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event_variable_spacing.html)0
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html1
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html (renamed from tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/universal.html)0
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html (renamed from tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/simple.html)0
-rw-r--r--tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html3
-rw-r--r--tests/template/includephp_test.php2
-rw-r--r--tests/template/template_events_test.php15
-rw-r--r--tests/template/template_test.php45
-rw-r--r--tests/template/template_test_case.php8
-rw-r--r--tests/template/template_test_case_with_tree.php7
-rw-r--r--tests/template/templates/define.html19
-rw-r--r--tests/template/templates/if.html2
-rw-r--r--tests/template/templates/include_define_variable.html6
-rw-r--r--tests/template/templates/include_loop.html8
-rw-r--r--tests/template/templates/include_loop_define.html6
-rw-r--r--tests/template/templates/loop.html14
-rw-r--r--tests/template/templates/loop_advanced.html20
-rw-r--r--tests/template/templates/loop_size.html10
-rw-r--r--tests/template/templates/loop_vars.html18
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php2
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php36
-rw-r--r--tests/test_framework/phpbb_session_test_case.php36
-rw-r--r--tests/text_processing/generate_text_for_display_test.php38
-rw-r--r--travis/phpunit-postgres-travis.xml3
-rwxr-xr-xtravis/setup-webserver.sh2
330 files changed, 10278 insertions, 6358 deletions
diff --git a/build/build.xml b/build/build.xml
index 5b4cf8b496..f8181160c1 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -170,8 +170,8 @@
checkreturn="true" />
<!-- Install composer dependencies, if there are any. -->
- <exec dir="."
- command='php -r "\$j = json_decode(file_get_contents("composer.json")); echo isset(\$j->require);"'
+ <exec dir="${dir}"
+ command='php -r "\$j = json_decode(file_get_contents(\"composer.json\")); echo isset(\$j->require);"'
checkreturn="true"
outputProperty='composer-has-dependencies' />
<if>
diff --git a/build/package.php b/build/package.php
index 48f42b3572..eef6765af6 100755
--- a/build/package.php
+++ b/build/package.php
@@ -121,6 +121,7 @@ if (sizeof($package->old_packages))
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $dest_filename_dir);
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $dest_filename_dir);
+ $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/vendor ' . $dest_filename_dir);
$package->run_command('mkdir ' . $dest_filename_dir . '/install/update');
$package->run_command('mkdir ' . $dest_filename_dir . '/install/update/old');
@@ -256,6 +257,7 @@ $update_info = array(
// Copy the install files to their respective locations
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $package->get('patch_directory'));
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $package->get('patch_directory'));
+ $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/vendor ' . $package->get('patch_directory'));
// Remove some files
chdir($package->get('patch_directory') . '/install');
diff --git a/phpBB/.htaccess b/phpBB/.htaccess
index 474f9774c2..6f33916775 100644
--- a/phpBB/.htaccess
+++ b/phpBB/.htaccess
@@ -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
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index 8cd1967c75..c1e8edbd03 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -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');
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index f7a7f9f9bf..ca15338133 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -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 {
diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js
index 6f21dfa6ac..efb0639f1b 100644
--- a/phpBB/adm/style/ajax.js
+++ b/phpBB/adm/style/ajax.js
@@ -127,8 +127,10 @@ phpbb.addAjaxCallback('activate_deactivate', function(res) {
* The removes the parent row of the link or form that triggered the callback,
* and is good for stuff like the removal of forums.
*/
-phpbb.addAjaxCallback('row_delete', function() {
- $(this).parents('tr').remove();
+phpbb.addAjaxCallback('row_delete', function(res) {
+ if (res.SUCCESS !== false) {
+ $(this).parents('tr').remove();
+ }
});
diff --git a/phpBB/adm/style/auth_provider_oauth.html b/phpBB/adm/style/auth_provider_oauth.html
new file mode 100644
index 0000000000..25e40ff596
--- /dev/null
+++ b/phpBB/adm/style/auth_provider_oauth.html
@@ -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 -->
diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html
index b5fa46dbf6..57e2c8ffea 100644
--- a/phpBB/adm/style/install_update.html
+++ b/phpBB/adm/style/install_update.html
@@ -109,27 +109,14 @@
<!-- ENDIF -->
</fieldset>
- <!-- IF not S_UP_TO_DATE -->
-
- <form id="install_dbupdate" method="post" action="{U_DB_UPDATE_ACTION}">
-
- <fieldset class="submit-buttons">
- <p>{L_UPDATE_DATABASE_EXPLAIN}</p>
- <input class="button1" type="submit" name="db_update" value="{L_UPDATE_DATABASE}" />
- </fieldset>
-
- </form>
-
- <!-- ELSE -->
- <form id="install_update" method="post" action="{U_ACTION}">
+ <form id="install_update" method="post" action="{U_ACTION}">
- <fieldset class="submit-buttons">
- <p>{L_CHECK_FILES_UP_TO_DATE}</p>
- <input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" />
- </fieldset>
+ <fieldset class="submit-buttons">
+ <p>{L_CHECK_FILES_EXPLAIN}</p>
+ <input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" />
+ </fieldset>
- </form>
- <!-- ENDIF -->
+ </form>
<!-- ELSEIF S_DB_UPDATE -->
@@ -155,29 +142,29 @@
<!-- ELSE -->
- <h1>{L_UPDATE_DB_SUCCESS}</h1>
+ <div class="successbox">
+ <h3>{L_UPDATE_SUCCESS}</h3>
+ <p>{L_EVERYTHING_UP_TO_DATE}</p>
+ </div>
- <br /><br />
+ <!-- ENDIF -->
- <form id="install_update" method="post" action="{U_ACTION}">
+<!-- ELSEIF S_FILE_CHECK -->
- <fieldset class="submit-buttons">
- <p>{L_CHECK_FILES_EXPLAIN}</p>
- <input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" />
- </fieldset>
+ <!-- IF S_ALL_UP_TO_DATE -->
- </form>
+ <h1>{L_UPDATE_FILE_SUCCESS}</h1>
+ <p>{L_ALL_FILES_UP_TO_DATE}</p>
- <!-- ENDIF -->
+ <p>{L_UPDATE_DATABASE_EXPLAIN}</p>
-<!-- ELSEIF S_FILE_CHECK -->
+ <form id="install_dbupdate" method="post" action="{U_DB_UPDATE_ACTION}">
- <!-- IF S_ALL_UP_TO_DATE -->
+ <fieldset class="submit-buttons">
+ <input class="button1" type="submit" name="db_update" value="{L_UPDATE_DATABASE}" />
+ </fieldset>
- <div class="successbox">
- <h3>{L_UPDATE_SUCCESS}</h3>
- <p>{L_ALL_FILES_UP_TO_DATE}</p>
- </div>
+ </form>
<!-- ELSE -->
<h1>{L_COLLECTED_INFORMATION}</h1>
diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html
index 8170931221..3a9b6db2a3 100644
--- a/phpBB/adm/style/overall_header.html
+++ b/phpBB/adm/style/overall_header.html
@@ -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';
diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html
index 6e0c360600..9c4c8a2960 100644
--- a/phpBB/adm/style/simple_header.html
+++ b/phpBB/adm/style/simple_header.html
@@ -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
diff --git a/phpBB/adm/swatch.php b/phpBB/adm/swatch.php
index 3ae38d0d8b..e9d46d65b5 100644
--- a/phpBB/adm/swatch.php
+++ b/phpBB/adm/swatch.php
@@ -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')
diff --git a/phpBB/app.php b/phpBB/app.php
index d93208d585..f1023ff1b5 100644
--- a/phpBB/app.php
+++ b/phpBB/app.php
@@ -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();
diff --git a/phpBB/common.php b/phpBB/common.php
index 027df4b2f3..2fb832648a 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -109,6 +109,9 @@ $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_create_symfony_request($request);
+
// Grab global variables, re-cache if necessary
$config = $phpbb_container->get('config');
set_config(null, null, null, $config);
@@ -121,7 +124,6 @@ $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);
diff --git a/phpBB/composer.json b/phpBB/composer.json
index bf693d1950..455ad49aac 100644
--- a/phpBB/composer.json
+++ b/phpBB/composer.json
@@ -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.*"
diff --git a/phpBB/composer.lock b/phpBB/composer.lock
index 1ba6cb6f83..eb57ddb4d9 100644
--- a/phpBB/composer.lock
+++ b/phpBB/composer.lock
@@ -3,33 +3,140 @@
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
- "hash": "6e6125b88160e28568edcb9fd007abed",
+ "hash": "0bc0fd0d784720629ae0ba6d4be6a577",
"packages": [
{
+ "name": "lusitanian/oauth",
+ "version": "v0.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Lusitanian/PHPoAuthLib.git",
+ "reference": "00c667d93058e983fc1b7d3d1cebdb1bc03fb043"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/00c667d93058e983fc1b7d3d1cebdb1bc03fb043",
+ "reference": "00c667d93058e983fc1b7d3d1cebdb1bc03fb043",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "3.7.*",
+ "predis/predis": "0.8.*@dev",
+ "symfony/http-foundation": "~2.1"
+ },
+ "suggest": {
+ "predis/predis": "Allows using the Redis storage backend.",
+ "symfony/http-foundation": "Allows using the Symfony Session storage backend."
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "OAuth": "src",
+ "OAuth\\Unit": "tests"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "David Desberg",
+ "email": "david@daviddesberg.com"
+ },
+ {
+ "name": "Pieter Hordijk",
+ "email": "info@pieterhordijk.com",
+ "homepage": "https://pieterhordijk.com",
+ "role": "developer"
+ }
+ ],
+ "description": "PHP 5.3+ oAuth 1/2 Library",
+ "keywords": [
+ "Authentication",
+ "authorization",
+ "oauth",
+ "security"
+ ],
+ "time": "2013-08-29 21:40:04"
+ },
+ {
+ "name": "psr/log",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
+ "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
+ "shasum": ""
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Psr\\Log\\": ""
+ }
+ },
+ "notification-url": "http://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "time": "2012-12-21 11:40:51"
+ },
+ {
"name": "symfony/config",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/Config",
"source": {
"type": "git",
"url": "https://github.com/symfony/Config.git",
- "reference": "v2.1.11"
+ "reference": "65a927c15ca5a911ba2fa277a5457fa8129505b0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Config/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/Config/zipball/65a927c15ca5a911ba2fa277a5457fa8129505b0",
+ "reference": "65a927c15ca5a911ba2fa277a5457fa8129505b0",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.3",
+ "symfony/filesystem": "~2.3"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\Config": ""
+ "Symfony\\Component\\Config\\": ""
}
},
- "notification-url": "https://packagist.org/downloads/",
+ "notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -45,41 +152,103 @@
],
"description": "Symfony Config Component",
"homepage": "http://symfony.com",
- "time": "2013-05-09 15:22:40"
+ "time": "2013-08-06 05:49:23"
+ },
+ {
+ "name": "symfony/debug",
+ "version": "v2.3.4",
+ "target-dir": "Symfony/Component/Debug",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Debug.git",
+ "reference": "729f6d19cfc401c4942e43fcc1059103bd6df130"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Debug/zipball/729f6d19cfc401c4942e43fcc1059103bd6df130",
+ "reference": "729f6d19cfc401c4942e43fcc1059103bd6df130",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "symfony/http-foundation": "~2.1",
+ "symfony/http-kernel": "~2.1"
+ },
+ "suggest": {
+ "symfony/class-loader": "",
+ "symfony/http-foundation": "",
+ "symfony/http-kernel": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Debug\\": ""
+ }
+ },
+ "notification-url": "http://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Debug Component",
+ "homepage": "http://symfony.com",
+ "time": "2013-08-08 14:16:10"
},
{
"name": "symfony/dependency-injection",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/DependencyInjection",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection.git",
- "reference": "v2.1.11"
+ "reference": "3678aa969e5bfeb8515a1f3047c63e8104723f5c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/3678aa969e5bfeb8515a1f3047c63e8104723f5c",
+ "reference": "3678aa969e5bfeb8515a1f3047c63e8104723f5c",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
- "symfony/config": "2.1.*",
- "symfony/yaml": "2.1.*"
+ "symfony/config": "~2.2",
+ "symfony/yaml": "~2.0"
},
"suggest": {
- "symfony/config": "2.1.*",
- "symfony/yaml": "2.1.*"
+ "symfony/config": "",
+ "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
+ "symfony/yaml": ""
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\DependencyInjection": ""
+ "Symfony\\Component\\DependencyInjection\\": ""
}
},
- "notification-url": "https://packagist.org/downloads/",
+ "notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -95,40 +264,45 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "http://symfony.com",
- "time": "2013-05-03 05:08:13"
+ "time": "2013-07-25 17:13:25"
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher.git",
- "reference": "v2.1.11"
+ "reference": "41c9826457c65fa3cf746f214985b7ca9cba42f8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/41c9826457c65fa3cf746f214985b7ca9cba42f8",
+ "reference": "41c9826457c65fa3cf746f214985b7ca9cba42f8",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
- "symfony/dependency-injection": "2.1.*"
+ "symfony/dependency-injection": "~2.0"
},
"suggest": {
- "symfony/dependency-injection": "2.1.*",
- "symfony/http-kernel": "2.1.*"
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\EventDispatcher": ""
+ "Symfony\\Component\\EventDispatcher\\": ""
}
},
- "notification-url": "https://packagist.org/downloads/",
+ "notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -144,34 +318,88 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com",
- "time": "2013-02-11 11:26:14"
+ "time": "2013-07-21 12:12:18"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "v2.3.4",
+ "target-dir": "Symfony/Component/Filesystem",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Filesystem.git",
+ "reference": "87acbbef6d35ba649f96f09cc572c45119b360c3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Filesystem/zipball/87acbbef6d35ba649f96f09cc572c45119b360c3",
+ "reference": "87acbbef6d35ba649f96f09cc572c45119b360c3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Filesystem\\": ""
+ }
+ },
+ "notification-url": "http://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Filesystem Component",
+ "homepage": "http://symfony.com",
+ "time": "2013-07-21 12:12:18"
},
{
"name": "symfony/http-foundation",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation.git",
- "reference": "v2.1.11"
+ "reference": "fdf130fe65457aedbc4639a22f4ef9d3be5c002c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/fdf130fe65457aedbc4639a22f4ef9d3be5c002c",
+ "reference": "fdf130fe65457aedbc4639a22f4ef9d3be5c002c",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\HttpFoundation": "",
- "SessionHandlerInterface": "Symfony/Component/HttpFoundation/Resources/stubs"
- }
+ "Symfony\\Component\\HttpFoundation\\": ""
+ },
+ "classmap": [
+ "Symfony/Component/HttpFoundation/Resources/stubs"
+ ]
},
- "notification-url": "https://packagist.org/downloads/",
+ "notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -187,53 +415,62 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com",
- "time": "2013-05-26 18:42:07"
+ "time": "2013-08-26 05:49:51"
},
{
"name": "symfony/http-kernel",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/HttpKernel",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel.git",
- "reference": "v2.1.11"
+ "reference": "9d35da40f07bbe7a4f8dfbc41555d2b69de674bf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/9d35da40f07bbe7a4f8dfbc41555d2b69de674bf",
+ "reference": "9d35da40f07bbe7a4f8dfbc41555d2b69de674bf",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
- "symfony/event-dispatcher": "2.1.*",
- "symfony/http-foundation": "2.1.*"
+ "psr/log": "~1.0",
+ "symfony/debug": "~2.3",
+ "symfony/event-dispatcher": "~2.1",
+ "symfony/http-foundation": "~2.2"
},
"require-dev": {
- "symfony/browser-kit": "2.1.*",
- "symfony/class-loader": "2.1.*",
- "symfony/config": "2.1.*",
- "symfony/console": "2.1.*",
- "symfony/dependency-injection": "2.1.*",
- "symfony/finder": "2.1.*",
- "symfony/process": "2.1.*",
- "symfony/routing": "2.1.*"
+ "symfony/browser-kit": "~2.2",
+ "symfony/class-loader": "~2.1",
+ "symfony/config": "~2.0",
+ "symfony/console": "~2.2",
+ "symfony/dependency-injection": "~2.0",
+ "symfony/finder": "~2.0",
+ "symfony/process": "~2.0",
+ "symfony/routing": "~2.2",
+ "symfony/stopwatch": "~2.2",
+ "symfony/templating": "~2.2"
},
"suggest": {
- "symfony/browser-kit": "2.1.*",
- "symfony/class-loader": "2.1.*",
- "symfony/config": "2.1.*",
- "symfony/console": "2.1.*",
- "symfony/dependency-injection": "2.1.*",
- "symfony/finder": "2.1.*"
+ "symfony/browser-kit": "",
+ "symfony/class-loader": "",
+ "symfony/config": "",
+ "symfony/console": "",
+ "symfony/dependency-injection": "",
+ "symfony/finder": ""
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\HttpKernel": ""
+ "Symfony\\Component\\HttpKernel\\": ""
}
},
- "notification-url": "https://packagist.org/downloads/",
+ "notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -249,44 +486,49 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "http://symfony.com",
- "time": "2013-06-02 12:29:05"
+ "time": "2013-08-27 08:58:24"
},
{
"name": "symfony/routing",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/Routing",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing.git",
- "reference": "v2.1.11"
+ "reference": "69af3f07dbf3ae93dd513dbc373f561cb2e7f143"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Routing/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/Routing/zipball/69af3f07dbf3ae93dd513dbc373f561cb2e7f143",
+ "reference": "69af3f07dbf3ae93dd513dbc373f561cb2e7f143",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
- "doctrine/common": ">=2.2,<3.0",
- "symfony/config": "2.1.*",
- "symfony/http-kernel": "2.1.*",
- "symfony/yaml": "2.1.*"
+ "doctrine/common": "~2.2",
+ "psr/log": "~1.0",
+ "symfony/config": "~2.2",
+ "symfony/yaml": "~2.0"
},
"suggest": {
- "doctrine/common": "~2.2",
- "symfony/config": "2.1.*",
- "symfony/yaml": "2.1.*"
+ "doctrine/common": "",
+ "symfony/config": "",
+ "symfony/yaml": ""
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\Routing": ""
+ "Symfony\\Component\\Routing\\": ""
}
},
- "notification-url": "https://packagist.org/downloads/",
+ "notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -302,30 +544,35 @@
],
"description": "Symfony Routing Component",
"homepage": "http://symfony.com",
- "time": "2013-05-06 10:48:41"
+ "time": "2013-08-23 15:14:07"
},
{
"name": "symfony/yaml",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
- "reference": "v2.1.11"
+ "reference": "5a279f1b5f5e1045a6c432354d9ea727ff3a9847"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/5a279f1b5f5e1045a6c432354d9ea727ff3a9847",
+ "reference": "5a279f1b5f5e1045a6c432354d9ea727ff3a9847",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\Yaml": ""
+ "Symfony\\Component\\Yaml\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -344,20 +591,20 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
- "time": "2013-05-10 00:09:46"
+ "time": "2013-08-24 15:26:22"
},
{
"name": "twig/twig",
- "version": "v1.13.1",
+ "version": "v1.13.2",
"source": {
"type": "git",
"url": "https://github.com/fabpot/Twig.git",
- "reference": "v1.13.1"
+ "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fabpot/Twig/zipball/v1.13.1",
- "reference": "v1.13.1",
+ "url": "https://api.github.com/repos/fabpot/Twig/zipball/6d6a1009427d1f398c9d40904147bf9f723d5755",
+ "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755",
"shasum": ""
},
"require": {
@@ -374,9 +621,9 @@
"Twig_": "lib/"
}
},
- "notification-url": "https://packagist.org/downloads/",
+ "notification-url": "http://packagist.org/downloads/",
"license": [
- "BSD-3"
+ "BSD-3-Clause"
],
"authors": [
{
@@ -393,33 +640,37 @@
"keywords": [
"templating"
],
- "time": "2013-06-06 06:06:01"
+ "time": "2013-08-03 15:35:31"
}
],
"packages-dev": [
{
"name": "fabpot/goutte",
- "version": "v0.1.0",
+ "version": "v1.0.3",
"source": {
"type": "git",
- "url": "https://github.com/fabpot/Goutte",
- "reference": "v0.1.0"
+ "url": "https://github.com/fabpot/Goutte.git",
+ "reference": "75c9f23c4122caf4ea3e87a42a00b471366e707f"
},
"dist": {
"type": "zip",
- "url": "https://github.com/fabpot/Goutte/archive/v0.1.0.zip",
- "reference": "v0.1.0",
+ "url": "https://api.github.com/repos/fabpot/Goutte/zipball/75c9f23c4122caf4ea3e87a42a00b471366e707f",
+ "reference": "75c9f23c4122caf4ea3e87a42a00b471366e707f",
"shasum": ""
},
"require": {
"ext-curl": "*",
- "guzzle/guzzle": "3.0.*",
+ "guzzle/http": ">=3.0.5,<3.8-dev",
"php": ">=5.3.0",
- "symfony/browser-kit": "2.1.*",
- "symfony/css-selector": "2.1.*",
- "symfony/dom-crawler": "2.1.*",
- "symfony/finder": "2.1.*",
- "symfony/process": "2.1.*"
+ "symfony/browser-kit": "~2.1",
+ "symfony/css-selector": "~2.1",
+ "symfony/dom-crawler": "~2.1",
+ "symfony/finder": "~2.1",
+ "symfony/process": "~2.1"
+ },
+ "require-dev": {
+ "guzzle/plugin-history": ">=3.0.5,<3.8-dev",
+ "guzzle/plugin-mock": ">=3.0.5,<3.8-dev"
},
"type": "application",
"extra": {
@@ -447,70 +698,85 @@
"keywords": [
"scraper"
],
- "time": "2012-12-02 13:44:35"
+ "time": "2013-08-16 06:03:22"
},
{
- "name": "guzzle/guzzle",
- "version": "v3.0.7",
+ "name": "guzzle/common",
+ "version": "v3.7.3",
+ "target-dir": "Guzzle/Common",
"source": {
"type": "git",
- "url": "https://github.com/guzzle/guzzle",
- "reference": "v3.0.7"
+ "url": "https://github.com/guzzle/common.git",
+ "reference": "bf73c87375f60861f8c7ccc7b95878023ade5306"
},
"dist": {
"type": "zip",
- "url": "https://github.com/guzzle/guzzle/archive/v3.0.7.zip",
- "reference": "v3.0.7",
+ "url": "https://api.github.com/repos/guzzle/common/zipball/bf73c87375f60861f8c7ccc7b95878023ade5306",
+ "reference": "bf73c87375f60861f8c7ccc7b95878023ade5306",
"shasum": ""
},
"require": {
- "ext-curl": "*",
"php": ">=5.3.2",
"symfony/event-dispatcher": ">=2.1"
},
- "replace": {
- "guzzle/batch": "self.version",
- "guzzle/cache": "self.version",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.7-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Guzzle\\Common": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Common libraries used by Guzzle",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "collection",
+ "common",
+ "event",
+ "exception"
+ ],
+ "time": "2013-09-08 21:09:18"
+ },
+ {
+ "name": "guzzle/http",
+ "version": "v3.7.3",
+ "target-dir": "Guzzle/Http",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/http.git",
+ "reference": "1034125dfd906b73119e535f03153a62fccb1989"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/http/zipball/1034125dfd906b73119e535f03153a62fccb1989",
+ "reference": "1034125dfd906b73119e535f03153a62fccb1989",
+ "shasum": ""
+ },
+ "require": {
"guzzle/common": "self.version",
- "guzzle/http": "self.version",
- "guzzle/inflection": "self.version",
- "guzzle/iterator": "self.version",
- "guzzle/log": "self.version",
"guzzle/parser": "self.version",
- "guzzle/plugin": "self.version",
- "guzzle/plugin-async": "self.version",
- "guzzle/plugin-backoff": "self.version",
- "guzzle/plugin-cache": "self.version",
- "guzzle/plugin-cookie": "self.version",
- "guzzle/plugin-curlauth": "self.version",
- "guzzle/plugin-history": "self.version",
- "guzzle/plugin-log": "self.version",
- "guzzle/plugin-md5": "self.version",
- "guzzle/plugin-mock": "self.version",
- "guzzle/plugin-oauth": "self.version",
- "guzzle/service": "self.version",
- "guzzle/stream": "self.version"
+ "guzzle/stream": "self.version",
+ "php": ">=5.3.2"
},
- "require-dev": {
- "doctrine/common": "*",
- "monolog/monolog": "1.*",
- "phpunit/phpunit": "3.7.*",
- "symfony/class-loader": "*",
- "zend/zend-cache1": "1.12",
- "zend/zend-log1": "1.12",
- "zendframework/zend-cache": "2.0.*",
- "zendframework/zend-log": "2.0.*"
+ "suggest": {
+ "ext-curl": "*"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-master": "3.7-dev"
}
},
"autoload": {
"psr-0": {
- "Guzzle\\Tests": "tests/",
- "Guzzle": "src/"
+ "Guzzle\\Http": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -522,37 +788,128 @@
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
- },
- {
- "name": "Guzzle Community",
- "homepage": "https://github.com/guzzle/guzzle/contributors"
}
],
- "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients",
+ "description": "HTTP libraries used by Guzzle",
"homepage": "http://guzzlephp.org/",
"keywords": [
+ "Guzzle",
"client",
"curl",
- "framework",
"http",
- "http client",
- "rest",
- "web service"
+ "http client"
],
- "time": "2012-12-19 23:06:35"
+ "time": "2013-09-06 11:34:26"
+ },
+ {
+ "name": "guzzle/parser",
+ "version": "v3.7.3",
+ "target-dir": "Guzzle/Parser",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/parser.git",
+ "reference": "a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/parser/zipball/a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2",
+ "reference": "a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.7-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Guzzle\\Parser": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Interchangeable parsers used by Guzzle",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "URI Template",
+ "cookie",
+ "http",
+ "message",
+ "url"
+ ],
+ "time": "2013-07-11 22:46:03"
+ },
+ {
+ "name": "guzzle/stream",
+ "version": "v3.7.3",
+ "target-dir": "Guzzle/Stream",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/stream.git",
+ "reference": "a86111d9ac7db31d65a053c825869409fe8fc83f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/stream/zipball/a86111d9ac7db31d65a053c825869409fe8fc83f",
+ "reference": "a86111d9ac7db31d65a053c825869409fe8fc83f",
+ "shasum": ""
+ },
+ "require": {
+ "guzzle/common": "self.version",
+ "php": ">=5.3.2"
+ },
+ "suggest": {
+ "guzzle/http": "To convert Guzzle request objects to PHP streams"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.7-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Guzzle\\Stream": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Guzzle stream wrapper component",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "Guzzle",
+ "component",
+ "stream"
+ ],
+ "time": "2013-07-30 22:07:23"
},
{
"name": "phing/phing",
"version": "2.4.14",
"source": {
"type": "git",
- "url": "https://github.com/phingofficial/phing",
- "reference": "2.4.14"
+ "url": "https://github.com/phingofficial/phing.git",
+ "reference": "41075d93ca254f1c90c79ec7ce81be2b2629e138"
},
"dist": {
"type": "zip",
- "url": "https://github.com/phingofficial/phing/archive/2.4.14.zip",
- "reference": "2.4.14",
+ "url": "https://api.github.com/repos/phingofficial/phing/zipball/41075d93ca254f1c90c79ec7ce81be2b2629e138",
+ "reference": "41075d93ca254f1c90c79ec7ce81be2b2629e138",
"shasum": ""
},
"require": {
@@ -599,12 +956,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/dbunit.git",
- "reference": "1.2.3"
+ "reference": "8386782a2d55153e44a06eb1a9d13d6ed35d9c2d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/1.2.3",
- "reference": "1.2.3",
+ "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/8386782a2d55153e44a06eb1a9d13d6ed35d9c2d",
+ "reference": "8386782a2d55153e44a06eb1a9d13d6ed35d9c2d",
"shasum": ""
},
"require": {
@@ -653,16 +1010,16 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "1.2.12",
+ "version": "1.2.13",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "1.2.12"
+ "reference": "466e7cd2554b4e264c9e3f31216d25ac0e5f3d94"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/1.2.12",
- "reference": "1.2.12",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/466e7cd2554b4e264c9e3f31216d25ac0e5f3d94",
+ "reference": "466e7cd2554b4e264c9e3f31216d25ac0e5f3d94",
"shasum": ""
},
"require": {
@@ -710,20 +1067,20 @@
"testing",
"xunit"
],
- "time": "2013-07-06 06:26:16"
+ "time": "2013-09-10 08:14:32"
},
{
"name": "phpunit/php-file-iterator",
"version": "1.3.3",
"source": {
"type": "git",
- "url": "git://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "1.3.3"
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "16a78140ed2fc01b945cfa539665fadc6a038029"
},
"dist": {
"type": "zip",
- "url": "https://github.com/sebastianbergmann/php-file-iterator/zipball/1.3.3",
- "reference": "1.3.3",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/16a78140ed2fc01b945cfa539665fadc6a038029",
+ "reference": "16a78140ed2fc01b945cfa539665fadc6a038029",
"shasum": ""
},
"require": {
@@ -755,20 +1112,20 @@
"filesystem",
"iterator"
],
- "time": "2012-10-11 04:44:38"
+ "time": "2012-10-11 11:44:38"
},
{
"name": "phpunit/php-text-template",
"version": "1.1.4",
"source": {
"type": "git",
- "url": "git://github.com/sebastianbergmann/php-text-template.git",
- "reference": "1.1.4"
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "5180896f51c5b3648ac946b05f9ec02be78a0b23"
},
"dist": {
"type": "zip",
- "url": "https://github.com/sebastianbergmann/php-text-template/zipball/1.1.4",
- "reference": "1.1.4",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5180896f51c5b3648ac946b05f9ec02be78a0b23",
+ "reference": "5180896f51c5b3648ac946b05f9ec02be78a0b23",
"shasum": ""
},
"require": {
@@ -799,20 +1156,20 @@
"keywords": [
"template"
],
- "time": "2012-10-31 11:15:28"
+ "time": "2012-10-31 18:15:28"
},
{
"name": "phpunit/php-timer",
- "version": "1.0.4",
+ "version": "1.0.5",
"source": {
"type": "git",
- "url": "git://github.com/sebastianbergmann/php-timer.git",
- "reference": "1.0.4"
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
},
"dist": {
"type": "zip",
- "url": "https://github.com/sebastianbergmann/php-timer/zipball/1.0.4",
- "reference": "1.0.4",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+ "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
"shasum": ""
},
"require": {
@@ -839,24 +1196,24 @@
}
],
"description": "Utility class for timing",
- "homepage": "http://www.phpunit.de/",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
"keywords": [
"timer"
],
- "time": "2012-10-11 04:45:58"
+ "time": "2013-08-02 07:42:54"
},
{
"name": "phpunit/php-token-stream",
- "version": "1.1.5",
+ "version": "1.2.1",
"source": {
"type": "git",
- "url": "git://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "1.1.5"
+ "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+ "reference": "5220af2a7929aa35cf663d97c89ad3d50cf5fa3e"
},
"dist": {
"type": "zip",
- "url": "https://github.com/sebastianbergmann/php-token-stream/zipball/1.1.5",
- "reference": "1.1.5",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/5220af2a7929aa35cf663d97c89ad3d50cf5fa3e",
+ "reference": "5220af2a7929aa35cf663d97c89ad3d50cf5fa3e",
"shasum": ""
},
"require": {
@@ -864,6 +1221,11 @@
"php": ">=5.3.3"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2-dev"
+ }
+ },
"autoload": {
"classmap": [
"PHP/"
@@ -884,24 +1246,24 @@
}
],
"description": "Wrapper around PHP's tokenizer extension.",
- "homepage": "http://www.phpunit.de/",
+ "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
"keywords": [
"tokenizer"
],
- "time": "2012-10-11 04:47:14"
+ "time": "2013-09-13 04:58:23"
},
{
"name": "phpunit/phpunit",
- "version": "3.7.22",
+ "version": "3.7.24",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "3.7.22"
+ "reference": "af7b77ccb5c64458bdfca95665d29558d1df7d08"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3.7.22",
- "reference": "3.7.22",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/af7b77ccb5c64458bdfca95665d29558d1df7d08",
+ "reference": "af7b77ccb5c64458bdfca95665d29558d1df7d08",
"shasum": ""
},
"require": {
@@ -913,7 +1275,7 @@
"phpunit/php-code-coverage": "~1.2.1",
"phpunit/php-file-iterator": ">=1.3.1",
"phpunit/php-text-template": ">=1.1.1",
- "phpunit/php-timer": "~1.0.2",
+ "phpunit/php-timer": ">=1.0.4",
"phpunit/phpunit-mock-objects": "~1.2.0",
"symfony/yaml": "~2.0"
},
@@ -962,20 +1324,20 @@
"testing",
"xunit"
],
- "time": "2013-07-06 06:29:15"
+ "time": "2013-08-09 06:58:24"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "1.2.3",
"source": {
"type": "git",
- "url": "git://github.com/sebastianbergmann/phpunit-mock-objects.git",
- "reference": "1.2.3"
+ "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
+ "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875"
},
"dist": {
"type": "zip",
- "url": "https://github.com/sebastianbergmann/phpunit-mock-objects/archive/1.2.3.zip",
- "reference": "1.2.3",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875",
+ "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875",
"shasum": ""
},
"require": {
@@ -1015,34 +1377,39 @@
},
{
"name": "symfony/browser-kit",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/BrowserKit",
"source": {
"type": "git",
"url": "https://github.com/symfony/BrowserKit.git",
- "reference": "v2.1.11"
+ "reference": "2639dc4eec81f92760e05396a93bb78000b4f5ca"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/2639dc4eec81f92760e05396a93bb78000b4f5ca",
+ "reference": "2639dc4eec81f92760e05396a93bb78000b4f5ca",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
- "symfony/dom-crawler": "2.1.*"
+ "symfony/dom-crawler": "~2.0"
},
"require-dev": {
- "symfony/css-selector": "2.1.*",
- "symfony/process": "2.1.*"
+ "symfony/css-selector": "~2.0",
+ "symfony/process": "~2.0"
},
"suggest": {
- "symfony/process": "2.1.*"
+ "symfony/process": ""
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\BrowserKit": ""
+ "Symfony\\Component\\BrowserKit\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1061,30 +1428,35 @@
],
"description": "Symfony BrowserKit Component",
"homepage": "http://symfony.com",
- "time": "2013-04-29 20:22:06"
+ "time": "2013-07-21 12:12:18"
},
{
"name": "symfony/css-selector",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/CssSelector",
"source": {
"type": "git",
"url": "https://github.com/symfony/CssSelector.git",
- "reference": "v2.1.11"
+ "reference": "885544201cb24e79754da1dbd61bd779c2e4353e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/CssSelector/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/CssSelector/zipball/885544201cb24e79754da1dbd61bd779c2e4353e",
+ "reference": "885544201cb24e79754da1dbd61bd779c2e4353e",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\CssSelector": ""
+ "Symfony\\Component\\CssSelector\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1099,40 +1471,49 @@
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
+ },
+ {
+ "name": "Jean-François Simon",
+ "email": "jeanfrancois.simon@sensiolabs.com"
}
],
"description": "Symfony CssSelector Component",
"homepage": "http://symfony.com",
- "time": "2013-05-17 00:31:34"
+ "time": "2013-07-21 12:12:18"
},
{
"name": "symfony/dom-crawler",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/DomCrawler",
"source": {
"type": "git",
"url": "https://github.com/symfony/DomCrawler.git",
- "reference": "v2.1.11"
+ "reference": "e05e07fe8958a304b5e135f8e65d4ae6148cf59b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/e05e07fe8958a304b5e135f8e65d4ae6148cf59b",
+ "reference": "e05e07fe8958a304b5e135f8e65d4ae6148cf59b",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
- "symfony/css-selector": "2.1.*"
+ "symfony/css-selector": "~2.0"
},
"suggest": {
- "symfony/css-selector": "2.1.*"
+ "symfony/css-selector": ""
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\DomCrawler": ""
+ "Symfony\\Component\\DomCrawler\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1151,30 +1532,35 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "http://symfony.com",
- "time": "2013-05-16 00:06:15"
+ "time": "2013-07-21 12:12:18"
},
{
"name": "symfony/finder",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/Finder",
"source": {
"type": "git",
"url": "https://github.com/symfony/Finder.git",
- "reference": "v2.1.11"
+ "reference": "4a0fee5b86f5bbd9dfdc11ec124eba2915737ce1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Finder/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/Finder/zipball/4a0fee5b86f5bbd9dfdc11ec124eba2915737ce1",
+ "reference": "4a0fee5b86f5bbd9dfdc11ec124eba2915737ce1",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\Finder": ""
+ "Symfony\\Component\\Finder\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1193,30 +1579,35 @@
],
"description": "Symfony Finder Component",
"homepage": "http://symfony.com",
- "time": "2013-05-25 15:47:15"
+ "time": "2013-08-13 20:18:00"
},
{
"name": "symfony/process",
- "version": "v2.1.11",
+ "version": "v2.3.4",
"target-dir": "Symfony/Component/Process",
"source": {
"type": "git",
"url": "https://github.com/symfony/Process.git",
- "reference": "v2.1.11"
+ "reference": "1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Process/zipball/v2.1.11",
- "reference": "v2.1.11",
+ "url": "https://api.github.com/repos/symfony/Process/zipball/1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b",
+ "reference": "1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-0": {
- "Symfony\\Component\\Process": ""
+ "Symfony\\Component\\Process\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1235,7 +1626,7 @@
],
"description": "Symfony Process Component",
"homepage": "http://symfony.com",
- "time": "2013-05-06 10:21:56"
+ "time": "2013-08-22 06:42:25"
}
],
"aliases": [
diff --git a/phpBB/config/auth_providers.yml b/phpBB/config/auth_providers.yml
index 0a20ed6a80..cc782376fc 100644
--- a/phpBB/config/auth_providers.yml
+++ b/phpBB/config/auth_providers.yml
@@ -35,3 +35,45 @@ services:
- @user
tags:
- { name: auth.provider }
+ auth.provider.oauth:
+ class: phpbb_auth_provider_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 }
diff --git a/phpBB/config/notifications.yml b/phpBB/config/notifications.yml
index adafa99e75..87a619661c 100644
--- a/phpBB/config/notifications.yml
+++ b/phpBB/config/notifications.yml
@@ -103,6 +103,42 @@ services:
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
+ - @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.pm:
class: phpbb\notification\type\pm
scope: prototype # scope MUST be prototype for this to work!
diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml
index f238ed3ed6..f991fea554 100644
--- a/phpBB/config/services.yml
+++ b/phpBB/config/services.yml
@@ -8,6 +8,12 @@ imports:
- { resource: auth_providers.yml }
services:
+ acl.permissions:
+ class: phpbb_permissions
+ arguments:
+ - @dispatcher
+ - @user
+
auth:
class: phpbb\auth\auth
@@ -84,6 +90,7 @@ services:
arguments:
- @template
- @user
+ - @config
- %core.root_path%
- %core.php_ext%
@@ -92,7 +99,7 @@ services:
arguments:
- @user
- @service_container
- - @style
+ - @template
cron.task_collection:
class: phpbb\di\service_collection
@@ -239,33 +246,12 @@ services:
- %tables.notifications%
- %tables.user_notifications%
+ php_ini:
+ class: phpbb_php_ini
+
request:
class: phpbb\request\request
- style:
- class: phpbb\style\style
- 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
-
template:
class: phpbb\template\twig\twig
arguments:
diff --git a/phpBB/config/tables.yml b/phpBB/config/tables.yml
index fdb448f4e0..0d364eb6b0 100644
--- a/phpBB/config/tables.yml
+++ b/phpBB/config/tables.yml
@@ -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
diff --git a/phpBB/develop/blank.gif b/phpBB/develop/blank.gif
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/phpBB/develop/blank.gif
diff --git a/phpBB/develop/blank.jpg b/phpBB/develop/blank.jpg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/phpBB/develop/blank.jpg
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index dc224cd411..9ffc8d229f 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -18,218 +18,12 @@ if (!is_writable($schema_path))
die('Schema path not writable');
}
-$schema_data = get_schema_struct();
-$dbms_type_map = array(
- 'mysql_41' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT' => 'text',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT' => 'text',
- 'TEXT_UNI' => 'text',
- 'MTEXT' => 'mediumtext',
- 'MTEXT_UNI' => 'mediumtext',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'mysql_40' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varbinary(255)',
- 'VCHAR:' => 'varbinary(%d)',
- 'CHAR:' => 'binary(%d)',
- 'XSTEXT' => 'blob',
- 'XSTEXT_UNI'=> 'blob',
- 'STEXT' => 'blob',
- 'STEXT_UNI' => 'blob',
- 'TEXT' => 'blob',
- 'TEXT_UNI' => 'blob',
- 'MTEXT' => 'mediumblob',
- 'MTEXT_UNI' => 'mediumblob',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'blob',
- 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
- 'VCHAR_CI' => 'blob',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'firebird' => array(
- 'INT:' => 'INTEGER',
- 'BINT' => 'DOUBLE PRECISION',
- 'UINT' => 'INTEGER',
- 'UINT:' => 'INTEGER',
- 'TINT:' => 'INTEGER',
- 'USINT' => 'INTEGER',
- 'BOOL' => 'INTEGER',
- 'VCHAR' => 'VARCHAR(255) CHARACTER SET NONE',
- 'VCHAR:' => 'VARCHAR(%d) CHARACTER SET NONE',
- 'CHAR:' => 'CHAR(%d) CHARACTER SET NONE',
- 'XSTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'STEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'TEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'MTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'XSTEXT_UNI'=> 'VARCHAR(100) CHARACTER SET UTF8',
- 'STEXT_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'TEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'MTEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'TIMESTAMP' => 'INTEGER',
- 'DECIMAL' => 'DOUBLE PRECISION',
- 'DECIMAL:' => 'DOUBLE PRECISION',
- 'PDECIMAL' => 'DOUBLE PRECISION',
- 'PDECIMAL:' => 'DOUBLE PRECISION',
- 'VCHAR_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VCHAR_UNI:'=> 'VARCHAR(%d) CHARACTER SET UTF8',
- 'VCHAR_CI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VARBINARY' => 'CHAR(255) CHARACTER SET NONE',
- ),
-
- 'mssql' => array(
- 'INT:' => '[int]',
- 'BINT' => '[float]',
- 'UINT' => '[int]',
- 'UINT:' => '[int]',
- 'TINT:' => '[int]',
- 'USINT' => '[int]',
- 'BOOL' => '[int]',
- 'VCHAR' => '[varchar] (255)',
- 'VCHAR:' => '[varchar] (%d)',
- 'CHAR:' => '[char] (%d)',
- 'XSTEXT' => '[varchar] (1000)',
- 'STEXT' => '[varchar] (3000)',
- 'TEXT' => '[varchar] (8000)',
- 'MTEXT' => '[text]',
- 'XSTEXT_UNI'=> '[varchar] (100)',
- 'STEXT_UNI' => '[varchar] (255)',
- 'TEXT_UNI' => '[varchar] (4000)',
- 'MTEXT_UNI' => '[text]',
- 'TIMESTAMP' => '[int]',
- 'DECIMAL' => '[float]',
- 'DECIMAL:' => '[float]',
- 'PDECIMAL' => '[float]',
- 'PDECIMAL:' => '[float]',
- 'VCHAR_UNI' => '[varchar] (255)',
- 'VCHAR_UNI:'=> '[varchar] (%d)',
- 'VCHAR_CI' => '[varchar] (255)',
- 'VARBINARY' => '[varchar] (255)',
- ),
-
- 'oracle' => array(
- 'INT:' => 'number(%d)',
- 'BINT' => 'number(20)',
- 'UINT' => 'number(8)',
- 'UINT:' => 'number(%d)',
- 'TINT:' => 'number(%d)',
- 'USINT' => 'number(4)',
- 'BOOL' => 'number(1)',
- 'VCHAR' => 'varchar2(255)',
- 'VCHAR:' => 'varchar2(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar2(1000)',
- 'STEXT' => 'varchar2(3000)',
- 'TEXT' => 'clob',
- 'MTEXT' => 'clob',
- 'XSTEXT_UNI'=> 'varchar2(300)',
- 'STEXT_UNI' => 'varchar2(765)',
- 'TEXT_UNI' => 'clob',
- 'MTEXT_UNI' => 'clob',
- 'TIMESTAMP' => 'number(11)',
- 'DECIMAL' => 'number(5, 2)',
- 'DECIMAL:' => 'number(%d, 2)',
- 'PDECIMAL' => 'number(6, 3)',
- 'PDECIMAL:' => 'number(%d, 3)',
- 'VCHAR_UNI' => 'varchar2(765)',
- 'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')),
- 'VCHAR_CI' => 'varchar2(255)',
- 'VARBINARY' => 'raw(255)',
- ),
-
- 'sqlite' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'INTEGER UNSIGNED', //'mediumint(8) UNSIGNED',
- 'UINT:' => 'INTEGER UNSIGNED', // 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'INTEGER UNSIGNED', //'mediumint(4) UNSIGNED',
- 'BOOL' => 'INTEGER UNSIGNED', //'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text(65535)',
- 'STEXT' => 'text(65535)',
- 'TEXT' => 'text(65535)',
- 'MTEXT' => 'mediumtext(16777215)',
- 'XSTEXT_UNI'=> 'text(65535)',
- 'STEXT_UNI' => 'text(65535)',
- 'TEXT_UNI' => 'text(65535)',
- 'MTEXT_UNI' => 'mediumtext(16777215)',
- 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'blob',
- ),
-
- 'postgres' => array(
- 'INT:' => 'INT4',
- 'BINT' => 'INT8',
- 'UINT' => 'INT4', // unsigned
- 'UINT:' => 'INT4', // unsigned
- 'USINT' => 'INT2', // unsigned
- 'BOOL' => 'INT2', // unsigned
- 'TINT:' => 'INT2',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar(1000)',
- 'STEXT' => 'varchar(3000)',
- 'TEXT' => 'varchar(8000)',
- 'MTEXT' => 'TEXT',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT_UNI' => 'varchar(4000)',
- 'MTEXT_UNI' => 'TEXT',
- 'TIMESTAMP' => 'INT4', // unsigned
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar_ci',
- 'VARBINARY' => 'bytea',
- ),
-);
+define('IN_PHPBB', true);
+
+require(dirname(__FILE__) . '/../includes/db/schema_data.php');
+require(dirname(__FILE__) . '/../phpbb/db/tools.php');
+
+$dbms_type_map = phpbb_db_tools::get_dbms_type_map();
// A list of types being unsigned for better reference in some db's
$unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
@@ -787,1191 +581,6 @@ foreach ($supported_dbms as $dbms)
fclose($fp);
}
-
-/**
-* Define the basic structure
-* The format:
-* array('{TABLE_NAME}' => {TABLE_DATA})
-* {TABLE_DATA}:
-* COLUMNS = array({column_name} = array({column_type}, {default}, {auto_increment}))
-* PRIMARY_KEY = {column_name(s)}
-* KEYS = array({key_name} = array({key_type}, {column_name(s)})),
-*
-* Column Types:
-* INT:x => SIGNED int(x)
-* BINT => BIGINT
-* UINT => mediumint(8) UNSIGNED
-* UINT:x => int(x) UNSIGNED
-* TINT:x => tinyint(x)
-* USINT => smallint(4) UNSIGNED (for _order columns)
-* BOOL => tinyint(1) UNSIGNED
-* VCHAR => varchar(255)
-* CHAR:x => char(x)
-* XSTEXT_UNI => text for storing 100 characters (topic_title for example)
-* STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI
-* TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.)
-* MTEXT_UNI => mediumtext (post text, large text)
-* VCHAR:x => varchar(x)
-* TIMESTAMP => int(11) UNSIGNED
-* DECIMAL => decimal number (5,2)
-* DECIMAL: => decimal number (x,2)
-* PDECIMAL => precision decimal number (6,3)
-* PDECIMAL: => precision decimal number (x,3)
-* VCHAR_UNI => varchar(255) BINARY
-* VCHAR_CI => varchar_ci for postgresql, others VCHAR
-*/
-function get_schema_struct()
-{
- $schema_data = array();
-
- $schema_data['phpbb_attachments'] = array(
- 'COLUMNS' => array(
- 'attach_id' => array('UINT', NULL, 'auto_increment'),
- 'post_msg_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'in_message' => array('BOOL', 0),
- 'poster_id' => array('UINT', 0),
- 'is_orphan' => array('BOOL', 1),
- 'physical_filename' => array('VCHAR', ''),
- 'real_filename' => array('VCHAR', ''),
- 'download_count' => array('UINT', 0),
- 'attach_comment' => array('TEXT_UNI', ''),
- 'extension' => array('VCHAR:100', ''),
- 'mimetype' => array('VCHAR:100', ''),
- 'filesize' => array('UINT:20', 0),
- 'filetime' => array('TIMESTAMP', 0),
- 'thumbnail' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'attach_id',
- 'KEYS' => array(
- 'filetime' => array('INDEX', 'filetime'),
- 'post_msg_id' => array('INDEX', 'post_msg_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'is_orphan' => array('INDEX', 'is_orphan'),
- ),
- );
-
- $schema_data['phpbb_acl_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'auth_opt_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_acl_options'] = array(
- 'COLUMNS' => array(
- 'auth_option_id' => array('UINT', NULL, 'auto_increment'),
- 'auth_option' => array('VCHAR:50', ''),
- 'is_global' => array('BOOL', 0),
- 'is_local' => array('BOOL', 0),
- 'founder_only' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'auth_option_id',
- 'KEYS' => array(
- 'auth_option' => array('UNIQUE', 'auth_option'),
- ),
- );
-
- $schema_data['phpbb_acl_roles'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', NULL, 'auto_increment'),
- 'role_name' => array('VCHAR_UNI', ''),
- 'role_description' => array('TEXT_UNI', ''),
- 'role_type' => array('VCHAR:10', ''),
- 'role_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'role_id',
- 'KEYS' => array(
- 'role_type' => array('INDEX', 'role_type'),
- 'role_order' => array('INDEX', 'role_order'),
- ),
- );
-
- $schema_data['phpbb_acl_roles_data'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'PRIMARY_KEY' => array('role_id', 'auth_option_id'),
- 'KEYS' => array(
- 'ath_op_id' => array('INDEX', 'auth_option_id'),
- ),
- );
-
- $schema_data['phpbb_acl_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- 'auth_option_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_banlist'] = array(
- 'COLUMNS' => array(
- 'ban_id' => array('UINT', NULL, 'auto_increment'),
- 'ban_userid' => array('UINT', 0),
- 'ban_ip' => array('VCHAR:40', ''),
- 'ban_email' => array('VCHAR_UNI:100', ''),
- 'ban_start' => array('TIMESTAMP', 0),
- 'ban_end' => array('TIMESTAMP', 0),
- 'ban_exclude' => array('BOOL', 0),
- 'ban_reason' => array('VCHAR_UNI', ''),
- 'ban_give_reason' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'ban_id',
- 'KEYS' => array(
- 'ban_end' => array('INDEX', 'ban_end'),
- 'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')),
- 'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')),
- 'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')),
- ),
- );
-
- $schema_data['phpbb_bbcodes'] = array(
- 'COLUMNS' => array(
- 'bbcode_id' => array('USINT', 0),
- 'bbcode_tag' => array('VCHAR:16', ''),
- 'bbcode_helpline' => array('VCHAR_UNI', ''),
- 'display_on_posting' => array('BOOL', 0),
- 'bbcode_match' => array('TEXT_UNI', ''),
- 'bbcode_tpl' => array('MTEXT_UNI', ''),
- 'first_pass_match' => array('MTEXT_UNI', ''),
- 'first_pass_replace' => array('MTEXT_UNI', ''),
- 'second_pass_match' => array('MTEXT_UNI', ''),
- 'second_pass_replace' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'bbcode_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_bookmarks'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('topic_id', 'user_id'),
- );
-
- $schema_data['phpbb_bots'] = array(
- 'COLUMNS' => array(
- 'bot_id' => array('UINT', NULL, 'auto_increment'),
- 'bot_active' => array('BOOL', 1),
- 'bot_name' => array('STEXT_UNI', ''),
- 'user_id' => array('UINT', 0),
- 'bot_agent' => array('VCHAR', ''),
- 'bot_ip' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'bot_id',
- 'KEYS' => array(
- 'bot_active' => array('INDEX', 'bot_active'),
- ),
- );
-
- $schema_data['\phpbb\config\config'] = array(
- 'COLUMNS' => array(
- 'config_name' => array('VCHAR', ''),
- 'config_value' => array('VCHAR_UNI', ''),
- 'is_dynamic' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'config_name',
- 'KEYS' => array(
- 'is_dynamic' => array('INDEX', 'is_dynamic'),
- ),
- );
-
- $schema_data['phpbb_config_text'] = array(
- 'COLUMNS' => array(
- 'config_name' => array('VCHAR', ''),
- 'config_value' => array('MTEXT', ''),
- ),
- 'PRIMARY_KEY' => 'config_name',
- );
-
- $schema_data['phpbb_confirm'] = array(
- 'COLUMNS' => array(
- 'confirm_id' => array('CHAR:32', ''),
- 'session_id' => array('CHAR:32', ''),
- 'confirm_type' => array('TINT:3', 0),
- 'code' => array('VCHAR:8', ''),
- 'seed' => array('UINT:10', 0),
- 'attempts' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('session_id', 'confirm_id'),
- 'KEYS' => array(
- 'confirm_type' => array('INDEX', 'confirm_type'),
- ),
- );
-
- $schema_data['phpbb_disallow'] = array(
- 'COLUMNS' => array(
- 'disallow_id' => array('UINT', NULL, 'auto_increment'),
- 'disallow_username' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'disallow_id',
- );
-
- $schema_data['phpbb_drafts'] = array(
- 'COLUMNS' => array(
- 'draft_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'save_time' => array('TIMESTAMP', 0),
- 'draft_subject' => array('STEXT_UNI', ''),
- 'draft_message' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'draft_id',
- 'KEYS' => array(
- 'save_time' => array('INDEX', 'save_time'),
- ),
- );
-
- $schema_data['phpbb_ext'] = array(
- 'COLUMNS' => array(
- 'ext_name' => array('VCHAR', ''),
- 'ext_active' => array('BOOL', 0),
- 'ext_state' => array('TEXT', ''),
- ),
- 'KEYS' => array(
- 'ext_name' => array('UNIQUE', 'ext_name'),
- ),
- );
-
- $schema_data['phpbb_extensions'] = array(
- 'COLUMNS' => array(
- 'extension_id' => array('UINT', NULL, 'auto_increment'),
- 'group_id' => array('UINT', 0),
- 'extension' => array('VCHAR:100', ''),
- ),
- 'PRIMARY_KEY' => 'extension_id',
- );
-
- $schema_data['phpbb_extension_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_name' => array('VCHAR_UNI', ''),
- 'cat_id' => array('TINT:2', 0),
- 'allow_group' => array('BOOL', 0),
- 'download_mode' => array('BOOL', 1),
- 'upload_icon' => array('VCHAR', ''),
- 'max_filesize' => array('UINT:20', 0),
- 'allowed_forums' => array('TEXT', ''),
- 'allow_in_pm' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'group_id',
- );
-
- $schema_data['phpbb_forums'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', NULL, 'auto_increment'),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'forum_parents' => array('MTEXT', ''),
- 'forum_name' => array('STEXT_UNI', ''),
- 'forum_desc' => array('TEXT_UNI', ''),
- 'forum_desc_bitfield' => array('VCHAR:255', ''),
- 'forum_desc_options' => array('UINT:11', 7),
- 'forum_desc_uid' => array('VCHAR:8', ''),
- 'forum_link' => array('VCHAR_UNI', ''),
- 'forum_password' => array('VCHAR_UNI:40', ''),
- 'forum_style' => array('UINT', 0),
- 'forum_image' => array('VCHAR', ''),
- 'forum_rules' => array('TEXT_UNI', ''),
- 'forum_rules_link' => array('VCHAR_UNI', ''),
- 'forum_rules_bitfield' => array('VCHAR:255', ''),
- 'forum_rules_options' => array('UINT:11', 7),
- 'forum_rules_uid' => array('VCHAR:8', ''),
- 'forum_topics_per_page' => array('TINT:4', 0),
- 'forum_type' => array('TINT:4', 0),
- 'forum_status' => array('TINT:4', 0),
- 'forum_posts_approved' => array('UINT', 0),
- 'forum_posts_unapproved' => array('UINT', 0),
- 'forum_posts_softdeleted' => array('UINT', 0),
- 'forum_topics_approved' => array('UINT', 0),
- 'forum_topics_unapproved' => array('UINT', 0),
- 'forum_topics_softdeleted' => array('UINT', 0),
- 'forum_last_post_id' => array('UINT', 0),
- 'forum_last_poster_id' => array('UINT', 0),
- 'forum_last_post_subject' => array('STEXT_UNI', ''),
- 'forum_last_post_time' => array('TIMESTAMP', 0),
- 'forum_last_poster_name'=> array('VCHAR_UNI', ''),
- 'forum_last_poster_colour'=> array('VCHAR:6', ''),
- 'forum_flags' => array('TINT:4', 32),
- 'forum_options' => array('UINT:20', 0),
- 'display_subforum_list' => array('BOOL', 1),
- 'display_on_index' => array('BOOL', 1),
- 'enable_indexing' => array('BOOL', 1),
- 'enable_icons' => array('BOOL', 1),
- 'enable_prune' => array('BOOL', 0),
- 'prune_next' => array('TIMESTAMP', 0),
- 'prune_days' => array('UINT', 0),
- 'prune_viewed' => array('UINT', 0),
- 'prune_freq' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'forum_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'forum_lastpost_id' => array('INDEX', 'forum_last_post_id'),
- ),
- );
-
- $schema_data['phpbb_forums_access'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'session_id' => array('CHAR:32', ''),
- ),
- 'PRIMARY_KEY' => array('forum_id', 'user_id', 'session_id'),
- );
-
- $schema_data['phpbb_forums_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'forum_id'),
- );
-
- $schema_data['phpbb_forums_watch'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_type' => array('TINT:4', 1),
- 'group_founder_manage' => array('BOOL', 0),
- 'group_skip_auth' => array('BOOL', 0),
- 'group_name' => array('VCHAR_CI', ''),
- 'group_desc' => array('TEXT_UNI', ''),
- 'group_desc_bitfield' => array('VCHAR:255', ''),
- 'group_desc_options' => array('UINT:11', 7),
- 'group_desc_uid' => array('VCHAR:8', ''),
- 'group_display' => array('BOOL', 0),
- 'group_avatar' => array('VCHAR', ''),
- 'group_avatar_type' => array('VCHAR:255', ''),
- 'group_avatar_width' => array('USINT', 0),
- 'group_avatar_height' => array('USINT', 0),
- 'group_rank' => array('UINT', 0),
- 'group_colour' => array('VCHAR:6', ''),
- 'group_sig_chars' => array('UINT', 0),
- 'group_receive_pm' => array('BOOL', 0),
- 'group_message_limit' => array('UINT', 0),
- 'group_max_recipients' => array('UINT', 0),
- 'group_legend' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'group_id',
- 'KEYS' => array(
- 'group_legend_name' => array('INDEX', array('group_legend', 'group_name')),
- ),
- );
-
- $schema_data['phpbb_icons'] = array(
- 'COLUMNS' => array(
- 'icons_id' => array('UINT', NULL, 'auto_increment'),
- 'icons_url' => array('VCHAR', ''),
- 'icons_width' => array('TINT:4', 0),
- 'icons_height' => array('TINT:4', 0),
- 'icons_order' => array('UINT', 0),
- 'display_on_posting' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'icons_id',
- 'KEYS' => array(
- 'display_on_posting' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_lang'] = array(
- 'COLUMNS' => array(
- 'lang_id' => array('TINT:4', NULL, 'auto_increment'),
- 'lang_iso' => array('VCHAR:30', ''),
- 'lang_dir' => array('VCHAR:30', ''),
- 'lang_english_name' => array('VCHAR_UNI:100', ''),
- 'lang_local_name' => array('VCHAR_UNI:255', ''),
- 'lang_author' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'lang_id',
- 'KEYS' => array(
- 'lang_iso' => array('INDEX', 'lang_iso'),
- ),
- );
-
- $schema_data['\phpbb\log\log'] = array(
- 'COLUMNS' => array(
- 'log_id' => array('UINT', NULL, 'auto_increment'),
- 'log_type' => array('TINT:4', 0),
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'reportee_id' => array('UINT', 0),
- 'log_ip' => array('VCHAR:40', ''),
- 'log_time' => array('TIMESTAMP', 0),
- 'log_operation' => array('TEXT_UNI', ''),
- 'log_data' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'log_id',
- 'KEYS' => array(
- 'log_type' => array('INDEX', 'log_type'),
- 'log_time' => array('INDEX', 'log_time'),
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'reportee_id' => array('INDEX', 'reportee_id'),
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_login_attempts'] = array(
- 'COLUMNS' => array(
- 'attempt_ip' => array('VCHAR:40', ''),
- 'attempt_browser' => array('VCHAR:150', ''),
- 'attempt_forwarded_for' => array('VCHAR:255', ''),
- 'attempt_time' => array('TIMESTAMP', 0),
- 'user_id' => array('UINT', 0),
- 'username' => array('VCHAR_UNI:255', 0),
- 'username_clean' => array('VCHAR_CI', 0),
- ),
- 'KEYS' => array(
- 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')),
- 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')),
- 'att_time' => array('INDEX', array('attempt_time')),
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_moderator_cache'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'username' => array('VCHAR_UNI:255', ''),
- 'group_id' => array('UINT', 0),
- 'group_name' => array('VCHAR_UNI', ''),
- 'display_on_index' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'disp_idx' => array('INDEX', 'display_on_index'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_migrations'] = array(
- 'COLUMNS' => array(
- 'migration_name' => array('VCHAR', ''),
- 'migration_depends_on' => array('TEXT', ''),
- 'migration_schema_done' => array('BOOL', 0),
- 'migration_data_done' => array('BOOL', 0),
- 'migration_data_state' => array('TEXT', ''),
- 'migration_start_time' => array('TIMESTAMP', 0),
- 'migration_end_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'migration_name',
- );
-
- $schema_data['phpbb_modules'] = array(
- 'COLUMNS' => array(
- 'module_id' => array('UINT', NULL, 'auto_increment'),
- 'module_enabled' => array('BOOL', 1),
- 'module_display' => array('BOOL', 1),
- 'module_basename' => array('VCHAR', ''),
- 'module_class' => array('VCHAR:10', ''),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'module_langname' => array('VCHAR', ''),
- 'module_mode' => array('VCHAR', ''),
- 'module_auth' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'module_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'module_enabled' => array('INDEX', 'module_enabled'),
- 'class_left_id' => array('INDEX', array('module_class', 'left_id')),
- ),
- );
-
- $schema_data['phpbb_notification_types'] = array(
- 'COLUMNS' => array(
- 'notification_type_id' => array('USINT', NULL, 'auto_increment'),
- 'notification_type_name' => array('VCHAR:255', ''),
- 'notification_type_enabled' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => array('notification_type_id'),
- 'KEYS' => array(
- 'type' => array('UNIQUE', array('notification_type_name')),
- ),
- );
-
- $schema_data['phpbb_notifications'] = array(
- 'COLUMNS' => array(
- 'notification_id' => array('UINT:10', NULL, 'auto_increment'),
- 'notification_type_id' => array('USINT', 0),
- 'item_id' => array('UINT', 0),
- 'item_parent_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notification_read' => array('BOOL', 0),
- 'notification_time' => array('TIMESTAMP', 1),
- 'notification_data' => array('TEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'notification_id',
- 'KEYS' => array(
- 'item_ident' => array('INDEX', array('notification_type_id', 'item_id')),
- 'user' => array('INDEX', array('user_id', 'notification_read')),
- ),
- );
-
- $schema_data['phpbb_poll_options'] = array(
- 'COLUMNS' => array(
- 'poll_option_id' => array('TINT:4', 0),
- 'topic_id' => array('UINT', 0),
- 'poll_option_text' => array('TEXT_UNI', ''),
- 'poll_option_total' => array('UINT', 0),
- ),
- 'KEYS' => array(
- 'poll_opt_id' => array('INDEX', 'poll_option_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- ),
- );
-
- $schema_data['phpbb_poll_votes'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'poll_option_id' => array('TINT:4', 0),
- 'vote_user_id' => array('UINT', 0),
- 'vote_user_ip' => array('VCHAR:40', ''),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'vote_user_id' => array('INDEX', 'vote_user_id'),
- 'vote_user_ip' => array('INDEX', 'vote_user_ip'),
- ),
- );
-
- $schema_data['phpbb_posts'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', NULL, 'auto_increment'),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'poster_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'poster_ip' => array('VCHAR:40', ''),
- 'post_time' => array('TIMESTAMP', 0),
- 'post_visibility' => array('TINT:3', 0),
- 'post_reported' => array('BOOL', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'post_username' => array('VCHAR_UNI:255', ''),
- 'post_subject' => array('STEXT_UNI', '', 'true_sort'),
- 'post_text' => array('MTEXT_UNI', ''),
- 'post_checksum' => array('VCHAR:32', ''),
- 'post_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'post_postcount' => array('BOOL', 1),
- 'post_edit_time' => array('TIMESTAMP', 0),
- 'post_edit_reason' => array('STEXT_UNI', ''),
- 'post_edit_user' => array('UINT', 0),
- 'post_edit_count' => array('USINT', 0),
- 'post_edit_locked' => array('BOOL', 0),
- 'post_delete_time' => array('TIMESTAMP', 0),
- 'post_delete_reason' => array('STEXT_UNI', ''),
- 'post_delete_user' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'post_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_ip' => array('INDEX', 'poster_ip'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'post_visibility' => array('INDEX', 'post_visibility'),
- 'post_username' => array('INDEX', 'post_username'),
- 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
- ),
- );
-
- $schema_data['phpbb_privmsgs'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', NULL, 'auto_increment'),
- 'root_level' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'author_ip' => array('VCHAR:40', ''),
- 'message_time' => array('TIMESTAMP', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'message_subject' => array('STEXT_UNI', ''),
- 'message_text' => array('MTEXT_UNI', ''),
- 'message_edit_reason' => array('STEXT_UNI', ''),
- 'message_edit_user' => array('UINT', 0),
- 'message_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'message_edit_time' => array('TIMESTAMP', 0),
- 'message_edit_count' => array('USINT', 0),
- 'to_address' => array('TEXT_UNI', ''),
- 'bcc_address' => array('TEXT_UNI', ''),
- 'message_reported' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'msg_id',
- 'KEYS' => array(
- 'author_ip' => array('INDEX', 'author_ip'),
- 'message_time' => array('INDEX', 'message_time'),
- 'author_id' => array('INDEX', 'author_id'),
- 'root_level' => array('INDEX', 'root_level'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_folder'] = array(
- 'COLUMNS' => array(
- 'folder_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'folder_name' => array('VCHAR_UNI', ''),
- 'pm_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'folder_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_rules'] = array(
- 'COLUMNS' => array(
- 'rule_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'rule_check' => array('UINT', 0),
- 'rule_connection' => array('UINT', 0),
- 'rule_string' => array('VCHAR_UNI', ''),
- 'rule_user_id' => array('UINT', 0),
- 'rule_group_id' => array('UINT', 0),
- 'rule_action' => array('UINT', 0),
- 'rule_folder_id' => array('INT:11', 0),
- ),
- 'PRIMARY_KEY' => 'rule_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_to'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'pm_deleted' => array('BOOL', 0),
- 'pm_new' => array('BOOL', 1),
- 'pm_unread' => array('BOOL', 1),
- 'pm_replied' => array('BOOL', 0),
- 'pm_marked' => array('BOOL', 0),
- 'pm_forwarded' => array('BOOL', 0),
- 'folder_id' => array('INT:11', 0),
- ),
- 'KEYS' => array(
- 'msg_id' => array('INDEX', 'msg_id'),
- 'author_id' => array('INDEX', 'author_id'),
- 'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')),
- ),
- );
-
- $schema_data['phpbb_profile_fields'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', NULL, 'auto_increment'),
- 'field_name' => array('VCHAR_UNI', ''),
- 'field_type' => array('TINT:4', 0),
- 'field_ident' => array('VCHAR:20', ''),
- 'field_length' => array('VCHAR:20', ''),
- 'field_minlen' => array('VCHAR', ''),
- 'field_maxlen' => array('VCHAR', ''),
- 'field_novalue' => array('VCHAR_UNI', ''),
- 'field_default_value' => array('VCHAR_UNI', ''),
- 'field_validation' => array('VCHAR_UNI:20', ''),
- 'field_required' => array('BOOL', 0),
- 'field_show_novalue' => array('BOOL', 0),
- 'field_show_on_reg' => array('BOOL', 0),
- 'field_show_on_pm' => array('BOOL', 0),
- 'field_show_on_vt' => array('BOOL', 0),
- 'field_show_profile' => array('BOOL', 0),
- 'field_hide' => array('BOOL', 0),
- 'field_no_view' => array('BOOL', 0),
- 'field_active' => array('BOOL', 0),
- 'field_order' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'field_id',
- 'KEYS' => array(
- 'fld_type' => array('INDEX', 'field_type'),
- 'fld_ordr' => array('INDEX', 'field_order'),
- ),
- );
-
- $schema_data['phpbb_profile_fields_data'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- );
-
- $schema_data['phpbb_profile_fields_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'option_id' => array('UINT', 0),
- 'field_type' => array('TINT:4', 0),
- 'lang_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'),
- );
-
- $schema_data['phpbb_profile_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'lang_name' => array('VCHAR_UNI', ''),
- 'lang_explain' => array('TEXT_UNI', ''),
- 'lang_default_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id'),
- );
-
- $schema_data['phpbb_ranks'] = array(
- 'COLUMNS' => array(
- 'rank_id' => array('UINT', NULL, 'auto_increment'),
- 'rank_title' => array('VCHAR_UNI', ''),
- 'rank_min' => array('UINT', 0),
- 'rank_special' => array('BOOL', 0),
- 'rank_image' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'rank_id',
- );
-
- $schema_data['phpbb_reports'] = array(
- 'COLUMNS' => array(
- 'report_id' => array('UINT', NULL, 'auto_increment'),
- 'reason_id' => array('USINT', 0),
- 'post_id' => array('UINT', 0),
- 'pm_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'user_notify' => array('BOOL', 0),
- 'report_closed' => array('BOOL', 0),
- 'report_time' => array('TIMESTAMP', 0),
- 'report_text' => array('MTEXT_UNI', ''),
- 'reported_post_text' => array('MTEXT_UNI', ''),
- 'reported_post_uid' => array('VCHAR:8', ''),
- 'reported_post_bitfield' => array('VCHAR:255', ''),
- 'reported_post_enable_magic_url' => array('BOOL', 1),
- 'reported_post_enable_smilies' => array('BOOL', 1),
- 'reported_post_enable_bbcode' => array('BOOL', 1)
- ),
- 'PRIMARY_KEY' => 'report_id',
- 'KEYS' => array(
- 'post_id' => array('INDEX', 'post_id'),
- 'pm_id' => array('INDEX', 'pm_id'),
- ),
- );
-
- $schema_data['phpbb_reports_reasons'] = array(
- 'COLUMNS' => array(
- 'reason_id' => array('USINT', NULL, 'auto_increment'),
- 'reason_title' => array('VCHAR_UNI', ''),
- 'reason_description' => array('MTEXT_UNI', ''),
- 'reason_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'reason_id',
- );
-
- $schema_data['phpbb_search_results'] = array(
- 'COLUMNS' => array(
- 'search_key' => array('VCHAR:32', ''),
- 'search_time' => array('TIMESTAMP', 0),
- 'search_keywords' => array('MTEXT_UNI', ''),
- 'search_authors' => array('MTEXT', ''),
- ),
- 'PRIMARY_KEY' => 'search_key',
- );
-
- $schema_data['phpbb_search_wordlist'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word_text' => array('VCHAR_UNI', ''),
- 'word_common' => array('BOOL', 0),
- 'word_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'word_id',
- 'KEYS' => array(
- 'wrd_txt' => array('UNIQUE', 'word_text'),
- 'wrd_cnt' => array('INDEX', 'word_count'),
- ),
- );
-
- $schema_data['phpbb_search_wordmatch'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', 0),
- 'word_id' => array('UINT', 0),
- 'title_match' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')),
- 'word_id' => array('INDEX', 'word_id'),
- 'post_id' => array('INDEX', 'post_id'),
- ),
- );
-
- $schema_data['phpbb_sessions'] = array(
- 'COLUMNS' => array(
- 'session_id' => array('CHAR:32', ''),
- 'session_user_id' => array('UINT', 0),
- 'session_forum_id' => array('UINT', 0),
- 'session_last_visit' => array('TIMESTAMP', 0),
- 'session_start' => array('TIMESTAMP', 0),
- 'session_time' => array('TIMESTAMP', 0),
- 'session_ip' => array('VCHAR:40', ''),
- 'session_browser' => array('VCHAR:150', ''),
- 'session_forwarded_for' => array('VCHAR:255', ''),
- 'session_page' => array('VCHAR_UNI', ''),
- 'session_viewonline' => array('BOOL', 1),
- 'session_autologin' => array('BOOL', 0),
- 'session_admin' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'session_id',
- 'KEYS' => array(
- 'session_time' => array('INDEX', 'session_time'),
- 'session_user_id' => array('INDEX', 'session_user_id'),
- 'session_fid' => array('INDEX', 'session_forum_id'),
- ),
- );
-
- $schema_data['phpbb_sessions_keys'] = array(
- 'COLUMNS' => array(
- 'key_id' => array('CHAR:32', ''),
- 'user_id' => array('UINT', 0),
- 'last_ip' => array('VCHAR:40', ''),
- 'last_login' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('key_id', 'user_id'),
- 'KEYS' => array(
- 'last_login' => array('INDEX', 'last_login'),
- ),
- );
-
- $schema_data['phpbb_sitelist'] = array(
- 'COLUMNS' => array(
- 'site_id' => array('UINT', NULL, 'auto_increment'),
- 'site_ip' => array('VCHAR:40', ''),
- 'site_hostname' => array('VCHAR', ''),
- 'ip_exclude' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'site_id',
- );
-
- $schema_data['phpbb_smilies'] = array(
- 'COLUMNS' => array(
- 'smiley_id' => array('UINT', NULL, 'auto_increment'),
- // We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed.
- 'code' => array('VCHAR_UNI:50', ''),
- 'emotion' => array('VCHAR_UNI:50', ''),
- 'smiley_url' => array('VCHAR:50', ''),
- 'smiley_width' => array('USINT', 0),
- 'smiley_height' => array('USINT', 0),
- 'smiley_order' => array('UINT', 0),
- 'display_on_posting'=> array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'smiley_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_styles'] = array(
- 'COLUMNS' => array(
- 'style_id' => array('UINT', NULL, 'auto_increment'),
- 'style_name' => array('VCHAR_UNI:255', ''),
- 'style_copyright' => array('VCHAR_UNI', ''),
- 'style_active' => array('BOOL', 1),
- 'style_path' => array('VCHAR:100', ''),
- 'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
- 'style_parent_id' => array('UINT:4', 0),
- 'style_parent_tree' => array('TEXT', ''),
- ),
- 'PRIMARY_KEY' => 'style_id',
- 'KEYS' => array(
- 'style_name' => array('UNIQUE', 'style_name'),
- ),
- );
-
- $schema_data['phpbb_teampage'] = array(
- 'COLUMNS' => array(
- 'teampage_id' => array('UINT', NULL, 'auto_increment'),
- 'group_id' => array('UINT', 0),
- 'teampage_name' => array('VCHAR_UNI:255', ''),
- 'teampage_position' => array('UINT', 0),
- 'teampage_parent' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'teampage_id',
- );
-
- $schema_data['phpbb_topics'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', NULL, 'auto_increment'),
- 'forum_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'topic_attachment' => array('BOOL', 0),
- 'topic_visibility' => array('TINT:3', 0),
- 'topic_reported' => array('BOOL', 0),
- 'topic_title' => array('STEXT_UNI', '', 'true_sort'),
- 'topic_poster' => array('UINT', 0),
- 'topic_time' => array('TIMESTAMP', 0),
- 'topic_time_limit' => array('TIMESTAMP', 0),
- 'topic_views' => array('UINT', 0),
- 'topic_posts_approved' => array('UINT', 0),
- 'topic_posts_unapproved' => array('UINT', 0),
- 'topic_posts_softdeleted' => array('UINT', 0),
- 'topic_status' => array('TINT:3', 0),
- 'topic_type' => array('TINT:3', 0),
- 'topic_first_post_id' => array('UINT', 0),
- 'topic_first_poster_name' => array('VCHAR_UNI', ''),
- 'topic_first_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_id' => array('UINT', 0),
- 'topic_last_poster_id' => array('UINT', 0),
- 'topic_last_poster_name' => array('VCHAR_UNI', ''),
- 'topic_last_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_subject' => array('STEXT_UNI', ''),
- 'topic_last_post_time' => array('TIMESTAMP', 0),
- 'topic_last_view_time' => array('TIMESTAMP', 0),
- 'topic_moved_id' => array('UINT', 0),
- 'topic_bumped' => array('BOOL', 0),
- 'topic_bumper' => array('UINT', 0),
- 'poll_title' => array('STEXT_UNI', ''),
- 'poll_start' => array('TIMESTAMP', 0),
- 'poll_length' => array('TIMESTAMP', 0),
- 'poll_max_options' => array('TINT:4', 1),
- 'poll_last_vote' => array('TIMESTAMP', 0),
- 'poll_vote_change' => array('BOOL', 0),
- 'topic_delete_time' => array('TIMESTAMP', 0),
- 'topic_delete_reason' => array('STEXT_UNI', ''),
- 'topic_delete_user' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'topic_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
- 'last_post_time' => array('INDEX', 'topic_last_post_time'),
- 'topic_visibility' => array('INDEX', 'topic_visibility'),
- 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_visibility', 'topic_last_post_id')),
- 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
- ),
- );
-
- $schema_data['phpbb_topics_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_topics_posted'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'topic_posted' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- );
-
- $schema_data['phpbb_topics_watch'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_user_notifications'] = array(
- 'COLUMNS' => array(
- 'item_type' => array('VCHAR:255', ''),
- 'item_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'method' => array('VCHAR:255', ''),
- 'notify' => array('BOOL', 1),
- ),
- );
-
- $schema_data['phpbb_user_group'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'group_leader' => array('BOOL', 0),
- 'user_pending' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'group_leader' => array('INDEX', 'group_leader'),
- ),
- );
-
- $schema_data['phpbb_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', NULL, 'auto_increment'),
- 'user_type' => array('TINT:2', 0),
- 'group_id' => array('UINT', 3),
- 'user_permissions' => array('MTEXT', ''),
- 'user_perm_from' => array('UINT', 0),
- 'user_ip' => array('VCHAR:40', ''),
- 'user_regdate' => array('TIMESTAMP', 0),
- 'username' => array('VCHAR_CI', ''),
- 'username_clean' => array('VCHAR_CI', ''),
- 'user_password' => array('VCHAR_UNI:40', ''),
- 'user_passchg' => array('TIMESTAMP', 0),
- 'user_pass_convert' => array('BOOL', 0),
- 'user_email' => array('VCHAR_UNI:100', ''),
- 'user_email_hash' => array('BINT', 0),
- 'user_birthday' => array('VCHAR:10', ''),
- 'user_lastvisit' => array('TIMESTAMP', 0),
- 'user_lastmark' => array('TIMESTAMP', 0),
- 'user_lastpost_time' => array('TIMESTAMP', 0),
- 'user_lastpage' => array('VCHAR_UNI:200', ''),
- 'user_last_confirm_key' => array('VCHAR:10', ''),
- 'user_last_search' => array('TIMESTAMP', 0),
- 'user_warnings' => array('TINT:4', 0),
- 'user_last_warning' => array('TIMESTAMP', 0),
- 'user_login_attempts' => array('TINT:4', 0),
- 'user_inactive_reason' => array('TINT:2', 0),
- 'user_inactive_time' => array('TIMESTAMP', 0),
- 'user_posts' => array('UINT', 0),
- 'user_lang' => array('VCHAR:30', ''),
- 'user_timezone' => array('VCHAR:100', 'UTC'),
- 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
- 'user_style' => array('UINT', 0),
- 'user_rank' => array('UINT', 0),
- 'user_colour' => array('VCHAR:6', ''),
- 'user_new_privmsg' => array('INT:4', 0),
- 'user_unread_privmsg' => array('INT:4', 0),
- 'user_last_privmsg' => array('TIMESTAMP', 0),
- 'user_message_rules' => array('BOOL', 0),
- 'user_full_folder' => array('INT:11', -3),
- 'user_emailtime' => array('TIMESTAMP', 0),
- 'user_topic_show_days' => array('USINT', 0),
- 'user_topic_sortby_type' => array('VCHAR:1', 't'),
- 'user_topic_sortby_dir' => array('VCHAR:1', 'd'),
- 'user_post_show_days' => array('USINT', 0),
- 'user_post_sortby_type' => array('VCHAR:1', 't'),
- 'user_post_sortby_dir' => array('VCHAR:1', 'a'),
- 'user_notify' => array('BOOL', 0),
- 'user_notify_pm' => array('BOOL', 1),
- 'user_notify_type' => array('TINT:4', 0),
- 'user_allow_pm' => array('BOOL', 1),
- 'user_allow_viewonline' => array('BOOL', 1),
- 'user_allow_viewemail' => array('BOOL', 1),
- 'user_allow_massemail' => array('BOOL', 1),
- 'user_options' => array('UINT:11', 230271),
- 'user_avatar' => array('VCHAR', ''),
- 'user_avatar_type' => array('VCHAR:255', ''),
- 'user_avatar_width' => array('USINT', 0),
- 'user_avatar_height' => array('USINT', 0),
- 'user_sig' => array('MTEXT_UNI', ''),
- 'user_sig_bbcode_uid' => array('VCHAR:8', ''),
- 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''),
- 'user_from' => array('VCHAR_UNI:100', ''),
- 'user_icq' => array('VCHAR:15', ''),
- 'user_aim' => array('VCHAR_UNI', ''),
- 'user_yim' => array('VCHAR_UNI', ''),
- 'user_msnm' => array('VCHAR_UNI', ''),
- 'user_jabber' => array('VCHAR_UNI', ''),
- 'user_website' => array('VCHAR_UNI:200', ''),
- 'user_occ' => array('TEXT_UNI', ''),
- 'user_interests' => array('TEXT_UNI', ''),
- 'user_actkey' => array('VCHAR:32', ''),
- 'user_newpasswd' => array('VCHAR_UNI:40', ''),
- 'user_form_salt' => array('VCHAR_UNI:32', ''),
- 'user_new' => array('BOOL', 1),
- 'user_reminded' => array('TINT:4', 0),
- 'user_reminded_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- 'KEYS' => array(
- 'user_birthday' => array('INDEX', 'user_birthday'),
- 'user_email_hash' => array('INDEX', 'user_email_hash'),
- 'user_type' => array('INDEX', 'user_type'),
- 'username_clean' => array('UNIQUE', 'username_clean'),
- ),
- );
-
- $schema_data['phpbb_warnings'] = array(
- 'COLUMNS' => array(
- 'warning_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'post_id' => array('UINT', 0),
- 'log_id' => array('UINT', 0),
- 'warning_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'warning_id',
- );
-
- $schema_data['phpbb_words'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word' => array('VCHAR_UNI', ''),
- 'replacement' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'word_id',
- );
-
- $schema_data['phpbb_zebra'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'zebra_id' => array('UINT', 0),
- 'friend' => array('BOOL', 0),
- 'foe' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'zebra_id'),
- );
-
- return $schema_data;
-}
-
-
/**
* Data put into the header for various dbms
*/
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index 0a8d2b00f6..3decee306a 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -56,68 +56,10 @@ echo "USE $dbname;$newline$newline";
@set_time_limit(0);
-$schema_data = get_schema_struct();
-$dbms_type_map = array(
- 'mysql_41' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT' => 'text',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT' => 'text',
- 'TEXT_UNI' => 'text',
- 'MTEXT' => 'mediumtext',
- 'MTEXT_UNI' => 'mediumtext',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'varbinary(255)',
- ),
+require($phpbb_root_path . 'includes/db/schema_data.' . $phpEx);
+require($phpbb_root_path . 'phpbb/db/tools.' . $phpEx);
- 'mysql_40' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varbinary(255)',
- 'VCHAR:' => 'varbinary(%d)',
- 'CHAR:' => 'binary(%d)',
- 'XSTEXT' => 'blob',
- 'XSTEXT_UNI'=> 'blob',
- 'STEXT' => 'blob',
- 'STEXT_UNI' => 'blob',
- 'TEXT' => 'blob',
- 'TEXT_UNI' => 'blob',
- 'MTEXT' => 'mediumblob',
- 'MTEXT_UNI' => 'mediumblob',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'blob',
- 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
- 'VCHAR_CI' => 'blob',
- 'VARBINARY' => 'varbinary(255)',
- ),
-);
+$dbms_type_map = phpbb_db_tools::get_dbms_type_map();
foreach ($schema_data as $table_name => $table_data)
{
@@ -149,7 +91,8 @@ foreach ($schema_data as $table_name => $table_data)
list($orig_column_type, $column_length) = explode(':', $column_data[0]);
$column_type = sprintf($dbms_type_map['mysql_41'][$orig_column_type . ':'], $column_length);
- if (isset($dbms_type_map['mysql_40'][$orig_column_type . ':']['limit'][0]))
+ if (isset($dbms_type_map['mysql_40'][$orig_column_type . ':']['limit']) &&
+ isset($dbms_type_map['mysql_40'][$orig_column_type . ':']['limit'][0]))
{
switch ($dbms_type_map['mysql_40'][$orig_column_type . ':']['limit'][0])
{
@@ -254,1071 +197,3 @@ foreach ($schema_data as $table_name => $table_data)
echo "ALTER TABLE $table_name ADD FULLTEXT (post_subject), ADD FULLTEXT (post_text), ADD FULLTEXT post_content (post_subject, post_text);{$newline}";
}
}
-
-/**
-* Define the basic structure
-* The format:
-* array('{TABLE_NAME}' => {TABLE_DATA})
-* {TABLE_DATA}:
-* COLUMNS = array({column_name} = array({column_type}, {default}, {auto_increment}))
-* PRIMARY_KEY = {column_name(s)}
-* KEYS = array({key_name} = array({key_type}, {column_name(s)})),
-*
-* Column Types:
-* INT:x => SIGNED int(x)
-* BINT => BIGINT
-* UINT => mediumint(8) UNSIGNED
-* UINT:x => int(x) UNSIGNED
-* TINT:x => tinyint(x)
-* USINT => smallint(4) UNSIGNED (for _order columns)
-* BOOL => tinyint(1) UNSIGNED
-* VCHAR => varchar(255)
-* CHAR:x => char(x)
-* XSTEXT_UNI => text for storing 100 characters (topic_title for example)
-* STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI
-* TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.)
-* MTEXT_UNI => mediumtext (post text, large text)
-* VCHAR:x => varchar(x)
-* TIMESTAMP => int(11) UNSIGNED
-* DECIMAL => decimal number (5,2)
-* DECIMAL: => decimal number (x,2)
-* PDECIMAL => precision decimal number (6,3)
-* PDECIMAL: => precision decimal number (x,3)
-* VCHAR_UNI => varchar(255) BINARY
-* VCHAR_CI => varchar_ci for postgresql, others VCHAR
-*/
-function get_schema_struct()
-{
- $schema_data = array();
-
- $schema_data['phpbb_attachments'] = array(
- 'COLUMNS' => array(
- 'attach_id' => array('UINT', NULL, 'auto_increment'),
- 'post_msg_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'in_message' => array('BOOL', 0),
- 'poster_id' => array('UINT', 0),
- 'is_orphan' => array('BOOL', 1),
- 'physical_filename' => array('VCHAR', ''),
- 'real_filename' => array('VCHAR', ''),
- 'download_count' => array('UINT', 0),
- 'attach_comment' => array('TEXT_UNI', ''),
- 'extension' => array('VCHAR:100', ''),
- 'mimetype' => array('VCHAR:100', ''),
- 'filesize' => array('UINT:20', 0),
- 'filetime' => array('TIMESTAMP', 0),
- 'thumbnail' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'attach_id',
- 'KEYS' => array(
- 'filetime' => array('INDEX', 'filetime'),
- 'post_msg_id' => array('INDEX', 'post_msg_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'is_orphan' => array('INDEX', 'is_orphan'),
- ),
- );
-
- $schema_data['phpbb_acl_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'auth_opt_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_acl_options'] = array(
- 'COLUMNS' => array(
- 'auth_option_id' => array('UINT', NULL, 'auto_increment'),
- 'auth_option' => array('VCHAR:50', ''),
- 'is_global' => array('BOOL', 0),
- 'is_local' => array('BOOL', 0),
- 'founder_only' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'auth_option_id',
- 'KEYS' => array(
- 'auth_option' => array('UNIQUE', 'auth_option'),
- ),
- );
-
- $schema_data['phpbb_acl_roles'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', NULL, 'auto_increment'),
- 'role_name' => array('VCHAR_UNI', ''),
- 'role_description' => array('TEXT_UNI', ''),
- 'role_type' => array('VCHAR:10', ''),
- 'role_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'role_id',
- 'KEYS' => array(
- 'role_type' => array('INDEX', 'role_type'),
- 'role_order' => array('INDEX', 'role_order'),
- ),
- );
-
- $schema_data['phpbb_acl_roles_data'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'PRIMARY_KEY' => array('role_id', 'auth_option_id'),
- 'KEYS' => array(
- 'ath_op_id' => array('INDEX', 'auth_option_id'),
- ),
- );
-
- $schema_data['phpbb_acl_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- 'auth_option_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_banlist'] = array(
- 'COLUMNS' => array(
- 'ban_id' => array('UINT', NULL, 'auto_increment'),
- 'ban_userid' => array('UINT', 0),
- 'ban_ip' => array('VCHAR:40', ''),
- 'ban_email' => array('VCHAR_UNI:100', ''),
- 'ban_start' => array('TIMESTAMP', 0),
- 'ban_end' => array('TIMESTAMP', 0),
- 'ban_exclude' => array('BOOL', 0),
- 'ban_reason' => array('VCHAR_UNI', ''),
- 'ban_give_reason' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'ban_id',
- 'KEYS' => array(
- 'ban_end' => array('INDEX', 'ban_end'),
- 'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')),
- 'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')),
- 'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')),
- ),
- );
-
- $schema_data['phpbb_bbcodes'] = array(
- 'COLUMNS' => array(
- 'bbcode_id' => array('USINT', 0),
- 'bbcode_tag' => array('VCHAR:16', ''),
- 'bbcode_helpline' => array('VCHAR_UNI', ''),
- 'display_on_posting' => array('BOOL', 0),
- 'bbcode_match' => array('TEXT_UNI', ''),
- 'bbcode_tpl' => array('MTEXT_UNI', ''),
- 'first_pass_match' => array('MTEXT_UNI', ''),
- 'first_pass_replace' => array('MTEXT_UNI', ''),
- 'second_pass_match' => array('MTEXT_UNI', ''),
- 'second_pass_replace' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'bbcode_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_bookmarks'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('topic_id', 'user_id'),
- );
-
- $schema_data['phpbb_bots'] = array(
- 'COLUMNS' => array(
- 'bot_id' => array('UINT', NULL, 'auto_increment'),
- 'bot_active' => array('BOOL', 1),
- 'bot_name' => array('STEXT_UNI', ''),
- 'user_id' => array('UINT', 0),
- 'bot_agent' => array('VCHAR', ''),
- 'bot_ip' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'bot_id',
- 'KEYS' => array(
- 'bot_active' => array('INDEX', 'bot_active'),
- ),
- );
-
- $schema_data['\phpbb\config\config'] = array(
- 'COLUMNS' => array(
- 'config_name' => array('VCHAR', ''),
- 'config_value' => array('VCHAR_UNI', ''),
- 'is_dynamic' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'config_name',
- 'KEYS' => array(
- 'is_dynamic' => array('INDEX', 'is_dynamic'),
- ),
- );
-
- $schema_data['phpbb_confirm'] = array(
- 'COLUMNS' => array(
- 'confirm_id' => array('CHAR:32', ''),
- 'session_id' => array('CHAR:32', ''),
- 'confirm_type' => array('TINT:3', 0),
- 'code' => array('VCHAR:8', ''),
- 'seed' => array('UINT:10', 0),
- 'attempts' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('session_id', 'confirm_id'),
- 'KEYS' => array(
- 'confirm_type' => array('INDEX', 'confirm_type'),
- ),
- );
-
- $schema_data['phpbb_disallow'] = array(
- 'COLUMNS' => array(
- 'disallow_id' => array('UINT', NULL, 'auto_increment'),
- 'disallow_username' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'disallow_id',
- );
-
- $schema_data['phpbb_drafts'] = array(
- 'COLUMNS' => array(
- 'draft_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'save_time' => array('TIMESTAMP', 0),
- 'draft_subject' => array('STEXT_UNI', ''),
- 'draft_message' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'draft_id',
- 'KEYS' => array(
- 'save_time' => array('INDEX', 'save_time'),
- ),
- );
-
- $schema_data['phpbb_extensions'] = array(
- 'COLUMNS' => array(
- 'extension_id' => array('UINT', NULL, 'auto_increment'),
- 'group_id' => array('UINT', 0),
- 'extension' => array('VCHAR:100', ''),
- ),
- 'PRIMARY_KEY' => 'extension_id',
- );
-
- $schema_data['phpbb_extension_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_name' => array('VCHAR_UNI', ''),
- 'cat_id' => array('TINT:2', 0),
- 'allow_group' => array('BOOL', 0),
- 'download_mode' => array('BOOL', 1),
- 'upload_icon' => array('VCHAR', ''),
- 'max_filesize' => array('UINT:20', 0),
- 'allowed_forums' => array('TEXT', ''),
- 'allow_in_pm' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'group_id',
- );
-
- $schema_data['phpbb_forums'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', NULL, 'auto_increment'),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'forum_parents' => array('MTEXT', ''),
- 'forum_name' => array('STEXT_UNI', ''),
- 'forum_desc' => array('TEXT_UNI', ''),
- 'forum_desc_bitfield' => array('VCHAR:255', ''),
- 'forum_desc_options' => array('UINT:11', 7),
- 'forum_desc_uid' => array('VCHAR:8', ''),
- 'forum_link' => array('VCHAR_UNI', ''),
- 'forum_password' => array('VCHAR_UNI:40', ''),
- 'forum_style' => array('UINT', 0),
- 'forum_image' => array('VCHAR', ''),
- 'forum_rules' => array('TEXT_UNI', ''),
- 'forum_rules_link' => array('VCHAR_UNI', ''),
- 'forum_rules_bitfield' => array('VCHAR:255', ''),
- 'forum_rules_options' => array('UINT:11', 7),
- 'forum_rules_uid' => array('VCHAR:8', ''),
- 'forum_topics_per_page' => array('TINT:4', 0),
- 'forum_type' => array('TINT:4', 0),
- 'forum_status' => array('TINT:4', 0),
- 'forum_posts_approved' => array('UINT', 0),
- 'forum_posts_unapproved' => array('UINT', 0),
- 'forum_posts_softdeleted' => array('UINT', 0),
- 'forum_topics_approved' => array('UINT', 0),
- 'forum_topics_unapproved' => array('UINT', 0),
- 'forum_topics_softdeleted' => array('UINT', 0),
- 'forum_last_post_id' => array('UINT', 0),
- 'forum_last_poster_id' => array('UINT', 0),
- 'forum_last_post_subject' => array('STEXT_UNI', ''),
- 'forum_last_post_time' => array('TIMESTAMP', 0),
- 'forum_last_poster_name'=> array('VCHAR_UNI', ''),
- 'forum_last_poster_colour'=> array('VCHAR:6', ''),
- 'forum_flags' => array('TINT:4', 32),
- 'forum_options' => array('UINT:20', 0),
- 'display_subforum_list' => array('BOOL', 1),
- 'display_on_index' => array('BOOL', 1),
- 'enable_indexing' => array('BOOL', 1),
- 'enable_icons' => array('BOOL', 1),
- 'enable_prune' => array('BOOL', 0),
- 'prune_next' => array('TIMESTAMP', 0),
- 'prune_days' => array('UINT', 0),
- 'prune_viewed' => array('UINT', 0),
- 'prune_freq' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'forum_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'forum_lastpost_id' => array('INDEX', 'forum_last_post_id'),
- ),
- );
-
- $schema_data['phpbb_forums_access'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'session_id' => array('CHAR:32', ''),
- ),
- 'PRIMARY_KEY' => array('forum_id', 'user_id', 'session_id'),
- );
-
- $schema_data['phpbb_forums_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'forum_id'),
- );
-
- $schema_data['phpbb_forums_watch'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_type' => array('TINT:4', 1),
- 'group_founder_manage' => array('BOOL', 0),
- 'group_skip_auth' => array('BOOL', 0),
- 'group_name' => array('VCHAR_CI', ''),
- 'group_desc' => array('TEXT_UNI', ''),
- 'group_desc_bitfield' => array('VCHAR:255', ''),
- 'group_desc_options' => array('UINT:11', 7),
- 'group_desc_uid' => array('VCHAR:8', ''),
- 'group_display' => array('BOOL', 0),
- 'group_avatar' => array('VCHAR', ''),
- 'group_avatar_type' => array('TINT:2', 0),
- 'group_avatar_width' => array('USINT', 0),
- 'group_avatar_height' => array('USINT', 0),
- 'group_rank' => array('UINT', 0),
- 'group_colour' => array('VCHAR:6', ''),
- 'group_sig_chars' => array('UINT', 0),
- 'group_receive_pm' => array('BOOL', 0),
- 'group_message_limit' => array('UINT', 0),
- 'group_max_recipients' => array('UINT', 0),
- 'group_legend' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'group_id',
- 'KEYS' => array(
- 'group_legend_name' => array('INDEX', array('group_legend', 'group_name')),
- ),
- );
-
- $schema_data['phpbb_icons'] = array(
- 'COLUMNS' => array(
- 'icons_id' => array('UINT', NULL, 'auto_increment'),
- 'icons_url' => array('VCHAR', ''),
- 'icons_width' => array('TINT:4', 0),
- 'icons_height' => array('TINT:4', 0),
- 'icons_order' => array('UINT', 0),
- 'display_on_posting' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'icons_id',
- 'KEYS' => array(
- 'display_on_posting' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_lang'] = array(
- 'COLUMNS' => array(
- 'lang_id' => array('TINT:4', NULL, 'auto_increment'),
- 'lang_iso' => array('VCHAR:30', ''),
- 'lang_dir' => array('VCHAR:30', ''),
- 'lang_english_name' => array('VCHAR_UNI:100', ''),
- 'lang_local_name' => array('VCHAR_UNI:255', ''),
- 'lang_author' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'lang_id',
- 'KEYS' => array(
- 'lang_iso' => array('INDEX', 'lang_iso'),
- ),
- );
-
- $schema_data['\phpbb\log\log'] = array(
- 'COLUMNS' => array(
- 'log_id' => array('UINT', NULL, 'auto_increment'),
- 'log_type' => array('TINT:4', 0),
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'reportee_id' => array('UINT', 0),
- 'log_ip' => array('VCHAR:40', ''),
- 'log_time' => array('TIMESTAMP', 0),
- 'log_operation' => array('TEXT_UNI', ''),
- 'log_data' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'log_id',
- 'KEYS' => array(
- 'log_type' => array('INDEX', 'log_type'),
- 'log_time' => array('INDEX', 'log_time'),
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'reportee_id' => array('INDEX', 'reportee_id'),
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_moderator_cache'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'username' => array('VCHAR_UNI:255', ''),
- 'group_id' => array('UINT', 0),
- 'group_name' => array('VCHAR_UNI', ''),
- 'display_on_index' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'disp_idx' => array('INDEX', 'display_on_index'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_modules'] = array(
- 'COLUMNS' => array(
- 'module_id' => array('UINT', NULL, 'auto_increment'),
- 'module_enabled' => array('BOOL', 1),
- 'module_display' => array('BOOL', 1),
- 'module_basename' => array('VCHAR', ''),
- 'module_class' => array('VCHAR:10', ''),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'module_langname' => array('VCHAR', ''),
- 'module_mode' => array('VCHAR', ''),
- 'module_auth' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'module_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'module_enabled' => array('INDEX', 'module_enabled'),
- 'class_left_id' => array('INDEX', array('module_class', 'left_id')),
- ),
- );
-
- $schema_data['phpbb_poll_options'] = array(
- 'COLUMNS' => array(
- 'poll_option_id' => array('TINT:4', 0),
- 'topic_id' => array('UINT', 0),
- 'poll_option_text' => array('TEXT_UNI', ''),
- 'poll_option_total' => array('UINT', 0),
- ),
- 'KEYS' => array(
- 'poll_opt_id' => array('INDEX', 'poll_option_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- ),
- );
-
- $schema_data['phpbb_poll_votes'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'poll_option_id' => array('TINT:4', 0),
- 'vote_user_id' => array('UINT', 0),
- 'vote_user_ip' => array('VCHAR:40', ''),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'vote_user_id' => array('INDEX', 'vote_user_id'),
- 'vote_user_ip' => array('INDEX', 'vote_user_ip'),
- ),
- );
-
- $schema_data['phpbb_posts'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', NULL, 'auto_increment'),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'poster_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'poster_ip' => array('VCHAR:40', ''),
- 'post_time' => array('TIMESTAMP', 0),
- 'post_visibility' => array('TINT:3', 0),
- 'post_reported' => array('BOOL', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'post_username' => array('VCHAR_UNI:255', ''),
- 'post_subject' => array('STEXT_UNI', '', 'true_sort'),
- 'post_text' => array('MTEXT_UNI', ''),
- 'post_checksum' => array('VCHAR:32', ''),
- 'post_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'post_postcount' => array('BOOL', 1),
- 'post_edit_time' => array('TIMESTAMP', 0),
- 'post_edit_reason' => array('STEXT_UNI', ''),
- 'post_edit_user' => array('UINT', 0),
- 'post_edit_count' => array('USINT', 0),
- 'post_edit_locked' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'post_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_ip' => array('INDEX', 'poster_ip'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'post_visibility' => array('INDEX', 'post_visibility'),
- 'post_username' => array('INDEX', 'post_username'),
- 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
- ),
- );
-
- $schema_data['phpbb_privmsgs'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', NULL, 'auto_increment'),
- 'root_level' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'author_ip' => array('VCHAR:40', ''),
- 'message_time' => array('TIMESTAMP', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'message_subject' => array('STEXT_UNI', ''),
- 'message_text' => array('MTEXT_UNI', ''),
- 'message_edit_reason' => array('STEXT_UNI', ''),
- 'message_edit_user' => array('UINT', 0),
- 'message_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'message_edit_time' => array('TIMESTAMP', 0),
- 'message_edit_count' => array('USINT', 0),
- 'to_address' => array('TEXT_UNI', ''),
- 'bcc_address' => array('TEXT_UNI', ''),
- 'message_reported' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'msg_id',
- 'KEYS' => array(
- 'author_ip' => array('INDEX', 'author_ip'),
- 'message_time' => array('INDEX', 'message_time'),
- 'author_id' => array('INDEX', 'author_id'),
- 'root_level' => array('INDEX', 'root_level'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_folder'] = array(
- 'COLUMNS' => array(
- 'folder_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'folder_name' => array('VCHAR_UNI', ''),
- 'pm_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'folder_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_rules'] = array(
- 'COLUMNS' => array(
- 'rule_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'rule_check' => array('UINT', 0),
- 'rule_connection' => array('UINT', 0),
- 'rule_string' => array('VCHAR_UNI', ''),
- 'rule_user_id' => array('UINT', 0),
- 'rule_group_id' => array('UINT', 0),
- 'rule_action' => array('UINT', 0),
- 'rule_folder_id' => array('INT:11', 0),
- ),
- 'PRIMARY_KEY' => 'rule_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_to'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'pm_deleted' => array('BOOL', 0),
- 'pm_new' => array('BOOL', 1),
- 'pm_unread' => array('BOOL', 1),
- 'pm_replied' => array('BOOL', 0),
- 'pm_marked' => array('BOOL', 0),
- 'pm_forwarded' => array('BOOL', 0),
- 'folder_id' => array('INT:11', 0),
- ),
- 'KEYS' => array(
- 'msg_id' => array('INDEX', 'msg_id'),
- 'author_id' => array('INDEX', 'author_id'),
- 'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')),
- ),
- );
-
- $schema_data['phpbb_profile_fields'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', NULL, 'auto_increment'),
- 'field_name' => array('VCHAR_UNI', ''),
- 'field_type' => array('TINT:4', 0),
- 'field_ident' => array('VCHAR:20', ''),
- 'field_length' => array('VCHAR:20', ''),
- 'field_minlen' => array('VCHAR', ''),
- 'field_maxlen' => array('VCHAR', ''),
- 'field_novalue' => array('VCHAR_UNI', ''),
- 'field_default_value' => array('VCHAR_UNI', ''),
- 'field_validation' => array('VCHAR_UNI:20', ''),
- 'field_required' => array('BOOL', 0),
- 'field_show_on_reg' => array('BOOL', 0),
- 'field_show_on_vt' => array('BOOL', 0),
- 'field_show_profile' => array('BOOL', 0),
- 'field_hide' => array('BOOL', 0),
- 'field_no_view' => array('BOOL', 0),
- 'field_active' => array('BOOL', 0),
- 'field_order' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'field_id',
- 'KEYS' => array(
- 'fld_type' => array('INDEX', 'field_type'),
- 'fld_ordr' => array('INDEX', 'field_order'),
- ),
- );
-
- $schema_data['phpbb_profile_fields_data'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- );
-
- $schema_data['phpbb_profile_fields_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'option_id' => array('UINT', 0),
- 'field_type' => array('TINT:4', 0),
- 'lang_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'),
- );
-
- $schema_data['phpbb_profile_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'lang_name' => array('VCHAR_UNI', ''),
- 'lang_explain' => array('TEXT_UNI', ''),
- 'lang_default_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id'),
- );
-
- $schema_data['phpbb_ranks'] = array(
- 'COLUMNS' => array(
- 'rank_id' => array('UINT', NULL, 'auto_increment'),
- 'rank_title' => array('VCHAR_UNI', ''),
- 'rank_min' => array('UINT', 0),
- 'rank_special' => array('BOOL', 0),
- 'rank_image' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'rank_id',
- );
-
- $schema_data['phpbb_reports'] = array(
- 'COLUMNS' => array(
- 'report_id' => array('UINT', NULL, 'auto_increment'),
- 'reason_id' => array('USINT', 0),
- 'post_id' => array('UINT', 0),
- 'pm_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'user_notify' => array('BOOL', 0),
- 'report_closed' => array('BOOL', 0),
- 'report_time' => array('TIMESTAMP', 0),
- 'report_text' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'report_id',
- 'KEYS' => array(
- 'post_id' => array('INDEX', 'post_id'),
- 'pm_id' => array('INDEX', 'pm_id'),
- ),
- );
-
- $schema_data['phpbb_reports_reasons'] = array(
- 'COLUMNS' => array(
- 'reason_id' => array('USINT', NULL, 'auto_increment'),
- 'reason_title' => array('VCHAR_UNI', ''),
- 'reason_description' => array('MTEXT_UNI', ''),
- 'reason_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'reason_id',
- );
-
- $schema_data['phpbb_search_results'] = array(
- 'COLUMNS' => array(
- 'search_key' => array('VCHAR:32', ''),
- 'search_time' => array('TIMESTAMP', 0),
- 'search_keywords' => array('MTEXT_UNI', ''),
- 'search_authors' => array('MTEXT', ''),
- ),
- 'PRIMARY_KEY' => 'search_key',
- );
-
- $schema_data['phpbb_search_wordlist'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word_text' => array('VCHAR_UNI', ''),
- 'word_common' => array('BOOL', 0),
- 'word_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'word_id',
- 'KEYS' => array(
- 'wrd_txt' => array('UNIQUE', 'word_text'),
- 'wrd_cnt' => array('INDEX', 'word_count'),
- ),
- );
-
- $schema_data['phpbb_search_wordmatch'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', 0),
- 'word_id' => array('UINT', 0),
- 'title_match' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')),
- 'word_id' => array('INDEX', 'word_id'),
- 'post_id' => array('INDEX', 'post_id'),
- ),
- );
-
- $schema_data['phpbb_sessions'] = array(
- 'COLUMNS' => array(
- 'session_id' => array('CHAR:32', ''),
- 'session_user_id' => array('UINT', 0),
- 'session_forum_id' => array('UINT', 0),
- 'session_last_visit' => array('TIMESTAMP', 0),
- 'session_start' => array('TIMESTAMP', 0),
- 'session_time' => array('TIMESTAMP', 0),
- 'session_ip' => array('VCHAR:40', ''),
- 'session_browser' => array('VCHAR:150', ''),
- 'session_forwarded_for' => array('VCHAR:255', ''),
- 'session_page' => array('VCHAR_UNI', ''),
- 'session_viewonline' => array('BOOL', 1),
- 'session_autologin' => array('BOOL', 0),
- 'session_admin' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'session_id',
- 'KEYS' => array(
- 'session_time' => array('INDEX', 'session_time'),
- 'session_user_id' => array('INDEX', 'session_user_id'),
- 'session_fid' => array('INDEX', 'session_forum_id'),
- ),
- );
-
- $schema_data['phpbb_sessions_keys'] = array(
- 'COLUMNS' => array(
- 'key_id' => array('CHAR:32', ''),
- 'user_id' => array('UINT', 0),
- 'last_ip' => array('VCHAR:40', ''),
- 'last_login' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('key_id', 'user_id'),
- 'KEYS' => array(
- 'last_login' => array('INDEX', 'last_login'),
- ),
- );
-
- $schema_data['phpbb_sitelist'] = array(
- 'COLUMNS' => array(
- 'site_id' => array('UINT', NULL, 'auto_increment'),
- 'site_ip' => array('VCHAR:40', ''),
- 'site_hostname' => array('VCHAR', ''),
- 'ip_exclude' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'site_id',
- );
-
- $schema_data['phpbb_smilies'] = array(
- 'COLUMNS' => array(
- 'smiley_id' => array('UINT', NULL, 'auto_increment'),
- // We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed.
- 'code' => array('VCHAR_UNI:50', ''),
- 'emotion' => array('VCHAR_UNI:50', ''),
- 'smiley_url' => array('VCHAR:50', ''),
- 'smiley_width' => array('USINT', 0),
- 'smiley_height' => array('USINT', 0),
- 'smiley_order' => array('UINT', 0),
- 'display_on_posting'=> array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'smiley_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_styles'] = array(
- 'COLUMNS' => array(
- 'style_id' => array('UINT', NULL, 'auto_increment'),
- 'style_name' => array('VCHAR_UNI:255', ''),
- 'style_copyright' => array('VCHAR_UNI', ''),
- 'style_active' => array('BOOL', 1),
- 'style_path' => array('VCHAR:100', ''),
- 'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
- 'style_parent_id' => array('UINT:4', 0),
- 'style_parent_tree' => array('TEXT', ''),
- ),
- 'PRIMARY_KEY' => 'style_id',
- 'KEYS' => array(
- 'style_name' => array('UNIQUE', 'style_name'),
- ),
- );
-
- $schema_data['phpbb_topics'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', NULL, 'auto_increment'),
- 'forum_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'topic_attachment' => array('BOOL', 0),
- 'topic_visibility' => array('TINT:3', 0),
- 'topic_reported' => array('BOOL', 0),
- 'topic_title' => array('STEXT_UNI', '', 'true_sort'),
- 'topic_poster' => array('UINT', 0),
- 'topic_time' => array('TIMESTAMP', 0),
- 'topic_time_limit' => array('TIMESTAMP', 0),
- 'topic_views' => array('UINT', 0),
- 'topic_posts_approved' => array('UINT', 0),
- 'topic_posts_unapproved' => array('UINT', 0),
- 'topic_posts_softdeleted' => array('UINT', 0),
- 'topic_status' => array('TINT:3', 0),
- 'topic_type' => array('TINT:3', 0),
- 'topic_first_post_id' => array('UINT', 0),
- 'topic_first_poster_name' => array('VCHAR_UNI', ''),
- 'topic_first_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_id' => array('UINT', 0),
- 'topic_last_poster_id' => array('UINT', 0),
- 'topic_last_poster_name' => array('VCHAR_UNI', ''),
- 'topic_last_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_subject' => array('STEXT_UNI', ''),
- 'topic_last_post_time' => array('TIMESTAMP', 0),
- 'topic_last_view_time' => array('TIMESTAMP', 0),
- 'topic_moved_id' => array('UINT', 0),
- 'topic_bumped' => array('BOOL', 0),
- 'topic_bumper' => array('UINT', 0),
- 'poll_title' => array('STEXT_UNI', ''),
- 'poll_start' => array('TIMESTAMP', 0),
- 'poll_length' => array('TIMESTAMP', 0),
- 'poll_max_options' => array('TINT:4', 1),
- 'poll_last_vote' => array('TIMESTAMP', 0),
- 'poll_vote_change' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'topic_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
- 'last_post_time' => array('INDEX', 'topic_last_post_time'),
- 'topic_visibility' => array('INDEX', 'topic_visibility'),
- 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_visibility', 'topic_last_post_id')),
- 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
- ),
- );
-
- $schema_data['phpbb_topics_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_topics_posted'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'topic_posted' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- );
-
- $schema_data['phpbb_topics_watch'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_user_group'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'group_leader' => array('BOOL', 0),
- 'user_pending' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'group_leader' => array('INDEX', 'group_leader'),
- ),
- );
-
- $schema_data['phpbb_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', NULL, 'auto_increment'),
- 'user_type' => array('TINT:2', 0),
- 'group_id' => array('UINT', 3),
- 'user_permissions' => array('MTEXT', ''),
- 'user_perm_from' => array('UINT', 0),
- 'user_ip' => array('VCHAR:40', ''),
- 'user_regdate' => array('TIMESTAMP', 0),
- 'username' => array('VCHAR_CI', ''),
- 'username_clean' => array('VCHAR_CI', ''),
- 'user_password' => array('VCHAR_UNI:40', ''),
- 'user_passchg' => array('TIMESTAMP', 0),
- 'user_pass_convert' => array('BOOL', 0),
- 'user_email' => array('VCHAR_UNI:100', ''),
- 'user_email_hash' => array('BINT', 0),
- 'user_birthday' => array('VCHAR:10', ''),
- 'user_lastvisit' => array('TIMESTAMP', 0),
- 'user_lastmark' => array('TIMESTAMP', 0),
- 'user_lastpost_time' => array('TIMESTAMP', 0),
- 'user_lastpage' => array('VCHAR_UNI:200', ''),
- 'user_last_confirm_key' => array('VCHAR:10', ''),
- 'user_last_search' => array('TIMESTAMP', 0),
- 'user_warnings' => array('TINT:4', 0),
- 'user_last_warning' => array('TIMESTAMP', 0),
- 'user_login_attempts' => array('TINT:4', 0),
- 'user_inactive_reason' => array('TINT:2', 0),
- 'user_inactive_time' => array('TIMESTAMP', 0),
- 'user_posts' => array('UINT', 0),
- 'user_lang' => array('VCHAR:30', ''),
- 'user_timezone' => array('VCHAR:100', 'UTC'),
- 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
- 'user_style' => array('UINT', 0),
- 'user_rank' => array('UINT', 0),
- 'user_colour' => array('VCHAR:6', ''),
- 'user_new_privmsg' => array('INT:4', 0),
- 'user_unread_privmsg' => array('INT:4', 0),
- 'user_last_privmsg' => array('TIMESTAMP', 0),
- 'user_message_rules' => array('BOOL', 0),
- 'user_full_folder' => array('INT:11', -3),
- 'user_emailtime' => array('TIMESTAMP', 0),
- 'user_topic_show_days' => array('USINT', 0),
- 'user_topic_sortby_type' => array('VCHAR:1', 't'),
- 'user_topic_sortby_dir' => array('VCHAR:1', 'd'),
- 'user_post_show_days' => array('USINT', 0),
- 'user_post_sortby_type' => array('VCHAR:1', 't'),
- 'user_post_sortby_dir' => array('VCHAR:1', 'a'),
- 'user_notify' => array('BOOL', 0),
- 'user_notify_pm' => array('BOOL', 1),
- 'user_notify_type' => array('TINT:4', 0),
- 'user_allow_pm' => array('BOOL', 1),
- 'user_allow_viewonline' => array('BOOL', 1),
- 'user_allow_viewemail' => array('BOOL', 1),
- 'user_allow_massemail' => array('BOOL', 1),
- 'user_options' => array('UINT:11', 230271),
- 'user_avatar' => array('VCHAR', ''),
- 'user_avatar_type' => array('TINT:2', 0),
- 'user_avatar_width' => array('USINT', 0),
- 'user_avatar_height' => array('USINT', 0),
- 'user_sig' => array('MTEXT_UNI', ''),
- 'user_sig_bbcode_uid' => array('VCHAR:8', ''),
- 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''),
- 'user_from' => array('VCHAR_UNI:100', ''),
- 'user_icq' => array('VCHAR:15', ''),
- 'user_aim' => array('VCHAR_UNI', ''),
- 'user_yim' => array('VCHAR_UNI', ''),
- 'user_msnm' => array('VCHAR_UNI', ''),
- 'user_jabber' => array('VCHAR_UNI', ''),
- 'user_website' => array('VCHAR_UNI:200', ''),
- 'user_occ' => array('TEXT_UNI', ''),
- 'user_interests' => array('TEXT_UNI', ''),
- 'user_actkey' => array('VCHAR:32', ''),
- 'user_newpasswd' => array('VCHAR_UNI:40', ''),
- 'user_form_salt' => array('VCHAR_UNI:32', ''),
- 'user_new' => array('BOOL', 1),
- 'user_reminded' => array('TINT:4', 0),
- 'user_reminded_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- 'KEYS' => array(
- 'user_birthday' => array('INDEX', 'user_birthday'),
- 'user_email_hash' => array('INDEX', 'user_email_hash'),
- 'user_type' => array('INDEX', 'user_type'),
- 'username_clean' => array('UNIQUE', 'username_clean'),
- ),
- );
-
- $schema_data['phpbb_warnings'] = array(
- 'COLUMNS' => array(
- 'warning_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'post_id' => array('UINT', 0),
- 'log_id' => array('UINT', 0),
- 'warning_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'warning_id',
- );
-
- $schema_data['phpbb_words'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word' => array('VCHAR_UNI', ''),
- 'replacement' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'word_id',
- );
-
- $schema_data['phpbb_zebra'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'zebra_id' => array('UINT', 0),
- 'friend' => array('BOOL', 0),
- 'foe' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'zebra_id'),
- );
-
- return $schema_data;
-}
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 97f8c40383..c2eb48137a 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -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>] - &quot;Could not open input file: ../composer.phar&quot; 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>] - &quot;String offset cast occured&quot; error on PHP 5.4</li>
@@ -183,6 +182,11 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11662">PHPBB3-11662</a>] - &quot;occured&quot; should be &quot;occurred&quot;</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11670">PHPBB3-11670</a>] - Replace trademark ™ with ® on &quot;Welcome to phpBB&quot; install page</li>
<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>
@@ -206,6 +210,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11294">PHPBB3-11294</a>] - Update extension list in running tests doc</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11368">PHPBB3-11368</a>] - Latest pm reports row count</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11583">PHPBB3-11583</a>] - InnoDB supports FULLTEXT index since MySQL 5.6.4.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11740">PHPBB3-11740</a>] - Update link in FAQ to Ideas Centre</li>
</ul>
<h4>Sub-task</h4>
<ul>
@@ -231,6 +236,8 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11529">PHPBB3-11529</a>] - Rename RUNNING_TESTS file to .md file to render it on GitHub</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11576">PHPBB3-11576</a>] - Make phpBB Test Suite MySQL behave at least as strict as phpBB MySQL driver</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11671">PHPBB3-11671</a>] - Add phing/phing to composer.json</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11752">PHPBB3-11752</a>] - Update phpBB.com URLs to https in email templates</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11753">PHPBB3-11753</a>] - Upgrade mysql_upgrader.php schema data.</li>
</ul>
<a name="v3010"></a><h3>1.ii. Changes since 3.0.10</h3>
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index 7c588a4905..6cd2627f43 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -832,7 +832,7 @@ $sql = 'SELECT *
$sql_ary = array(
'somedata' =&gt; $my_string,
'otherdata' =&gt; $an_int,
- 'moredata' =&gt; $another_int
+ 'moredata' =&gt; $another_int,
);
$db-&gt;sql_query('INSERT INTO ' . SOME_TABLE . ' ' . $db-&gt;sql_build_array('INSERT', $sql_ary));
@@ -844,7 +844,7 @@ $db-&gt;sql_query('INSERT INTO ' . SOME_TABLE . ' ' . $db-&gt;sql_build_array('I
$sql_ary = array(
'somedata' =&gt; $my_string,
'otherdata' =&gt; $an_int,
- 'moredata' =&gt; $another_int
+ 'moredata' =&gt; $another_int,
);
$sql = 'UPDATE ' . SOME_TABLE . '
@@ -937,20 +937,20 @@ $sql_array = array(
'FROM' =&gt; array(
FORUMS_WATCH_TABLE =&gt; 'fw',
- FORUMS_TABLE =&gt; 'f'
+ FORUMS_TABLE =&gt; 'f',
),
'LEFT_JOIN' =&gt; array(
array(
'FROM' =&gt; array(FORUMS_TRACK_TABLE =&gt; 'ft'),
- 'ON' =&gt; 'ft.user_id = ' . $user-&gt;data['user_id'] . ' AND ft.forum_id = f.forum_id'
- )
+ 'ON' =&gt; 'ft.user_id = ' . $user-&gt;data['user_id'] . ' AND ft.forum_id = f.forum_id',
+ ),
),
'WHERE' =&gt; 'fw.user_id = ' . $user-&gt;data['user_id'] . '
AND f.forum_id = fw.forum_id',
- 'ORDER_BY' =&gt; 'left_id'
+ 'ORDER_BY' =&gt; 'left_id',
);
$sql = $db-&gt;sql_build_query('SELECT', $sql_array);
@@ -964,13 +964,13 @@ $sql_array = array(
'FROM' =&gt; array(
FORUMS_WATCH_TABLE =&gt; 'fw',
- FORUMS_TABLE =&gt; 'f'
+ FORUMS_TABLE =&gt; 'f',
),
'WHERE' =&gt; 'fw.user_id = ' . $user-&gt;data['user_id'] . '
AND f.forum_id = fw.forum_id',
- 'ORDER_BY' =&gt; 'left_id'
+ 'ORDER_BY' =&gt; 'left_id',
);
if ($config['load_db_lastread'])
@@ -978,8 +978,8 @@ if ($config['load_db_lastread'])
$sql_array['LEFT_JOIN'] = array(
array(
'FROM' =&gt; array(FORUMS_TRACK_TABLE =&gt; 'ft'),
- 'ON' =&gt; 'ft.user_id = ' . $user-&gt;data['user_id'] . ' AND ft.forum_id = f.forum_id'
- )
+ 'ON' =&gt; 'ft.user_id = ' . $user-&gt;data['user_id'] . ' AND ft.forum_id = f.forum_id',
+ ),
);
$sql_array['SELECT'] .= ', ft.mark_time ';
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
index 3723bf7b3f..bef4727149 100644
--- a/phpBB/docs/events.md
+++ b/phpBB/docs/events.md
@@ -52,6 +52,36 @@ index_body_stat_blocks_before
+ styles/subsilver2/template/index_body.html
* Purpose: Add new statistic blocks above the Who Is Online and Board Statistics blocks
+memberlist_body_username_append
+===
+* Locations:
+ + styles/prosilver/template/memberlist_body.html
+ + styles/subsilver2/template/memberlist_body.html
+* Purpose: Add information after every username in the memberlist. Works in
+all display modes (leader, group and normal memberlist).
+
+memberlist_body_username_prepend
+===
+* Locations:
+ + styles/prosilver/template/memberlist_body.html
+ + styles/subsilver2/template/memberlist_body.html
+* Purpose: Add information before every username in the memberlist. Works in
+all display modes (leader, group and normal memberlist).
+
+memberlist_view_user_statistics_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Purpose: Add entries after the user statistics part of any user profile
+
+memberlist_view_user_statistics_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Purpose: Add entries before the user statistics part of any user profile
+
overall_footer_after
===
* Locations:
@@ -114,11 +144,101 @@ simple_footer_after
* Location: styles/prosilver/template/simple_footer.html
* Purpose: Add content directly prior to the `</body>` tag of the simple footer
+topiclist_row_prepend
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/search_results.html
+ + styles/subsilver2/template/viewforum_body.html
+* Purpose: Add content into topic rows (inside the elements containing topic titles)
+
+topiclist_row_append
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/search_results.html
+ + styles/subsilver2/template/viewforum_body.html
+* Purpose: Add content into topic rows (inside the elements containing topic titles)
+
+ucp_pm_viewmessage_custom_fields_after
+===
+* Location: styles/prosilver/template/ucp_pm_viewmessage.html
+* Purpose: Add data after the custom fields on the user profile when viewing
+a private message
+
+ucp_pm_viewmessage_custom_fields_before
+===
+* Location: styles/prosilver/template/ucp_pm_viewmessage.html
+* Purpose: Add data before the custom fields on the user profile when viewing
+a private message
+
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
@@ -133,6 +253,38 @@ viewtopic_body_footer_before
and quick reply, directly before the jumpbox in Prosilver, breadcrumbs in
Subsilver2.
+viewtopic_body_post_buttons_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Purpose: Add post button to posts (next to edit, quote etc), at the end of
+the list.
+
+viewtopic_body_post_buttons_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Purpose: Add post button to posts (next to edit, quote etc), at the start of
+the list.
+
+viewtopic_body_postrow_custom_fields_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Purpose: Add data after the custom fields on the user profile when viewing
+a post
+
+viewtopic_body_postrow_custom_fields_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Purpose: Add data before the custom fields on the user profile when viewing
+a post
+
viewtopic_topic_title_prepend
===
* Locations:
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index 8912a9f9d0..f612d11d3c 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -41,7 +41,7 @@ if (isset($_GET['avatar']))
exit;
}
- require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
+ require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
@@ -50,7 +50,7 @@ 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}includes/", $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->register();
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 309376a75d..8f2548166b 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -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'],
@@ -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>' : '');
+ }
}
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index a1819e6dd5..8aa72076da 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -379,6 +379,7 @@ class acp_modules
$json_response->send(array(
'MESSAGE_TITLE' => $user->lang('ERROR'),
'MESSAGE_TEXT' => implode('<br />', $errors),
+ 'SUCCESS' => false,
));
}
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php
index e830479389..17e48d6576 100644
--- a/phpBB/includes/acp/acp_permission_roles.php
+++ b/phpBB/includes/acp/acp_permission_roles.php
@@ -25,7 +25,7 @@ class acp_permission_roles
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -306,6 +306,8 @@ class acp_permission_roles
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+ $phpbb_permissions = $phpbb_container->get('acl.permissions');
+
$template->assign_vars(array(
'S_EDIT' => true,
@@ -314,9 +316,8 @@ class acp_permission_roles
'ROLE_NAME' => $role_row['role_name'],
'ROLE_DESCRIPTION' => $role_row['role_description'],
- 'L_ACL_TYPE' => $user->lang['ACL_TYPE_' . strtoupper($permission_type)],
- )
- );
+ 'L_ACL_TYPE' => $phpbb_permissions->get_type_lang($permission_type),
+ ));
// We need to fill the auth options array with ACL_NO options ;)
$sql = 'SELECT auth_option_id, auth_option
@@ -456,7 +457,9 @@ class acp_permission_roles
*/
function display_auth_options($auth_options)
{
- global $template, $user;
+ global $template, $user, $phpbb_container;
+
+ $phpbb_permissions = $phpbb_container->get('acl.permissions');
$content_array = $categories = array();
$key_sort_array = array(0);
@@ -473,7 +476,7 @@ class acp_permission_roles
foreach ($content_array as $cat => $cat_array)
{
$template->assign_block_vars('auth', array(
- 'CAT_NAME' => $user->lang['permission_cat'][$cat],
+ 'CAT_NAME' => $phpbb_permissions->get_category_lang($cat),
'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
@@ -488,8 +491,8 @@ class acp_permission_roles
'S_NO' => ($allowed == ACL_NO) ? true : false,
'FIELD_NAME' => $permission,
- 'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
- );
+ 'PERMISSION' => $phpbb_permissions->get_permission_lang($permission),
+ ));
}
}
}
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 2cc5595190..e7dc03db5c 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -22,15 +22,18 @@ class acp_permissions
{
var $u_action;
var $permission_dropdown;
+ protected $permissions;
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ $this->permissions = $phpbb_container->get('acl.permissions');
+
$auth_admin = new auth_admin();
$user->add_lang('acp/permissions');
@@ -49,7 +52,7 @@ class acp_permissions
if ($user_id && isset($auth_admin->acl_options['id'][$permission]) && $auth->acl_get('a_viewauth'))
{
- $this->page_title = sprintf($user->lang['TRACE_PERMISSION'], $user->lang['acl_' . $permission]['lang']);
+ $this->page_title = sprintf($user->lang['TRACE_PERMISSION'], $this->permissions->get_permission_lang($permission));
$this->permission_trace($user_id, $forum_id, $permission);
return;
}
@@ -512,7 +515,7 @@ class acp_permissions
$template->assign_vars(array(
'S_PERMISSION_DROPDOWN' => (sizeof($this->permission_dropdown) > 1) ? $this->build_permission_dropdown($this->permission_dropdown, $permission_type, $permission_scope) : false,
- 'L_PERMISSION_TYPE' => $user->lang['ACL_TYPE_' . strtoupper($permission_type)],
+ 'L_PERMISSION_TYPE' => $this->permissions->get_type_lang($permission_type),
'U_ACTION' => $this->u_action,
'S_HIDDEN_FIELDS' => $s_hidden_fields)
@@ -587,7 +590,7 @@ class acp_permissions
*/
function build_permission_dropdown($options, $default_option, $permission_scope)
{
- global $user, $auth;
+ global $auth;
$s_dropdown_options = '';
foreach ($options as $setting)
@@ -598,7 +601,7 @@ class acp_permissions
}
$selected = ($setting == $default_option) ? ' selected="selected"' : '';
- $l_setting = (isset($user->lang['permission_type'][$permission_scope][$setting])) ? $user->lang['permission_type'][$permission_scope][$setting] : $user->lang['permission_type'][$setting];
+ $l_setting = $this->permissions->get_type_lang($setting, $permission_scope);
$s_dropdown_options .= '<option value="' . $setting . '"' . $selected . '>' . $l_setting . '</option>';
}
@@ -979,7 +982,7 @@ class acp_permissions
$back = request_var('back', 0);
$template->assign_vars(array(
- 'PERMISSION' => $user->lang['acl_' . $permission]['lang'],
+ 'PERMISSION' => $this->permissions->get_permission_lang($permission),
'PERMISSION_USERNAME' => $userdata['username'],
'FORUM_NAME' => $forum_name,
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 94fd67c9dd..f5f90fb5b8 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -261,7 +261,8 @@ class auth_admin extends \phpbb\auth\auth
*/
function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true)
{
- global $template, $user, $db, $phpbb_root_path, $phpEx;
+ global $template, $user, $db, $phpbb_root_path, $phpEx, $phpbb_container;
+ $phpbb_permissions = $phpbb_container->get('acl.permissions');
// Define names for template loops, might be able to be set
$tpl_pmask = 'p_mask';
@@ -269,7 +270,7 @@ class auth_admin extends \phpbb\auth\auth
$tpl_category = 'category';
$tpl_mask = 'mask';
- $l_acl_type = (isset($user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)])) ? $user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)] : 'ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type);
+ $l_acl_type = $phpbb_permissions->get_type_lang($permission_type, (($local) ? 'local' : 'global'));
// Allow trace for viewing permissions and in user mode
$show_trace = ($mode == 'view' && $user_mode == 'user') ? true : false;
@@ -1100,7 +1101,9 @@ class auth_admin extends \phpbb\auth\auth
*/
function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false, $s_view)
{
- global $template, $user, $phpbb_admin_path, $phpEx;
+ global $template, $user, $phpbb_admin_path, $phpEx, $phpbb_container;
+
+ $phpbb_permissions = $phpbb_container->get('acl.permissions');
@reset($category_array);
while (list($cat, $cat_array) = each($category_array))
@@ -1110,8 +1113,8 @@ class auth_admin extends \phpbb\auth\auth
'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
'S_NO' => ($cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES']) ? true : false,
- 'CAT_NAME' => $user->lang['permission_cat'][$cat])
- );
+ 'CAT_NAME' => $phpbb_permissions->get_category_lang($cat),
+ ));
/* Sort permissions by name (more naturaly and user friendly than sorting by a primary key)
* Commented out due to it's memory consumption and time needed
@@ -1145,8 +1148,8 @@ class auth_admin extends \phpbb\auth\auth
'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
- 'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
- );
+ 'PERMISSION' => $phpbb_permissions->get_permission_lang($permission),
+ ));
}
else
{
@@ -1163,8 +1166,8 @@ class auth_admin extends \phpbb\auth\auth
'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
- 'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
- );
+ 'PERMISSION' => $phpbb_permissions->get_permission_lang($permission),
+ ));
}
}
}
@@ -1176,7 +1179,9 @@ class auth_admin extends \phpbb\auth\auth
*/
function build_permission_array(&$permission_row, &$content_array, &$categories, $key_sort_array)
{
- global $user;
+ global $user, $phpbb_container;
+
+ $phpbb_permissions = $phpbb_container->get('acl.permissions');
foreach ($key_sort_array as $forum_id)
{
@@ -1191,20 +1196,12 @@ class auth_admin extends \phpbb\auth\auth
@reset($permissions);
while (list($permission, $auth_setting) = each($permissions))
{
- if (!isset($user->lang['acl_' . $permission]))
- {
- $user->lang['acl_' . $permission] = array(
- 'cat' => 'misc',
- 'lang' => '{ acl_' . $permission . ' }'
- );
- }
-
- $cat = $user->lang['acl_' . $permission]['cat'];
+ $cat = $phpbb_permissions->get_permission_category($permission);
// Build our categories array
if (!isset($categories[$cat]))
{
- $categories[$cat] = $user->lang['permission_cat'][$cat];
+ $categories[$cat] = $phpbb_permissions->get_category_lang($cat);
}
// Build our content array
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 15cda46246..b6da41f9aa 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -132,11 +132,8 @@ class bbcode
{
$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\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context(), $phpbb_extension_manager);
- $style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, $style_path_provider, $template);
- $style->set_style();
+ $template = new \phpbb\template\twig($phpbb_root_path, $phpEx, $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');
}
diff --git a/phpBB/includes/captcha/captcha_factory.php b/phpBB/includes/captcha/captcha_factory.php
index 1ed8e119b5..fac45087e3 100644
--- a/phpBB/includes/captcha/captcha_factory.php
+++ b/phpBB/includes/captcha/captcha_factory.php
@@ -50,7 +50,8 @@ class phpbb_captcha_factory
{
include($phpbb_root_path . "includes/captcha/plugins/{$name}_plugin." . $phpEx);
}
- call_user_func(array($name, 'garbage_collect'), 0);
+ $captcha = self::get_instance($name);
+ $captcha->garbage_collect(0);
}
/**
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index c1f4c6ac0e..ae55a71e50 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -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);
diff --git a/phpBB/includes/db/schema_data.php b/phpBB/includes/db/schema_data.php
new file mode 100644
index 0000000000..69d39e0f8c
--- /dev/null
+++ b/phpBB/includes/db/schema_data.php
@@ -0,0 +1,1219 @@
+<?php
+/**
+*
+* @package dbal
+* @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;
+}
+
+$schema_data = array();
+
+/**
+* Define the basic structure
+* The format:
+* array('{TABLE_NAME}' => {TABLE_DATA})
+* {TABLE_DATA}:
+* COLUMNS = array({column_name} = array({column_type}, {default}, {auto_increment}))
+* PRIMARY_KEY = {column_name(s)}
+* KEYS = array({key_name} = array({key_type}, {column_name(s)})),
+*
+* Column Types:
+* INT:x => SIGNED int(x)
+* BINT => BIGINT
+* UINT => mediumint(8) UNSIGNED
+* UINT:x => int(x) UNSIGNED
+* TINT:x => tinyint(x)
+* USINT => smallint(4) UNSIGNED (for _order columns)
+* BOOL => tinyint(1) UNSIGNED
+* VCHAR => varchar(255)
+* CHAR:x => char(x)
+* XSTEXT_UNI => text for storing 100 characters (topic_title for example)
+* STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI
+* TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.)
+* MTEXT_UNI => mediumtext (post text, large text)
+* VCHAR:x => varchar(x)
+* TIMESTAMP => int(11) UNSIGNED
+* DECIMAL => decimal number (5,2)
+* DECIMAL: => decimal number (x,2)
+* PDECIMAL => precision decimal number (6,3)
+* PDECIMAL: => precision decimal number (x,3)
+* VCHAR_UNI => varchar(255) BINARY
+* VCHAR_CI => varchar_ci for postgresql, others VCHAR
+*/
+$schema_data['phpbb_attachments'] = array(
+ 'COLUMNS' => array(
+ 'attach_id' => array('UINT', NULL, 'auto_increment'),
+ 'post_msg_id' => array('UINT', 0),
+ 'topic_id' => array('UINT', 0),
+ 'in_message' => array('BOOL', 0),
+ 'poster_id' => array('UINT', 0),
+ 'is_orphan' => array('BOOL', 1),
+ 'physical_filename' => array('VCHAR', ''),
+ 'real_filename' => array('VCHAR', ''),
+ 'download_count' => array('UINT', 0),
+ 'attach_comment' => array('TEXT_UNI', ''),
+ 'extension' => array('VCHAR:100', ''),
+ 'mimetype' => array('VCHAR:100', ''),
+ 'filesize' => array('UINT:20', 0),
+ 'filetime' => array('TIMESTAMP', 0),
+ 'thumbnail' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'attach_id',
+ 'KEYS' => array(
+ 'filetime' => array('INDEX', 'filetime'),
+ 'post_msg_id' => array('INDEX', 'post_msg_id'),
+ 'topic_id' => array('INDEX', 'topic_id'),
+ 'poster_id' => array('INDEX', 'poster_id'),
+ 'is_orphan' => array('INDEX', 'is_orphan'),
+ ),
+);
+
+$schema_data['phpbb_acl_groups'] = array(
+ 'COLUMNS' => array(
+ 'group_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'auth_option_id' => array('UINT', 0),
+ 'auth_role_id' => array('UINT', 0),
+ 'auth_setting' => array('TINT:2', 0),
+ ),
+ 'KEYS' => array(
+ 'group_id' => array('INDEX', 'group_id'),
+ 'auth_opt_id' => array('INDEX', 'auth_option_id'),
+ 'auth_role_id' => array('INDEX', 'auth_role_id'),
+ ),
+);
+
+$schema_data['phpbb_acl_options'] = array(
+ 'COLUMNS' => array(
+ 'auth_option_id' => array('UINT', NULL, 'auto_increment'),
+ 'auth_option' => array('VCHAR:50', ''),
+ 'is_global' => array('BOOL', 0),
+ 'is_local' => array('BOOL', 0),
+ 'founder_only' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'auth_option_id',
+ 'KEYS' => array(
+ 'auth_option' => array('UNIQUE', 'auth_option'),
+ ),
+);
+
+$schema_data['phpbb_acl_roles'] = array(
+ 'COLUMNS' => array(
+ 'role_id' => array('UINT', NULL, 'auto_increment'),
+ 'role_name' => array('VCHAR_UNI', ''),
+ 'role_description' => array('TEXT_UNI', ''),
+ 'role_type' => array('VCHAR:10', ''),
+ 'role_order' => array('USINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'role_id',
+ 'KEYS' => array(
+ 'role_type' => array('INDEX', 'role_type'),
+ 'role_order' => array('INDEX', 'role_order'),
+ ),
+);
+
+$schema_data['phpbb_acl_roles_data'] = array(
+ 'COLUMNS' => array(
+ 'role_id' => array('UINT', 0),
+ 'auth_option_id' => array('UINT', 0),
+ 'auth_setting' => array('TINT:2', 0),
+ ),
+ 'PRIMARY_KEY' => array('role_id', 'auth_option_id'),
+ 'KEYS' => array(
+ 'ath_op_id' => array('INDEX', 'auth_option_id'),
+ ),
+);
+
+$schema_data['phpbb_acl_users'] = array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'auth_option_id' => array('UINT', 0),
+ 'auth_role_id' => array('UINT', 0),
+ 'auth_setting' => array('TINT:2', 0),
+ ),
+ 'KEYS' => array(
+ 'user_id' => array('INDEX', 'user_id'),
+ 'auth_option_id' => array('INDEX', 'auth_option_id'),
+ 'auth_role_id' => array('INDEX', 'auth_role_id'),
+ ),
+);
+
+$schema_data['phpbb_banlist'] = array(
+ 'COLUMNS' => array(
+ 'ban_id' => array('UINT', NULL, 'auto_increment'),
+ 'ban_userid' => array('UINT', 0),
+ 'ban_ip' => array('VCHAR:40', ''),
+ 'ban_email' => array('VCHAR_UNI:100', ''),
+ 'ban_start' => array('TIMESTAMP', 0),
+ 'ban_end' => array('TIMESTAMP', 0),
+ 'ban_exclude' => array('BOOL', 0),
+ 'ban_reason' => array('VCHAR_UNI', ''),
+ 'ban_give_reason' => array('VCHAR_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'ban_id',
+ 'KEYS' => array(
+ 'ban_end' => array('INDEX', 'ban_end'),
+ 'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')),
+ 'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')),
+ 'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')),
+ ),
+);
+
+$schema_data['phpbb_bbcodes'] = array(
+ 'COLUMNS' => array(
+ 'bbcode_id' => array('USINT', 0),
+ 'bbcode_tag' => array('VCHAR:16', ''),
+ 'bbcode_helpline' => array('VCHAR_UNI', ''),
+ 'display_on_posting' => array('BOOL', 0),
+ 'bbcode_match' => array('TEXT_UNI', ''),
+ 'bbcode_tpl' => array('MTEXT_UNI', ''),
+ 'first_pass_match' => array('MTEXT_UNI', ''),
+ 'first_pass_replace' => array('MTEXT_UNI', ''),
+ 'second_pass_match' => array('MTEXT_UNI', ''),
+ 'second_pass_replace' => array('MTEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'bbcode_id',
+ 'KEYS' => array(
+ 'display_on_post' => array('INDEX', 'display_on_posting'),
+ ),
+);
+
+$schema_data['phpbb_bookmarks'] = array(
+ 'COLUMNS' => array(
+ 'topic_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => array('topic_id', 'user_id'),
+);
+
+$schema_data['phpbb_bots'] = array(
+ 'COLUMNS' => array(
+ 'bot_id' => array('UINT', NULL, 'auto_increment'),
+ 'bot_active' => array('BOOL', 1),
+ 'bot_name' => array('STEXT_UNI', ''),
+ 'user_id' => array('UINT', 0),
+ 'bot_agent' => array('VCHAR', ''),
+ 'bot_ip' => array('VCHAR', ''),
+ ),
+ 'PRIMARY_KEY' => 'bot_id',
+ 'KEYS' => array(
+ 'bot_active' => array('INDEX', 'bot_active'),
+ ),
+);
+
+$schema_data['phpbb_config'] = array(
+ 'COLUMNS' => array(
+ 'config_name' => array('VCHAR', ''),
+ 'config_value' => array('VCHAR_UNI', ''),
+ 'is_dynamic' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'config_name',
+ 'KEYS' => array(
+ 'is_dynamic' => array('INDEX', 'is_dynamic'),
+ ),
+);
+
+$schema_data['phpbb_config_text'] = array(
+ 'COLUMNS' => array(
+ 'config_name' => array('VCHAR', ''),
+ 'config_value' => array('MTEXT', ''),
+ ),
+ 'PRIMARY_KEY' => 'config_name',
+);
+
+$schema_data['phpbb_confirm'] = array(
+ 'COLUMNS' => array(
+ 'confirm_id' => array('CHAR:32', ''),
+ 'session_id' => array('CHAR:32', ''),
+ 'confirm_type' => array('TINT:3', 0),
+ 'code' => array('VCHAR:8', ''),
+ 'seed' => array('UINT:10', 0),
+ 'attempts' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => array('session_id', 'confirm_id'),
+ 'KEYS' => array(
+ 'confirm_type' => array('INDEX', 'confirm_type'),
+ ),
+);
+
+$schema_data['phpbb_disallow'] = array(
+ 'COLUMNS' => array(
+ 'disallow_id' => array('UINT', NULL, 'auto_increment'),
+ 'disallow_username' => array('VCHAR_UNI:255', ''),
+ ),
+ 'PRIMARY_KEY' => 'disallow_id',
+);
+
+$schema_data['phpbb_drafts'] = array(
+ 'COLUMNS' => array(
+ 'draft_id' => array('UINT', NULL, 'auto_increment'),
+ 'user_id' => array('UINT', 0),
+ 'topic_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'save_time' => array('TIMESTAMP', 0),
+ 'draft_subject' => array('STEXT_UNI', ''),
+ 'draft_message' => array('MTEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'draft_id',
+ 'KEYS' => array(
+ 'save_time' => array('INDEX', 'save_time'),
+ ),
+);
+
+$schema_data['phpbb_ext'] = array(
+ 'COLUMNS' => array(
+ 'ext_name' => array('VCHAR', ''),
+ 'ext_active' => array('BOOL', 0),
+ 'ext_state' => array('TEXT', ''),
+ ),
+ 'KEYS' => array(
+ 'ext_name' => array('UNIQUE', 'ext_name'),
+ ),
+);
+
+$schema_data['phpbb_extensions'] = array(
+ 'COLUMNS' => array(
+ 'extension_id' => array('UINT', NULL, 'auto_increment'),
+ 'group_id' => array('UINT', 0),
+ 'extension' => array('VCHAR:100', ''),
+ ),
+ 'PRIMARY_KEY' => 'extension_id',
+);
+
+$schema_data['phpbb_extension_groups'] = array(
+ 'COLUMNS' => array(
+ 'group_id' => array('UINT', NULL, 'auto_increment'),
+ 'group_name' => array('VCHAR_UNI', ''),
+ 'cat_id' => array('TINT:2', 0),
+ 'allow_group' => array('BOOL', 0),
+ 'download_mode' => array('BOOL', 1),
+ 'upload_icon' => array('VCHAR', ''),
+ 'max_filesize' => array('UINT:20', 0),
+ 'allowed_forums' => array('TEXT', ''),
+ 'allow_in_pm' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'group_id',
+);
+
+$schema_data['phpbb_forums'] = array(
+ 'COLUMNS' => array(
+ 'forum_id' => array('UINT', NULL, 'auto_increment'),
+ 'parent_id' => array('UINT', 0),
+ 'left_id' => array('UINT', 0),
+ 'right_id' => array('UINT', 0),
+ 'forum_parents' => array('MTEXT', ''),
+ 'forum_name' => array('STEXT_UNI', ''),
+ 'forum_desc' => array('TEXT_UNI', ''),
+ 'forum_desc_bitfield' => array('VCHAR:255', ''),
+ 'forum_desc_options' => array('UINT:11', 7),
+ 'forum_desc_uid' => array('VCHAR:8', ''),
+ 'forum_link' => array('VCHAR_UNI', ''),
+ 'forum_password' => array('VCHAR_UNI:40', ''),
+ 'forum_style' => array('UINT', 0),
+ 'forum_image' => array('VCHAR', ''),
+ 'forum_rules' => array('TEXT_UNI', ''),
+ 'forum_rules_link' => array('VCHAR_UNI', ''),
+ 'forum_rules_bitfield' => array('VCHAR:255', ''),
+ 'forum_rules_options' => array('UINT:11', 7),
+ 'forum_rules_uid' => array('VCHAR:8', ''),
+ 'forum_topics_per_page' => array('TINT:4', 0),
+ 'forum_type' => array('TINT:4', 0),
+ 'forum_status' => array('TINT:4', 0),
+ 'forum_posts_approved' => array('UINT', 0),
+ 'forum_posts_unapproved' => array('UINT', 0),
+ 'forum_posts_softdeleted' => array('UINT', 0),
+ 'forum_topics_approved' => array('UINT', 0),
+ 'forum_topics_unapproved' => array('UINT', 0),
+ 'forum_topics_softdeleted' => array('UINT', 0),
+ 'forum_last_post_id' => array('UINT', 0),
+ 'forum_last_poster_id' => array('UINT', 0),
+ 'forum_last_post_subject' => array('STEXT_UNI', ''),
+ 'forum_last_post_time' => array('TIMESTAMP', 0),
+ 'forum_last_poster_name'=> array('VCHAR_UNI', ''),
+ 'forum_last_poster_colour'=> array('VCHAR:6', ''),
+ 'forum_flags' => array('TINT:4', 32),
+ 'forum_options' => array('UINT:20', 0),
+ 'display_subforum_list' => array('BOOL', 1),
+ 'display_on_index' => array('BOOL', 1),
+ 'enable_indexing' => array('BOOL', 1),
+ 'enable_icons' => array('BOOL', 1),
+ 'enable_prune' => array('BOOL', 0),
+ 'prune_next' => array('TIMESTAMP', 0),
+ 'prune_days' => array('UINT', 0),
+ 'prune_viewed' => array('UINT', 0),
+ 'prune_freq' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'forum_id',
+ 'KEYS' => array(
+ 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
+ 'forum_lastpost_id' => array('INDEX', 'forum_last_post_id'),
+ ),
+);
+
+$schema_data['phpbb_forums_access'] = array(
+ 'COLUMNS' => array(
+ 'forum_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'session_id' => array('CHAR:32', ''),
+ ),
+ 'PRIMARY_KEY' => array('forum_id', 'user_id', 'session_id'),
+);
+
+$schema_data['phpbb_forums_track'] = array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'mark_time' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => array('user_id', 'forum_id'),
+);
+
+$schema_data['phpbb_forums_watch'] = array(
+ 'COLUMNS' => array(
+ 'forum_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'notify_status' => array('BOOL', 0),
+ ),
+ 'KEYS' => array(
+ 'forum_id' => array('INDEX', 'forum_id'),
+ 'user_id' => array('INDEX', 'user_id'),
+ 'notify_stat' => array('INDEX', 'notify_status'),
+ ),
+);
+
+$schema_data['phpbb_groups'] = array(
+ 'COLUMNS' => array(
+ 'group_id' => array('UINT', NULL, 'auto_increment'),
+ 'group_type' => array('TINT:4', 1),
+ 'group_founder_manage' => array('BOOL', 0),
+ 'group_skip_auth' => array('BOOL', 0),
+ 'group_name' => array('VCHAR_CI', ''),
+ 'group_desc' => array('TEXT_UNI', ''),
+ 'group_desc_bitfield' => array('VCHAR:255', ''),
+ 'group_desc_options' => array('UINT:11', 7),
+ 'group_desc_uid' => array('VCHAR:8', ''),
+ 'group_display' => array('BOOL', 0),
+ 'group_avatar' => array('VCHAR', ''),
+ 'group_avatar_type' => array('VCHAR:255', ''),
+ 'group_avatar_width' => array('USINT', 0),
+ 'group_avatar_height' => array('USINT', 0),
+ 'group_rank' => array('UINT', 0),
+ 'group_colour' => array('VCHAR:6', ''),
+ 'group_sig_chars' => array('UINT', 0),
+ 'group_receive_pm' => array('BOOL', 0),
+ 'group_message_limit' => array('UINT', 0),
+ 'group_max_recipients' => array('UINT', 0),
+ 'group_legend' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'group_id',
+ 'KEYS' => array(
+ 'group_legend_name' => array('INDEX', array('group_legend', 'group_name')),
+ ),
+);
+
+$schema_data['phpbb_icons'] = array(
+ 'COLUMNS' => array(
+ 'icons_id' => array('UINT', NULL, 'auto_increment'),
+ 'icons_url' => array('VCHAR', ''),
+ 'icons_width' => array('TINT:4', 0),
+ 'icons_height' => array('TINT:4', 0),
+ 'icons_order' => array('UINT', 0),
+ 'display_on_posting' => array('BOOL', 1),
+ ),
+ 'PRIMARY_KEY' => 'icons_id',
+ 'KEYS' => array(
+ 'display_on_posting' => array('INDEX', 'display_on_posting'),
+ ),
+);
+
+$schema_data['phpbb_lang'] = array(
+ 'COLUMNS' => array(
+ 'lang_id' => array('TINT:4', NULL, 'auto_increment'),
+ 'lang_iso' => array('VCHAR:30', ''),
+ 'lang_dir' => array('VCHAR:30', ''),
+ 'lang_english_name' => array('VCHAR_UNI:100', ''),
+ 'lang_local_name' => array('VCHAR_UNI:255', ''),
+ 'lang_author' => array('VCHAR_UNI:255', ''),
+ ),
+ 'PRIMARY_KEY' => 'lang_id',
+ 'KEYS' => array(
+ 'lang_iso' => array('INDEX', 'lang_iso'),
+ ),
+);
+
+$schema_data['phpbb_log'] = array(
+ 'COLUMNS' => array(
+ 'log_id' => array('UINT', NULL, 'auto_increment'),
+ 'log_type' => array('TINT:4', 0),
+ 'user_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'topic_id' => array('UINT', 0),
+ 'reportee_id' => array('UINT', 0),
+ 'log_ip' => array('VCHAR:40', ''),
+ 'log_time' => array('TIMESTAMP', 0),
+ 'log_operation' => array('TEXT_UNI', ''),
+ 'log_data' => array('MTEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'log_id',
+ 'KEYS' => array(
+ 'log_type' => array('INDEX', 'log_type'),
+ 'log_time' => array('INDEX', 'log_time'),
+ 'forum_id' => array('INDEX', 'forum_id'),
+ 'topic_id' => array('INDEX', 'topic_id'),
+ 'reportee_id' => array('INDEX', 'reportee_id'),
+ 'user_id' => array('INDEX', 'user_id'),
+ ),
+);
+
+$schema_data['phpbb_login_attempts'] = array(
+ 'COLUMNS' => array(
+ 'attempt_ip' => array('VCHAR:40', ''),
+ 'attempt_browser' => array('VCHAR:150', ''),
+ 'attempt_forwarded_for' => array('VCHAR:255', ''),
+ 'attempt_time' => array('TIMESTAMP', 0),
+ 'user_id' => array('UINT', 0),
+ 'username' => array('VCHAR_UNI:255', 0),
+ 'username_clean' => array('VCHAR_CI', 0),
+ ),
+ 'KEYS' => array(
+ 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')),
+ 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')),
+ 'att_time' => array('INDEX', array('attempt_time')),
+ 'user_id' => array('INDEX', 'user_id'),
+ ),
+);
+
+$schema_data['phpbb_moderator_cache'] = array(
+ 'COLUMNS' => array(
+ 'forum_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'username' => array('VCHAR_UNI:255', ''),
+ 'group_id' => array('UINT', 0),
+ 'group_name' => array('VCHAR_UNI', ''),
+ 'display_on_index' => array('BOOL', 1),
+ ),
+ 'KEYS' => array(
+ 'disp_idx' => array('INDEX', 'display_on_index'),
+ 'forum_id' => array('INDEX', 'forum_id'),
+ ),
+);
+
+$schema_data['phpbb_migrations'] = array(
+ 'COLUMNS' => array(
+ 'migration_name' => array('VCHAR', ''),
+ 'migration_depends_on' => array('TEXT', ''),
+ 'migration_schema_done' => array('BOOL', 0),
+ 'migration_data_done' => array('BOOL', 0),
+ 'migration_data_state' => array('TEXT', ''),
+ 'migration_start_time' => array('TIMESTAMP', 0),
+ 'migration_end_time' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => 'migration_name',
+);
+
+$schema_data['phpbb_modules'] = array(
+ 'COLUMNS' => array(
+ 'module_id' => array('UINT', NULL, 'auto_increment'),
+ 'module_enabled' => array('BOOL', 1),
+ 'module_display' => array('BOOL', 1),
+ 'module_basename' => array('VCHAR', ''),
+ 'module_class' => array('VCHAR:10', ''),
+ 'parent_id' => array('UINT', 0),
+ 'left_id' => array('UINT', 0),
+ 'right_id' => array('UINT', 0),
+ 'module_langname' => array('VCHAR', ''),
+ 'module_mode' => array('VCHAR', ''),
+ 'module_auth' => array('VCHAR', ''),
+ ),
+ 'PRIMARY_KEY' => 'module_id',
+ 'KEYS' => array(
+ 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
+ 'module_enabled' => array('INDEX', 'module_enabled'),
+ 'class_left_id' => array('INDEX', array('module_class', 'left_id')),
+ ),
+);
+
+$schema_data['phpbb_notification_types'] = array(
+ 'COLUMNS' => array(
+ 'notification_type_id' => array('USINT', NULL, 'auto_increment'),
+ 'notification_type_name' => array('VCHAR:255', ''),
+ 'notification_type_enabled' => array('BOOL', 1),
+ ),
+ 'PRIMARY_KEY' => array('notification_type_id'),
+ 'KEYS' => array(
+ 'type' => array('UNIQUE', array('notification_type_name')),
+ ),
+);
+
+$schema_data['phpbb_notifications'] = array(
+ 'COLUMNS' => array(
+ 'notification_id' => array('UINT:10', NULL, 'auto_increment'),
+ 'notification_type_id' => array('USINT', 0),
+ 'item_id' => array('UINT', 0),
+ 'item_parent_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'notification_read' => array('BOOL', 0),
+ 'notification_time' => array('TIMESTAMP', 1),
+ 'notification_data' => array('TEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'notification_id',
+ 'KEYS' => array(
+ 'item_ident' => array('INDEX', array('notification_type_id', 'item_id')),
+ 'user' => array('INDEX', array('user_id', 'notification_read')),
+ ),
+);
+
+$schema_data['phpbb_oauth_accounts'] = array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'provider' => array('VCHAR', ''),
+ 'oauth_provider_id' => array('TEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => array(
+ 'user_id',
+ 'provider',
+ ),
+);
+
+$schema_data['phpbb_oauth_tokens'] = array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0), // phpbb_users.user_id
+ 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set
+ 'provider' => array('VCHAR', ''), // Name of the OAuth provider
+ 'oauth_token' => array('MTEXT', ''), // Serialized token
+ ),
+ 'KEYS' => array(
+ 'user_id' => array('INDEX', 'user_id'),
+ 'provider' => array('INDEX', 'provider'),
+ ),
+);
+
+$schema_data['phpbb_poll_options'] = array(
+ 'COLUMNS' => array(
+ 'poll_option_id' => array('TINT:4', 0),
+ 'topic_id' => array('UINT', 0),
+ 'poll_option_text' => array('TEXT_UNI', ''),
+ 'poll_option_total' => array('UINT', 0),
+ ),
+ 'KEYS' => array(
+ 'poll_opt_id' => array('INDEX', 'poll_option_id'),
+ 'topic_id' => array('INDEX', 'topic_id'),
+ ),
+);
+
+$schema_data['phpbb_poll_votes'] = array(
+ 'COLUMNS' => array(
+ 'topic_id' => array('UINT', 0),
+ 'poll_option_id' => array('TINT:4', 0),
+ 'vote_user_id' => array('UINT', 0),
+ 'vote_user_ip' => array('VCHAR:40', ''),
+ ),
+ 'KEYS' => array(
+ 'topic_id' => array('INDEX', 'topic_id'),
+ 'vote_user_id' => array('INDEX', 'vote_user_id'),
+ 'vote_user_ip' => array('INDEX', 'vote_user_ip'),
+ ),
+);
+
+$schema_data['phpbb_posts'] = array(
+ 'COLUMNS' => array(
+ 'post_id' => array('UINT', NULL, 'auto_increment'),
+ 'topic_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'poster_id' => array('UINT', 0),
+ 'icon_id' => array('UINT', 0),
+ 'poster_ip' => array('VCHAR:40', ''),
+ 'post_time' => array('TIMESTAMP', 0),
+ 'post_visibility' => array('TINT:3', 0),
+ 'post_reported' => array('BOOL', 0),
+ 'enable_bbcode' => array('BOOL', 1),
+ 'enable_smilies' => array('BOOL', 1),
+ 'enable_magic_url' => array('BOOL', 1),
+ 'enable_sig' => array('BOOL', 1),
+ 'post_username' => array('VCHAR_UNI:255', ''),
+ 'post_subject' => array('STEXT_UNI', '', 'true_sort'),
+ 'post_text' => array('MTEXT_UNI', ''),
+ 'post_checksum' => array('VCHAR:32', ''),
+ 'post_attachment' => array('BOOL', 0),
+ 'bbcode_bitfield' => array('VCHAR:255', ''),
+ 'bbcode_uid' => array('VCHAR:8', ''),
+ 'post_postcount' => array('BOOL', 1),
+ 'post_edit_time' => array('TIMESTAMP', 0),
+ 'post_edit_reason' => array('STEXT_UNI', ''),
+ 'post_edit_user' => array('UINT', 0),
+ 'post_edit_count' => array('USINT', 0),
+ 'post_edit_locked' => array('BOOL', 0),
+ 'post_delete_time' => array('TIMESTAMP', 0),
+ 'post_delete_reason' => array('STEXT_UNI', ''),
+ 'post_delete_user' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'post_id',
+ 'KEYS' => array(
+ 'forum_id' => array('INDEX', 'forum_id'),
+ 'topic_id' => array('INDEX', 'topic_id'),
+ 'poster_ip' => array('INDEX', 'poster_ip'),
+ 'poster_id' => array('INDEX', 'poster_id'),
+ 'post_visibility' => array('INDEX', 'post_visibility'),
+ 'post_username' => array('INDEX', 'post_username'),
+ 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
+ ),
+);
+
+$schema_data['phpbb_privmsgs'] = array(
+ 'COLUMNS' => array(
+ 'msg_id' => array('UINT', NULL, 'auto_increment'),
+ 'root_level' => array('UINT', 0),
+ 'author_id' => array('UINT', 0),
+ 'icon_id' => array('UINT', 0),
+ 'author_ip' => array('VCHAR:40', ''),
+ 'message_time' => array('TIMESTAMP', 0),
+ 'enable_bbcode' => array('BOOL', 1),
+ 'enable_smilies' => array('BOOL', 1),
+ 'enable_magic_url' => array('BOOL', 1),
+ 'enable_sig' => array('BOOL', 1),
+ 'message_subject' => array('STEXT_UNI', ''),
+ 'message_text' => array('MTEXT_UNI', ''),
+ 'message_edit_reason' => array('STEXT_UNI', ''),
+ 'message_edit_user' => array('UINT', 0),
+ 'message_attachment' => array('BOOL', 0),
+ 'bbcode_bitfield' => array('VCHAR:255', ''),
+ 'bbcode_uid' => array('VCHAR:8', ''),
+ 'message_edit_time' => array('TIMESTAMP', 0),
+ 'message_edit_count' => array('USINT', 0),
+ 'to_address' => array('TEXT_UNI', ''),
+ 'bcc_address' => array('TEXT_UNI', ''),
+ 'message_reported' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'msg_id',
+ 'KEYS' => array(
+ 'author_ip' => array('INDEX', 'author_ip'),
+ 'message_time' => array('INDEX', 'message_time'),
+ 'author_id' => array('INDEX', 'author_id'),
+ 'root_level' => array('INDEX', 'root_level'),
+ ),
+);
+
+$schema_data['phpbb_privmsgs_folder'] = array(
+ 'COLUMNS' => array(
+ 'folder_id' => array('UINT', NULL, 'auto_increment'),
+ 'user_id' => array('UINT', 0),
+ 'folder_name' => array('VCHAR_UNI', ''),
+ 'pm_count' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'folder_id',
+ 'KEYS' => array(
+ 'user_id' => array('INDEX', 'user_id'),
+ ),
+);
+
+$schema_data['phpbb_privmsgs_rules'] = array(
+ 'COLUMNS' => array(
+ 'rule_id' => array('UINT', NULL, 'auto_increment'),
+ 'user_id' => array('UINT', 0),
+ 'rule_check' => array('UINT', 0),
+ 'rule_connection' => array('UINT', 0),
+ 'rule_string' => array('VCHAR_UNI', ''),
+ 'rule_user_id' => array('UINT', 0),
+ 'rule_group_id' => array('UINT', 0),
+ 'rule_action' => array('UINT', 0),
+ 'rule_folder_id' => array('INT:11', 0),
+ ),
+ 'PRIMARY_KEY' => 'rule_id',
+ 'KEYS' => array(
+ 'user_id' => array('INDEX', 'user_id'),
+ ),
+);
+
+$schema_data['phpbb_privmsgs_to'] = array(
+ 'COLUMNS' => array(
+ 'msg_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'author_id' => array('UINT', 0),
+ 'pm_deleted' => array('BOOL', 0),
+ 'pm_new' => array('BOOL', 1),
+ 'pm_unread' => array('BOOL', 1),
+ 'pm_replied' => array('BOOL', 0),
+ 'pm_marked' => array('BOOL', 0),
+ 'pm_forwarded' => array('BOOL', 0),
+ 'folder_id' => array('INT:11', 0),
+ ),
+ 'KEYS' => array(
+ 'msg_id' => array('INDEX', 'msg_id'),
+ 'author_id' => array('INDEX', 'author_id'),
+ 'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')),
+ ),
+);
+
+$schema_data['phpbb_profile_fields'] = array(
+ 'COLUMNS' => array(
+ 'field_id' => array('UINT', NULL, 'auto_increment'),
+ 'field_name' => array('VCHAR_UNI', ''),
+ 'field_type' => array('TINT:4', 0),
+ 'field_ident' => array('VCHAR:20', ''),
+ 'field_length' => array('VCHAR:20', ''),
+ 'field_minlen' => array('VCHAR', ''),
+ 'field_maxlen' => array('VCHAR', ''),
+ 'field_novalue' => array('VCHAR_UNI', ''),
+ 'field_default_value' => array('VCHAR_UNI', ''),
+ 'field_validation' => array('VCHAR_UNI:20', ''),
+ 'field_required' => array('BOOL', 0),
+ 'field_show_novalue' => array('BOOL', 0),
+ 'field_show_on_reg' => array('BOOL', 0),
+ 'field_show_on_pm' => array('BOOL', 0),
+ 'field_show_on_vt' => array('BOOL', 0),
+ 'field_show_profile' => array('BOOL', 0),
+ 'field_hide' => array('BOOL', 0),
+ 'field_no_view' => array('BOOL', 0),
+ 'field_active' => array('BOOL', 0),
+ 'field_order' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'field_id',
+ 'KEYS' => array(
+ 'fld_type' => array('INDEX', 'field_type'),
+ 'fld_ordr' => array('INDEX', 'field_order'),
+ ),
+);
+
+$schema_data['phpbb_profile_fields_data'] = array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'user_id',
+);
+
+$schema_data['phpbb_profile_fields_lang'] = array(
+ 'COLUMNS' => array(
+ 'field_id' => array('UINT', 0),
+ 'lang_id' => array('UINT', 0),
+ 'option_id' => array('UINT', 0),
+ 'field_type' => array('TINT:4', 0),
+ 'lang_value' => array('VCHAR_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'),
+);
+
+$schema_data['phpbb_profile_lang'] = array(
+ 'COLUMNS' => array(
+ 'field_id' => array('UINT', 0),
+ 'lang_id' => array('UINT', 0),
+ 'lang_name' => array('VCHAR_UNI', ''),
+ 'lang_explain' => array('TEXT_UNI', ''),
+ 'lang_default_value' => array('VCHAR_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => array('field_id', 'lang_id'),
+);
+
+$schema_data['phpbb_ranks'] = array(
+ 'COLUMNS' => array(
+ 'rank_id' => array('UINT', NULL, 'auto_increment'),
+ 'rank_title' => array('VCHAR_UNI', ''),
+ 'rank_min' => array('UINT', 0),
+ 'rank_special' => array('BOOL', 0),
+ 'rank_image' => array('VCHAR', ''),
+ ),
+ 'PRIMARY_KEY' => 'rank_id',
+);
+
+$schema_data['phpbb_reports'] = array(
+ 'COLUMNS' => array(
+ 'report_id' => array('UINT', NULL, 'auto_increment'),
+ 'reason_id' => array('USINT', 0),
+ 'post_id' => array('UINT', 0),
+ 'pm_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'user_notify' => array('BOOL', 0),
+ 'report_closed' => array('BOOL', 0),
+ 'report_time' => array('TIMESTAMP', 0),
+ 'report_text' => array('MTEXT_UNI', ''),
+ 'reported_post_text' => array('MTEXT_UNI', ''),
+ 'reported_post_uid' => array('VCHAR:8', ''),
+ 'reported_post_bitfield' => array('VCHAR:255', ''),
+ 'reported_post_enable_magic_url' => array('BOOL', 1),
+ 'reported_post_enable_smilies' => array('BOOL', 1),
+ 'reported_post_enable_bbcode' => array('BOOL', 1)
+ ),
+ 'PRIMARY_KEY' => 'report_id',
+ 'KEYS' => array(
+ 'post_id' => array('INDEX', 'post_id'),
+ 'pm_id' => array('INDEX', 'pm_id'),
+ ),
+);
+
+$schema_data['phpbb_reports_reasons'] = array(
+ 'COLUMNS' => array(
+ 'reason_id' => array('USINT', NULL, 'auto_increment'),
+ 'reason_title' => array('VCHAR_UNI', ''),
+ 'reason_description' => array('MTEXT_UNI', ''),
+ 'reason_order' => array('USINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'reason_id',
+);
+
+$schema_data['phpbb_search_results'] = array(
+ 'COLUMNS' => array(
+ 'search_key' => array('VCHAR:32', ''),
+ 'search_time' => array('TIMESTAMP', 0),
+ 'search_keywords' => array('MTEXT_UNI', ''),
+ 'search_authors' => array('MTEXT', ''),
+ ),
+ 'PRIMARY_KEY' => 'search_key',
+);
+
+$schema_data['phpbb_search_wordlist'] = array(
+ 'COLUMNS' => array(
+ 'word_id' => array('UINT', NULL, 'auto_increment'),
+ 'word_text' => array('VCHAR_UNI', ''),
+ 'word_common' => array('BOOL', 0),
+ 'word_count' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'word_id',
+ 'KEYS' => array(
+ 'wrd_txt' => array('UNIQUE', 'word_text'),
+ 'wrd_cnt' => array('INDEX', 'word_count'),
+ ),
+);
+
+$schema_data['phpbb_search_wordmatch'] = array(
+ 'COLUMNS' => array(
+ 'post_id' => array('UINT', 0),
+ 'word_id' => array('UINT', 0),
+ 'title_match' => array('BOOL', 0),
+ ),
+ 'KEYS' => array(
+ 'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')),
+ 'word_id' => array('INDEX', 'word_id'),
+ 'post_id' => array('INDEX', 'post_id'),
+ ),
+);
+
+$schema_data['phpbb_sessions'] = array(
+ 'COLUMNS' => array(
+ 'session_id' => array('CHAR:32', ''),
+ 'session_user_id' => array('UINT', 0),
+ 'session_forum_id' => array('UINT', 0),
+ 'session_last_visit' => array('TIMESTAMP', 0),
+ 'session_start' => array('TIMESTAMP', 0),
+ 'session_time' => array('TIMESTAMP', 0),
+ 'session_ip' => array('VCHAR:40', ''),
+ 'session_browser' => array('VCHAR:150', ''),
+ 'session_forwarded_for' => array('VCHAR:255', ''),
+ 'session_page' => array('VCHAR_UNI', ''),
+ 'session_viewonline' => array('BOOL', 1),
+ 'session_autologin' => array('BOOL', 0),
+ 'session_admin' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'session_id',
+ 'KEYS' => array(
+ 'session_time' => array('INDEX', 'session_time'),
+ 'session_user_id' => array('INDEX', 'session_user_id'),
+ 'session_fid' => array('INDEX', 'session_forum_id'),
+ ),
+);
+
+$schema_data['phpbb_sessions_keys'] = array(
+ 'COLUMNS' => array(
+ 'key_id' => array('CHAR:32', ''),
+ 'user_id' => array('UINT', 0),
+ 'last_ip' => array('VCHAR:40', ''),
+ 'last_login' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => array('key_id', 'user_id'),
+ 'KEYS' => array(
+ 'last_login' => array('INDEX', 'last_login'),
+ ),
+);
+
+$schema_data['phpbb_sitelist'] = array(
+ 'COLUMNS' => array(
+ 'site_id' => array('UINT', NULL, 'auto_increment'),
+ 'site_ip' => array('VCHAR:40', ''),
+ 'site_hostname' => array('VCHAR', ''),
+ 'ip_exclude' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'site_id',
+);
+
+$schema_data['phpbb_smilies'] = array(
+ 'COLUMNS' => array(
+ 'smiley_id' => array('UINT', NULL, 'auto_increment'),
+ // We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed.
+ 'code' => array('VCHAR_UNI:50', ''),
+ 'emotion' => array('VCHAR_UNI:50', ''),
+ 'smiley_url' => array('VCHAR:50', ''),
+ 'smiley_width' => array('USINT', 0),
+ 'smiley_height' => array('USINT', 0),
+ 'smiley_order' => array('UINT', 0),
+ 'display_on_posting'=> array('BOOL', 1),
+ ),
+ 'PRIMARY_KEY' => 'smiley_id',
+ 'KEYS' => array(
+ 'display_on_post' => array('INDEX', 'display_on_posting'),
+ ),
+);
+
+$schema_data['phpbb_styles'] = array(
+ 'COLUMNS' => array(
+ 'style_id' => array('UINT', NULL, 'auto_increment'),
+ 'style_name' => array('VCHAR_UNI:255', ''),
+ 'style_copyright' => array('VCHAR_UNI', ''),
+ 'style_active' => array('BOOL', 1),
+ 'style_path' => array('VCHAR:100', ''),
+ 'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
+ 'style_parent_id' => array('UINT:4', 0),
+ 'style_parent_tree' => array('TEXT', ''),
+ ),
+ 'PRIMARY_KEY' => 'style_id',
+ 'KEYS' => array(
+ 'style_name' => array('UNIQUE', 'style_name'),
+ ),
+);
+
+$schema_data['phpbb_teampage'] = array(
+ 'COLUMNS' => array(
+ 'teampage_id' => array('UINT', NULL, 'auto_increment'),
+ 'group_id' => array('UINT', 0),
+ 'teampage_name' => array('VCHAR_UNI:255', ''),
+ 'teampage_position' => array('UINT', 0),
+ 'teampage_parent' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'teampage_id',
+);
+
+$schema_data['phpbb_topics'] = array(
+ 'COLUMNS' => array(
+ 'topic_id' => array('UINT', NULL, 'auto_increment'),
+ 'forum_id' => array('UINT', 0),
+ 'icon_id' => array('UINT', 0),
+ 'topic_attachment' => array('BOOL', 0),
+ 'topic_visibility' => array('TINT:3', 0),
+ 'topic_reported' => array('BOOL', 0),
+ 'topic_title' => array('STEXT_UNI', '', 'true_sort'),
+ 'topic_poster' => array('UINT', 0),
+ 'topic_time' => array('TIMESTAMP', 0),
+ 'topic_time_limit' => array('TIMESTAMP', 0),
+ 'topic_views' => array('UINT', 0),
+ 'topic_posts_approved' => array('UINT', 0),
+ 'topic_posts_unapproved' => array('UINT', 0),
+ 'topic_posts_softdeleted' => array('UINT', 0),
+ 'topic_status' => array('TINT:3', 0),
+ 'topic_type' => array('TINT:3', 0),
+ 'topic_first_post_id' => array('UINT', 0),
+ 'topic_first_poster_name' => array('VCHAR_UNI', ''),
+ 'topic_first_poster_colour' => array('VCHAR:6', ''),
+ 'topic_last_post_id' => array('UINT', 0),
+ 'topic_last_poster_id' => array('UINT', 0),
+ 'topic_last_poster_name' => array('VCHAR_UNI', ''),
+ 'topic_last_poster_colour' => array('VCHAR:6', ''),
+ 'topic_last_post_subject' => array('STEXT_UNI', ''),
+ 'topic_last_post_time' => array('TIMESTAMP', 0),
+ 'topic_last_view_time' => array('TIMESTAMP', 0),
+ 'topic_moved_id' => array('UINT', 0),
+ 'topic_bumped' => array('BOOL', 0),
+ 'topic_bumper' => array('UINT', 0),
+ 'poll_title' => array('STEXT_UNI', ''),
+ 'poll_start' => array('TIMESTAMP', 0),
+ 'poll_length' => array('TIMESTAMP', 0),
+ 'poll_max_options' => array('TINT:4', 1),
+ 'poll_last_vote' => array('TIMESTAMP', 0),
+ 'poll_vote_change' => array('BOOL', 0),
+ 'topic_delete_time' => array('TIMESTAMP', 0),
+ 'topic_delete_reason' => array('STEXT_UNI', ''),
+ 'topic_delete_user' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'topic_id',
+ 'KEYS' => array(
+ 'forum_id' => array('INDEX', 'forum_id'),
+ 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
+ 'last_post_time' => array('INDEX', 'topic_last_post_time'),
+ 'topic_visibility' => array('INDEX', 'topic_visibility'),
+ 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_visibility', 'topic_last_post_id')),
+ 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
+ ),
+);
+
+$schema_data['phpbb_topics_track'] = array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'topic_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'mark_time' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => array('user_id', 'topic_id'),
+ 'KEYS' => array(
+ 'topic_id' => array('INDEX', 'topic_id'),
+ 'forum_id' => array('INDEX', 'forum_id'),
+ ),
+);
+
+$schema_data['phpbb_topics_posted'] = array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'topic_id' => array('UINT', 0),
+ 'topic_posted' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('user_id', 'topic_id'),
+);
+
+$schema_data['phpbb_topics_watch'] = array(
+ 'COLUMNS' => array(
+ 'topic_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'notify_status' => array('BOOL', 0),
+ ),
+ 'KEYS' => array(
+ 'topic_id' => array('INDEX', 'topic_id'),
+ 'user_id' => array('INDEX', 'user_id'),
+ 'notify_stat' => array('INDEX', 'notify_status'),
+ ),
+);
+
+$schema_data['phpbb_user_notifications'] = array(
+ 'COLUMNS' => array(
+ 'item_type' => array('VCHAR:255', ''),
+ 'item_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'method' => array('VCHAR:255', ''),
+ 'notify' => array('BOOL', 1),
+ ),
+);
+
+$schema_data['phpbb_user_group'] = array(
+ 'COLUMNS' => array(
+ 'group_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'group_leader' => array('BOOL', 0),
+ 'user_pending' => array('BOOL', 1),
+ ),
+ 'KEYS' => array(
+ 'group_id' => array('INDEX', 'group_id'),
+ 'user_id' => array('INDEX', 'user_id'),
+ 'group_leader' => array('INDEX', 'group_leader'),
+ ),
+);
+
+$schema_data['phpbb_users'] = array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', NULL, 'auto_increment'),
+ 'user_type' => array('TINT:2', 0),
+ 'group_id' => array('UINT', 3),
+ 'user_permissions' => array('MTEXT', ''),
+ 'user_perm_from' => array('UINT', 0),
+ 'user_ip' => array('VCHAR:40', ''),
+ 'user_regdate' => array('TIMESTAMP', 0),
+ 'username' => array('VCHAR_CI', ''),
+ 'username_clean' => array('VCHAR_CI', ''),
+ 'user_password' => array('VCHAR_UNI:40', ''),
+ 'user_passchg' => array('TIMESTAMP', 0),
+ 'user_pass_convert' => array('BOOL', 0),
+ 'user_email' => array('VCHAR_UNI:100', ''),
+ 'user_email_hash' => array('BINT', 0),
+ 'user_birthday' => array('VCHAR:10', ''),
+ 'user_lastvisit' => array('TIMESTAMP', 0),
+ 'user_lastmark' => array('TIMESTAMP', 0),
+ 'user_lastpost_time' => array('TIMESTAMP', 0),
+ 'user_lastpage' => array('VCHAR_UNI:200', ''),
+ 'user_last_confirm_key' => array('VCHAR:10', ''),
+ 'user_last_search' => array('TIMESTAMP', 0),
+ 'user_warnings' => array('TINT:4', 0),
+ 'user_last_warning' => array('TIMESTAMP', 0),
+ 'user_login_attempts' => array('TINT:4', 0),
+ 'user_inactive_reason' => array('TINT:2', 0),
+ 'user_inactive_time' => array('TIMESTAMP', 0),
+ 'user_posts' => array('UINT', 0),
+ 'user_lang' => array('VCHAR:30', ''),
+ 'user_timezone' => array('VCHAR:100', 'UTC'),
+ 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
+ 'user_style' => array('UINT', 0),
+ 'user_rank' => array('UINT', 0),
+ 'user_colour' => array('VCHAR:6', ''),
+ 'user_new_privmsg' => array('INT:4', 0),
+ 'user_unread_privmsg' => array('INT:4', 0),
+ 'user_last_privmsg' => array('TIMESTAMP', 0),
+ 'user_message_rules' => array('BOOL', 0),
+ 'user_full_folder' => array('INT:11', -3),
+ 'user_emailtime' => array('TIMESTAMP', 0),
+ 'user_topic_show_days' => array('USINT', 0),
+ 'user_topic_sortby_type' => array('VCHAR:1', 't'),
+ 'user_topic_sortby_dir' => array('VCHAR:1', 'd'),
+ 'user_post_show_days' => array('USINT', 0),
+ 'user_post_sortby_type' => array('VCHAR:1', 't'),
+ 'user_post_sortby_dir' => array('VCHAR:1', 'a'),
+ 'user_notify' => array('BOOL', 0),
+ 'user_notify_pm' => array('BOOL', 1),
+ 'user_notify_type' => array('TINT:4', 0),
+ 'user_allow_pm' => array('BOOL', 1),
+ 'user_allow_viewonline' => array('BOOL', 1),
+ 'user_allow_viewemail' => array('BOOL', 1),
+ 'user_allow_massemail' => array('BOOL', 1),
+ 'user_options' => array('UINT:11', 230271),
+ 'user_avatar' => array('VCHAR', ''),
+ 'user_avatar_type' => array('VCHAR:255', ''),
+ 'user_avatar_width' => array('USINT', 0),
+ 'user_avatar_height' => array('USINT', 0),
+ 'user_sig' => array('MTEXT_UNI', ''),
+ 'user_sig_bbcode_uid' => array('VCHAR:8', ''),
+ 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''),
+ 'user_from' => array('VCHAR_UNI:100', ''),
+ 'user_icq' => array('VCHAR:15', ''),
+ 'user_aim' => array('VCHAR_UNI', ''),
+ 'user_yim' => array('VCHAR_UNI', ''),
+ 'user_msnm' => array('VCHAR_UNI', ''),
+ 'user_jabber' => array('VCHAR_UNI', ''),
+ 'user_website' => array('VCHAR_UNI:200', ''),
+ 'user_occ' => array('TEXT_UNI', ''),
+ 'user_interests' => array('TEXT_UNI', ''),
+ 'user_actkey' => array('VCHAR:32', ''),
+ 'user_newpasswd' => array('VCHAR_UNI:40', ''),
+ 'user_form_salt' => array('VCHAR_UNI:32', ''),
+ 'user_new' => array('BOOL', 1),
+ 'user_reminded' => array('TINT:4', 0),
+ 'user_reminded_time' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => 'user_id',
+ 'KEYS' => array(
+ 'user_birthday' => array('INDEX', 'user_birthday'),
+ 'user_email_hash' => array('INDEX', 'user_email_hash'),
+ 'user_type' => array('INDEX', 'user_type'),
+ 'username_clean' => array('UNIQUE', 'username_clean'),
+ ),
+);
+
+$schema_data['phpbb_warnings'] = array(
+ 'COLUMNS' => array(
+ 'warning_id' => array('UINT', NULL, 'auto_increment'),
+ 'user_id' => array('UINT', 0),
+ 'post_id' => array('UINT', 0),
+ 'log_id' => array('UINT', 0),
+ 'warning_time' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => 'warning_id',
+);
+
+$schema_data['phpbb_words'] = array(
+ 'COLUMNS' => array(
+ 'word_id' => array('UINT', NULL, 'auto_increment'),
+ 'word' => array('VCHAR_UNI', ''),
+ 'replacement' => array('VCHAR_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'word_id',
+);
+
+$schema_data['phpbb_zebra'] = array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'zebra_id' => array('UINT', 0),
+ 'friend' => array('BOOL', 0),
+ 'foe' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('user_id', 'zebra_id'),
+);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 086d8b9dd0..03a4895433 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2343,7 +2343,6 @@ function phpbb_generate_template_pagination($template, $base_url, $block_var_nam
$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) : '',
@@ -2383,7 +2382,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));
@@ -2413,6 +2412,7 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
{
global $_SID, $_EXTRA_URL, $phpbb_hook;
global $phpbb_dispatcher;
+ global $symfony_request, $phpbb_root_path;
if ($params === '' || (is_array($params) && empty($params)))
{
@@ -2420,6 +2420,12 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
$params = false;
}
+ $corrected_path = $symfony_request !== null ? phpbb_get_web_root_path($symfony_request, $phpbb_root_path) : '';
+ if ($corrected_path)
+ {
+ $url = substr($corrected_path . $url, strlen($phpbb_root_path));
+ }
+
$append_sid_overwrite = false;
/**
@@ -3199,7 +3205,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 +3232,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 +3373,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(
@@ -5051,7 +5080,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, $symfony_request;
if (defined('HEADER_INC'))
{
@@ -5208,7 +5237,11 @@ 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.
+ $corrected_path = $symfony_request !== null ? phpbb_get_web_root_path($symfony_request, $phpbb_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'];
@@ -5300,7 +5333,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
'U_RETURN_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
'U_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=popup'),
- 'UA_POPUP_PM' => addslashes(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;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,
@@ -5390,8 +5422,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'T_UPLOAD' => $config['upload_path'],
'SITE_LOGO_IMG' => $user->img('site_logo'),
-
- 'A_COOKIE_SETTINGS' => addslashes('; path=' . $config['cookie_path'] . ((!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain']) . ((!$config['cookie_secure']) ? '' : '; secure')),
));
// application/xhtml+xml not used because of IE
@@ -5684,6 +5714,16 @@ function phpbb_convert_30_dbms_to_31($dbms)
*/
function phpbb_create_symfony_request(\phpbb\request\request $request)
{
+ // If we have already gotten it, don't go back through all the trouble of
+ // creating it again; instead, just return it. This allows multiple calls
+ // of this method so we don't have to globalize $symfony_request in other
+ // functions.
+ static $symfony_request;
+ if (null !== $symfony_request)
+ {
+ return $symfony_request;
+ }
+
// This function is meant to sanitize the global input arrays
$sanitizer = function(&$value, $key) {
$type_cast_helper = new \phpbb\request\type_cast_helper();
@@ -5703,21 +5743,45 @@ function phpbb_create_symfony_request(\phpbb\request\request $request)
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'];
+ $symfony_request = new Request($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters);
+ return $symfony_request;
+}
+
+/**
+* Get a relative root path from the current URL
+*
+* @param Request $symfony_request Symfony Request object
+*/
+function phpbb_get_web_root_path(Request $symfony_request, $phpbb_root_path = '')
+{
+ global $phpbb_container;
+
+ static $path;
+ if (null !== $path)
+ {
+ return $path;
+ }
- // Remove the query string from REQUEST_URI
- if ($pos = strpos($request_uri, '?'))
+ $path_info = $symfony_request->getPathInfo();
+ if ($path_info === '/')
{
- $request_uri = substr($request_uri, 0, $pos);
+ $path = $phpbb_root_path;
+ return $path;
}
- // Add the path info (i.e. controller route) to the REQUEST_URI
- $server_parameters['REQUEST_URI'] = $request_uri . $path_info;
- $server_parameters['SCRIPT_NAME'] = '';
+ $filesystem = $phpbb_container->get('filesystem');
+ $path_info = $filesystem->clean_path($path_info);
+
+ // Do not count / at start of path
+ $corrections = substr_count(substr($path_info, 1), '/');
+
+ // When URL Rewriting is enabled, app.php is optional. We have to
+ // correct for it not being there
+ if (strpos($symfony_request->getRequestUri(), $symfony_request->getScriptName()) === false)
+ {
+ $corrections -= 1;
+ }
- return new Request($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters);
+ $path = $phpbb_root_path . str_repeat('../', $corrections);
+ return $path;
}
diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php
index 4412c5973c..62559fbf36 100644
--- a/phpBB/includes/functions_container.php
+++ b/phpBB/includes/functions_container.php
@@ -118,7 +118,10 @@ function phpbb_create_container(array $extensions, $phpbb_root_path, $php_ext)
*/
function phpbb_create_install_container($phpbb_root_path, $php_ext)
{
- $core = new \phpbb\di\extension\core($phpbb_root_path);
+ $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);
$container = phpbb_create_container(array($core), $phpbb_root_path, $php_ext);
$container->setParameter('core.root_path', $phpbb_root_path);
@@ -136,6 +139,32 @@ function phpbb_create_install_container($phpbb_root_path, $php_ext)
}
/**
+* Create updater container
+*
+* @param string $phpbb_root_path Root path
+* @param string $php_ext PHP Extension
+* @param array $config_path Path to config directory
+* @return ContainerBuilder object (compiled)
+*/
+function phpbb_create_update_container($phpbb_root_path, $php_ext, $config_path)
+{
+ $config_file = $phpbb_root_path . 'config.' . $php_ext;
+ return phpbb_create_compiled_container(
+ $config_file,
+ array(
+ 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(),
+ ),
+ $phpbb_root_path,
+ $php_ext
+ );
+}
+
+/**
* Create a compiled ContainerBuilder object
*
* @param array $extensions Array of Container extension objects
@@ -146,11 +175,6 @@ function phpbb_create_install_container($phpbb_root_path, $php_ext)
*/
function phpbb_create_compiled_container($config_file, array $extensions, array $passes, $phpbb_root_path, $php_ext)
{
- $installed_exts = phpbb_bootstrap_enabled_exts($config_file, $phpbb_root_path);
-
- // Now pass the enabled extension paths into the ext compiler extension
- $extensions[] = new \phpbb\di\extension\ext($installed_exts);
-
// Create the final container to be compiled and cached
$container = phpbb_create_container($extensions, $phpbb_root_path, $php_ext);
@@ -231,11 +255,14 @@ function phpbb_create_dumped_container_unless_debug($config_file, array $extensi
function phpbb_create_default_container($phpbb_root_path, $php_ext)
{
$config_file = $phpbb_root_path . 'config.' . $php_ext;
+ $installed_exts = phpbb_bootstrap_enabled_exts($config_file, $phpbb_root_path);
+
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),
+ new \phpbb\di\extension\core($phpbb_root_path . 'config'),
+ new \phpbb\di\extension\ext($installed_exts),
),
array(
new \phpbb\di\pass\collection_pass(),
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index c54cc25f34..05d3c5fde2 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -413,7 +413,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text
static $bbcode;
global $phpbb_dispatcher;
- if (!$text)
+ if ($text === '')
{
return '';
}
@@ -505,7 +505,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
$uid = $bitfield = '';
$flags = (($allow_bbcode) ? OPTION_FLAG_BBCODE : 0) + (($allow_smilies) ? OPTION_FLAG_SMILIES : 0) + (($allow_urls) ? OPTION_FLAG_LINKS : 0);
- if (!$text)
+ if ($text === '')
{
return;
}
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index d5f3c8725e..e5eff46fe0 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -21,7 +21,7 @@ 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;
@@ -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'));
@@ -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);
}
}
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index 99c24fcb19..80477684a8 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -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', '');
@@ -508,7 +508,7 @@ class p_master
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'));
}
}
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 03565c27bb..ce1238d8e0 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1095,25 +1095,20 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
$poster_id = $row['user_id'];
$post_subject = $row['post_subject'];
- $message = censor_text($row['post_text']);
$decoded_message = false;
if ($show_quote_button && $auth->acl_get('f_reply', $forum_id))
{
- $decoded_message = $message;
+ $decoded_message = censor_text($row['post_text']);
decode_message($decoded_message, $row['bbcode_uid']);
$decoded_message = bbcode_nl2br($decoded_message);
}
- if ($row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message, !$row['enable_smilies']);
+ $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
+ $parse_flags |= ($row['enable_smilies'] ? OPTION_FLAG_SMILIES : 0);
+ $message = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, true);
if (!empty($attachments[$row['post_id']]))
{
@@ -1995,6 +1990,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
}
+ $first_post_has_topic_info = ($post_mode == 'edit_first_post' &&
+ (($post_visibility == ITEM_DELETED && $data['topic_posts_softdeleted'] == 1) ||
+ ($post_visibility == ITEM_UNAPPROVED && $data['topic_posts_unapproved'] == 1) ||
+ ($post_visibility == ITEM_APPROVED && $data['topic_posts_approved'] == 1)));
// Fix the post's and topic's visibility and first/last post information, when the post is edited
if (($post_mode != 'post' && $post_mode != 'reply') && $data['post_visibility'] != $post_visibility)
{
@@ -2007,7 +2006,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
$phpbb_content_visibility->set_post_visibility($post_visibility, $data['post_id'], $data['topic_id'], $data['forum_id'], $user->data['user_id'], time(), '', $is_starter, $is_latest);
}
- else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies']))
+ else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || $first_post_has_topic_info)
{
if ($post_visibility == ITEM_APPROVED || $data['topic_visibility'] == $post_visibility)
{
@@ -2167,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,
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index f69b2946f7..a2a79e032f 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -2018,14 +2018,11 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$decoded_message = bbcode_nl2br($decoded_message);
}
-
- if ($row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message, !$row['enable_smilies']);
+
+ $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
+ $parse_flags |= ($row['enable_smilies'] ? OPTION_FLAG_SMILIES : 0);
+
+ $message = generate_text_for_display($message, $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false);
$subject = censor_text($subject);
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 56fcef29e6..c248be0864 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -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();
-
- 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']);
- }
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
- $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;
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index 99ff397a66..f0452b37a5 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -115,17 +115,9 @@ class mcp_pm_reports
}
// Process message, leave it uncensored
- $message = $pm_info['message_text'];
+ $parse_flags = ($pm_info['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($pm_info['message_text'], $pm_info['bbcode_uid'], $pm_info['bbcode_bitfield'], $parse_flags, false);
- if ($pm_info['bbcode_bitfield'])
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode($pm_info['bbcode_bitfield']);
- $bbcode->bbcode_second_pass($message, $pm_info['bbcode_uid'], $pm_info['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
$report['report_text'] = make_clickable(bbcode_nl2br($report['report_text']));
if ($pm_info['message_attachment'] && $auth->acl_get('u_pm_download'))
@@ -169,6 +161,7 @@ class mcp_pm_reports
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&amp;mode=pm_report_details&amp;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&amp;mode=pm_report_details&amp;r=' . $report_id),
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index 734fa96a78..06f27655ae 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -125,17 +125,8 @@ function mcp_post_details($id, $mode, $action)
$post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false;
// Process message, leave it uncensored
- $message = $post_info['post_text'];
-
- if ($post_info['bbcode_bitfield'])
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode($post_info['bbcode_bitfield']);
- $bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = ($post_info['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($post_info['post_text'], $post_info['bbcode_uid'], $post_info['bbcode_bitfield'], $parse_flags, false);
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
{
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 81965df463..db461d07fa 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -206,17 +206,8 @@ class mcp_queue
$post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false;
// Process message, leave it uncensored
- $message = $post_info['post_text'];
-
- if ($post_info['bbcode_bitfield'])
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode($post_info['bbcode_bitfield']);
- $bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = ($post_info['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($post_info['post_text'], $post_info['bbcode_uid'], $post_info['bbcode_bitfield'], $parse_flags, false);
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
{
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 72400ce623..8db5bb9727 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -187,8 +187,9 @@ class mcp_reports
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
- 'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == POST_UNAPPROVED),
+ '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&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index d0e4a2e057..9c294b96c8 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -207,13 +207,8 @@ function mcp_topic_view($id, $mode, $action)
$message = $row['post_text'];
$post_subject = ($row['post_subject'] != '') ? $row['post_subject'] : $topic_info['topic_title'];
- if ($row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($message, $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false);
if (!empty($attachments[$row['post_id']]))
{
@@ -674,10 +669,10 @@ function merge_posts($topic_id, $to_topic_id)
}
// If the topic no longer exist, we will update the topic watch table.
- phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', $topic_ids, $to_topic_id);
+ phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', array($topic_id), $to_topic_id);
// If the topic no longer exist, we will update the bookmarks table.
- phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', $topic_id, $to_topic_id);
+ phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', array($topic_id), $to_topic_id);
}
// Link to the new topic
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index fedf672249..3ffd75ac78 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -289,19 +289,8 @@ class mcp_warn
// We want to make the message available here as a reminder
// Parse the message and subject
- $message = censor_text($user_row['post_text']);
-
- // Second parse bbcode here
- if ($user_row['bbcode_bitfield'])
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
-
- $bbcode = new bbcode($user_row['bbcode_bitfield']);
- $bbcode->bbcode_second_pass($message, $user_row['bbcode_uid'], $user_row['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = OPTION_FLAG_SMILIES | ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
+ $message = generate_text_for_display($user_row['post_text'], $user_row['bbcode_uid'], $user_row['bbcode_bitfield'], $parse_flags, true);
// Generate the appropriate user information for the user we are looking at
if (!function_exists('phpbb_get_user_avatar'))
diff --git a/phpBB/includes/ucp/info/ucp_auth_link.php b/phpBB/includes/ucp/info/ucp_auth_link.php
new file mode 100644
index 0000000000..ee88b15ea8
--- /dev/null
+++ b/phpBB/includes/ucp/info/ucp_auth_link.php
@@ -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()
+ {
+ }
+}
diff --git a/phpBB/includes/ucp/ucp_auth_link.php b/phpBB/includes/ucp/ucp_auth_link.php
new file mode 100644
index 0000000000..5a5653e0b2
--- /dev/null
+++ b/phpBB/includes/ucp/ucp_auth_link.php
@@ -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_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_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_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';
+ }
+}
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index ff47e4d37d..a75d2e9bfc 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -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']);
diff --git a/phpBB/includes/ucp/ucp_login_link.php b/phpBB/includes/ucp/ucp_login_link.php
new file mode 100644
index 0000000000..4620eb9b9e
--- /dev/null
+++ b/phpBB/includes/ucp/ucp_login_link.php
@@ -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_interface::POST);
+ $login_password = $request->untrimmed_variable('login_password', '', true, phpbb_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_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_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);
+ }
+}
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index b7d2dd6821..c7b4489daf 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -76,17 +76,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
$user_info = get_user_information($author_id, $message_row);
// Parse the message and subject
- $message = censor_text($message_row['message_text']);
-
- // Second parse bbcode here
- if ($message_row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($message, $message_row['bbcode_uid'], $message_row['bbcode_bitfield']);
- }
-
- // Always process smilies after parsing bbcodes
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = ($message_row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($message_row['message_text'], $message_row['bbcode_uid'], $message_row['bbcode_bitfield'], $parse_flags, true);
// Replace naughty words such as farty pants
$message_row['message_subject'] = censor_text($message_row['message_subject']);
@@ -160,21 +151,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// End signature parsing, only if needed
if ($signature)
{
- $signature = censor_text($signature);
-
- if ($user_info['user_sig_bbcode_bitfield'])
- {
- if ($bbcode === false)
- {
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode($user_info['user_sig_bbcode_bitfield']);
- }
-
- $bbcode->bbcode_second_pass($signature, $user_info['user_sig_bbcode_uid'], $user_info['user_sig_bbcode_bitfield']);
- }
-
- $signature = bbcode_nl2br($signature);
- $signature = smiley_text($signature);
+ $parse_flags = ($user_info['user_sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $signature = generate_text_for_display($signature, $user_info['user_sig_bbcode_uid'], $user_info['user_sig_bbcode_bitfield'], $parse_flags, true);
}
$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 7c3286c1d1..e80cc2dce3 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -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'];
@@ -267,7 +317,7 @@ class ucp_prefs
$limit_topic_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_topic_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
- $sort_by_topic_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views');
+ $sort_by_topic_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_posts_approved', 's' => 't.topic_title', 'v' => 't.topic_views');
// Post ordering options
$limit_post_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
@@ -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'];
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 03081cffb6..8ae7acaa11 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -546,6 +546,9 @@ class ucp_profile
// Build custom bbcodes array
display_custom_bbcodes();
+ // Generate smiley listing
+ generate_smilies('inline', 0);
+
break;
case 'avatar':
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 70fbfe46fb..44621e6dea 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -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)
@@ -38,7 +38,7 @@ class ucp_register
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
$coppa = $request->is_set('coppa') ? (int) $request->variable('coppa', false) : false;
- $agreed = (int) $request->variable('agreed', false);
+ $agreed = $request->variable('agreed', false);
$submit = $request->is_set_post('submit');
$change_lang = request_var('change_lang', '');
$user_lang = request_var('lang', $user->lang_name);
@@ -63,7 +63,7 @@ class ucp_register
$submit = false;
// Setting back agreed to let the user view the agreement in his/her language
- $agreed = ($request->variable('change_lang', false)) ? 0 : $agreed;
+ $agreed = false;
}
$user->lang_name = $user_lang = $use_lang;
@@ -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) ? '&amp;change_lang=' . urlencode($change_lang) : '';
$add_coppa = ($coppa !== false) ? '&amp;coppa=' . $coppa : '';
- $s_hidden_fields = array(
- 'change_lang' => $change_lang,
- );
+ $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_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_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;
+ }
}
diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php
index 63bde7f054..b3def63896 100644
--- a/phpBB/includes/ucp/ucp_remind.php
+++ b/phpBB/includes/ucp/ucp_remind.php
@@ -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),
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 74106ca31f..fa8ec6b6ce 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -21,26 +21,6 @@ define('IN_INSTALL', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
-if (!function_exists('phpbb_require_updated'))
-{
- function phpbb_require_updated($path, $optional = false)
- {
- global $phpbb_root_path;
-
- $new_path = $phpbb_root_path . 'install/update/new/' . $path;
- $old_path = $phpbb_root_path . $path;
-
- if (file_exists($new_path))
- {
- require($new_path);
- }
- else if (!$optional || file_exists($old_path))
- {
- require($old_path);
- }
- }
-}
-
function phpbb_end_update($cache, $config)
{
$cache->purge();
@@ -69,7 +49,7 @@ function phpbb_end_update($cache, $config)
exit_handler();
}
-phpbb_require_updated('includes/startup.' . $phpEx);
+require($phpbb_root_path . 'includes/startup.' . $phpEx);
include($phpbb_root_path . 'config.' . $phpEx);
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
@@ -88,7 +68,9 @@ require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
require($phpbb_root_path . 'includes/functions_container.' . $phpEx);
+require($phpbb_root_path . 'config.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
+include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Set PHP error handler to ours
@@ -101,11 +83,10 @@ $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),
+ new \phpbb\di\extension\core($phpbb_root_path . 'config/'),
);
$container_passes = array(
new \phpbb\di\pass\collection_pass(),
- //new \phpbb\di\pass\kernel_pass(),
);
$phpbb_container = phpbb_create_container($container_extensions, $phpbb_root_path, $phpEx);
@@ -263,8 +244,8 @@ while (!$migrator->finished())
// Are we approaching the time limit? If so we want to pause the update and continue after refreshing
if ((time() - $update_start_time) >= $safe_time_limit)
{
- echo $user->lang['DATABASE_UPDATE_NOT_COMPLETED'] . '<br />';
- echo '<a href="' . append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=' . $request->variable('type', 0) . '&amp;language=' . $user->lang['USER_LANG']) . '">' . $user->lang['DATABASE_UPDATE_CONTINUE'] . '</a>';
+ echo '<br />' . $user->lang['DATABASE_UPDATE_NOT_COMPLETED'] . '<br /><br />';
+ echo '<a href="' . append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=' . $request->variable('type', 0) . '&amp;language=' . $request->variable('language', 'en')) . '" class="button1">' . $user->lang['DATABASE_UPDATE_CONTINUE'] . '</a>';
phpbb_end_update($cache, $config);
}
@@ -280,7 +261,7 @@ echo $user->lang['DATABASE_UPDATE_COMPLETE'] . '<br />';
if ($request->variable('type', 0))
{
echo $user->lang['INLINE_UPDATE_SUCCESSFUL'] . '<br /><br />';
- echo '<a href="' . append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update&amp;sub=file_check&amp;language=' . $user->lang['USER_LANG']) . '" class="button1">' . $user->lang['CONTINUE_UPDATE_NOW'] . '</a>';
+ echo '<a href="' . append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update&amp;sub=update_db&amp;language=' . $request->variable('language', 'en')) . '" class="button1">' . $user->lang['CONTINUE_UPDATE_NOW'] . '</a>';
}
else
{
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index b01dfa61ed..90d840aa31 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -28,7 +28,7 @@ if (version_compare(PHP_VERSION, '5.3.3') < 0)
function phpbb_require_updated($path, $optional = false)
{
- global $phpbb_root_path;
+ global $phpbb_root_path, $table_prefix;
$new_path = $phpbb_root_path . 'install/update/new/' . $path;
$old_path = $phpbb_root_path . $path;
@@ -43,6 +43,23 @@ function phpbb_require_updated($path, $optional = false)
}
}
+function phpbb_include_updated($path, $optional = false)
+{
+ global $phpbb_root_path;
+
+ $new_path = $phpbb_root_path . 'install/update/new/' . $path;
+ $old_path = $phpbb_root_path . $path;
+
+ if (file_exists($new_path))
+ {
+ include($new_path);
+ }
+ else if (!$optional || file_exists($old_path))
+ {
+ include($old_path);
+ }
+}
+
phpbb_require_updated('includes/startup.' . $phpEx);
// Try to override some limits - maybe it helps some...
@@ -78,19 +95,22 @@ $phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relati
$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path;
// Include essential scripts
-require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+phpbb_require_updated('phpbb/class_loader.' . $phpEx);
-require($phpbb_root_path . 'includes/functions.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_container.' . $phpEx);
+phpbb_require_updated('includes/functions.' . $phpEx);
+phpbb_require_updated('includes/functions_container.' . $phpEx);
phpbb_require_updated('includes/functions_content.' . $phpEx, true);
-include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_install.' . $phpEx);
+phpbb_include_updated('includes/functions_admin.' . $phpEx);
+phpbb_include_updated('includes/utf/utf_normalizer.' . $phpEx);
+phpbb_include_updated('includes/utf/utf_tools.' . $phpEx);
+phpbb_require_updated('includes/functions_install.' . $phpEx);
// Setup class loader first
-$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}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->register();
$phpbb_class_loader_ext = new \phpbb\class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();
@@ -108,7 +128,7 @@ $request = $phpbb_container->get('request');
request_var('', 0, false, false, $request); // "dependency injection" for a function
// Try and load an appropriate language if required
-$language = basename(request_var('language', ''));
+$language = basename($request->variable('language', ''));
if ($request->header('Accept-Language') && !$language)
{
@@ -167,11 +187,23 @@ if (!file_exists($phpbb_root_path . 'language/' . $language) || !is_dir($phpbb_r
}
// And finally, load the relevant language files
-include($phpbb_root_path . 'language/' . $language . '/common.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/acp/common.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/acp/board.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/install.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/posting.' . $phpEx);
+$load_lang_files = array('common', 'acp/common', 'acp/board', 'install', 'posting');
+$new_path = $phpbb_root_path . 'install/update/new/language/' . $language . '/';
+$old_path = $phpbb_root_path . 'language/' . $language . '/';
+
+// NOTE: we can not use "phpbb_include_updated" as the files uses vars which would be required
+// to be global while loading.
+foreach ($load_lang_files as $lang_file)
+{
+ if (file_exists($new_path . $lang_file . '.' . $phpEx))
+ {
+ include($new_path . $lang_file . '.' . $phpEx);
+ }
+ else
+ {
+ include($old_path . $lang_file . '.' . $phpEx);
+ }
+}
// usually we would need every single constant here - and it would be consistent. For 3.0.x, use a dirty hack... :(
@@ -181,8 +213,8 @@ define('CHMOD_READ', 4);
define('CHMOD_WRITE', 2);
define('CHMOD_EXECUTE', 1);
-$mode = request_var('mode', 'overview');
-$sub = request_var('sub', '');
+$mode = $request->variable('mode', 'overview');
+$sub = $request->variable('sub', '');
// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
@@ -212,12 +244,20 @@ $config = new \phpbb\config\config(array(
'load_tplcompile' => '1'
));
+<<<<<<< HEAD
$phpbb_style_resource_locator = new \phpbb\style\resource_locator();
$phpbb_style_path_provider = new \phpbb\style\path_provider();
$template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context());
$phpbb_style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider, $template);
$phpbb_style->set_ext_dir_prefix('adm/');
$phpbb_style->set_custom_style('admin', $phpbb_admin_path . 'style', array(), '');
+=======
+$template = new phpbb_template_twig($phpbb_root_path, $phpEx, $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');
+$template->set_custom_style('adm', $paths);
+
+>>>>>>> github-phpbb/develop
$template->assign_var('T_ASSETS_PATH', '../assets');
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index b61ee277b4..b7b358ab2f 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -39,7 +39,7 @@ if (!empty($setmodules))
'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
'module_order' => 30,
'module_subs' => '',
- 'module_stages' => array('INTRO', 'VERSION_CHECK', 'UPDATE_DB', 'FILE_CHECK', 'UPDATE_FILES'),
+ 'module_stages' => array('INTRO', 'VERSION_CHECK', 'FILE_CHECK', 'UPDATE_FILES', 'UPDATE_DB'),
'module_reqs' => ''
);
}
@@ -57,7 +57,6 @@ class install_update extends module
var $new_location;
var $latest_version;
var $current_version;
- var $unequal_version;
var $update_to_version;
@@ -71,18 +70,22 @@ 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,
+ // using the new container with a dbal connection will fail with the following PHP Notice:
+ // Object of class phpbb_request_deactivated_super_global could not be converted to int
+ $request->enable_super_globals();
+
// Create a normal container now
- $phpbb_container = phpbb_create_default_container($phpbb_root_path, $phpEx);
+ $phpbb_container = phpbb_create_update_container($phpbb_root_path, $phpEx, $phpbb_root_path . 'install/update/new/config');
// Writes into global $cache
$cache = $phpbb_container->get('cache');
$this->tpl_name = 'install_update';
$this->page_title = 'UPDATE_INSTALLATION';
- $this->unequal_version = false;
$this->old_location = $phpbb_root_path . 'install/update/old/';
$this->new_location = $phpbb_root_path . 'install/update/new/';
@@ -125,7 +128,7 @@ class install_update extends module
$config['default_lang'] = $language;
$user->data['user_lang'] = $language;
- $user->setup(array('common', 'acp/common', 'acp/board', 'install', 'posting'));
+ $user->add_lang(array('common', 'acp/common', 'acp/board', 'install', 'posting'));
// Reset the default_lang
$config['default_lang'] = $config_default_lang;
@@ -138,7 +141,9 @@ class install_update extends module
}
// Set custom template again. ;)
- $phpbb_style->set_custom_style('admin', $phpbb_admin_path . 'style', array(), '');
+ $paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style');
+ $paths = array_filter($paths, 'is_dir');
+ $template->set_custom_style('adm', $paths);
$template->assign_vars(array(
'S_USER_LANG' => $user->lang['USER_LANG'],
@@ -192,8 +197,6 @@ class install_update extends module
// Check if the update files are actually meant to update from the current version
if ($this->current_version != $this->update_info['version']['from'])
{
- $this->unequal_version = true;
-
$template->assign_vars(array(
'S_ERROR' => true,
'ERROR_MSG' => sprintf($user->lang['INCOMPATIBLE_UPDATE_FILES'], $this->current_version, $this->update_info['version']['from'], $this->update_info['version']['to']),
@@ -201,10 +204,8 @@ class install_update extends module
}
// Check if the update files stored are for the latest version...
- if ($this->latest_version != $this->update_info['version']['to'])
+ if (version_compare(strtolower($this->latest_version), strtolower($this->update_info['version']['to']), '>'))
{
- $this->unequal_version = true;
-
$template->assign_vars(array(
'S_WARNING' => true,
'WARNING_MSG' => sprintf($user->lang['OLD_UPDATE_FILES'], $this->update_info['version']['from'], $this->update_info['version']['to'], $this->latest_version))
@@ -222,14 +223,15 @@ class install_update extends module
if ($this->test_update === false)
{
- // Got the updater template itself updated? If so, we are able to directly use it - but only if all three files are present
- if (in_array($phpbb_adm_relative_path . 'style/install_update.html', $this->update_info['files']))
+ // What about the language file? Got it updated?
+ if (in_array('language/' . $language . '/install.' . $phpEx, $this->update_info['files']))
{
- $this->tpl_name = '../../install/update/new/adm/style/install_update';
+ $lang = array();
+ include($this->new_location . 'language/' . $language . '/install.' . $phpEx);
+ // this is the user's language.. just merge it
+ $user->lang = array_merge($user->lang, $lang);
}
-
- // What about the language file? Got it updated?
- if (in_array('language/en/install.' . $phpEx, $this->update_info['files']))
+ if ($language != 'en' && in_array('language/en/install.' . $phpEx, $this->update_info['files']))
{
$lang = array();
include($this->new_location . 'language/en/install.' . $phpEx);
@@ -273,18 +275,17 @@ class install_update extends module
$this->page_title = 'STAGE_VERSION_CHECK';
$template->assign_vars(array(
- 'S_UP_TO_DATE' => $up_to_date,
'S_VERSION_CHECK' => true,
- 'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=file_check"),
- 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=update_db"),
+ 'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=file_check"),
+ 'S_UP_TO_DATE' => $up_to_date,
'LATEST_VERSION' => $this->latest_version,
- 'CURRENT_VERSION' => $this->current_version)
- );
+ 'CURRENT_VERSION' => $this->current_version,
+ ));
// Print out version the update package updates to
- if ($this->unequal_version)
+ if ($this->latest_version != $this->update_info['version']['to'])
{
$template->assign_var('PACKAGE_VERSION', $this->update_info['version']['to']);
}
@@ -302,30 +303,6 @@ class install_update extends module
break;
case 'update_db':
-
- // Make sure the database update is valid for the latest version
- $valid = false;
- $updates_to_version = '';
-
- if (file_exists($phpbb_root_path . 'install/database_update.' . $phpEx))
- {
- include_once($phpbb_root_path . 'install/database_update.' . $phpEx);
-
- if ($updates_to_version === $this->update_info['version']['to'])
- {
- $valid = true;
- }
- }
-
- // Should not happen at all
- if (!$valid)
- {
- trigger_error($user->lang['DATABASE_UPDATE_INFO_OLD'], E_USER_ERROR);
- }
-
- // Just a precaution
- $cache->purge();
-
// Redirect the user to the database update script with some explanations...
$template->assign_vars(array(
'S_DB_UPDATE' => true,
@@ -333,8 +310,14 @@ class install_update extends module
'U_DB_UPDATE' => append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=1&amp;language=' . $user->data['user_lang']),
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=update_db"),
'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=file_check"),
+ 'L_EVERYTHING_UP_TO_DATE' => $user->lang('EVERYTHING_UP_TO_DATE', append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login&amp;redirect=' . $phpbb_adm_relative_path . 'index.php%3Fi=send_statistics%26mode=send_statistics')),
));
+ // Do not display incompatible package note after successful update
+ if ($config['version'] == $this->update_info['version']['to'])
+ {
+ $template->assign_var('S_ERROR', false);
+ }
break;
case 'file_check':
@@ -500,17 +483,30 @@ class install_update extends module
$template->assign_vars(array(
'S_FILE_CHECK' => true,
'S_ALL_UP_TO_DATE' => $all_up_to_date,
- 'L_ALL_FILES_UP_TO_DATE' => $user->lang('ALL_FILES_UP_TO_DATE', append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login&amp;redirect=' . $phpbb_adm_relative_path . 'index.php%3Fi=send_statistics%26mode=send_statistics')),
'S_VERSION_UP_TO_DATE' => $up_to_date,
+ 'S_UP_TO_DATE' => $up_to_date,
'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=file_check"),
'U_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=update_files"),
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=update_db"),
));
+ // Since some people try to update to RC releases, but phpBB.com tells them the last version is the version they currently run
+ // we are faced with the updater thinking the database schema is up-to-date; which it is, but should be updated none-the-less
+ // We now try to cope with this by triggering the update process
+ if (version_compare(str_replace('rc', 'RC', strtolower($this->current_version)), str_replace('rc', 'RC', strtolower($this->update_info['version']['to'])), '<'))
+ {
+ $template->assign_vars(array(
+ 'S_UP_TO_DATE' => false,
+ ));
+ }
+
if ($all_up_to_date)
{
+ global $phpbb_container;
+ $phpbb_log = $phpbb_container->get('log');
+
// Add database update to log
- add_log('admin', 'LOG_UPDATE_PHPBB', $this->current_version, $this->update_to_version);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_UPDATE_PHPBB', time(), array($this->current_version, $this->update_to_version));
$db->sql_return_on_error(true);
$db->sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'");
@@ -1089,12 +1085,6 @@ class install_update extends module
$this->tpl_name = 'install_update_diff';
- // Got the diff template itself updated? If so, we are able to directly use it
- if (in_array($phpbb_adm_relative_path . 'style/install_update_diff.html', $this->update_info['files']))
- {
- $this->tpl_name = '../../install/update/new/adm/style/install_update_diff';
- }
-
$this->page_title = 'VIEWING_FILE_DIFF';
$status = request_var('status', '');
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index ca68ea387d..1e47008d73 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -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,
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index a2a6d2192c..922313236e 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -167,6 +167,43 @@ 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'
*/
CREATE TABLE [phpbb_banlist] (
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index 2c5931bae4..e07a768387 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -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,
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 7b7be3c462..d3ed1ee15e 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -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,
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 75c01446d8..f32980e378 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -211,6 +211,34 @@ 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'
*/
CREATE TABLE phpbb_banlist (
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index c7fbe9a507..14435898eb 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -189,6 +189,30 @@ 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'
*/
CREATE SEQUENCE phpbb_banlist_seq;
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index d03fdf9de4..68f3c32f72 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -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');
@@ -170,7 +171,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_search_load'
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_anon_lastread', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_birthdays', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_memberlist', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_profile', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_pm', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewprofile', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewtopic', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_lastread', '1');
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index 72b2b276da..de88900f06 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -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 ,
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index ce15dfefb4..f786374ba6 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -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>.',
diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php
index 98679ad544..5ea151f6ea 100644
--- a/phpBB/language/en/acp/permissions_phpbb.php
+++ b/phpBB/language/en/acp/permissions_phpbb.php
@@ -33,209 +33,175 @@ if (empty($lang) || !is_array($lang))
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
/**
-* MODDERS PLEASE NOTE
+* EXTENSION-DEVELOPERS PLEASE NOTE
*
-* You are able to put your permission sets into a separate file too by
-* prefixing the new file with permissions_ and putting it into the acp
-* language folder.
-*
-* An example of how the file could look like:
-*
-* <code>
-*
-* if (empty($lang) || !is_array($lang))
-* {
-* $lang = array();
-* }
-*
-* // Adding new category
-* $lang['permission_cat']['bugs'] = 'Bugs';
-*
-* // Adding new permission set
-* $lang['permission_type']['bug_'] = 'Bug Permissions';
-*
-* // Adding the permissions
-* $lang = array_merge($lang, array(
-* 'acl_bug_view' => array('lang' => 'Can view bug reports', 'cat' => 'bugs'),
-* 'acl_bug_post' => array('lang' => 'Can post bugs', 'cat' => 'post'), // Using a phpBB category here
-* ));
-*
-* </code>
+* You are able to put your permission sets into your extension.
+* The permissions logic should be added via the 'core.permissions' event.
+* You can easily add new permission categories, types and permissions, by
+* simply merging them into the respective arrays.
+* The respective language strings should be added into a language file, that
+* start with 'permissions_', so they are automatically loaded within the ACP.
*/
-// Define categories and permission types
$lang = array_merge($lang, array(
- 'permission_cat' => array(
- 'actions' => 'Actions',
- 'content' => 'Content',
- 'forums' => 'Forums',
- 'misc' => 'Misc',
- 'permissions' => 'Permissions',
- 'pm' => 'Private messages',
- 'polls' => 'Polls',
- 'post' => 'Post',
- 'post_actions' => 'Post actions',
- 'posting' => 'Posting',
- 'profile' => 'Profile',
- 'settings' => 'Settings',
- 'topic_actions' => 'Topic actions',
- 'user_group' => 'Users &amp; Groups',
- ),
-
- // With defining 'global' here we are able to specify what is printed out if the permission is within the global scope.
- 'permission_type' => array(
- 'u_' => 'User permissions',
- 'a_' => 'Admin permissions',
- 'm_' => 'Moderator permissions',
- 'f_' => 'Forum permissions',
- 'global' => array(
- 'm_' => 'Global moderator permissions',
- ),
- ),
+ 'ACL_CAT_ACTIONS' => 'Actions',
+ 'ACL_CAT_CONTENT' => 'Content',
+ 'ACL_CAT_FORUMS' => 'Forums',
+ 'ACL_CAT_MISC' => 'Misc',
+ 'ACL_CAT_PERMISSIONS' => 'Permissions',
+ 'ACL_CAT_PM' => 'Private messages',
+ 'ACL_CAT_POLLS' => 'Polls',
+ 'ACL_CAT_POST' => 'Post',
+ 'ACL_CAT_POST_ACTIONS' => 'Post actions',
+ 'ACL_CAT_POSTING' => 'Posting',
+ 'ACL_CAT_PROFILE' => 'Profile',
+ 'ACL_CAT_SETTINGS' => 'Settings',
+ 'ACL_CAT_TOPIC_ACTIONS' => 'Topic actions',
+ 'ACL_CAT_USER_GROUP' => 'Users &amp; Groups',
));
// User Permissions
$lang = array_merge($lang, array(
- 'acl_u_viewprofile' => array('lang' => 'Can view profiles, memberlist and online list', 'cat' => 'profile'),
- 'acl_u_chgname' => array('lang' => 'Can change username', 'cat' => 'profile'),
- 'acl_u_chgpasswd' => array('lang' => 'Can change password', 'cat' => 'profile'),
- 'acl_u_chgemail' => array('lang' => 'Can change email address', 'cat' => 'profile'),
- 'acl_u_chgavatar' => array('lang' => 'Can change avatar', 'cat' => 'profile'),
- 'acl_u_chggrp' => array('lang' => 'Can change default usergroup', 'cat' => 'profile'),
- 'acl_u_chgprofileinfo' => array('lang' => 'Can change profile field information', 'cat' => 'profile'),
-
- 'acl_u_attach' => array('lang' => 'Can attach files', 'cat' => 'post'),
- 'acl_u_download' => array('lang' => 'Can download files', 'cat' => 'post'),
- 'acl_u_savedrafts' => array('lang' => 'Can save drafts', 'cat' => 'post'),
- 'acl_u_chgcensors' => array('lang' => 'Can disable word censors', 'cat' => 'post'),
- 'acl_u_sig' => array('lang' => 'Can use signature', 'cat' => 'post'),
-
- 'acl_u_sendpm' => array('lang' => 'Can send private messages', 'cat' => 'pm'),
- 'acl_u_masspm' => array('lang' => 'Can send messages to multiple users', 'cat' => 'pm'),
- 'acl_u_masspm_group'=> array('lang' => 'Can send messages to groups', 'cat' => 'pm'),
- 'acl_u_readpm' => array('lang' => 'Can read private messages', 'cat' => 'pm'),
- 'acl_u_pm_edit' => array('lang' => 'Can edit own private messages', 'cat' => 'pm'),
- 'acl_u_pm_delete' => array('lang' => 'Can remove private messages from own folder', 'cat' => 'pm'),
- 'acl_u_pm_forward' => array('lang' => 'Can forward private messages', 'cat' => 'pm'),
- 'acl_u_pm_emailpm' => array('lang' => 'Can email private messages', 'cat' => 'pm'),
- 'acl_u_pm_printpm' => array('lang' => 'Can print private messages', 'cat' => 'pm'),
- 'acl_u_pm_attach' => array('lang' => 'Can attach files in private messages', 'cat' => 'pm'),
- 'acl_u_pm_download' => array('lang' => 'Can download files in private messages', 'cat' => 'pm'),
- 'acl_u_pm_bbcode' => array('lang' => 'Can use BBCode in private messages', 'cat' => 'pm'),
- 'acl_u_pm_smilies' => array('lang' => 'Can use smilies in private messages', 'cat' => 'pm'),
- 'acl_u_pm_img' => array('lang' => 'Can use [img] BBCode tag in private messages', 'cat' => 'pm'),
- 'acl_u_pm_flash' => array('lang' => 'Can use [flash] BBCode tag in private messages', 'cat' => 'pm'),
-
- 'acl_u_sendemail' => array('lang' => 'Can send emails', 'cat' => 'misc'),
- 'acl_u_sendim' => array('lang' => 'Can send instant messages', 'cat' => 'misc'),
- 'acl_u_ignoreflood' => array('lang' => 'Can ignore flood limit', 'cat' => 'misc'),
- 'acl_u_hideonline' => array('lang' => 'Can hide online status', 'cat' => 'misc'),
- 'acl_u_viewonline' => array('lang' => 'Can view hidden online users', 'cat' => 'misc'),
- 'acl_u_search' => array('lang' => 'Can search board', 'cat' => 'misc'),
+ 'ACL_U_VIEWPROFILE' => 'Can view profiles, memberlist and online list',
+ 'ACL_U_CHGNAME' => 'Can change username',
+ 'ACL_U_CHGPASSWD' => 'Can change password',
+ 'ACL_U_CHGEMAIL' => 'Can change email address',
+ 'ACL_U_CHGAVATAR' => 'Can change avatar',
+ 'ACL_U_CHGGRP' => 'Can change default usergroup',
+ 'ACL_U_CHGPROFILEINFO' => 'Can change profile field information',
+
+ 'ACL_U_ATTACH' => 'Can attach files',
+ 'ACL_U_DOWNLOAD' => 'Can download files',
+ 'ACL_U_SAVEDRAFTS' => 'Can save drafts',
+ 'ACL_U_CHGCENSORS' => 'Can disable word censors',
+ 'ACL_U_SIG' => 'Can use signature',
+
+ 'ACL_U_SENDPM' => 'Can send private messages',
+ 'ACL_U_MASSPM' => 'Can send messages to multiple users',
+ 'ACL_U_MASSPM_GROUP'=> 'Can send messages to groups',
+ 'ACL_U_READPM' => 'Can read private messages',
+ 'ACL_U_PM_EDIT' => 'Can edit own private messages',
+ 'ACL_U_PM_DELETE' => 'Can remove private messages from own folder',
+ 'ACL_U_PM_FORWARD' => 'Can forward private messages',
+ 'ACL_U_PM_EMAILPM' => 'Can email private messages',
+ 'ACL_U_PM_PRINTPM' => 'Can print private messages',
+ 'ACL_U_PM_ATTACH' => 'Can attach files in private messages',
+ 'ACL_U_PM_DOWNLOAD' => 'Can download files in private messages',
+ 'ACL_U_PM_BBCODE' => 'Can use BBCode in private messages',
+ 'ACL_U_PM_SMILIES' => 'Can use smilies in private messages',
+ 'ACL_U_PM_IMG' => 'Can use [img] BBCode tag in private messages',
+ 'ACL_U_PM_FLASH' => 'Can use [flash] BBCode tag in private messages',
+
+ 'ACL_U_SENDEMAIL' => 'Can send emails',
+ 'ACL_U_SENDIM' => 'Can send instant messages',
+ 'ACL_U_IGNOREFLOOD' => 'Can ignore flood limit',
+ 'ACL_U_HIDEONLINE' => 'Can hide online status',
+ 'ACL_U_VIEWONLINE' => 'Can view hidden online users',
+ 'ACL_U_SEARCH' => 'Can search board',
));
// Forum Permissions
$lang = array_merge($lang, array(
- 'acl_f_list' => array('lang' => 'Can see forum', 'cat' => 'actions'),
- 'acl_f_read' => array('lang' => 'Can read forum', 'cat' => 'actions'),
- 'acl_f_search' => array('lang' => 'Can search the forum', 'cat' => 'actions'),
- 'acl_f_subscribe' => array('lang' => 'Can subscribe forum', 'cat' => 'actions'),
- 'acl_f_print' => array('lang' => 'Can print topics', 'cat' => 'actions'),
- 'acl_f_email' => array('lang' => 'Can email topics', 'cat' => 'actions'),
- 'acl_f_bump' => array('lang' => 'Can bump topics', 'cat' => 'actions'),
- 'acl_f_user_lock' => array('lang' => 'Can lock own topics', 'cat' => 'actions'),
- 'acl_f_download' => array('lang' => 'Can download files', 'cat' => 'actions'),
- 'acl_f_report' => array('lang' => 'Can report posts', 'cat' => 'actions'),
-
- 'acl_f_post' => array('lang' => 'Can start new topics', 'cat' => 'post'),
- 'acl_f_sticky' => array('lang' => 'Can post stickies', 'cat' => 'post'),
- 'acl_f_announce' => array('lang' => 'Can post announcements', 'cat' => 'post'),
- 'acl_f_reply' => array('lang' => 'Can reply to topics', 'cat' => 'post'),
- 'acl_f_edit' => array('lang' => 'Can edit own posts', 'cat' => 'post'),
- 'acl_f_delete' => array('lang' => 'Can permanently delete own posts', 'cat' => 'post'),
- 'acl_f_softdelete' => array('lang' => 'Can soft delete own posts<br /><em>Moderators, who have the approve posts permission, can restore soft deleted posts.</em>', 'cat' => 'post'),
- 'acl_f_ignoreflood' => array('lang' => 'Can ignore flood limit', 'cat' => 'post'),
- 'acl_f_postcount' => array('lang' => 'Increment post counter<br /><em>Please note that this setting only affects new posts.</em>', 'cat' => 'post'),
- 'acl_f_noapprove' => array('lang' => 'Can post without approval', 'cat' => 'post'),
-
- 'acl_f_attach' => array('lang' => 'Can attach files', 'cat' => 'content'),
- 'acl_f_icons' => array('lang' => 'Can use topic/post icons', 'cat' => 'content'),
- 'acl_f_bbcode' => array('lang' => 'Can use BBCode', 'cat' => 'content'),
- 'acl_f_flash' => array('lang' => 'Can use [flash] BBCode tag', 'cat' => 'content'),
- 'acl_f_img' => array('lang' => 'Can use [img] BBCode tag', 'cat' => 'content'),
- 'acl_f_sigs' => array('lang' => 'Can use signatures', 'cat' => 'content'),
- 'acl_f_smilies' => array('lang' => 'Can use smilies', 'cat' => 'content'),
-
- 'acl_f_poll' => array('lang' => 'Can create polls', 'cat' => 'polls'),
- 'acl_f_vote' => array('lang' => 'Can vote in polls', 'cat' => 'polls'),
- 'acl_f_votechg' => array('lang' => 'Can change existing vote', 'cat' => 'polls'),
+ 'ACL_F_LIST' => 'Can see forum',
+ 'ACL_F_READ' => 'Can read forum',
+ 'ACL_F_SEARCH' => 'Can search the forum',
+ 'ACL_F_SUBSCRIBE' => 'Can subscribe forum',
+ 'ACL_F_PRINT' => 'Can print topics',
+ 'ACL_F_EMAIL' => 'Can email topics',
+ 'ACL_F_BUMP' => 'Can bump topics',
+ 'ACL_F_USER_LOCK' => 'Can lock own topics',
+ 'ACL_F_DOWNLOAD' => 'Can download files',
+ 'ACL_F_REPORT' => 'Can report posts',
+
+ 'ACL_F_POST' => 'Can start new topics',
+ 'ACL_F_STICKY' => 'Can post stickies',
+ 'ACL_F_ANNOUNCE' => 'Can post announcements',
+ 'ACL_F_REPLY' => 'Can reply to topics',
+ 'ACL_F_EDIT' => 'Can edit own posts',
+ 'ACL_F_DELETE' => 'Can permanently delete own posts',
+ 'ACL_F_SOFTDELETE' => 'Can soft delete own posts<br /><em>Moderators, who have the approve posts permission, can restore soft deleted posts.</em>',
+ 'ACL_F_IGNOREFLOOD' => 'Can ignore flood limit',
+ 'ACL_F_POSTCOUNT' => 'Increment post counter<br /><em>Please note that this setting only affects new posts.</em>',
+ 'ACL_F_NOAPPROVE' => 'Can post without approval',
+
+ 'ACL_F_ATTACH' => 'Can attach files',
+ 'ACL_F_ICONS' => 'Can use topic/post icons',
+ 'ACL_F_BBCODE' => 'Can use BBCode',
+ 'ACL_F_FLASH' => 'Can use [flash] BBCode tag',
+ 'ACL_F_IMG' => 'Can use [img] BBCode tag',
+ 'ACL_F_SIGS' => 'Can use signatures',
+ 'ACL_F_SMILIES' => 'Can use smilies',
+
+ 'ACL_F_POLL' => 'Can create polls',
+ 'ACL_F_VOTE' => 'Can vote in polls',
+ 'ACL_F_VOTECHG' => 'Can change existing vote',
));
// Moderator Permissions
$lang = array_merge($lang, array(
- 'acl_m_edit' => array('lang' => 'Can edit posts', 'cat' => 'post_actions'),
- 'acl_m_delete' => array('lang' => 'Can permanently delete posts', 'cat' => 'post_actions'),
- 'acl_m_softdelete' => array('lang' => 'Can soft delete posts<br /><em>Moderators, who have the approve posts permission, can restore soft deleted posts.</em>', 'cat' => 'post_actions'),
- 'acl_m_approve' => array('lang' => 'Can approve and restore posts', 'cat' => 'post_actions'),
- 'acl_m_report' => array('lang' => 'Can close and delete reports', 'cat' => 'post_actions'),
- 'acl_m_chgposter' => array('lang' => 'Can change post author', 'cat' => 'post_actions'),
-
- 'acl_m_move' => array('lang' => 'Can move topics', 'cat' => 'topic_actions'),
- 'acl_m_lock' => array('lang' => 'Can lock topics', 'cat' => 'topic_actions'),
- 'acl_m_split' => array('lang' => 'Can split topics', 'cat' => 'topic_actions'),
- 'acl_m_merge' => array('lang' => 'Can merge topics', 'cat' => 'topic_actions'),
-
- 'acl_m_info' => array('lang' => 'Can view post details', 'cat' => 'misc'),
- 'acl_m_warn' => array('lang' => 'Can issue warnings<br /><em>This setting is only assigned globally. It is not forum based.</em>', 'cat' => 'misc'), // This moderator setting is only global (and not local)
- 'acl_m_ban' => array('lang' => 'Can manage bans<br /><em>This setting is only assigned globally. It is not forum based.</em>', 'cat' => 'misc'), // This moderator setting is only global (and not local)
+ 'ACL_M_EDIT' => 'Can edit posts',
+ 'ACL_M_DELETE' => 'Can permanently delete posts',
+ 'ACL_M_SOFTDELETE' => 'Can soft delete posts<br /><em>Moderators, who have the approve posts permission, can restore soft deleted posts.</em>',
+ 'ACL_M_APPROVE' => 'Can approve posts',
+ 'ACL_M_REPORT' => 'Can close and delete reports',
+ 'ACL_M_CHGPOSTER' => 'Can change post author',
+
+ 'ACL_M_MOVE' => 'Can move topics',
+ 'ACL_M_LOCK' => 'Can lock topics',
+ 'ACL_M_SPLIT' => 'Can split topics',
+ 'ACL_M_MERGE' => 'Can merge topics',
+
+ 'ACL_M_INFO' => 'Can view post details',
+ 'ACL_M_WARN' => 'Can issue warnings<br /><em>This setting is only assigned globally. It is not forum based.</em>', // This moderator setting is only global (and not local)
+ 'ACL_M_BAN' => 'Can manage bans<br /><em>This setting is only assigned globally. It is not forum based.</em>', // This moderator setting is only global (and not local)
));
// Admin Permissions
$lang = array_merge($lang, array(
- 'acl_a_board' => array('lang' => 'Can alter board settings/check for updates', 'cat' => 'settings'),
- 'acl_a_server' => array('lang' => 'Can alter server/communication settings', 'cat' => 'settings'),
- 'acl_a_jabber' => array('lang' => 'Can alter Jabber settings', 'cat' => 'settings'),
- 'acl_a_phpinfo' => array('lang' => 'Can view php settings', 'cat' => 'settings'),
-
- 'acl_a_forum' => array('lang' => 'Can manage forums', 'cat' => 'forums'),
- 'acl_a_forumadd' => array('lang' => 'Can add new forums', 'cat' => 'forums'),
- 'acl_a_forumdel' => array('lang' => 'Can delete forums', 'cat' => 'forums'),
- 'acl_a_prune' => array('lang' => 'Can prune forums', 'cat' => 'forums'),
-
- 'acl_a_icons' => array('lang' => 'Can alter topic/post icons and smilies', 'cat' => 'posting'),
- 'acl_a_words' => array('lang' => 'Can alter word censors', 'cat' => 'posting'),
- 'acl_a_bbcode' => array('lang' => 'Can define BBCode tags', 'cat' => 'posting'),
- 'acl_a_attach' => array('lang' => 'Can alter attachment related settings', 'cat' => 'posting'),
-
- 'acl_a_user' => array('lang' => 'Can manage users<br /><em>This also includes seeing the users browser agent within the viewonline list.</em>', 'cat' => 'user_group'),
- 'acl_a_userdel' => array('lang' => 'Can delete/prune users', 'cat' => 'user_group'),
- 'acl_a_group' => array('lang' => 'Can manage groups', 'cat' => 'user_group'),
- 'acl_a_groupadd' => array('lang' => 'Can add new groups', 'cat' => 'user_group'),
- 'acl_a_groupdel' => array('lang' => 'Can delete groups', 'cat' => 'user_group'),
- 'acl_a_ranks' => array('lang' => 'Can manage ranks', 'cat' => 'user_group'),
- 'acl_a_profile' => array('lang' => 'Can manage custom profile fields', 'cat' => 'user_group'),
- 'acl_a_names' => array('lang' => 'Can manage disallowed names', 'cat' => 'user_group'),
- 'acl_a_ban' => array('lang' => 'Can manage bans', 'cat' => 'user_group'),
-
- 'acl_a_viewauth' => array('lang' => 'Can view permission masks', 'cat' => 'permissions'),
- 'acl_a_authgroups' => array('lang' => 'Can alter permissions for individual groups', 'cat' => 'permissions'),
- 'acl_a_authusers' => array('lang' => 'Can alter permissions for individual users', 'cat' => 'permissions'),
- 'acl_a_fauth' => array('lang' => 'Can alter forum permission class', 'cat' => 'permissions'),
- 'acl_a_mauth' => array('lang' => 'Can alter moderator permission class', 'cat' => 'permissions'),
- 'acl_a_aauth' => array('lang' => 'Can alter admin permission class', 'cat' => 'permissions'),
- 'acl_a_uauth' => array('lang' => 'Can alter user permission class', 'cat' => 'permissions'),
- 'acl_a_roles' => array('lang' => 'Can manage roles', 'cat' => 'permissions'),
- 'acl_a_switchperm' => array('lang' => 'Can use others permissions', 'cat' => 'permissions'),
-
- 'acl_a_styles' => array('lang' => 'Can manage styles', 'cat' => 'misc'),
- 'acl_a_extensions' => array('lang' => 'Can manage extensions', 'cat' => 'misc'),
- 'acl_a_viewlogs' => array('lang' => 'Can view logs', 'cat' => 'misc'),
- 'acl_a_clearlogs' => array('lang' => 'Can clear logs', 'cat' => 'misc'),
- 'acl_a_modules' => array('lang' => 'Can manage modules', 'cat' => 'misc'),
- 'acl_a_language' => array('lang' => 'Can manage language packs', 'cat' => 'misc'),
- 'acl_a_email' => array('lang' => 'Can send mass email', 'cat' => 'misc'),
- 'acl_a_bots' => array('lang' => 'Can manage bots', 'cat' => 'misc'),
- 'acl_a_reasons' => array('lang' => 'Can manage report/denial reasons', 'cat' => 'misc'),
- 'acl_a_backup' => array('lang' => 'Can backup/restore database', 'cat' => 'misc'),
- 'acl_a_search' => array('lang' => 'Can manage search backends and settings', 'cat' => 'misc'),
+ 'ACL_A_BOARD' => 'Can alter board settings/check for updates',
+ 'ACL_A_SERVER' => 'Can alter server/communication settings',
+ 'ACL_A_JABBER' => 'Can alter Jabber settings',
+ 'ACL_A_PHPINFO' => 'Can view php settings',
+
+ 'ACL_A_FORUM' => 'Can manage forums',
+ 'ACL_A_FORUMADD' => 'Can add new forums',
+ 'ACL_A_FORUMDEL' => 'Can delete forums',
+ 'ACL_A_PRUNE' => 'Can prune forums',
+
+ 'ACL_A_ICONS' => 'Can alter topic/post icons and smilies',
+ 'ACL_A_WORDS' => 'Can alter word censors',
+ 'ACL_A_BBCODE' => 'Can define BBCode tags',
+ 'ACL_A_ATTACH' => 'Can alter attachment related settings',
+
+ 'ACL_A_USER' => 'Can manage users<br /><em>This also includes seeing the users browser agent within the viewonline list.</em>',
+ 'ACL_A_USERDEL' => 'Can delete/prune users',
+ 'ACL_A_GROUP' => 'Can manage groups',
+ 'ACL_A_GROUPADD' => 'Can add new groups',
+ 'ACL_A_GROUPDEL' => 'Can delete groups',
+ 'ACL_A_RANKS' => 'Can manage ranks',
+ 'ACL_A_PROFILE' => 'Can manage custom profile fields',
+ 'ACL_A_NAMES' => 'Can manage disallowed names',
+ 'ACL_A_BAN' => 'Can manage bans',
+
+ 'ACL_A_VIEWAUTH' => 'Can view permission masks',
+ 'ACL_A_AUTHGROUPS' => 'Can alter permissions for individual groups',
+ 'ACL_A_AUTHUSERS' => 'Can alter permissions for individual users',
+ 'ACL_A_FAUTH' => 'Can alter forum permission class',
+ 'ACL_A_MAUTH' => 'Can alter moderator permission class',
+ 'ACL_A_AAUTH' => 'Can alter admin permission class',
+ 'ACL_A_UAUTH' => 'Can alter user permission class',
+ 'ACL_A_ROLES' => 'Can manage roles',
+ 'ACL_A_SWITCHPERM' => 'Can use others permissions',
+
+ 'ACL_A_STYLES' => 'Can manage styles',
+ 'ACL_A_EXTENSIONS' => 'Can manage extensions',
+ 'ACL_A_VIEWLOGS' => 'Can view logs',
+ 'ACL_A_CLEARLOGS' => 'Can clear logs',
+ 'ACL_A_MODULES' => 'Can manage modules',
+ 'ACL_A_LANGUAGE' => 'Can manage language packs',
+ 'ACL_A_EMAIL' => 'Can send mass email',
+ 'ACL_A_BOTS' => 'Can manage bots',
+ 'ACL_A_REASONS' => 'Can manage report/denial reasons',
+ 'ACL_A_BACKUP' => 'Can backup/restore database',
+ 'ACL_A_SEARCH' => 'Can manage search backends and settings',
));
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index b188d90f3a..e5c0478d98 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -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".',
diff --git a/phpBB/language/en/email/forum_notify.txt b/phpBB/language/en/email/forum_notify.txt
index 66f3a68689..a05be5fd96 100644
--- a/phpBB/language/en/email/forum_notify.txt
+++ b/phpBB/language/en/email/forum_notify.txt
@@ -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}
diff --git a/phpBB/language/en/email/group_approved.txt b/phpBB/language/en/email/group_approved.txt
deleted file mode 100644
index 24afefcd07..0000000000
--- a/phpBB/language/en/email/group_approved.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Subject: Your request has been approved
-
-Congratulations,
-
-Your request to join the "{GROUP_NAME}" group on "{SITENAME}" has been approved.
-Click on the following link to see your group membership.
-
-{U_GROUP}
-
-{EMAIL_SIG}
diff --git a/phpBB/language/en/email/installed.txt b/phpBB/language/en/email/installed.txt
index 9ec93484e1..8f63d07635 100644
--- a/phpBB/language/en/email/installed.txt
+++ b/phpBB/language/en/email/installed.txt
@@ -12,7 +12,7 @@ Username: {USERNAME}
Board URL: {U_BOARD}
----------------------------
-Useful information regarding the phpBB software can be found in the docs folder of your installation and on phpBB.com's support page - http://www.phpbb.com/support/
+Useful information regarding the phpBB software can be found in the docs folder of your installation and on phpBB.com's support page - https://www.phpbb.com/support/
In order to keep your board safe and secure, we highly recommended keeping current with software releases. For your convenience, a mailing list is available at the page referenced above.
diff --git a/phpBB/language/en/email/newtopic_notify.txt b/phpBB/language/en/email/newtopic_notify.txt
index bf6799e5be..5089e7dcb8 100644
--- a/phpBB/language/en/email/newtopic_notify.txt
+++ b/phpBB/language/en/email/newtopic_notify.txt
@@ -2,7 +2,7 @@ Subject: New topic 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 topic<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum.
+You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum.
{U_FORUM}
diff --git a/phpBB/language/en/email/topic_notify.txt b/phpBB/language/en/email/topic_notify.txt
index 472375fb22..529478eae2 100644
--- a/phpBB/language/en/email/topic_notify.txt
+++ b/phpBB/language/en/email/topic_notify.txt
@@ -2,7 +2,7 @@ Subject: Topic reply notification - "{TOPIC_TITLE}"
Hello {USERNAME},
-You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic.
+You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic.
If you want to view the newest post made since your last visit, click the following link:
{U_NEWEST_POST}
diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php
index 68dc05f992..94e6622685 100644
--- a/phpBB/language/en/help_faq.php
+++ b/phpBB/language/en/help_faq.php
@@ -332,7 +332,7 @@ $help = array(
),
array(
0 => 'Why isn’t X feature available?',
- 1 => 'This software was written by and licensed through phpBB Group. If you believe a feature needs to be added, or you want to report a bug, please visit the phpBB <a href="http://area51.phpbb.com/">Area51</a> website, where you will find resources to do so.'
+ 1 => 'This software was written by and licensed through phpBB Group. If you believe a feature needs to be added please visit the <a href="https://www.phpbb.com/ideas/">phpBB Ideas Centre</a>, where you can upvote existing ideas or suggest new features.'
),
array(
0 => 'Who do I contact about abusive and/or legal matters related to this board?',
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index be45047861..03c9562983 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -374,7 +374,7 @@ $lang = array_merge($lang, array(
// Updater
$lang = array_merge($lang, array(
- 'ALL_FILES_UP_TO_DATE' => 'All files are up to date with the latest phpBB version. You should now <a href="%1$s">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the <a href="%2$s">Send statistics</a> module in your ACP.',
+ 'ALL_FILES_UP_TO_DATE' => 'All files are up to date with the latest phpBB version.',
'ARCHIVE_FILE' => 'Source file within archive',
'BACK' => 'Back',
@@ -398,7 +398,7 @@ $lang = array_merge($lang, array(
'DATABASE_TYPE' => 'Database type',
'DATABASE_UPDATE_COMPLETE' => 'Database updater has completed!',
- 'DATABASE_UPDATE_CONTINUE' => 'Continue database update.',
+ 'DATABASE_UPDATE_CONTINUE' => 'Continue database update',
'DATABASE_UPDATE_INFO_OLD' => 'The database update file within the install directory is outdated. Please make sure you uploaded the correct version of the file.',
'DATABASE_UPDATE_NOT_COMPLETED' => 'The database update has not yet completed.',
'DELETE_USER_REMOVE' => 'Delete user and remove posts',
@@ -419,8 +419,9 @@ $lang = array_merge($lang, array(
'DOWNLOAD_UPDATE_METHOD' => 'Download modified files archive',
'DOWNLOAD_UPDATE_METHOD_EXPLAIN' => 'Once downloaded you should unpack the archive. You will find the modified files you need to upload to your phpBB root directory within it. Please upload the files to their respective locations then. After you have uploaded all files, please check the files again with the other button below.',
- 'ERROR' => 'Error',
'EDIT_USERNAME' => 'Edit username',
+ 'ERROR' => 'Error',
+ 'EVERYTHING_UP_TO_DATE' => 'Everything is up to date with the latest phpBB version. You should now <a href="%1$s">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the <a href="%2$s">Send statistics</a> module in your ACP.',
'FILE_ALREADY_UP_TO_DATE' => 'File is already up to date.',
'FILE_DIFF_NOT_ALLOWED' => 'File not allowed to be diffed.',
@@ -570,6 +571,7 @@ $lang = array_merge($lang, array(
'UPLOAD_METHOD' => 'Upload method',
'UPDATE_DB_SUCCESS' => 'Database update was successful.',
+ 'UPDATE_FILE_SUCCESS' => 'File update was successful.',
'USER_ACTIVE' => 'Active user',
'USER_INACTIVE' => 'Inactive user',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 51823ddb12..e2d5dc5ad1 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -270,6 +270,10 @@ $lang = array_merge($lang, array(
'LINK_REMOTE_SIZE' => 'Avatar dimensions',
'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.',
'LOGIN_EXPLAIN_UCP' => 'Please login in order to access the User Control Panel.',
+ 'LOGIN_LINK' => 'Link or register your account on an external service with your board account',
+ 'LOGIN_LINK_EXPLAIN' => 'You have attempted to login with an external service that is not yet connected to an account on this board. You must now either link this account to an existing account or create a new account.',
+ 'LOGIN_LINK_MISSING_DATA' => 'Data that is necessary to link your account with an external service is not available. Please restart the login process.',
+ 'LOGIN_LINK_NO_DATA_PROVIDED' => 'No data has been provided to this page to link an external account to a forum account. Please contact the board administrator if you continue to experience problems.',
'LOGIN_KEY' => 'Login Key',
'LOGIN_TIME' => 'Login Time',
'LOGIN_REDIRECT' => 'You have been successfully logged in.',
@@ -313,6 +317,7 @@ $lang = array_merge($lang, array(
'NOTIFICATION_METHOD_JABBER' => 'Jabber',
'NOTIFICATION_TYPE' => 'Notification type',
'NOTIFICATION_TYPE_BOOKMARK' => 'Someone replies to a topic you have bookmarked',
+ 'NOTIFICATION_TYPE_GROUP_REQUEST' => 'Someone requests to join a group you lead',
'NOTIFICATION_TYPE_IN_MODERATION_QUEUE' => 'A post or topic needs approval',
'NOTIFICATION_TYPE_MODERATION_QUEUE' => 'Your topics/posts are approved or disapproved by a moderator',
'NOTIFICATION_TYPE_PM' => 'Someone sends you a private message',
@@ -475,11 +480,20 @@ $lang = array_merge($lang, array(
'UCP_ADMIN_ACTIVATE' => 'Please note that you will need to enter a valid email address before your account is activated. The administrator will review your account and if approved you will receive an email at the address you specified.',
'UCP_AIM' => 'AOL Instant Messenger',
'UCP_ATTACHMENTS' => 'Attachments',
+ 'UCP_AUTH_LINK' => 'External accounts',
+ 'UCP_AUTH_LINK_ASK' => 'You currently have no account associated with this external service. Click the button below to link your board account to an account with this external service.',
+ 'UCP_AUTH_LINK_ID' => 'Unique identifier',
+ 'UCP_AUTH_LINK_LINK' => 'Link',
+ 'UCP_AUTH_LINK_MANAGE' => 'Manage external account associations',
+ 'UCP_AUTH_LINK_NOT_SUPPORTED' => 'Linking board accounts to external services is not supported by this board’s current authentication method.',
+ 'UCP_AUTH_LINK_TITLE' => 'Manage your external account associations',
+ 'UCP_AUTH_LINK_UNLINK' => 'Unlink',
'UCP_COPPA_BEFORE' => 'Before %s',
'UCP_COPPA_ON_AFTER' => 'On or after %s',
'UCP_EMAIL_ACTIVATE' => 'Please note that you will need to enter a valid email address before your account is activated. You will receive an email at the address you provide that contains an account activation link.',
'UCP_ICQ' => 'ICQ number',
'UCP_JABBER' => 'Jabber address',
+ 'UCP_LOGIN_LINK' => 'Set up an external account association',
'UCP_MAIN' => 'Overview',
'UCP_MAIN_ATTACHMENTS' => 'Manage attachments',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 2e4301d43a..ead7179732 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -561,17 +561,8 @@ switch ($mode)
if ($member['user_sig'])
{
- $member['user_sig'] = censor_text($member['user_sig']);
-
- if ($member['user_sig_bbcode_bitfield'])
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode();
- $bbcode->bbcode_second_pass($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield']);
- }
-
- $member['user_sig'] = bbcode_nl2br($member['user_sig']);
- $member['user_sig'] = smiley_text($member['user_sig']);
+ $parse_flags = ($member['user_sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $member['user_sig'] = generate_text_for_display($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield'], $parse_flags, true);
}
$poster_avatar = phpbb_get_user_avatar($member);
diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php
index 804e1ce44b..5c76b64281 100644
--- a/phpBB/phpbb/auth/auth.php
+++ b/phpBB/phpbb/auth/auth.php
@@ -972,6 +972,18 @@ class auth
);
}
+ // If the auth provider wants us to link an empty account do so and redirect
+ if ($login['status'] == LOGIN_SUCCESS_LINK_PROFILE)
+ {
+ // If this status exists a fourth field is in the $login array called 'redirect_data'
+ // This data is passed along as GET data to the next page allow the account to be linked
+
+ $params = array('mode' => 'login_link');
+ $url = append_sid($phpbb_root_path . 'ucp.' . $phpEx, array_merge($params, $login['redirect_data']));
+
+ redirect($url);
+ }
+
// If login succeeded, we will log the user in... else we pass the login array through...
if ($login['status'] == LOGIN_SUCCESS)
{
diff --git a/phpBB/phpbb/auth/provider/base.php b/phpBB/phpbb/auth/provider/base.php
index f0a2a2f68c..2222d8c1b6 100644
--- a/phpBB/phpbb/auth/provider/base.php
+++ b/phpBB/phpbb/auth/provider/base.php
@@ -59,6 +59,22 @@ abstract class base implements \phpbb\auth\provider\provider_interface
/**
* {@inheritdoc}
*/
+ public function get_login_data()
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_auth_link_data()
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
public function logout($data, $new_session)
{
return;
@@ -71,4 +87,28 @@ abstract class base implements \phpbb\auth\provider\provider_interface
{
return;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function login_link_has_necessary_data($login_link_data)
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function link_account(array $link_data)
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function unlink_account(array $link_data)
+ {
+ return;
+ }
}
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
new file mode 100644
index 0000000000..be0b8bb7d6
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -0,0 +1,618 @@
+<?php
+/**
+*
+* @package auth
+* @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;
+}
+
+use OAuth\Common\Consumer\Credentials;
+use OAuth\Common\Http\Uri\Uri;
+
+/**
+* OAuth authentication provider for phpBB3
+*
+* @package auth
+*/
+class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
+{
+ /**
+ * Database driver
+ *
+ * @var phpbb_db_driver
+ */
+ protected $db;
+
+ /**
+ * phpBB config
+ *
+ * @var phpbb_config
+ */
+ protected $config;
+
+ /**
+ * phpBB request object
+ *
+ * @var phpbb_request
+ */
+ protected $request;
+
+ /**
+ * phpBB user
+ *
+ * @var phpbb_user
+ */
+ protected $user;
+
+ /**
+ * OAuth token table
+ *
+ * @var string
+ */
+ protected $auth_provider_oauth_token_storage_table;
+
+ /**
+ * OAuth account association table
+ *
+ * @var string
+ */
+ protected $auth_provider_oauth_token_account_assoc;
+
+ /**
+ * All OAuth service providers
+ *
+ * @var phpbb_di_service_collection Contains phpbb_auth_provider_oauth_service_interface
+ */
+ protected $service_providers;
+
+ /**
+ * Users table
+ *
+ * @var string
+ */
+ protected $users_table;
+
+ /**
+ * Cached current uri object
+ *
+ * @var \OAuth\Common\Http\Uri\UriInterface|null
+ */
+ protected $current_uri;
+
+ /**
+ * phpBB root path
+ *
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP extenstion
+ *
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * OAuth Authentication Constructor
+ *
+ * @param phpbb_db_driver $db
+ * @param phpbb_config $config
+ * @param phpbb_request $request
+ * @param phpbb_user $user
+ * @param string $auth_provider_oauth_token_storage_table
+ * @param string $auth_provider_oauth_token_account_assoc
+ * @param phpbb_di_service_collection $service_providers Contains phpbb_auth_provider_oauth_service_interface
+ * @param string $users_table
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, phpbb_di_service_collection $service_providers, $users_table, $phpbb_root_path, $php_ext)
+ {
+ $this->db = $db;
+ $this->config = $config;
+ $this->request = $request;
+ $this->user = $user;
+ $this->auth_provider_oauth_token_storage_table = $auth_provider_oauth_token_storage_table;
+ $this->auth_provider_oauth_token_account_assoc = $auth_provider_oauth_token_account_assoc;
+ $this->service_providers = $service_providers;
+ $this->users_table = $users_table;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function init()
+ {
+ // This does not test whether or not the key and secret provided are valid.
+ foreach ($this->service_providers as $service_provider)
+ {
+ $credentials = $service_provider->get_service_credentials();
+
+ if (($credentials['key'] && !$credentials['secret']) || (!$credentials['key'] && $credentials['secret']))
+ {
+ return $this->user->lang['AUTH_PROVIDER_OAUTH_ERROR_ELEMENT_MISSING'];
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function login($username, $password)
+ {
+ // Temporary workaround for only having one authentication provider available
+ if (!$this->request->is_set('oauth_service'))
+ {
+ $provider = new phpbb_auth_provider_db($this->db, $this->config, $this->request, $this->user, $this->phpbb_root_path, $this->php_ext);
+ return $provider->login($username, $password);
+ }
+
+ // Requst the name of the OAuth service
+ $service_name_original = $this->request->variable('oauth_service', '', false);
+ $service_name = 'auth.provider.oauth.service.' . strtolower($service_name_original);
+ if ($service_name_original === '' || !array_key_exists($service_name, $this->service_providers))
+ {
+ return array(
+ 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
+ 'error_msg' => 'LOGIN_ERROR_OAUTH_SERVICE_DOES_NOT_EXIST',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ // Get the service credentials for the given service
+ $service_credentials = $this->service_providers[$service_name]->get_service_credentials();
+
+ $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $query = 'mode=login&login=external&oauth_service=' . $service_name_original;
+ $service = $this->get_service($service_name_original, $storage, $service_credentials, $this->service_providers[$service_name]->get_auth_scope(), $query);
+
+ if ($this->request->is_set('code', phpbb_request_interface::GET))
+ {
+ $this->service_providers[$service_name]->set_external_service_provider($service);
+ $unique_id = $this->service_providers[$service_name]->perform_auth_login();
+
+ // Check to see if this provider is already assosciated with an account
+ $data = array(
+ 'provider' => $service_name_original,
+ 'oauth_provider_id' => $unique_id
+ );
+ $sql = 'SELECT user_id FROM ' . $this->auth_provider_oauth_token_account_assoc . '
+ WHERE ' . $this->db->sql_build_array('SELECT', $data);
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row)
+ {
+ // The user does not yet exist, ask to link or create profile
+ return array(
+ 'status' => LOGIN_SUCCESS_LINK_PROFILE,
+ 'error_msg' => 'LOGIN_OAUTH_ACCOUNT_NOT_LINKED',
+ 'user_row' => array(),
+ 'redirect_data' => array(
+ 'auth_provider' => 'oauth',
+ 'login_link_oauth_service' => $service_name_original,
+ ),
+ );
+ }
+
+ // Retrieve the user's account
+ $sql = 'SELECT user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts
+ FROM ' . $this->users_table . '
+ WHERE user_id = ' . (int) $row['user_id'];
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row)
+ {
+ throw new Exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_ENTRY');
+ }
+
+ // Update token storage to store the user_id
+ $storage->set_user_id($row['user_id']);
+
+ // The user is now authenticated and can be logged in
+ return array(
+ 'status' => LOGIN_SUCCESS,
+ 'error_msg' => false,
+ 'user_row' => $row,
+ );
+ }
+ else
+ {
+ $url = $service->getAuthorizationUri();
+ header('Location: ' . $url);
+ }
+ }
+
+ /**
+ * Returns the cached current_uri object or creates and caches it if it is
+ * not already created. In each case the query string is updated based on
+ * the $query parameter.
+ *
+ * @param string $service_name The name of the service
+ * @param string $query The query string of the current_uri
+ * used in redirects
+ * @return \OAuth\Common\Http\Uri\UriInterface
+ */
+ protected function get_current_uri($service_name, $query)
+ {
+ if ($this->current_uri)
+ {
+ $this->current_uri->setQuery($query);
+ return $this->current_uri;
+ }
+
+ $uri_factory = new \OAuth\Common\Http\Uri\UriFactory();
+ $current_uri = $uri_factory->createFromSuperGlobalArray($this->request->get_super_global(phpbb_request_interface::SERVER));
+ $current_uri->setQuery($query);
+
+ $this->current_uri = $current_uri;
+ return $current_uri;
+ }
+
+ /**
+ * Returns a new service object
+ *
+ * @param string $service_name The name of the service
+ * @param phpbb_auth_oauth_token_storage $storage
+ * @param array $service_credentials {@see phpbb_auth_provider_oauth::get_service_credentials}
+ * @param array $scope The scope of the request against
+ * the api.
+ * @param string $query The query string of the
+ * current_uri used in redirection
+ * @return \OAuth\Common\Service\ServiceInterface
+ */
+ protected function get_service($service_name, phpbb_auth_provider_oauth_token_storage $storage, array $service_credentials, array $scopes = array(), $query)
+ {
+ $current_uri = $this->get_current_uri($service_name, $query);
+
+ // Setup the credentials for the requests
+ $credentials = new Credentials(
+ $service_credentials['key'],
+ $service_credentials['secret'],
+ $current_uri->getAbsoluteUri()
+ );
+
+ $service_factory = new \OAuth\ServiceFactory();
+ $service = $service_factory->createService($service_name, $credentials, $storage, $scopes);
+
+ if (!$service)
+ {
+ throw new Exception('AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED');
+ }
+
+ return $service;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_login_data()
+ {
+ $login_data = array(
+ 'TEMPLATE_FILE' => 'login_body_oauth.html',
+ 'BLOCK_VAR_NAME' => 'oauth',
+ 'BLOCK_VARS' => array(),
+ );
+
+ foreach ($this->service_providers as $service_name => $service_provider)
+ {
+ // Only include data if the credentials are set
+ $credentials = $service_provider->get_service_credentials();
+ if ($credentials['key'] && $credentials['secret'])
+ {
+ $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name);
+ $redirect_url = build_url(false) . '&login=external&oauth_service=' . $actual_name;
+ $login_data['BLOCK_VARS'][$service_name] = array(
+ 'REDIRECT_URL' => redirect($redirect_url, true),
+ 'SERVICE_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)],
+ );
+ }
+ }
+
+ return $login_data;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function acp()
+ {
+ $ret = array();
+
+ foreach ($this->service_providers as $service_name => $service_provider)
+ {
+ $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name);
+ $ret[] = 'auth_oauth_' . $actual_name . '_key';
+ $ret[] = 'auth_oauth_' . $actual_name . '_secret';
+ }
+
+ return $ret;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_acp_template($new_config)
+ {
+ $ret = array(
+ 'BLOCK_VAR_NAME' => 'oauth_services',
+ 'BLOCK_VARS' => array(),
+ 'TEMPLATE_FILE' => 'auth_provider_oauth.html',
+ 'TEMPLATE_VARS' => array(),
+ );
+
+ foreach ($this->service_providers as $service_name => $service_provider)
+ {
+ $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name);
+ $ret['BLOCK_VARS'][$actual_name] = array(
+ 'ACTUAL_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)],
+ 'KEY' => $new_config['auth_oauth_' . $actual_name . '_key'],
+ 'NAME' => $actual_name,
+ 'SECRET' => $new_config['auth_oauth_' . $actual_name . '_secret'],
+ );
+ }
+
+ return $ret;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function login_link_has_necessary_data($login_link_data)
+ {
+ if (empty($login_link_data))
+ {
+ return 'LOGIN_LINK_NO_DATA_PROVIDED';
+ }
+
+ if (!array_key_exists('oauth_service', $login_link_data) || !$login_link_data['oauth_service'] ||
+ !array_key_exists('link_method', $login_link_data) || !$login_link_data['link_method'])
+ {
+ return 'LOGIN_LINK_MISSING_DATA';
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function link_account(array $link_data)
+ {
+ // Check for a valid link method (auth_link or login_link)
+ if (!array_key_exists('link_method', $link_data) ||
+ !in_array($link_data['link_method'], array(
+ 'auth_link',
+ 'login_link',
+ )))
+ {
+ return 'LOGIN_LINK_MISSING_DATA';
+ }
+
+ // We must have an oauth_service listed, check for it two ways
+ if (!array_key_exists('oauth_service', $link_data) || !$link_data['oauth_service'])
+ {
+ $link_data['oauth_service'] = $this->request->variable('oauth_service', '');
+
+ if (!$link_data['oauth_service'])
+ {
+ return 'LOGIN_LINK_MISSING_DATA';
+ }
+ }
+
+ $service_name = 'auth.provider.oauth.service.' . strtolower($link_data['oauth_service']);
+ if (!array_key_exists($service_name, $this->service_providers))
+ {
+ return 'LOGIN_ERROR_OAUTH_SERVICE_DOES_NOT_EXIST';
+ }
+
+ switch ($link_data['link_method'])
+ {
+ case 'auth_link':
+ return $this->link_account_auth_link($link_data, $service_name);
+ case 'login_link':
+ return $this->link_account_login_link($link_data, $service_name);
+ }
+ }
+
+ /**
+ * Performs the account linking for login_link
+ *
+ * @param array $link_data The same variable given to {@see phpbb_auth_provider_interface::link_account}
+ * @param string $service_name The name of the service being used in
+ * linking.
+ * @return string|null Returns a language constant (string) if an error is
+ * encountered, or null on success.
+ */
+ protected function link_account_login_link(array $link_data, $service_name)
+ {
+ $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+
+ // Check for an access token, they should have one
+ if (!$storage->has_access_token_by_session($service_name))
+ {
+ return 'LOGIN_LINK_ERROR_OAUTH_NO_ACCESS_TOKEN';
+ }
+
+ // Prepare the query string
+ $query = 'mode=login_link&login_link_oauth_service=' . strtolower($link_data['oauth_service']);
+
+ // Prepare for an authentication request
+ $service_credentials = $this->service_providers[$service_name]->get_service_credentials();
+ $scopes = $this->service_providers[$service_name]->get_auth_scope();
+ $service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $scopes, $query);
+ $this->service_providers[$service_name]->set_external_service_provider($service);
+
+ // The user has already authenticated successfully, request to authenticate again
+ $unique_id = $this->service_providers[$service_name]->perform_token_auth();
+
+ // Insert into table, they will be able to log in after this
+ $data = array(
+ 'user_id' => $link_data['user_id'],
+ 'provider' => strtolower($link_data['oauth_service']),
+ 'oauth_provider_id' => $unique_id,
+ );
+
+ $this->link_account_perform_link($data);
+ // Update token storage to store the user_id
+ $storage->set_user_id($link_data['user_id']);
+ }
+
+ /**
+ * Performs the account linking for auth_link
+ *
+ * @param array $link_data The same variable given to {@see phpbb_auth_provider_interface::link_account}
+ * @param string $service_name The name of the service being used in
+ * linking.
+ * @return string|null Returns a language constant (string) if an error is
+ * encountered, or null on success.
+ */
+ protected function link_account_auth_link(array $link_data, $service_name)
+ {
+ $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $query = 'i=ucp_auth_link&mode=auth_link&link=1&oauth_service=' . strtolower($link_data['oauth_service']);
+ $service_credentials = $this->service_providers[$service_name]->get_service_credentials();
+ $scopes = $this->service_providers[$service_name]->get_auth_scope();
+ $service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $scopes, $query);
+
+ if ($this->request->is_set('code', phpbb_request_interface::GET))
+ {
+ $this->service_providers[$service_name]->set_external_service_provider($service);
+ $unique_id = $this->service_providers[$service_name]->perform_auth_login();
+
+ // Insert into table, they will be able to log in after this
+ $data = array(
+ 'user_id' => $this->user->data['user_id'],
+ 'provider' => strtolower($link_data['oauth_service']),
+ 'oauth_provider_id' => $unique_id,
+ );
+
+ $this->link_account_perform_link($data);
+ }
+ else
+ {
+ $url = $service->getAuthorizationUri();
+ header('Location: ' . $url);
+ }
+ }
+
+ /**
+ * Performs the query that inserts an account link
+ *
+ * @param array $data This array is passed to db->sql_build_array
+ */
+ protected function link_account_perform_link(array $data)
+ {
+ $sql = 'INSERT INTO ' . $this->auth_provider_oauth_token_account_assoc . '
+ ' . $this->db->sql_build_array('INSERT', $data);
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function logout($data, $new_session)
+ {
+ // Clear all tokens belonging to the user
+ $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $storage->clearAllTokens();
+
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_auth_link_data()
+ {
+ $block_vars = array();
+
+ // Get all external accounts tied to the current user
+ $data = array(
+ 'user_id' => (int) $this->user->data['user_id'],
+ );
+ $sql = 'SELECT oauth_provider_id, provider FROM ' . $this->auth_provider_oauth_token_account_assoc . '
+ WHERE ' . $this->db->sql_build_array('SELECT', $data);
+ $result = $this->db->sql_query($sql);
+ $rows = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+
+ $oauth_user_ids = array();
+
+ if ($rows !== false && sizeof($rows))
+ {
+ foreach ($rows as $row)
+ {
+ $oauth_user_ids[$row['provider']] = $row['oauth_provider_id'];
+ }
+ }
+ unset($rows);
+
+ foreach ($this->service_providers as $service_name => $service_provider)
+ {
+ // Only include data if the credentials are set
+ $credentials = $service_provider->get_service_credentials();
+ if ($credentials['key'] && $credentials['secret'])
+ {
+ $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name);
+
+ $block_vars[$service_name] = array(
+ 'HIDDEN_FIELDS' => array(
+ 'link' => (!isset($oauth_user_ids[$actual_name])),
+ 'oauth_service' => $actual_name,
+ ),
+
+ 'SERVICE_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)],
+ 'UNIQUE_ID' => (isset($oauth_user_ids[$actual_name])) ? $oauth_user_ids[$actual_name] : null,
+ );
+ }
+ }
+
+ return array(
+ 'BLOCK_VAR_NAME' => 'oauth',
+ 'BLOCK_VARS' => $block_vars,
+
+ 'TEMPLATE_FILE' => 'ucp_auth_link_oauth.html',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function unlink_account(array $link_data)
+ {
+ if (!array_key_exists('oauth_service', $link_data) || !$link_data['oauth_service'])
+ {
+ return 'LOGIN_LINK_MISSING_DATA';
+ }
+
+ // Remove the link
+ $sql = 'DELETE FROM ' . $this->auth_provider_oauth_token_account_assoc . "
+ WHERE provider = '" . $this->db->sql_escape($link_data['oauth_service']) . "'
+ AND user_id = " . (int) $this->user->data['user_id'];
+ $this->db->sql_query($sql);
+
+ // Clear all tokens belonging to the user on this servce
+ $service_name = 'auth.provider.oauth.service.' . strtolower($link_data['oauth_service']);
+ $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $storage->clearToken($service_name);
+
+ return;
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/base.php b/phpBB/phpbb/auth/provider/oauth/service/base.php
new file mode 100644
index 0000000000..1eb49b4265
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/base.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* @package auth
+* @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;
+}
+
+/**
+* Base OAuth abstract class that all OAuth services should implement
+*
+* @package auth
+*/
+abstract class phpbb_auth_provider_oauth_service_base implements phpbb_auth_provider_oauth_service_interface
+{
+ /**
+ * External OAuth service provider
+ *
+ * @var \OAuth\Common\Service\ServiceInterface
+ */
+ protected $service_provider;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_external_service_provider()
+ {
+ return $this->service_provider;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_auth_scope()
+ {
+ return array();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_external_service_provider(\OAuth\Common\Service\ServiceInterface $service_provider)
+ {
+ $this->service_provider = $service_provider;
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/bitly.php b/phpBB/phpbb/auth/provider/oauth/service/bitly.php
new file mode 100644
index 0000000000..3bafdd59ce
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/bitly.php
@@ -0,0 +1,98 @@
+<?php
+/**
+*
+* @package auth
+* @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;
+}
+
+/**
+* Bitly OAuth service
+*
+* @package auth
+*/
+class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_service_base
+{
+ /**
+ * phpBB config
+ *
+ * @var phpbb_config
+ */
+ protected $config;
+
+ /**
+ * phpBB request
+ *
+ * @var phpbb_request
+ */
+ protected $request;
+
+ /**
+ * Constructor
+ *
+ * @param phpbb_config $config
+ * @param phpbb_request $request
+ */
+ public function __construct(phpbb_config $config, phpbb_request $request)
+ {
+ $this->config = $config;
+ $this->request = $request;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_service_credentials()
+ {
+ return array(
+ 'key' => $this->config['auth_oauth_bitly_key'],
+ 'secret' => $this->config['auth_oauth_bitly_secret'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_auth_login()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly))
+ {
+ throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // This was a callback request from bitly, get the token
+ $this->service_provider->requestAccessToken($this->request->variable('code', ''));
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('user/info'), true);
+
+ // Return the unique identifier returned from bitly
+ return $result['data']['login'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_token_auth()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly))
+ {
+ throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('user/info'), true);
+
+ // Return the unique identifier returned from bitly
+ return $result['data']['login'];
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/exception.php b/phpBB/phpbb/auth/provider/oauth/service/exception.php
new file mode 100644
index 0000000000..23d3387951
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/exception.php
@@ -0,0 +1,25 @@
+<?php
+/**
+*
+* @package auth
+* @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;
+}
+
+/**
+* OAuth service exception class
+*
+* @package auth
+*/
+class phpbb_auth_provider_oauth_service_exception extends RuntimeException
+{
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/facebook.php b/phpBB/phpbb/auth/provider/oauth/service/facebook.php
new file mode 100644
index 0000000000..49206b7654
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/facebook.php
@@ -0,0 +1,98 @@
+<?php
+/**
+*
+* @package auth
+* @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;
+}
+
+/**
+* Facebook OAuth service
+*
+* @package auth
+*/
+class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oauth_service_base
+{
+ /**
+ * phpBB config
+ *
+ * @var phpbb_config
+ */
+ protected $config;
+
+ /**
+ * phpBB request
+ *
+ * @var phpbb_request
+ */
+ protected $request;
+
+ /**
+ * Constructor
+ *
+ * @param phpbb_config $config
+ * @param phpbb_request $request
+ */
+ public function __construct(phpbb_config $config, phpbb_request $request)
+ {
+ $this->config = $config;
+ $this->request = $request;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_service_credentials()
+ {
+ return array(
+ 'key' => $this->config['auth_oauth_facebook_key'],
+ 'secret' => $this->config['auth_oauth_facebook_secret'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_auth_login()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook))
+ {
+ throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // This was a callback request, get the token
+ $this->service_provider->requestAccessToken($this->request->variable('code', ''));
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('/me'), true);
+
+ // Return the unique identifier
+ return $result['id'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_token_auth()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook))
+ {
+ throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('/me'), true);
+
+ // Return the unique identifier
+ return $result['id'];
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/google.php b/phpBB/phpbb/auth/provider/oauth/service/google.php
new file mode 100644
index 0000000000..d4ef6e1d42
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/google.php
@@ -0,0 +1,109 @@
+<?php
+/**
+*
+* @package auth
+* @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;
+}
+
+/**
+* Google OAuth service
+*
+* @package auth
+*/
+class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth_service_base
+{
+ /**
+ * phpBB config
+ *
+ * @var phpbb_config
+ */
+ protected $config;
+
+ /**
+ * phpBB request
+ *
+ * @var phpbb_request
+ */
+ protected $request;
+
+ /**
+ * Constructor
+ *
+ * @param phpbb_config $config
+ * @param phpbb_request $request
+ */
+ public function __construct(phpbb_config $config, phpbb_request $request)
+ {
+ $this->config = $config;
+ $this->request = $request;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_auth_scope()
+ {
+ return array(
+ 'userinfo_email',
+ 'userinfo_profile',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_service_credentials()
+ {
+ return array(
+ 'key' => $this->config['auth_oauth_google_key'],
+ 'secret' => $this->config['auth_oauth_google_secret'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_auth_login()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google))
+ {
+ throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // This was a callback request, get the token
+ $this->service_provider->requestAccessToken($this->request->variable('code', ''));
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('https://www.googleapis.com/oauth2/v1/userinfo'), true);
+
+ // Return the unique identifier
+ return $result['id'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_token_auth()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google))
+ {
+ throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('https://www.googleapis.com/oauth2/v1/userinfo'), true);
+
+ // Return the unique identifier
+ return $result['id'];
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/interface.php b/phpBB/phpbb/auth/provider/oauth/service/interface.php
new file mode 100644
index 0000000000..3bba7c0e2c
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/interface.php
@@ -0,0 +1,77 @@
+<?php
+/**
+*
+* @package auth
+* @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;
+}
+
+/**
+* OAuth service interface
+*
+* @package auth
+*/
+interface phpbb_auth_provider_oauth_service_interface
+{
+ /**
+ * Returns an array of the scopes necessary for auth
+ *
+ * @return array An array of the required scopes
+ */
+ public function get_auth_scope();
+
+ /**
+ * Returns the external library service provider once it has been set
+ *
+ * @param \OAuth\Common\Service\ServiceInterface|null
+ */
+ public function get_external_service_provider();
+
+ /**
+ * Returns an array containing the service credentials belonging to requested
+ * service.
+ *
+ * @return array An array containing the 'key' and the 'secret' of the
+ * service in the form:
+ * array(
+ * 'key' => string
+ * 'secret' => string
+ * )
+ */
+ public function get_service_credentials();
+
+ /**
+ * Returns the results of the authentication in json format
+ *
+ * @throws phpbb_auth_provider_oauth_service_exception
+ * @return string The unique identifier returned by the service provider
+ * that is used to authenticate the user with phpBB.
+ */
+ public function perform_auth_login();
+
+ /**
+ * Returns the results of the authentication in json format
+ * Use this function when the user already has an access token
+ *
+ * @throws phpbb_auth_provider_oauth_service_exception
+ * @return string The unique identifier returned by the service provider
+ * that is used to authenticate the user with phpBB.
+ */
+ public function perform_token_auth();
+
+ /**
+ * Sets the external library service provider
+ *
+ * @param \OAuth\Common\Service\ServiceInterface $service
+ */
+ public function set_external_service_provider(\OAuth\Common\Service\ServiceInterface $service_provider);
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/token_storage.php b/phpBB/phpbb/auth/provider/oauth/token_storage.php
new file mode 100644
index 0000000000..d21deb8999
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/token_storage.php
@@ -0,0 +1,366 @@
+<?php
+/**
+*
+* @package auth
+* @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;
+}
+
+
+use OAuth\OAuth1\Token\StdOAuth1Token;
+use OAuth\Common\Token\TokenInterface;
+use OAuth\Common\Storage\TokenStorageInterface;
+use OAuth\Common\Storage\Exception\StorageException;
+use OAuth\Common\Storage\Exception\TokenNotFoundException;
+
+/**
+* OAuth storage wrapper for phpbb's cache
+*
+* @package auth
+*/
+class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
+{
+ /**
+ * Cache driver.
+ *
+ * @var phpbb_db_driver
+ */
+ protected $db;
+
+ /**
+ * phpBB user
+ *
+ * @var phpbb_user
+ */
+ protected $user;
+
+ /**
+ * OAuth token table
+ *
+ * @var string
+ */
+ protected $auth_provider_oauth_table;
+
+ /**
+ * @var object|TokenInterface
+ */
+ protected $cachedToken;
+
+ /**
+ * Creates token storage for phpBB.
+ *
+ * @param phpbb_db_driver $db
+ * @param phpbb_user $user
+ * @param string $auth_provider_oauth_table
+ */
+ public function __construct(phpbb_db_driver $db, phpbb_user $user, $auth_provider_oauth_table)
+ {
+ $this->db = $db;
+ $this->user = $user;
+ $this->auth_provider_oauth_table = $auth_provider_oauth_table;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function retrieveAccessToken($service)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ if ($this->cachedToken instanceOf TokenInterface)
+ {
+ return $this->cachedToken;
+ }
+
+ $data = array(
+ 'user_id' => (int) $this->user->data['user_id'],
+ 'provider' => $service,
+ );
+
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
+ {
+ $data['session_id'] = $this->user->data['session_id'];
+ }
+
+ return $this->_retrieve_access_token($data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function storeAccessToken($service, TokenInterface $token)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ $this->cachedToken = $token;
+
+ $data = array(
+ 'user_id' => (int) $this->user->data['user_id'],
+ 'provider' => $service,
+ 'oauth_token' => $this->json_encode_token($token),
+ 'session_id' => $this->user->data['session_id'],
+ );
+
+ $sql = 'INSERT INTO ' . $this->auth_provider_oauth_table . '
+ ' . $this->db->sql_build_array('INSERT', $data);
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hasAccessToken($service)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ if ($this->cachedToken) {
+ return true;
+ }
+
+ $data = array(
+ 'user_id' => (int) $this->user->data['user_id'],
+ 'provider' => $service,
+ );
+
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
+ {
+ $data['session_id'] = $this->user->data['session_id'];
+ }
+
+ return $this->_has_acess_token($data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function clearToken($service)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ $this->cachedToken = null;
+
+ $sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . '
+ WHERE user_id = ' . (int) $this->user->data['user_id'] . "
+ AND provider = '" . $this->db->sql_escape($service) . "'";
+
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
+ {
+ $sql .= " AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
+ }
+
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function clearAllTokens()
+ {
+ $this->cachedToken = null;
+
+ $sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . '
+ WHERE user_id = ' . (int) $this->user->data['user_id'];
+
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
+ {
+ $sql .= " AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
+ }
+
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Updates the user_id field in the database assosciated with the token
+ *
+ * @param int $user_id
+ */
+ public function set_user_id($user_id)
+ {
+ if (!$this->cachedToken)
+ {
+ return;
+ }
+
+ $sql = 'UPDATE ' . $this->auth_provider_oauth_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', array(
+ 'user_id' => (int) $user_id
+ )) . '
+ WHERE user_id = ' . (int) $this->user->data['user_id'] . "
+ AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Checks to see if an access token exists solely by the session_id of the user
+ *
+ * @return bool true if they have token, false if they don't
+ */
+ public function has_access_token_by_session($service)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ if ($this->cachedToken)
+ {
+ return true;
+ }
+
+ $data = array(
+ 'session_id' => $this->user->data['session_id'],
+ 'provider' => $service,
+ );
+
+ return $this->_has_acess_token($data);
+ }
+
+ /**
+ * A helper function that performs the query for has access token functions
+ *
+ * @param array $data
+ * @return bool
+ */
+ protected function _has_acess_token($data)
+ {
+ return (bool) $this->get_access_token_row($data);
+ }
+
+ public function retrieve_access_token_by_session($service)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ if ($this->cachedToken instanceOf TokenInterface) {
+ return $this->cachedToken;
+ }
+
+ $data = array(
+ 'session_id' => $this->user->data['session_id'],
+ 'provider' => $service,
+ );
+
+ return $this->_retrieve_access_token($data);
+ }
+
+ /**
+ * A helper function that performs the query for retrieve access token functions
+ * Also checks if the token is a valid token
+ *
+ * @param array $data
+ * @return mixed
+ */
+ protected function _retrieve_access_token($data)
+ {
+ $row = $this->get_access_token_row($data);
+
+ if (!$row)
+ {
+ throw new TokenNotFoundException('AUTH_PROVIDER_OAUTH_TOKEN_ERROR_NOT_STORED');
+ }
+
+ $token = $this->json_decode_token($row['oauth_token']);
+
+ // Ensure that the token was serialized/unserialized correctly
+ if (!($token instanceof TokenInterface))
+ {
+ $this->clearToken();
+ throw new TokenNotFoundException('AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED');
+ }
+
+ $this->cachedToken = $token;
+ return $token;
+ }
+
+ /**
+ * A helper function that performs the query for retrieving an access token
+ *
+ * @param array $data
+ * @return mixed
+ */
+ protected function get_access_token_row($data)
+ {
+ $sql = 'SELECT oauth_token FROM ' . $this->auth_provider_oauth_table . '
+ WHERE ' . $this->db->sql_build_array('SELECT', $data);
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ return $row;
+ }
+
+ public function json_encode_token(TokenInterface $token)
+ {
+ $members = array(
+ 'accessToken' => $token->getAccessToken(),
+ 'endOfLife' => $token->getEndOfLife(),
+ 'extraParams' => $token->getExtraParams(),
+ 'refreshToken' => $token->getRefreshToken(),
+
+ 'token_class' => get_class($token),
+ );
+
+ // Handle additional data needed for OAuth1 tokens
+ if ($token instanceof StdOAuth1Token)
+ {
+ $members['requestToken'] = $token->getRequestToken();
+ $members['requestTokenSecret'] = $token->getRequestTokenSecret();
+ $members['accessTokenSecret'] = $token->getAccessTokenSecret();
+ }
+
+ return json_encode($members);
+ }
+
+ public function json_decode_token($json)
+ {
+ $token_data = json_decode($json, true);
+
+ if ($token_data === null)
+ {
+ throw new TokenNotFoundException('AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED');
+ }
+
+ $token_class = $token_data['token_class'];
+ $access_token = $token_data['accessToken'];
+ $refresh_token = $token_data['refreshToken'];
+ $endOfLife = $token_data['endOfLife'];
+ $extra_params = $token_data['extraParams'];
+
+ // Create the token
+ $token = new $token_class($access_token, $refresh_token, TokenInterface::EOL_NEVER_EXPIRES, $extra_params);
+ $token->setEndOfLife($endOfLife);
+
+ // Handle OAuth 1.0 specific elements
+ if ($token instanceof StdOAuth1Token)
+ {
+ $token->setRequestToken($token_data['requestToken']);
+ $token->setRequestTokenSecret($token_data['requestTokenSecret']);
+ $token->setAccessTokenSecret($token_data['accessTokenSecret']);
+ }
+
+ return $token;
+ }
+
+ /**
+ * Returns the name of the service as it must be stored in the database.
+ *
+ * @param string $service The name of the OAuth service
+ * @return string The name of the OAuth service as it needs to be stored
+ * in the database.
+ */
+ protected function get_service_name_for_db($service)
+ {
+ // Enforce the naming convention for oauth services
+ if (strpos($service, 'auth.provider.oauth.service.') !== 0)
+ {
+ $service = 'auth.provider.oauth.service.' . strtolower($service);
+ }
+
+ return $service;
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/provider_interface.php b/phpBB/phpbb/auth/provider/provider_interface.php
index 8df2043375..46245d34ca 100644
--- a/phpBB/phpbb/auth/provider/provider_interface.php
+++ b/phpBB/phpbb/auth/provider/provider_interface.php
@@ -47,6 +47,11 @@ interface provider_interface
* 'error_msg' => string
* 'user_row' => array
* )
+ * A fourth key of the array may be present:
+ * 'redirect_data' This key is only used when 'status' is
+ * equal to LOGIN_SUCCESS_LINK_PROFILE and its value is an
+ * associative array that is turned into GET variables on
+ * the redirect url.
*/
public function login($username, $password);
@@ -82,10 +87,49 @@ interface provider_interface
* 'TEMPLATE_FILE' => string,
* 'TEMPLATE_VARS' => array(...),
* )
+ * An optional third element may be added to this
+ * array: 'BLOCK_VAR_NAME'. If this is present,
+ * then its value should be a string that is used
+ * to designate the name of the loop used in the
+ * ACP template file. When this is present, an
+ * additional key named 'BLOCK_VARS' is required.
+ * This must be an array containing at least one
+ * array of variables that will be assigned during
+ * the loop in the template. An example of this is
+ * presented below:
+ * array(
+ * 'BLOCK_VAR_NAME' => string,
+ * 'BLOCK_VARS' => array(
+ * 'KEY IS UNIMPORTANT' => array(...),
+ * ),
+ * 'TEMPLATE_FILE' => string,
+ * 'TEMPLATE_VARS' => array(...),
+ * )
*/
public function get_acp_template($new_config);
/**
+ * Returns an array of data necessary to build custom elements on the login
+ * form.
+ *
+ * @return array|null If this function is not implemented on an auth
+ * provider then it returns null. If it is implemented
+ * it will return an array of up to four elements of
+ * which only 'TEMPLATE_FILE'. If 'BLOCK_VAR_NAME' is
+ * present then 'BLOCK_VARS' must also be present in
+ * the array. The fourth element 'VARS' is also
+ * optional. The array, with all four elements present
+ * looks like the following:
+ * array(
+ * 'TEMPLATE_FILE' => string,
+ * 'BLOCK_VAR_NAME' => string,
+ * 'BLOCK_VARS' => array(...),
+ * 'VARS' => array(...),
+ * )
+ */
+ public function get_login_data();
+
+ /**
* Performs additional actions during logout.
*
* @param array $data An array corresponding to
@@ -104,4 +148,52 @@ interface provider_interface
* session should be closed, or null if not implemented.
*/
public function validate_session($user);
+
+ /**
+ * Checks to see if $login_link_data contains all information except for the
+ * user_id of an account needed to successfully link an external account to
+ * a forum account.
+ *
+ * @param array $link_data Any data needed to link a phpBB account to
+ * an external account.
+ * @return string|null Returns a string with a language constant if there
+ * is data missing or null if there is no error.
+ */
+ public function login_link_has_necessary_data($login_link_data);
+
+ /**
+ * Links an external account to a phpBB account.
+ *
+ * @param array $link_data Any data needed to link a phpBB account to
+ * an external account.
+ */
+ public function link_account(array $link_data);
+
+ /**
+ * Returns an array of data necessary to build the ucp_auth_link page
+ *
+ * @return array|null If this function is not implemented on an auth
+ * provider then it returns null. If it is implemented
+ * it will return an array of up to four elements of
+ * which only 'TEMPLATE_FILE'. If 'BLOCK_VAR_NAME' is
+ * present then 'BLOCK_VARS' must also be present in
+ * the array. The fourth element 'VARS' is also
+ * optional. The array, with all four elements present
+ * looks like the following:
+ * array(
+ * 'TEMPLATE_FILE' => string,
+ * 'BLOCK_VAR_NAME' => string,
+ * 'BLOCK_VARS' => array(...),
+ * 'VARS' => array(...),
+ * )
+ */
+ public function get_auth_link_data();
+
+ /**
+ * Unlinks an external account from a phpBB account.
+ *
+ * @param array $link_data Any data needed to unlink a phpBB account
+ * from a phpbb account.
+ */
+ public function unlink_account(array $link_data);
}
diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php
index 1e29fb5735..1aa638dfe5 100644
--- a/phpBB/phpbb/avatar/driver/remote.php
+++ b/phpBB/phpbb/avatar/driver/remote.php
@@ -95,7 +95,7 @@ class remote extends \phpbb\avatar\driver\driver
// Make sure getimagesize works...
if (function_exists('getimagesize'))
{
- if (($width <= 0 || $height <= 0) && (($image_data = getimagesize($url)) === false))
+ if (($width <= 0 || $height <= 0) && (($image_data = @getimagesize($url)) === false))
{
$error[] = 'UNABLE_GET_IMAGE_SIZE';
return false;
diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php
index 6e88499577..36525e7f55 100644
--- a/phpBB/phpbb/cache/driver/file.php
+++ b/phpBB/phpbb/cache/driver/file.php
@@ -207,28 +207,34 @@ class file extends \phpbb\cache\driver\base
function purge()
{
// Purge all phpbb cache files
- $dir = @opendir($this->cache_dir);
-
- if (!$dir)
+ try
+ {
+ $iterator = new DirectoryIterator($this->cache_dir);
+ }
+ catch (Exception $e)
{
return;
}
- while (($entry = readdir($dir)) !== false)
+ foreach ($iterator as $fileInfo)
{
- if (strpos($entry, 'container_') !== 0 &&
- strpos($entry, 'url_matcher') !== 0 &&
- strpos($entry, 'sql_') !== 0 &&
- strpos($entry, 'data_') !== 0 &&
- strpos($entry, 'ctpl_') !== 0 &&
- strpos($entry, 'tpl_') !== 0)
+ if ($fileInfo->isDot())
{
continue;
}
-
- $this->remove_file($this->cache_dir . $entry);
+ $filename = $fileInfo->getFilename();
+ if ($fileInfo->isDir())
+ {
+ $this->remove_dir($fileInfo->getPathname());
+ }
+ elseif (strpos($filename, 'container_') === 0 ||
+ strpos($filename, 'url_matcher') === 0 ||
+ strpos($filename, 'sql_') === 0 ||
+ strpos($filename, 'data_') === 0)
+ {
+ $this->remove_file($fileInfo->getPathname());
+ }
}
- closedir($dir);
unset($this->vars);
unset($this->var_expires);
@@ -244,6 +250,44 @@ class file extends \phpbb\cache\driver\base
}
/**
+ * Remove directory
+ *
+ * @param string $dir Directory to remove
+ *
+ * @return null
+ */
+ protected function remove_dir($dir)
+ {
+ try
+ {
+ $iterator = new DirectoryIterator($dir);
+ }
+ catch (Exception $e)
+ {
+ return;
+ }
+
+ foreach ($iterator as $fileInfo)
+ {
+ if ($fileInfo->isDot())
+ {
+ continue;
+ }
+
+ if ($fileInfo->isDir())
+ {
+ $this->remove_dir($fileInfo->getPathname());
+ }
+ else
+ {
+ $this->remove_file($fileInfo->getPathname());
+ }
+ }
+
+ @rmdir($dir);
+ }
+
+ /**
* Destroy cache data
*/
function destroy($var_name, $table = '')
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
index 097a886430..bf720957bc 100644
--- a/phpBB/phpbb/content_visibility.php
+++ b/phpBB/phpbb/content_visibility.php
@@ -362,6 +362,11 @@ class content_visibility
// Sync the first/last topic information if needed
if (!$is_starter && $is_latest)
{
+ if (!function_exists('update_post_information'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext);
+ }
+
// update_post_information can only update the last post info ...
if ($topic_id)
{
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index f1cc29f21b..6e45374643 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -38,6 +38,12 @@ class helper
protected $user;
/**
+ * config object
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
* phpBB root path
* @var string
*/
@@ -53,14 +59,16 @@ class helper
* Constructor
*
* @param \phpbb\template\template $template Template object
- * @param \phpbb\user $user User object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\config\config $config Config object
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP extension
*/
- public function __construct(\phpbb\template\template $template, \phpbb\user $user, $phpbb_root_path, $php_ext)
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, $phpbb_root_path, $php_ext)
{
$this->template = $template;
$this->user = $user;
+ $this->config = $config;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
}
@@ -104,22 +112,14 @@ class helper
$route = substr($route, 0, $route_delim);
}
- if (is_array($params) && !empty($params))
- {
- $params = array_merge(array(
- 'controller' => $route,
- ), $params);
- }
- else if (is_string($params) && $params)
- {
- $params = 'controller=' . $route . (($is_amp) ? '&amp;' : '&') . $params;
- }
- else
+ // If enable_mod_rewrite is false, we need to include app.php
+ $route_prefix = $this->phpbb_root_path;
+ if (empty($this->config['enable_mod_rewrite']))
{
- $params = array('controller' => $route);
+ $route_prefix .= 'app.' . $this->php_ext . '/';
}
- return append_sid($this->phpbb_root_path . 'app.' . $this->php_ext . $route_params, $params, $is_amp, $session_id);
+ return append_sid($route_prefix . "$route" . $route_params, $params, $is_amp, $session_id);
}
/**
diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php
index 5c1f5e836e..dad2ebd06b 100644
--- a/phpBB/phpbb/controller/resolver.php
+++ b/phpBB/phpbb/controller/resolver.php
@@ -40,23 +40,23 @@ class resolver implements ControllerResolverInterface
protected $container;
/**
- * \phpbb\style\style object
- * @var \phpbb\style\style
+ * phpbb\template\template object
+ * @var phpbb\template\template
*/
- protected $style;
+ protected $template;
/**
* Construct method
*
* @param \phpbb\user $user User Object
* @param ContainerInterface $container ContainerInterface object
- * @param \phpbb\style\style $style
+ * @param \phpbb\template\template $template
*/
- public function __construct(\phpbb\user $user, ContainerInterface $container, \phpbb\style\style $style = null)
+ public function __construct(\phpbb\user $user, ContainerInterface $container, \phpbb\template\template $template = null)
{
$this->user = $user;
$this->container = $container;
- $this->style = $style;
+ $this->template = $template;
}
/**
@@ -98,13 +98,13 @@ class resolver implements ControllerResolverInterface
$controller_dir = explode('_', get_class($controller_object));
// 0 phpbb, 1 ext, 2 vendor, 3 extension name, ...
- if (!is_null($this->style) && isset($controller_dir[3]) && $controller_dir[1] === 'ext')
+ if (!is_null($this->template) && isset($controller_dir[3]) && $controller_dir[1] === 'ext')
{
$controller_style_dir = 'ext/' . $controller_dir[2] . '/' . $controller_dir[3] . '/styles';
if (is_dir($controller_style_dir))
{
- $this->style->set_style(array($controller_style_dir, 'styles'));
+ $this->template->set_style(array($controller_style_dir, 'styles'));
}
}
diff --git a/phpBB/phpbb/cron/task/core/prune_notifications.php b/phpBB/phpbb/cron/task/core/prune_notifications.php
new file mode 100644
index 0000000000..296c0ae64f
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/prune_notifications.php
@@ -0,0 +1,65 @@
+<?php
+/**
+*
+* @package phpBB3
+* @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;
+}
+
+/**
+* Prune notifications cron task.
+*
+* @package phpBB3
+*/
+class phpbb_cron_task_core_prune_notifications extends phpbb_cron_task_base
+{
+ protected $config;
+ protected $notification_manager;
+
+ /**
+ * Constructor.
+ *
+ * @param phpbb_config $config The config
+ * @param phpbb_notification_manager $notification_manager Notification manager
+ */
+ public function __construct(phpbb_config $config, phpbb_notification_manager $notification_manager)
+ {
+ $this->config = $config;
+ $this->notification_manager = $notification_manager;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ // time minus expire days in seconds
+ $timestamp = time() - ($this->config['read_notification_expire_days'] * 60 * 60 * 24);
+ $this->notification_manager->prune_notifications($timestamp);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_runnable()
+ {
+ return (bool) $this->config['read_notification_expire_days'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function should_run()
+ {
+ return $this->config['read_notification_last_gc'] < time() - $this->config['read_notification_gc'];
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php
new file mode 100644
index 0000000000..cad1c16bb2
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php
@@ -0,0 +1,71 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
+*
+*/
+
+class phpbb_db_migration_data_310_auth_provider_oauth extends phpbb_db_migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_tables' => array(
+ $this->table_prefix . 'oauth_tokens' => array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0), // phpbb_users.user_id
+ 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set
+ 'provider' => array('VCHAR', ''), // Name of the OAuth provider
+ 'oauth_token' => array('MTEXT', ''), // Serialized token
+ ),
+ 'KEYS' => array(
+ 'user_id' => array('INDEX', 'user_id'),
+ 'provider' => array('INDEX', 'provider'),
+ ),
+ ),
+ $this->table_prefix . 'oauth_accounts' => array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'provider' => array('VCHAR', ''),
+ 'oauth_provider_id' => array('TEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => array(
+ 'user_id',
+ 'provider',
+ ),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'oauth_tokens',
+ $this->table_prefix . 'oauth_accounts',
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('module.add', array(
+ 'ucp',
+ 'UCP_PROFILE',
+ array(
+ 'module_basename' => 'ucp_auth_link',
+ 'modes' => array('auth_link'),
+ ),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/310/mod_rewrite.php b/phpBB/phpbb/db/migration/data/310/mod_rewrite.php
new file mode 100644
index 0000000000..85ce25abf3
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/310/mod_rewrite.php
@@ -0,0 +1,25 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
+*
+*/
+
+class phpbb_db_migration_data_310_mod_rewrite extends phpbb_db_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ 'phpbb_db_migration_data_310_dev',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('enable_mod_rewrite', '0')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/310/notifications_cron.php b/phpBB/phpbb/db/migration/data/310/notifications_cron.php
new file mode 100644
index 0000000000..454628e50e
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/310/notifications_cron.php
@@ -0,0 +1,25 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+class phpbb_db_migration_data_310_notifications_cron extends phpbb_db_migration
+{
+ static public function depends_on()
+ {
+ return array('phpbb_db_migration_data_310_notifications');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('read_notification_expire_days', 30)),
+ array('config.add', array('read_notification_last_gc', 0)), // last run
+ array('config.add', array('read_notification_gc', (60 * 60 * 24))), // seconds between run; 1 day
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/310/softdelete_mcp_modules.php b/phpBB/phpbb/db/migration/data/310/softdelete_mcp_modules.php
new file mode 100644
index 0000000000..f80f55d19a
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/310/softdelete_mcp_modules.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
+*
+*/
+
+class phpbb_db_migration_data_310_softdelete_mcp_modules extends phpbb_db_migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'mcp'
+ AND module_basename = 'mcp_queue'
+ AND module_mode = 'deleted_topics'";
+ $result = $this->db->sql_query($sql);
+ $module_id = $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ return $module_id !== false;
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ 'phpbb_db_migration_data_310_dev',
+ 'phpbb_db_migration_data_310_softdelete_p2',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('module.add', array(
+ 'mcp',
+ 'MCP_QUEUE',
+ array(
+ 'module_basename' => 'mcp_queue',
+ 'modes' => array('deleted_topics'),
+ ),
+ )),
+ array('module.add', array(
+ 'mcp',
+ 'MCP_QUEUE',
+ array(
+ 'module_basename' => 'mcp_queue',
+ 'modes' => array('deleted_posts'),
+ ),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php
index 26f90a18f3..aed0f2784b 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php
@@ -13,7 +13,7 @@ class release_3_0_1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.1', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php
index 5da406e115..305309c3bd 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php
@@ -13,7 +13,7 @@ class release_3_0_10 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.10', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.10', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php
index 4cde65dd72..fb50d67fb5 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php
@@ -13,7 +13,7 @@ class release_3_0_10_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.10-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.10-RC1', '>=');
}
static public function depends_on()
@@ -26,7 +26,7 @@ class release_3_0_10_rc1 extends \phpbb\db\migration\migration
return array(
array('config.add', array('email_max_chunk_size', 50)),
- array('config.update', array('version', '3.0.10-rc1')),
+ array('config.update', array('version', '3.0.10-RC1')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php
index a729f45ed1..63ba1e8fc2 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php
@@ -13,7 +13,7 @@ class release_3_0_10_rc2 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.10-rc2', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.10-RC2', '>=');
}
static public function depends_on()
@@ -24,7 +24,7 @@ class release_3_0_10_rc2 extends \phpbb\db\migration\migration
public function update_data()
{
return array(
- array('config.update', array('version', '3.0.10-rc2')),
+ array('config.update', array('version', '3.0.10-RC2')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php
index 4c47868c19..7055063032 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php
@@ -13,7 +13,7 @@ class release_3_0_10_rc3 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.10-rc3', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.10-RC3', '>=');
}
static public function depends_on()
@@ -24,7 +24,7 @@ class release_3_0_10_rc3 extends \phpbb\db\migration\migration
public function update_data()
{
return array(
- array('config.update', array('version', '3.0.10-rc3')),
+ array('config.update', array('version', '3.0.10-RC3')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php
index f65fe178c0..1246597efb 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php
@@ -13,7 +13,7 @@ class release_3_0_11 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.11', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.11', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php
index 860a65052f..7e284235e1 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php
@@ -13,7 +13,7 @@ class release_3_0_11_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.11-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.11-RC1', '>=');
}
static public function depends_on()
@@ -27,7 +27,7 @@ class release_3_0_11_rc1 extends \phpbb\db\migration\migration
array('custom', array(array(&$this, 'cleanup_deactivated_styles'))),
array('custom', array(array(&$this, 'delete_orphan_private_messages'))),
- array('config.update', array('version', '3.0.11-rc1')),
+ array('config.update', array('version', '3.0.11-RC1')),
);
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php
index 62e267ac01..017038855d 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php
@@ -13,7 +13,7 @@ class release_3_0_11_rc2 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.11-rc2', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.11-RC2', '>=');
}
static public function depends_on()
@@ -46,7 +46,7 @@ class release_3_0_11_rc2 extends \phpbb\db\migration\migration
public function update_data()
{
return array(
- array('config.update', array('version', '3.0.11-rc2')),
+ array('config.update', array('version', '3.0.11-RC2')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php
index 69db096cb0..35a3015959 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php
@@ -15,7 +15,7 @@ class release_3_0_12_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.12-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.12-RC1', '>=');
}
static public function depends_on()
@@ -30,7 +30,7 @@ class release_3_0_12_rc1 extends \phpbb\db\migration\migration
array('custom', array(array(&$this, 'update_bots'))),
array('custom', array(array(&$this, 'disable_bots_from_receiving_pms'))),
- array('config.update', array('version', '3.0.12-rc1')),
+ array('config.update', array('version', '3.0.12-RC1')),
);
}
@@ -110,7 +110,7 @@ class release_3_0_12_rc1 extends \phpbb\db\migration\migration
WHERE user_id = $bot_user_id";
$this->sql_query($sql);
- user_delete('remove', $bot_user_id);
+ user_delete('retain', $bot_user_id);
}
else
{
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php
index 990b82141e..862276528d 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php
@@ -13,7 +13,7 @@ class release_3_0_1_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.1-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.1-RC1', '>=');
}
public function update_schema()
@@ -76,7 +76,7 @@ class release_3_0_1_rc1 extends \phpbb\db\migration\migration
array('custom', array(array(&$this, 'fix_unset_last_view_time'))),
array('custom', array(array(&$this, 'reset_smiley_size'))),
- array('config.update', array('version', '3.0.1-rc1')),
+ array('config.update', array('version', '3.0.1-RC1')),
);
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php
index abb41f38cf..7e2a08590e 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php
@@ -13,7 +13,7 @@ class release_3_0_2 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.2', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.2', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php
index 8661531dd9..7a856383e2 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php
@@ -13,7 +13,7 @@ class release_3_0_2_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.2-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.2-RC1', '>=');
}
static public function depends_on()
@@ -28,7 +28,7 @@ class release_3_0_2_rc1 extends \phpbb\db\migration\migration
array('config.add', array('check_attachment_content', '1')),
array('config.add', array('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title')),
- array('config.update', array('version', '3.0.2-rc1')),
+ array('config.update', array('version', '3.0.2-RC1')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php
index 55055ca0a2..61562575eb 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php
@@ -13,7 +13,7 @@ class release_3_0_2_rc2 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.2-rc2', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.2-RC2', '>=');
}
static public function depends_on()
@@ -76,7 +76,7 @@ class release_3_0_2_rc2 extends \phpbb\db\migration\migration
public function update_data()
{
return array(
- array('config.update', array('version', '3.0.2-rc2')),
+ array('config.update', array('version', '3.0.2-RC2')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php
index 49e37e9386..b2adbeaa43 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php
@@ -13,7 +13,7 @@ class release_3_0_3 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.3', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.3', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php
index 4b87933b11..57bd59bba3 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php
@@ -13,7 +13,7 @@ class release_3_0_3_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.3-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.3-RC1', '>=');
}
static public function depends_on()
@@ -62,7 +62,7 @@ class release_3_0_3_rc1 extends \phpbb\db\migration\migration
array('permission.add', array('u_masspm_group', true, 'u_masspm')),
array('custom', array(array(&$this, 'correct_acp_email_permissions'))),
- array('config.update', array('version', '3.0.3-rc1')),
+ array('config.update', array('version', '3.0.3-RC1')),
);
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php
index f15f806cee..5d6140393b 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php
@@ -13,7 +13,7 @@ class release_3_0_4 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.4', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.4', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php
index 752dfd2576..a8af4dd76c 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php
@@ -13,7 +13,7 @@ class release_3_0_4_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.4-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.4-RC1', '>=');
}
static public function depends_on()
@@ -78,7 +78,7 @@ class release_3_0_4_rc1 extends \phpbb\db\migration\migration
return array(
array('custom', array(array(&$this, 'update_custom_profile_fields'))),
- array('config.update', array('version', '3.0.4-rc1')),
+ array('config.update', array('version', '3.0.4-RC1')),
);
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php
index f2d458e9c5..7bbe7ffed9 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php
@@ -13,7 +13,7 @@ class release_3_0_5 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.5', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.5', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php
index 81bd3db975..ffe2c6a44d 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php
@@ -13,7 +13,7 @@ class release_3_0_5_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.5-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.5-RC1', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php
index 1c04d814fd..04b14b5189 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php
@@ -13,7 +13,7 @@ class release_3_0_5_rc1part2 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.5-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.5-RC1', '>=');
}
static public function depends_on()
@@ -38,7 +38,7 @@ class release_3_0_5_rc1part2 extends \phpbb\db\migration\migration
public function update_data()
{
return array(
- array('config.update', array('version', '3.0.5-rc1')),
+ array('config.update', array('version', '3.0.5-RC1')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php
index 24b7dc51a5..85ea2e9d20 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php
@@ -13,7 +13,7 @@ class release_3_0_6 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.6', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.6', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php
index d78a0b7eed..712d54a723 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php
@@ -13,7 +13,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.6-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.6-RC1', '>=');
}
static public function depends_on()
@@ -187,7 +187,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration
array('custom', array(array(&$this, 'add_newly_registered_group'))),
array('custom', array(array(&$this, 'set_user_options_default'))),
- array('config.update', array('version', '3.0.6-rc1')),
+ array('config.update', array('version', '3.0.6-RC1')),
);
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php
index d5dbf2e2a9..7a0ef28601 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php
@@ -13,7 +13,7 @@ class release_3_0_6_rc2 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.6-rc2', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.6-RC2', '>=');
}
static public function depends_on()
@@ -24,7 +24,7 @@ class release_3_0_6_rc2 extends \phpbb\db\migration\migration
public function update_data()
{
return array(
- array('config.update', array('version', '3.0.6-rc2')),
+ array('config.update', array('version', '3.0.6-RC2')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php
index 40fd076ff1..73a1fe9e6a 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php
@@ -13,7 +13,7 @@ class release_3_0_6_rc3 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.6-rc3', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.6-RC3', '>=');
}
static public function depends_on()
@@ -26,7 +26,7 @@ class release_3_0_6_rc3 extends \phpbb\db\migration\migration
return array(
array('custom', array(array(&$this, 'update_cp_fields'))),
- array('config.update', array('version', '3.0.6-rc3')),
+ array('config.update', array('version', '3.0.6-RC3')),
);
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php
index 93b01c888f..b6e5be2c2f 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php
@@ -13,7 +13,7 @@ class release_3_0_6_rc4 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.6-rc4', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.6-RC4', '>=');
}
static public function depends_on()
@@ -24,7 +24,7 @@ class release_3_0_6_rc4 extends \phpbb\db\migration\migration
public function update_data()
{
return array(
- array('config.update', array('version', '3.0.6-rc4')),
+ array('config.update', array('version', '3.0.6-RC4')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php
index e19cbb04fa..2b0da30bc6 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php
@@ -13,7 +13,7 @@ class release_3_0_7 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.7', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.7', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php
index 0fad5f5ff5..3547ee77e1 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php
@@ -13,7 +13,7 @@ class release_3_0_7_pl1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.7-pl1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.7-pl1', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php
index 17f97c7043..de4d772808 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php
@@ -13,7 +13,7 @@ class release_3_0_7_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.7-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.7-RC1', '>=');
}
static public function depends_on()
@@ -64,7 +64,7 @@ class release_3_0_7_rc1 extends \phpbb\db\migration\migration
array('config.add', array('feed_topics_active', $this->config['feed_overall_topics'])),
array('custom', array(array(&$this, 'delete_text_templates'))),
- array('config.update', array('version', '3.0.7-rc1')),
+ array('config.update', array('version', '3.0.7-RC1')),
);
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php
index 0437e7aa7c..800803a753 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php
@@ -13,7 +13,7 @@ class release_3_0_7_rc2 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.7-rc2', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.7-RC2', '>=');
}
static public function depends_on()
@@ -26,7 +26,7 @@ class release_3_0_7_rc2 extends \phpbb\db\migration\migration
return array(
array('custom', array(array(&$this, 'update_email_hash'))),
- array('config.update', array('version', '3.0.7-rc2')),
+ array('config.update', array('version', '3.0.7-RC2')),
);
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php
index ccd1b94bef..6c8b1df6fc 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php
@@ -13,7 +13,7 @@ class release_3_0_8 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.8', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.8', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php
index be32ec0384..1a14e5c961 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php
@@ -13,7 +13,7 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.8-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.8-RC1', '>=');
}
static public function depends_on()
@@ -40,7 +40,7 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration
array('config.update_if_equals', array(600, 'queue_interval', 60)),
array('config.update_if_equals', array(50, 'email_package_size', 20)),
- array('config.update', array('version', '3.0.8-rc1')),
+ array('config.update', array('version', '3.0.8-RC1')),
);
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php
index 1783ee8a34..9af2fce971 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php
@@ -13,7 +13,7 @@ class release_3_0_9 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.9', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.9', '>=');
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php
index 12a8c341d0..3fb790bc0d 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php
@@ -13,7 +13,7 @@ class release_3_0_9_rc1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.9-rc1', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.9-RC1', '>=');
}
static public function depends_on()
@@ -76,7 +76,7 @@ class release_3_0_9_rc1 extends \phpbb\db\migration\migration
array('custom', array(array(&$this, 'update_file_extension_group_names'))),
array('custom', array(array(&$this, 'fix_firebird_qa_captcha'))),
- array('config.update', array('version', '3.0.9-rc1')),
+ array('config.update', array('version', '3.0.9-RC1')),
);
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php
index f6e05361b3..cd79d24ade 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php
@@ -13,7 +13,7 @@ class release_3_0_9_rc2 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.9-rc2', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.9-RC2', '>=');
}
static public function depends_on()
@@ -24,7 +24,7 @@ class release_3_0_9_rc2 extends \phpbb\db\migration\migration
public function update_data()
{
return array(
- array('config.update', array('version', '3.0.9-rc2')),
+ array('config.update', array('version', '3.0.9-RC2')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php
index 29b53e56c9..7e59b8f9e8 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php
@@ -13,7 +13,7 @@ class release_3_0_9_rc3 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.9-rc3', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.9-RC3', '>=');
}
static public function depends_on()
@@ -24,7 +24,7 @@ class release_3_0_9_rc3 extends \phpbb\db\migration\migration
public function update_data()
{
return array(
- array('config.update', array('version', '3.0.9-rc3')),
+ array('config.update', array('version', '3.0.9-RC3')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php
index 4921330fdd..e71d9defa6 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php
@@ -13,7 +13,7 @@ class release_3_0_9_rc4 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
- return version_compare($this->config['version'], '3.0.9-rc4', '>=');
+ return phpbb_version_compare($this->config['version'], '3.0.9-RC4', '>=');
}
static public function depends_on()
@@ -24,7 +24,7 @@ class release_3_0_9_rc4 extends \phpbb\db\migration\migration
public function update_data()
{
return array(
- array('config.update', array('version', '3.0.9-rc4')),
+ array('config.update', array('version', '3.0.9-RC4')),
);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php b/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php
index 494125ea5c..a85e0be01c 100644
--- a/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php
+++ b/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php
@@ -19,7 +19,7 @@ class signature_module_auth extends \phpbb\db\migration\migration
AND module_basename = 'ucp_profile'
AND module_mode = 'signature'";
$result = $this->db->sql_query($sql);
- $module_auth = $this->db_sql_fetchfield('module_auth');
+ $module_auth = $this->db->sql_fetchfield('module_auth');
$this->db->sql_freeresult($result);
return $module_auth === 'acl_u_sig' || $module_auth === false;
diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php
index 35b89e8166..f594fbe63f 100644
--- a/phpBB/phpbb/db/tools.php
+++ b/phpBB/phpbb/db/tools.php
@@ -39,247 +39,257 @@ class tools
* The Column types for every database we support
* @var array
*/
- var $dbms_type_map = array(
- 'mysql_41' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT' => 'text',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT' => 'text',
- 'TEXT_UNI' => 'text',
- 'MTEXT' => 'mediumtext',
- 'MTEXT_UNI' => 'mediumtext',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'mysql_40' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varbinary(255)',
- 'VCHAR:' => 'varbinary(%d)',
- 'CHAR:' => 'binary(%d)',
- 'XSTEXT' => 'blob',
- 'XSTEXT_UNI'=> 'blob',
- 'STEXT' => 'blob',
- 'STEXT_UNI' => 'blob',
- 'TEXT' => 'blob',
- 'TEXT_UNI' => 'blob',
- 'MTEXT' => 'mediumblob',
- 'MTEXT_UNI' => 'mediumblob',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'blob',
- 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
- 'VCHAR_CI' => 'blob',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'firebird' => array(
- 'INT:' => 'INTEGER',
- 'BINT' => 'DOUBLE PRECISION',
- 'UINT' => 'INTEGER',
- 'UINT:' => 'INTEGER',
- 'TINT:' => 'INTEGER',
- 'USINT' => 'INTEGER',
- 'BOOL' => 'INTEGER',
- 'VCHAR' => 'VARCHAR(255) CHARACTER SET NONE',
- 'VCHAR:' => 'VARCHAR(%d) CHARACTER SET NONE',
- 'CHAR:' => 'CHAR(%d) CHARACTER SET NONE',
- 'XSTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'STEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'TEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'MTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'XSTEXT_UNI'=> 'VARCHAR(100) CHARACTER SET UTF8',
- 'STEXT_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'TEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'MTEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'TIMESTAMP' => 'INTEGER',
- 'DECIMAL' => 'DOUBLE PRECISION',
- 'DECIMAL:' => 'DOUBLE PRECISION',
- 'PDECIMAL' => 'DOUBLE PRECISION',
- 'PDECIMAL:' => 'DOUBLE PRECISION',
- 'VCHAR_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VCHAR_UNI:'=> 'VARCHAR(%d) CHARACTER SET UTF8',
- 'VCHAR_CI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VARBINARY' => 'CHAR(255) CHARACTER SET NONE',
- ),
-
- 'mssql' => array(
- 'INT:' => '[int]',
- 'BINT' => '[float]',
- 'UINT' => '[int]',
- 'UINT:' => '[int]',
- 'TINT:' => '[int]',
- 'USINT' => '[int]',
- 'BOOL' => '[int]',
- 'VCHAR' => '[varchar] (255)',
- 'VCHAR:' => '[varchar] (%d)',
- 'CHAR:' => '[char] (%d)',
- 'XSTEXT' => '[varchar] (1000)',
- 'STEXT' => '[varchar] (3000)',
- 'TEXT' => '[varchar] (8000)',
- 'MTEXT' => '[text]',
- 'XSTEXT_UNI'=> '[varchar] (100)',
- 'STEXT_UNI' => '[varchar] (255)',
- 'TEXT_UNI' => '[varchar] (4000)',
- 'MTEXT_UNI' => '[text]',
- 'TIMESTAMP' => '[int]',
- 'DECIMAL' => '[float]',
- 'DECIMAL:' => '[float]',
- 'PDECIMAL' => '[float]',
- 'PDECIMAL:' => '[float]',
- 'VCHAR_UNI' => '[varchar] (255)',
- 'VCHAR_UNI:'=> '[varchar] (%d)',
- 'VCHAR_CI' => '[varchar] (255)',
- 'VARBINARY' => '[varchar] (255)',
- ),
-
- 'mssqlnative' => array(
- 'INT:' => '[int]',
- 'BINT' => '[float]',
- 'UINT' => '[int]',
- 'UINT:' => '[int]',
- 'TINT:' => '[int]',
- 'USINT' => '[int]',
- 'BOOL' => '[int]',
- 'VCHAR' => '[varchar] (255)',
- 'VCHAR:' => '[varchar] (%d)',
- 'CHAR:' => '[char] (%d)',
- 'XSTEXT' => '[varchar] (1000)',
- 'STEXT' => '[varchar] (3000)',
- 'TEXT' => '[varchar] (8000)',
- 'MTEXT' => '[text]',
- 'XSTEXT_UNI'=> '[varchar] (100)',
- 'STEXT_UNI' => '[varchar] (255)',
- 'TEXT_UNI' => '[varchar] (4000)',
- 'MTEXT_UNI' => '[text]',
- 'TIMESTAMP' => '[int]',
- 'DECIMAL' => '[float]',
- 'DECIMAL:' => '[float]',
- 'PDECIMAL' => '[float]',
- 'PDECIMAL:' => '[float]',
- 'VCHAR_UNI' => '[varchar] (255)',
- 'VCHAR_UNI:'=> '[varchar] (%d)',
- 'VCHAR_CI' => '[varchar] (255)',
- 'VARBINARY' => '[varchar] (255)',
- ),
-
- 'oracle' => array(
- 'INT:' => 'number(%d)',
- 'BINT' => 'number(20)',
- 'UINT' => 'number(8)',
- 'UINT:' => 'number(%d)',
- 'TINT:' => 'number(%d)',
- 'USINT' => 'number(4)',
- 'BOOL' => 'number(1)',
- 'VCHAR' => 'varchar2(255)',
- 'VCHAR:' => 'varchar2(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar2(1000)',
- 'STEXT' => 'varchar2(3000)',
- 'TEXT' => 'clob',
- 'MTEXT' => 'clob',
- 'XSTEXT_UNI'=> 'varchar2(300)',
- 'STEXT_UNI' => 'varchar2(765)',
- 'TEXT_UNI' => 'clob',
- 'MTEXT_UNI' => 'clob',
- 'TIMESTAMP' => 'number(11)',
- 'DECIMAL' => 'number(5, 2)',
- 'DECIMAL:' => 'number(%d, 2)',
- 'PDECIMAL' => 'number(6, 3)',
- 'PDECIMAL:' => 'number(%d, 3)',
- 'VCHAR_UNI' => 'varchar2(765)',
- 'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')),
- 'VCHAR_CI' => 'varchar2(255)',
- 'VARBINARY' => 'raw(255)',
- ),
-
- 'sqlite' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'INTEGER UNSIGNED', //'mediumint(8) UNSIGNED',
- 'UINT:' => 'INTEGER UNSIGNED', // 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'INTEGER UNSIGNED', //'mediumint(4) UNSIGNED',
- 'BOOL' => 'INTEGER UNSIGNED', //'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text(65535)',
- 'STEXT' => 'text(65535)',
- 'TEXT' => 'text(65535)',
- 'MTEXT' => 'mediumtext(16777215)',
- 'XSTEXT_UNI'=> 'text(65535)',
- 'STEXT_UNI' => 'text(65535)',
- 'TEXT_UNI' => 'text(65535)',
- 'MTEXT_UNI' => 'mediumtext(16777215)',
- 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'blob',
- ),
-
- 'postgres' => array(
- 'INT:' => 'INT4',
- 'BINT' => 'INT8',
- 'UINT' => 'INT4', // unsigned
- 'UINT:' => 'INT4', // unsigned
- 'USINT' => 'INT2', // unsigned
- 'BOOL' => 'INT2', // unsigned
- 'TINT:' => 'INT2',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar(1000)',
- 'STEXT' => 'varchar(3000)',
- 'TEXT' => 'varchar(8000)',
- 'MTEXT' => 'TEXT',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT_UNI' => 'varchar(4000)',
- 'MTEXT_UNI' => 'TEXT',
- 'TIMESTAMP' => 'INT4', // unsigned
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar_ci',
- 'VARBINARY' => 'bytea',
- ),
- );
+ var $dbms_type_map = array();
+
+ /**
+ * Get the column types for every database we support
+ *
+ * @return array
+ */
+ public static function get_dbms_type_map()
+ {
+ return array(
+ 'mysql_41' => array(
+ 'INT:' => 'int(%d)',
+ 'BINT' => 'bigint(20)',
+ 'UINT' => 'mediumint(8) UNSIGNED',
+ 'UINT:' => 'int(%d) UNSIGNED',
+ 'TINT:' => 'tinyint(%d)',
+ 'USINT' => 'smallint(4) UNSIGNED',
+ 'BOOL' => 'tinyint(1) UNSIGNED',
+ 'VCHAR' => 'varchar(255)',
+ 'VCHAR:' => 'varchar(%d)',
+ 'CHAR:' => 'char(%d)',
+ 'XSTEXT' => 'text',
+ 'XSTEXT_UNI'=> 'varchar(100)',
+ 'STEXT' => 'text',
+ 'STEXT_UNI' => 'varchar(255)',
+ 'TEXT' => 'text',
+ 'TEXT_UNI' => 'text',
+ 'MTEXT' => 'mediumtext',
+ 'MTEXT_UNI' => 'mediumtext',
+ 'TIMESTAMP' => 'int(11) UNSIGNED',
+ 'DECIMAL' => 'decimal(5,2)',
+ 'DECIMAL:' => 'decimal(%d,2)',
+ 'PDECIMAL' => 'decimal(6,3)',
+ 'PDECIMAL:' => 'decimal(%d,3)',
+ 'VCHAR_UNI' => 'varchar(255)',
+ 'VCHAR_UNI:'=> 'varchar(%d)',
+ 'VCHAR_CI' => 'varchar(255)',
+ 'VARBINARY' => 'varbinary(255)',
+ ),
+
+ 'mysql_40' => array(
+ 'INT:' => 'int(%d)',
+ 'BINT' => 'bigint(20)',
+ 'UINT' => 'mediumint(8) UNSIGNED',
+ 'UINT:' => 'int(%d) UNSIGNED',
+ 'TINT:' => 'tinyint(%d)',
+ 'USINT' => 'smallint(4) UNSIGNED',
+ 'BOOL' => 'tinyint(1) UNSIGNED',
+ 'VCHAR' => 'varbinary(255)',
+ 'VCHAR:' => 'varbinary(%d)',
+ 'CHAR:' => 'binary(%d)',
+ 'XSTEXT' => 'blob',
+ 'XSTEXT_UNI'=> 'blob',
+ 'STEXT' => 'blob',
+ 'STEXT_UNI' => 'blob',
+ 'TEXT' => 'blob',
+ 'TEXT_UNI' => 'blob',
+ 'MTEXT' => 'mediumblob',
+ 'MTEXT_UNI' => 'mediumblob',
+ 'TIMESTAMP' => 'int(11) UNSIGNED',
+ 'DECIMAL' => 'decimal(5,2)',
+ 'DECIMAL:' => 'decimal(%d,2)',
+ 'PDECIMAL' => 'decimal(6,3)',
+ 'PDECIMAL:' => 'decimal(%d,3)',
+ 'VCHAR_UNI' => 'blob',
+ 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
+ 'VCHAR_CI' => 'blob',
+ 'VARBINARY' => 'varbinary(255)',
+ ),
+
+ 'firebird' => array(
+ 'INT:' => 'INTEGER',
+ 'BINT' => 'DOUBLE PRECISION',
+ 'UINT' => 'INTEGER',
+ 'UINT:' => 'INTEGER',
+ 'TINT:' => 'INTEGER',
+ 'USINT' => 'INTEGER',
+ 'BOOL' => 'INTEGER',
+ 'VCHAR' => 'VARCHAR(255) CHARACTER SET NONE',
+ 'VCHAR:' => 'VARCHAR(%d) CHARACTER SET NONE',
+ 'CHAR:' => 'CHAR(%d) CHARACTER SET NONE',
+ 'XSTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
+ 'STEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
+ 'TEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
+ 'MTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
+ 'XSTEXT_UNI'=> 'VARCHAR(100) CHARACTER SET UTF8',
+ 'STEXT_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
+ 'TEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
+ 'MTEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
+ 'TIMESTAMP' => 'INTEGER',
+ 'DECIMAL' => 'DOUBLE PRECISION',
+ 'DECIMAL:' => 'DOUBLE PRECISION',
+ 'PDECIMAL' => 'DOUBLE PRECISION',
+ 'PDECIMAL:' => 'DOUBLE PRECISION',
+ 'VCHAR_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
+ 'VCHAR_UNI:'=> 'VARCHAR(%d) CHARACTER SET UTF8',
+ 'VCHAR_CI' => 'VARCHAR(255) CHARACTER SET UTF8',
+ 'VARBINARY' => 'CHAR(255) CHARACTER SET NONE',
+ ),
+
+ 'mssql' => array(
+ 'INT:' => '[int]',
+ 'BINT' => '[float]',
+ 'UINT' => '[int]',
+ 'UINT:' => '[int]',
+ 'TINT:' => '[int]',
+ 'USINT' => '[int]',
+ 'BOOL' => '[int]',
+ 'VCHAR' => '[varchar] (255)',
+ 'VCHAR:' => '[varchar] (%d)',
+ 'CHAR:' => '[char] (%d)',
+ 'XSTEXT' => '[varchar] (1000)',
+ 'STEXT' => '[varchar] (3000)',
+ 'TEXT' => '[varchar] (8000)',
+ 'MTEXT' => '[text]',
+ 'XSTEXT_UNI'=> '[varchar] (100)',
+ 'STEXT_UNI' => '[varchar] (255)',
+ 'TEXT_UNI' => '[varchar] (4000)',
+ 'MTEXT_UNI' => '[text]',
+ 'TIMESTAMP' => '[int]',
+ 'DECIMAL' => '[float]',
+ 'DECIMAL:' => '[float]',
+ 'PDECIMAL' => '[float]',
+ 'PDECIMAL:' => '[float]',
+ 'VCHAR_UNI' => '[varchar] (255)',
+ 'VCHAR_UNI:'=> '[varchar] (%d)',
+ 'VCHAR_CI' => '[varchar] (255)',
+ 'VARBINARY' => '[varchar] (255)',
+ ),
+
+ 'mssqlnative' => array(
+ 'INT:' => '[int]',
+ 'BINT' => '[float]',
+ 'UINT' => '[int]',
+ 'UINT:' => '[int]',
+ 'TINT:' => '[int]',
+ 'USINT' => '[int]',
+ 'BOOL' => '[int]',
+ 'VCHAR' => '[varchar] (255)',
+ 'VCHAR:' => '[varchar] (%d)',
+ 'CHAR:' => '[char] (%d)',
+ 'XSTEXT' => '[varchar] (1000)',
+ 'STEXT' => '[varchar] (3000)',
+ 'TEXT' => '[varchar] (8000)',
+ 'MTEXT' => '[text]',
+ 'XSTEXT_UNI'=> '[varchar] (100)',
+ 'STEXT_UNI' => '[varchar] (255)',
+ 'TEXT_UNI' => '[varchar] (4000)',
+ 'MTEXT_UNI' => '[text]',
+ 'TIMESTAMP' => '[int]',
+ 'DECIMAL' => '[float]',
+ 'DECIMAL:' => '[float]',
+ 'PDECIMAL' => '[float]',
+ 'PDECIMAL:' => '[float]',
+ 'VCHAR_UNI' => '[varchar] (255)',
+ 'VCHAR_UNI:'=> '[varchar] (%d)',
+ 'VCHAR_CI' => '[varchar] (255)',
+ 'VARBINARY' => '[varchar] (255)',
+ ),
+
+ 'oracle' => array(
+ 'INT:' => 'number(%d)',
+ 'BINT' => 'number(20)',
+ 'UINT' => 'number(8)',
+ 'UINT:' => 'number(%d)',
+ 'TINT:' => 'number(%d)',
+ 'USINT' => 'number(4)',
+ 'BOOL' => 'number(1)',
+ 'VCHAR' => 'varchar2(255)',
+ 'VCHAR:' => 'varchar2(%d)',
+ 'CHAR:' => 'char(%d)',
+ 'XSTEXT' => 'varchar2(1000)',
+ 'STEXT' => 'varchar2(3000)',
+ 'TEXT' => 'clob',
+ 'MTEXT' => 'clob',
+ 'XSTEXT_UNI'=> 'varchar2(300)',
+ 'STEXT_UNI' => 'varchar2(765)',
+ 'TEXT_UNI' => 'clob',
+ 'MTEXT_UNI' => 'clob',
+ 'TIMESTAMP' => 'number(11)',
+ 'DECIMAL' => 'number(5, 2)',
+ 'DECIMAL:' => 'number(%d, 2)',
+ 'PDECIMAL' => 'number(6, 3)',
+ 'PDECIMAL:' => 'number(%d, 3)',
+ 'VCHAR_UNI' => 'varchar2(765)',
+ 'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')),
+ 'VCHAR_CI' => 'varchar2(255)',
+ 'VARBINARY' => 'raw(255)',
+ ),
+
+ 'sqlite' => array(
+ 'INT:' => 'int(%d)',
+ 'BINT' => 'bigint(20)',
+ 'UINT' => 'INTEGER UNSIGNED', //'mediumint(8) UNSIGNED',
+ 'UINT:' => 'INTEGER UNSIGNED', // 'int(%d) UNSIGNED',
+ 'TINT:' => 'tinyint(%d)',
+ 'USINT' => 'INTEGER UNSIGNED', //'mediumint(4) UNSIGNED',
+ 'BOOL' => 'INTEGER UNSIGNED', //'tinyint(1) UNSIGNED',
+ 'VCHAR' => 'varchar(255)',
+ 'VCHAR:' => 'varchar(%d)',
+ 'CHAR:' => 'char(%d)',
+ 'XSTEXT' => 'text(65535)',
+ 'STEXT' => 'text(65535)',
+ 'TEXT' => 'text(65535)',
+ 'MTEXT' => 'mediumtext(16777215)',
+ 'XSTEXT_UNI'=> 'text(65535)',
+ 'STEXT_UNI' => 'text(65535)',
+ 'TEXT_UNI' => 'text(65535)',
+ 'MTEXT_UNI' => 'mediumtext(16777215)',
+ 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
+ 'DECIMAL' => 'decimal(5,2)',
+ 'DECIMAL:' => 'decimal(%d,2)',
+ 'PDECIMAL' => 'decimal(6,3)',
+ 'PDECIMAL:' => 'decimal(%d,3)',
+ 'VCHAR_UNI' => 'varchar(255)',
+ 'VCHAR_UNI:'=> 'varchar(%d)',
+ 'VCHAR_CI' => 'varchar(255)',
+ 'VARBINARY' => 'blob',
+ ),
+
+ 'postgres' => array(
+ 'INT:' => 'INT4',
+ 'BINT' => 'INT8',
+ 'UINT' => 'INT4', // unsigned
+ 'UINT:' => 'INT4', // unsigned
+ 'USINT' => 'INT2', // unsigned
+ 'BOOL' => 'INT2', // unsigned
+ 'TINT:' => 'INT2',
+ 'VCHAR' => 'varchar(255)',
+ 'VCHAR:' => 'varchar(%d)',
+ 'CHAR:' => 'char(%d)',
+ 'XSTEXT' => 'varchar(1000)',
+ 'STEXT' => 'varchar(3000)',
+ 'TEXT' => 'varchar(8000)',
+ 'MTEXT' => 'TEXT',
+ 'XSTEXT_UNI'=> 'varchar(100)',
+ 'STEXT_UNI' => 'varchar(255)',
+ 'TEXT_UNI' => 'varchar(4000)',
+ 'MTEXT_UNI' => 'TEXT',
+ 'TIMESTAMP' => 'INT4', // unsigned
+ 'DECIMAL' => 'decimal(5,2)',
+ 'DECIMAL:' => 'decimal(%d,2)',
+ 'PDECIMAL' => 'decimal(6,3)',
+ 'PDECIMAL:' => 'decimal(%d,3)',
+ 'VCHAR_UNI' => 'varchar(255)',
+ 'VCHAR_UNI:'=> 'varchar(%d)',
+ 'VCHAR_CI' => 'varchar_ci',
+ 'VARBINARY' => 'bytea',
+ ),
+ );
+ }
/**
* A list of types being unsigned for better reference in some db's
@@ -310,6 +320,8 @@ class tools
$this->db = $db;
$this->return_statements = $return_statements;
+ $this->dbms_type_map = self::get_dbms_type_map();
+
// Determine mapping database type
switch ($this->db->sql_layer)
{
diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php
index 901addc694..1f6b700973 100644
--- a/phpBB/phpbb/di/extension/core.php
+++ b/phpBB/phpbb/di/extension/core.php
@@ -28,19 +28,19 @@ use Symfony\Component\Config\FileLocator;
class core extends Extension
{
/**
- * phpBB Root path
+ * Config path
* @var string
*/
- protected $root_path;
+ protected $config_path;
/**
* Constructor
*
- * @param string $root_path Root path
+ * @param string $config_path Config path
*/
- public function __construct($root_path)
+ public function __construct($config_path)
{
- $this->root_path = $root_path;
+ $this->config_path = $config_path;
}
/**
@@ -53,7 +53,7 @@ class core extends Extension
*/
public function load(array $config, ContainerBuilder $container)
{
- $loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($this->root_path . 'config')));
+ $loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($this->config_path)));
$loader->load('services.yml');
}
diff --git a/phpBB/phpbb/event/extension_subscriber_loader.php b/phpBB/phpbb/event/extension_subscriber_loader.php
index 6bc23be176..ab50a589fe 100644
--- a/phpBB/phpbb/event/extension_subscriber_loader.php
+++ b/phpBB/phpbb/event/extension_subscriber_loader.php
@@ -35,7 +35,6 @@ class extension_subscriber_loader
$finder = $this->extension_manager->get_finder();
$subscriber_classes = $finder
->extension_directory('/event')
- ->suffix('listener')
->core_path('event/')
->get_classes();
diff --git a/phpBB/phpbb/feed/overall.php b/phpBB/phpbb/feed/overall.php
index 7a0973a027..8ee1f092ab 100644
--- a/phpBB/phpbb/feed/overall.php
+++ b/phpBB/phpbb/feed/overall.php
@@ -74,7 +74,7 @@ class overall extends \phpbb\feed\post_base
),
),
'WHERE' => $this->db->sql_in_set('p.topic_id', $topic_ids) . '
- AND ' . $this->content_visibility->get_visibility_sql('post', array(), 'p.') . '
+ AND ' . $this->content_visibility->get_forums_visibility_sql('post', $forum_ids, 'p.') . '
AND p.post_time >= ' . $min_post_time . '
AND u.user_id = p.poster_id',
'ORDER_BY' => 'p.post_time DESC',
diff --git a/phpBB/phpbb/feed/topic.php b/phpBB/phpbb/feed/topic.php
index b5714e434b..1eeb4fbe94 100644
--- a/phpBB/phpbb/feed/topic.php
+++ b/phpBB/phpbb/feed/topic.php
@@ -45,7 +45,7 @@ class topic extends \phpbb\feed\post_base
function open()
{
- $sql = 'SELECT f.forum_options, f.forum_password, t.topic_id, t.forum_id, t.topic_visibility, t.topic_title, t.topic_time, t.topic_views, t.topic_replies, t.topic_type
+ $sql = 'SELECT f.forum_options, f.forum_password, t.topic_id, t.forum_id, t.topic_visibility, t.topic_title, t.topic_time, t.topic_views, t.topic_posts_approved, t.topic_type
FROM ' . TOPICS_TABLE . ' t
LEFT JOIN ' . FORUMS_TABLE . ' f
ON (f.forum_id = t.forum_id)
@@ -62,7 +62,7 @@ class topic extends \phpbb\feed\post_base
$this->forum_id = (int) $this->topic_data['forum_id'];
// Make sure topic is either approved or user authed
- if (!$this->topic_data['topic_approved'] && !$this->auth->acl_get('m_approve', $this->forum_id))
+ if ($this->topic_data['topic_visibility'] != ITEM_APPROVED && !$this->auth->acl_get('m_approve', $this->forum_id))
{
trigger_error('SORRY_AUTH_READ');
}
diff --git a/phpBB/phpbb/log/null.php b/phpBB/phpbb/log/null.php
new file mode 100644
index 0000000000..14b5f65eec
--- /dev/null
+++ b/phpBB/phpbb/log/null.php
@@ -0,0 +1,78 @@
+<?php
+/**
+*
+* @package phpbb_log
+* @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;
+}
+
+/**
+* Null logger
+*
+* @package phpbb_log
+*/
+class phpbb_log_null implements phpbb_log_interface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function is_enabled($type = '')
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function disable($type = '')
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function enable($type = '')
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array())
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_logs($mode, $count_logs = true, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $log_time = 0, $sort_by = 'l.log_time DESC', $keywords = '')
+ {
+ return array();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_log_count()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_valid_offset()
+ {
+ return 0;
+ }
+}
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php
index 2a445be90e..a865f7d6b9 100644
--- a/phpBB/phpbb/notification/manager.php
+++ b/phpBB/phpbb/notification/manager.php
@@ -61,7 +61,7 @@ class manager
/**
* Notification Constructor
- *
+ *
* @param array $notification_types
* @param array $notification_methods
* @param ContainerBuilder $phpbb_container
@@ -492,15 +492,15 @@ class manager
*
* @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $item_id is identical for the specified types)
* @param int|array $item_id Identifier within the type (or array of ids)
- * @param array $data Data specific for this type that will be updated
+ * @param mixed $parent_id Parent identifier within the type (or array of ids), used in combination with item_id if specified (Default: false; not checked)
*/
- public function delete_notifications($notification_type_name, $item_id)
+ public function delete_notifications($notification_type_name, $item_id, $parent_id = false)
{
if (is_array($notification_type_name))
{
foreach ($notification_type_name as $type)
{
- $this->delete_notifications($type, $item_id);
+ $this->delete_notifications($type, $item_id, $parent_id);
}
return;
@@ -510,7 +510,8 @@ class manager
$sql = 'DELETE FROM ' . $this->notifications_table . '
WHERE notification_type_id = ' . (int) $notification_type_id . '
- AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id);
+ AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id) .
+ (($parent_id !== false) ? ' AND ' . ((is_array($parent_id) ? $this->db->sql_in_set('item_parent_id', $parent_id) : 'item_parent_id = ' . (int) $parent_id)) : '');
$this->db->sql_query($sql);
}
@@ -798,11 +799,13 @@ class manager
* Delete all notifications older than a certain time
*
* @param int $timestamp Unix timestamp to delete all notifications that were created before
+ * @param bool $only_unread True (default) to only prune read notifications
*/
- public function prune_notifications($timestamp)
+ public function prune_notifications($timestamp, $only_read = true)
{
$sql = 'DELETE FROM ' . $this->notifications_table . '
- WHERE notification_time < ' . (int) $timestamp;
+ WHERE notification_time < ' . (int) $timestamp .
+ (($only_read) ? ' AND notification_read = 1' : '');
$this->db->sql_query($sql);
}
@@ -836,12 +839,12 @@ class manager
protected function load_object($object_name)
{
$object = $this->phpbb_container->get($object_name);
-
+
if (method_exists($object, 'set_notification_manager'))
{
$object->set_notification_manager($this);
}
-
+
return $object;
}
diff --git a/phpBB/phpbb/notification/type/group_request.php b/phpBB/phpbb/notification/type/group_request.php
new file mode 100644
index 0000000000..1a3b5b6992
--- /dev/null
+++ b/phpBB/phpbb/notification/type/group_request.php
@@ -0,0 +1,163 @@
+<?php
+/**
+*
+* @package notifications
+* @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 phpbb_notification_type_group_request extends phpbb_notification_type_base
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_type()
+ {
+ return 'group_request';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static $notification_option = array(
+ 'lang' => 'NOTIFICATION_TYPE_GROUP_REQUEST',
+ );
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_available()
+ {
+ // Leader of any groups?
+ $sql = 'SELECT group_id
+ FROM ' . USER_GROUP_TABLE . '
+ WHERE user_id = ' . (int) $this->user->data['user_id'] . '
+ AND group_leader = 1';
+ $result = $this->db->sql_query_limit($sql, 1);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ return (!empty($row)) ? true : false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function get_item_id($group)
+ {
+ return (int) $group['user_id'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function get_item_parent_id($group)
+ {
+ // Group id is the parent
+ return (int) $group['group_id'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function find_users_for_notification($group, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ $sql = 'SELECT user_id
+ FROM ' . USER_GROUP_TABLE . '
+ WHERE group_leader = 1
+ AND group_id = ' . (int) $group['group_id'];
+ $result = $this->db->sql_query($sql);
+
+ $user_ids = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $user_ids[] = (int) $row['user_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->user_loader->load_users($user_ids);
+
+ return $this->check_user_notification_options($user_ids, $options);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_avatar()
+ {
+ return $this->user_loader->get_avatar($this->item_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_title()
+ {
+ $username = $this->user_loader->get_username($this->item_id, 'no_profile');
+
+ return $this->user->lang('NOTIFICATION_GROUP_REQUEST', $username, $this->get_data('group_name'));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_email_template()
+ {
+ return 'group_request';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_email_template_variables()
+ {
+ $user_data = $this->user_loader->get_user($this->item_id);
+
+ return array(
+ 'GROUP_NAME' => htmlspecialchars_decode($this->get_data('group_name')),
+ 'REQUEST_USERNAME' => htmlspecialchars_decode($user_data['username']),
+
+ 'U_PENDING' => generate_board_url() . "/ucp.{$this->php_ext}?i=groups&mode=manage&action=list&g={$this->item_parent_id}",
+ 'U_GROUP' => generate_board_url() . "/memberlist.{$this->php_ext}?mode=group&g={$this->item_parent_id}",
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_url()
+ {
+ return append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext, "i=groups&mode=manage&action=list&g={$this->item_parent_id}");
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function users_to_query()
+ {
+ return array($this->item_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function create_insert_array($group, $pre_create_data = array())
+ {
+ $this->set_data('group_name', $group['group_name']);
+
+ return parent::create_insert_array($group, $pre_create_data);
+ }
+}
diff --git a/phpBB/phpbb/notification/type/group_request_approved.php b/phpBB/phpbb/notification/type/group_request_approved.php
new file mode 100644
index 0000000000..ce83329ff3
--- /dev/null
+++ b/phpBB/phpbb/notification/type/group_request_approved.php
@@ -0,0 +1,118 @@
+<?php
+/**
+*
+* @package notifications
+* @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 phpbb_notification_type_group_request_approved extends phpbb_notification_type_base
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_type()
+ {
+ return 'group_request_approved';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_available()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function get_item_id($group)
+ {
+ return (int) $group['group_id'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function get_item_parent_id($group)
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function find_users_for_notification($group, $options = array())
+ {
+ $users = array();
+
+ $group['user_ids'] = (!is_array($group['user_ids'])) ? array($group['user_ids']) : $group['user_ids'];
+
+ foreach ($group['user_ids'] as $user_id)
+ {
+ $users[$user_id] = array('');
+ }
+
+ return $users;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_title()
+ {
+ return $this->user->lang('NOTIFICATION_GROUP_REQUEST_APPROVED', $this->get_data('group_name'));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_url()
+ {
+ return append_sid($this->phpbb_root_path . 'memberlist.' . $this->php_ext, "mode=group&g={$this->item_id}");
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function create_insert_array($group, $pre_create_data = array())
+ {
+ $this->set_data('group_name', $group['group_name']);
+
+ return parent::create_insert_array($group, $pre_create_data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function users_to_query()
+ {
+ return array();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_email_template()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_email_template_variables()
+ {
+ return array();
+ }
+}
diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php
new file mode 100644
index 0000000000..0fbacdad8a
--- /dev/null
+++ b/phpBB/phpbb/permissions.php
@@ -0,0 +1,340 @@
+<?php
+/**
+*
+* @package phpBB3
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+class phpbb_permissions
+{
+ /**
+ * Event dispatcher object
+ * @var phpbb_event_dispatcher
+ */
+ protected $dispatcher;
+
+ /**
+ * User object
+ * @var phpbb_user
+ */
+ protected $user;
+
+ /**
+ * Constructor
+ *
+ * @param phpbb_event_dispatcher $phpbb_dispatcher Event dispatcher
+ * @param phpbb_user $user User Object
+ * @return null
+ */
+ public function __construct(phpbb_event_dispatcher $phpbb_dispatcher, phpbb_user $user)
+ {
+ $this->dispatcher = $phpbb_dispatcher;
+ $this->user = $user;
+
+ $categories = $this->categories;
+ $types = $this->types;
+ $permissions = $this->permissions;
+
+ /**
+ * Allows to specify additional permission categories, types and permissions
+ *
+ * @event core.permissions
+ * @var array types Array with permission types (a_, u_, m_, etc.)
+ * @var array categories Array with permission categories (pm, post, settings, misc, etc.)
+ * @var array permissions Array with permissions. Each Permission has the following layout:
+ * '<type><permission>' => array(
+ * 'lang' => 'Language Key with a Short description', // Optional, if not set,
+ * // the permissions identifier '<type><permission>' is used with
+ * // all uppercase.
+ * 'cat' => 'Identifier of the category, the permission should be displayed in',
+ * ),
+ * Example:
+ * 'u_viewprofile' => array(
+ * 'lang' => 'ACL_U_VIEWPROFILE',
+ * 'cat' => 'profile',
+ * ),
+ * @since 3.1-A1
+ */
+ $vars = array('types', 'categories', 'permissions');
+ extract($phpbb_dispatcher->trigger_event('core.permissions', compact($vars)));
+
+ $this->categories = $categories;
+ $this->types = $types;
+ $this->permissions = $permissions;
+ }
+
+ /**
+ * Returns an array with all the permission categories (pm, post, settings, misc, etc.)
+ *
+ * @return array Layout: cat-identifier => Language key
+ */
+ public function get_categories()
+ {
+ return $this->categories;
+ }
+
+ /**
+ * Returns the language string of a permission category
+ *
+ * @param string $category Identifier of the category
+ * @return string Language string
+ */
+ public function get_category_lang($category)
+ {
+ return $this->user->lang($this->categories[$category]);
+ }
+
+ /**
+ * Returns an array with all the permission types (a_, u_, m_, etc.)
+ *
+ * @return array Layout: type-identifier => Language key
+ */
+ public function get_types()
+ {
+ return $this->types;
+ }
+
+ /**
+ * Returns the language string of a permission type
+ *
+ * @param string $type Identifier of the type
+ * @param mixed $scope Scope of the type (should be 'global', 'local' or false)
+ * @return string Language string
+ */
+ public function get_type_lang($type, $scope = false)
+ {
+ if ($scope && isset($this->types[$scope][$type]))
+ {
+ $lang_key = $this->types[$scope][$type];
+ }
+ else if (isset($this->types[$type]))
+ {
+ $lang_key = $this->types[$type];
+ }
+ else
+ {
+ $lang_key = 'ACL_TYPE_' . strtoupper(($scope) ? $scope . '_' . $type : $type);
+ }
+
+ return $this->user->lang($lang_key);
+ }
+
+ /**
+ * Returns an array with all the permissions.
+ * Each Permission has the following layout:
+ * '<type><permission>' => array(
+ * 'lang' => 'Language Key with a Short description', // Optional, if not set,
+ * // the permissions identifier '<type><permission>' is used with
+ * // all uppercase.
+ * 'cat' => 'Identifier of the category, the permission should be displayed in',
+ * ),
+ * Example:
+ * 'u_viewprofile' => array(
+ * 'lang' => 'ACL_U_VIEWPROFILE',
+ * 'cat' => 'profile',
+ * ),
+ *
+ * @return array
+ */
+ public function get_permissions()
+ {
+ return $this->permissions;
+ }
+
+ /**
+ * Returns the category of a permission
+ *
+ * @param string $permission Identifier of the permission
+ * @return string Returns the category identifier of the permission
+ */
+ public function get_permission_category($permission)
+ {
+ return (isset($this->permissions[$permission]['cat'])) ? $this->permissions[$permission]['cat'] : 'misc';
+ }
+
+ /**
+ * Returns the language string of a permission
+ *
+ * @param string $permission Identifier of the permission
+ * @return string Language string
+ */
+ public function get_permission_lang($permission)
+ {
+ return (isset($this->permissions[$permission]['lang'])) ? $this->user->lang($this->permissions[$permission]['lang']) : $this->user->lang('ACL_' . strtoupper($permission));
+ }
+
+ protected $types = array(
+ 'u_' => 'ACL_TYPE_U_',
+ 'a_' => 'ACL_TYPE_A_',
+ 'm_' => 'ACL_TYPE_M_',
+ 'f_' => 'ACL_TYPE_F_',
+ 'global' => array(
+ 'm_' => 'ACL_TYPE_GLOBAL_M_',
+ ),
+ );
+
+ protected $categories = array(
+ 'actions' => 'ACL_CAT_ACTIONS',
+ 'content' => 'ACL_CAT_CONTENT',
+ 'forums' => 'ACL_CAT_FORUMS',
+ 'misc' => 'ACL_CAT_MISC',
+ 'permissions' => 'ACL_CAT_PERMISSIONS',
+ 'pm' => 'ACL_CAT_PM',
+ 'polls' => 'ACL_CAT_POLLS',
+ 'post' => 'ACL_CAT_POST',
+ 'post_actions' => 'ACL_CAT_POST_ACTIONS',
+ 'posting' => 'ACL_CAT_POSTING',
+ 'profile' => 'ACL_CAT_PROFILE',
+ 'settings' => 'ACL_CAT_SETTINGS',
+ 'topic_actions' => 'ACL_CAT_TOPIC_ACTIONS',
+ 'user_group' => 'ACL_CAT_USER_GROUP',
+ );
+
+ protected $permissions = array(
+ // User Permissions
+ 'u_viewprofile' => array('lang' => 'ACL_U_VIEWPROFILE', 'cat' => 'profile'),
+ 'u_chgname' => array('lang' => 'ACL_U_CHGNAME', 'cat' => 'profile'),
+ 'u_chgpasswd' => array('lang' => 'ACL_U_CHGPASSWD', 'cat' => 'profile'),
+ 'u_chgemail' => array('lang' => 'ACL_U_CHGEMAIL', 'cat' => 'profile'),
+ 'u_chgavatar' => array('lang' => 'ACL_U_CHGAVATAR', 'cat' => 'profile'),
+ 'u_chggrp' => array('lang' => 'ACL_U_CHGGRP', 'cat' => 'profile'),
+ 'u_chgprofileinfo' => array('lang' => 'ACL_U_CHGPROFILEINFO', 'cat' => 'profile'),
+
+ 'u_attach' => array('lang' => 'ACL_U_ATTACH', 'cat' => 'post'),
+ 'u_download' => array('lang' => 'ACL_U_DOWNLOAD', 'cat' => 'post'),
+ 'u_savedrafts' => array('lang' => 'ACL_U_SAVEDRAFTS', 'cat' => 'post'),
+ 'u_chgcensors' => array('lang' => 'ACL_U_CHGCENSORS', 'cat' => 'post'),
+ 'u_sig' => array('lang' => 'ACL_U_SIG', 'cat' => 'post'),
+
+ 'u_sendpm' => array('lang' => 'ACL_U_SENDPM', 'cat' => 'pm'),
+ 'u_masspm' => array('lang' => 'ACL_U_MASSPM', 'cat' => 'pm'),
+ 'u_masspm_group'=> array('lang' => 'ACL_U_MASSPM_GROUP', 'cat' => 'pm'),
+ 'u_readpm' => array('lang' => 'ACL_U_READPM', 'cat' => 'pm'),
+ 'u_pm_edit' => array('lang' => 'ACL_U_PM_EDIT', 'cat' => 'pm'),
+ 'u_pm_delete' => array('lang' => 'ACL_U_PM_DELETE', 'cat' => 'pm'),
+ 'u_pm_forward' => array('lang' => 'ACL_U_PM_FORWARD', 'cat' => 'pm'),
+ 'u_pm_emailpm' => array('lang' => 'ACL_U_PM_EMAILPM', 'cat' => 'pm'),
+ 'u_pm_printpm' => array('lang' => 'ACL_U_PM_PRINTPM', 'cat' => 'pm'),
+ 'u_pm_attach' => array('lang' => 'ACL_U_PM_ATTACH', 'cat' => 'pm'),
+ 'u_pm_download' => array('lang' => 'ACL_U_PM_DOWNLOAD', 'cat' => 'pm'),
+ 'u_pm_bbcode' => array('lang' => 'ACL_U_PM_BBCODE', 'cat' => 'pm'),
+ 'u_pm_smilies' => array('lang' => 'ACL_U_PM_SMILIES', 'cat' => 'pm'),
+ 'u_pm_img' => array('lang' => 'ACL_U_PM_IMG', 'cat' => 'pm'),
+ 'u_pm_flash' => array('lang' => 'ACL_U_PM_FLASH', 'cat' => 'pm'),
+
+ 'u_sendemail' => array('lang' => 'ACL_U_SENDEMAIL', 'cat' => 'misc'),
+ 'u_sendim' => array('lang' => 'ACL_U_SENDIM', 'cat' => 'misc'),
+ 'u_ignoreflood' => array('lang' => 'ACL_U_IGNOREFLOOD', 'cat' => 'misc'),
+ 'u_hideonline' => array('lang' => 'ACL_U_HIDEONLINE', 'cat' => 'misc'),
+ 'u_viewonline' => array('lang' => 'ACL_U_VIEWONLINE', 'cat' => 'misc'),
+ 'u_search' => array('lang' => 'ACL_U_SEARCH', 'cat' => 'misc'),
+
+ // Forum Permissions
+ 'f_list' => array('lang' => 'ACL_F_LIST', 'cat' => 'actions'),
+ 'f_read' => array('lang' => 'ACL_F_READ', 'cat' => 'actions'),
+ 'f_search' => array('lang' => 'ACL_F_SEARCH', 'cat' => 'actions'),
+ 'f_subscribe' => array('lang' => 'ACL_F_SUBSCRIBE', 'cat' => 'actions'),
+ 'f_print' => array('lang' => 'ACL_F_PRINT', 'cat' => 'actions'),
+ 'f_email' => array('lang' => 'ACL_F_EMAIL', 'cat' => 'actions'),
+ 'f_bump' => array('lang' => 'ACL_F_BUMP', 'cat' => 'actions'),
+ 'f_user_lock' => array('lang' => 'ACL_F_USER_LOCK', 'cat' => 'actions'),
+ 'f_download' => array('lang' => 'ACL_F_DOWNLOAD', 'cat' => 'actions'),
+ 'f_report' => array('lang' => 'ACL_F_REPORT', 'cat' => 'actions'),
+
+ 'f_post' => array('lang' => 'ACL_F_POST', 'cat' => 'post'),
+ 'f_sticky' => array('lang' => 'ACL_F_STICKY', 'cat' => 'post'),
+ 'f_announce' => array('lang' => 'ACL_F_ANNOUNCE', 'cat' => 'post'),
+ 'f_reply' => array('lang' => 'ACL_F_REPLY', 'cat' => 'post'),
+ 'f_edit' => array('lang' => 'ACL_F_EDIT', 'cat' => 'post'),
+ 'f_delete' => array('lang' => 'ACL_F_DELETE', 'cat' => 'post'),
+ 'f_ignoreflood' => array('lang' => 'ACL_F_IGNOREFLOOD', 'cat' => 'post'),
+ 'f_postcount' => array('lang' => 'ACL_F_POSTCOUNT', 'cat' => 'post'),
+ 'f_noapprove' => array('lang' => 'ACL_F_NOAPPROVE', 'cat' => 'post'),
+
+ 'f_attach' => array('lang' => 'ACL_F_ATTACH', 'cat' => 'content'),
+ 'f_icons' => array('lang' => 'ACL_F_ICONS', 'cat' => 'content'),
+ 'f_bbcode' => array('lang' => 'ACL_F_BBCODE', 'cat' => 'content'),
+ 'f_flash' => array('lang' => 'ACL_F_FLASH', 'cat' => 'content'),
+ 'f_img' => array('lang' => 'ACL_F_IMG', 'cat' => 'content'),
+ 'f_sigs' => array('lang' => 'ACL_F_SIGS', 'cat' => 'content'),
+ 'f_smilies' => array('lang' => 'ACL_F_SMILIES', 'cat' => 'content'),
+
+ 'f_poll' => array('lang' => 'ACL_F_POLL', 'cat' => 'polls'),
+ 'f_vote' => array('lang' => 'ACL_F_VOTE', 'cat' => 'polls'),
+ 'f_votechg' => array('lang' => 'ACL_F_VOTECHG', 'cat' => 'polls'),
+
+ // Moderator Permissions
+ 'm_edit' => array('lang' => 'ACL_M_EDIT', 'cat' => 'post_actions'),
+ 'm_delete' => array('lang' => 'ACL_M_DELETE', 'cat' => 'post_actions'),
+ 'm_approve' => array('lang' => 'ACL_M_APPROVE', 'cat' => 'post_actions'),
+ 'm_report' => array('lang' => 'ACL_M_REPORT', 'cat' => 'post_actions'),
+ 'm_chgposter' => array('lang' => 'ACL_M_CHGPOSTER', 'cat' => 'post_actions'),
+
+ 'm_move' => array('lang' => 'ACL_M_MOVE', 'cat' => 'topic_actions'),
+ 'm_lock' => array('lang' => 'ACL_M_LOCK', 'cat' => 'topic_actions'),
+ 'm_split' => array('lang' => 'ACL_M_SPLIT', 'cat' => 'topic_actions'),
+ 'm_merge' => array('lang' => 'ACL_M_MERGE', 'cat' => 'topic_actions'),
+
+ 'm_info' => array('lang' => 'ACL_M_INFO', 'cat' => 'misc'),
+ 'm_warn' => array('lang' => 'ACL_M_WARN', 'cat' => 'misc'),
+ 'm_ban' => array('lang' => 'ACL_M_BAN', 'cat' => 'misc'),
+
+ // Admin Permissions
+ 'a_board' => array('lang' => 'ACL_A_BOARD', 'cat' => 'settings'),
+ 'a_server' => array('lang' => 'ACL_A_SERVER', 'cat' => 'settings'),
+ 'a_jabber' => array('lang' => 'ACL_A_JABBER', 'cat' => 'settings'),
+ 'a_phpinfo' => array('lang' => 'ACL_A_PHPINFO', 'cat' => 'settings'),
+
+ 'a_forum' => array('lang' => 'ACL_A_FORUM', 'cat' => 'forums'),
+ 'a_forumadd' => array('lang' => 'ACL_A_FORUMADD', 'cat' => 'forums'),
+ 'a_forumdel' => array('lang' => 'ACL_A_FORUMDEL', 'cat' => 'forums'),
+ 'a_prune' => array('lang' => 'ACL_A_PRUNE', 'cat' => 'forums'),
+
+ 'a_icons' => array('lang' => 'ACL_A_ICONS', 'cat' => 'posting'),
+ 'a_words' => array('lang' => 'ACL_A_WORDS', 'cat' => 'posting'),
+ 'a_bbcode' => array('lang' => 'ACL_A_BBCODE', 'cat' => 'posting'),
+ 'a_attach' => array('lang' => 'ACL_A_ATTACH', 'cat' => 'posting'),
+
+ 'a_user' => array('lang' => 'ACL_A_USER', 'cat' => 'user_group'),
+ 'a_userdel' => array('lang' => 'ACL_A_USERDEL', 'cat' => 'user_group'),
+ 'a_group' => array('lang' => 'ACL_A_GROUP', 'cat' => 'user_group'),
+ 'a_groupadd' => array('lang' => 'ACL_A_GROUPADD', 'cat' => 'user_group'),
+ 'a_groupdel' => array('lang' => 'ACL_A_GROUPDEL', 'cat' => 'user_group'),
+ 'a_ranks' => array('lang' => 'ACL_A_RANKS', 'cat' => 'user_group'),
+ 'a_profile' => array('lang' => 'ACL_A_PROFILE', 'cat' => 'user_group'),
+ 'a_names' => array('lang' => 'ACL_A_NAMES', 'cat' => 'user_group'),
+ 'a_ban' => array('lang' => 'ACL_A_BAN', 'cat' => 'user_group'),
+
+ 'a_viewauth' => array('lang' => 'ACL_A_VIEWAUTH', 'cat' => 'permissions'),
+ 'a_authgroups' => array('lang' => 'ACL_A_AUTHGROUPS', 'cat' => 'permissions'),
+ 'a_authusers' => array('lang' => 'ACL_A_AUTHUSERS', 'cat' => 'permissions'),
+ 'a_fauth' => array('lang' => 'ACL_A_FAUTH', 'cat' => 'permissions'),
+ 'a_mauth' => array('lang' => 'ACL_A_MAUTH', 'cat' => 'permissions'),
+ 'a_aauth' => array('lang' => 'ACL_A_AAUTH', 'cat' => 'permissions'),
+ 'a_uauth' => array('lang' => 'ACL_A_UAUTH', 'cat' => 'permissions'),
+ 'a_roles' => array('lang' => 'ACL_A_ROLES', 'cat' => 'permissions'),
+ 'a_switchperm' => array('lang' => 'ACL_A_SWITCHPERM', 'cat' => 'permissions'),
+
+ 'a_styles' => array('lang' => 'ACL_A_STYLES', 'cat' => 'misc'),
+ 'a_extensions' => array('lang' => 'ACL_A_EXTENSIONS', 'cat' => 'misc'),
+ 'a_viewlogs' => array('lang' => 'ACL_A_VIEWLOGS', 'cat' => 'misc'),
+ 'a_clearlogs' => array('lang' => 'ACL_A_CLEARLOGS', 'cat' => 'misc'),
+ 'a_modules' => array('lang' => 'ACL_A_MODULES', 'cat' => 'misc'),
+ 'a_language' => array('lang' => 'ACL_A_LANGUAGE', 'cat' => 'misc'),
+ 'a_email' => array('lang' => 'ACL_A_EMAIL', 'cat' => 'misc'),
+ 'a_bots' => array('lang' => 'ACL_A_BOTS', 'cat' => 'misc'),
+ 'a_reasons' => array('lang' => 'ACL_A_REASONS', 'cat' => 'misc'),
+ 'a_backup' => array('lang' => 'ACL_A_BACKUP', 'cat' => 'misc'),
+ 'a_search' => array('lang' => 'ACL_A_SEARCH', 'cat' => 'misc'),
+ );
+}
diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php
index b36ac3711a..1c388b3c73 100644
--- a/phpBB/phpbb/request/request.php
+++ b/phpBB/phpbb/request/request.php
@@ -414,4 +414,12 @@ class request implements \phpbb\request\request_interface
return $var;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_super_global($super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ return $this->input[$super_global];
+ }
}
diff --git a/phpBB/phpbb/request/request_interface.php b/phpBB/phpbb/request/request_interface.php
index 3281e1ca03..cd949147f7 100644
--- a/phpBB/phpbb/request/request_interface.php
+++ b/phpBB/phpbb/request/request_interface.php
@@ -138,4 +138,14 @@ interface request_interface
* Pay attention when using these, they are unsanitised!
*/
public function variable_names($super_global = \phpbb\request\request_interface::REQUEST);
+
+ /**
+ * Returns the original array of the requested super global
+ *
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * The super global which will be returned
+ *
+ * @return array The original array of the requested super global.
+ */
+ public function get_super_global($super_global = \phpbb\request\request_interface::REQUEST);
}
diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php
index 8663af5969..a4812c139a 100644
--- a/phpBB/phpbb/search/fulltext_mysql.php
+++ b/phpBB/phpbb/search/fulltext_mysql.php
@@ -544,7 +544,7 @@ class fulltext_mysql extends \phpbb\search\base
* @param int $per_page number of ids each page is supposed to contain
* @return boolean|int total number of results
*/
- public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
+ public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
{
// No author? No posts
if (!sizeof($author_ary))
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php
index 782ef60c52..6925ebbc6a 100644
--- a/phpBB/phpbb/session.php
+++ b/phpBB/phpbb/session.php
@@ -1024,7 +1024,8 @@ class session
{
include($phpbb_root_path . "includes/captcha/captcha_factory." . $phpEx);
}
- \phpbb_captcha_factory::garbage_collect($config['captcha_plugin']);
+ $captcha_factory = new \phpbb_captcha_factory();
+ $captcha_factory->garbage_collect($config['captcha_plugin']);
$sql = 'DELETE FROM ' . LOGIN_ATTEMPT_TABLE . '
WHERE attempt_time < ' . (time() - (int) $config['ip_login_limit_time']);
diff --git a/phpBB/phpbb/style/extension_path_provider.php b/phpBB/phpbb/style/extension_path_provider.php
deleted file mode 100644
index 104cda757b..0000000000
--- a/phpBB/phpbb/style/extension_path_provider.php
+++ /dev/null
@@ -1,139 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-namespace phpbb\style;
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Provides a style resource locator with core style paths and extension style paths
-*
-* Finds installed style paths and makes them available to the resource locator.
-*
-* @package phpBB3
-*/
-class extension_path_provider extends \phpbb\extension\provider implements \phpbb\style\path_provider_interface
-{
- /**
- * Optional prefix for style paths searched within extensions.
- *
- * Empty by default. Relative to the extension directory. As an example, it
- * could be adm/ for admin style.
- *
- * @var string
- */
- protected $ext_dir_prefix = '';
-
- /**
- * A provider of paths to be searched for styles
- * @var \phpbb\style\path_provider
- */
- protected $base_path_provider;
-
- /** @var string */
- protected $phpbb_root_path;
-
- /**
- * Constructor stores extension manager
- *
- * @param \phpbb\extension\manager $extension_manager phpBB extension manager
- * @param \phpbb\style\path_provider $base_path_provider A simple path provider
- * to provide paths to be located in extensions
- * @param string $phpbb_root_path phpBB root path
- */
- public function __construct(\phpbb\extension\manager $extension_manager, \phpbb\style\path_provider $base_path_provider, $phpbb_root_path)
- {
- parent::__construct($extension_manager);
- $this->base_path_provider = $base_path_provider;
- $this->phpbb_root_path = $phpbb_root_path;
- }
-
- /**
- * Sets a prefix for style paths searched within extensions.
- *
- * The prefix is inserted between the extension's path e.g. ext/foo/ and
- * the looked up style path, e.g. styles/bar/. So it should not have a
- * leading slash, but should have a trailing slash.
- *
- * @param string $ext_dir_prefix The prefix including trailing slash
- * @return null
- */
- public function set_ext_dir_prefix($ext_dir_prefix)
- {
- $this->ext_dir_prefix = $ext_dir_prefix;
- }
-
- /**
- * Finds style paths using the extension manager
- *
- * Locates a path (e.g. styles/prosilver/) in all active extensions.
- * Then appends the core style paths based in the current working
- * directory.
- *
- * @return array List of style paths
- */
- public function find()
- {
- $directories = array();
-
- $finder = $this->extension_manager->get_finder();
- foreach ($this->base_path_provider as $key => $paths)
- {
- if ($key == 'style')
- {
- foreach ($paths as $path)
- {
- $directories['style'][] = $path;
- if ($path && !phpbb_is_absolute($path))
- {
- // Remove phpBB root path from the style path,
- // so the finder is able to find extension styles,
- // when the root path is not ./
- if (strpos($path, $this->phpbb_root_path) === 0)
- {
- $path = substr($path, strlen($this->phpbb_root_path));
- }
-
- $result = $finder->directory('/' . $this->ext_dir_prefix . $path)
- ->get_directories(true, false, true);
- foreach ($result as $ext => $ext_path)
- {
- // Make sure $ext_path has no ending slash
- if (substr($ext_path, -1) === '/')
- {
- $ext_path = substr($ext_path, 0, -1);
- }
- $directories[$ext][] = $ext_path;
- }
- }
- }
- }
- }
-
- return $directories;
- }
-
- /**
- * Overwrites the current style paths
- *
- * @param array $styles An array of style paths. The first element is the main style.
- * @return null
- */
- public function set_styles(array $styles)
- {
- $this->base_path_provider->set_styles($styles);
- $this->items = null;
- }
-}
diff --git a/phpBB/phpbb/style/path_provider.php b/phpBB/phpbb/style/path_provider.php
deleted file mode 100644
index 0a5906d0a8..0000000000
--- a/phpBB/phpbb/style/path_provider.php
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-namespace phpbb\style;
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Provides a style resource locator with paths
-*
-* Finds installed style paths and makes them available to the resource locator.
-*
-* @package phpBB3
-*/
-class path_provider implements \IteratorAggregate, \phpbb\style\path_provider_interface
-{
- protected $paths = array();
-
- /**
- * Ignores the extension dir prefix
- *
- * @param string $ext_dir_prefix The prefix including trailing slash
- * @return null
- */
- public function set_ext_dir_prefix($ext_dir_prefix)
- {
- }
-
- /**
- * Overwrites the current style paths
- *
- * The first element of the passed styles map, is considered the main
- * style.
- *
- * @param array $styles An array of style paths. The first element is the main style.
- * @return null
- */
- public function set_styles(array $styles)
- {
- $this->paths = array('style' => $styles);
- }
-
- /**
- * Retrieve an iterator over all style paths
- *
- * @return ArrayIterator An iterator for the array of style paths
- */
- public function getIterator()
- {
- return new \ArrayIterator($this->paths);
- }
-}
diff --git a/phpBB/phpbb/style/path_provider_interface.php b/phpBB/phpbb/style/path_provider_interface.php
deleted file mode 100644
index beb0da29df..0000000000
--- a/phpBB/phpbb/style/path_provider_interface.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-namespace phpbb\style;
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Provides a style resource locator with paths
-*
-* Finds installed style paths and makes them available to the resource locator.
-*
-* @package phpBB3
-*/
-interface path_provider_interface extends \Traversable
-{
- /**
- * Defines a prefix to use for style paths in extensions
- *
- * @param string $ext_dir_prefix The prefix including trailing slash
- * @return null
- */
- public function set_ext_dir_prefix($ext_dir_prefix);
-
- /**
- * Overwrites the current style paths
- *
- * @param array $styles An array of style paths. The first element is the main style.
- * @return null
- */
- public function set_styles(array $styles);
-}
diff --git a/phpBB/phpbb/style/resource_locator.php b/phpBB/phpbb/style/resource_locator.php
deleted file mode 100644
index 848624ee69..0000000000
--- a/phpBB/phpbb/style/resource_locator.php
+++ /dev/null
@@ -1,350 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-namespace phpbb\style;
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-
-/**
-* Style resource locator.
-* Maintains mapping from template handles to source template file paths.
-* Locates style files: resources (such as .js and .css files) and templates.
-*
-* Style resource locator is aware of styles tree, and can return actual
-* filesystem paths (i.e., the "child" style or the "parent" styles)
-* depending on what files exist.
-*
-* Root paths stored in locator are paths to style directories. Templates are
-* stored in subdirectory that $template_path points to.
-*
-* @package phpBB3
-*/
-class resource_locator implements \phpbb\template\locator
-{
- /**
- * Paths to style directories.
- * @var array
- */
- private $roots = array();
-
- /**
- * Location of templates directory within style directories.
- * Must have trailing slash. Empty if templates are stored in root
- * style directory, such as admin control panel templates.
- * @var string
- */
- private $template_path;
-
- /**
- * Map from root index to handles to source template file paths.
- * Normally it only contains paths for handles that are used
- * (or are likely to be used) by the page being rendered and not
- * all templates that exist on the filesystem.
- * @var array
- */
- private $files = array();
-
- /**
- * Map from handles to source template file names.
- * Covers the same data as $files property but maps to basenames
- * instead of paths.
- * @var array
- */
- private $filenames = array();
-
- /**
- * Constructor.
- *
- * Sets default template path to template/.
- */
- public function __construct()
- {
- $this->set_default_template_path();
- }
-
- /**
- * Sets the list of style paths
- *
- * These paths will be searched for style files in the provided order.
- * Paths may be outside of phpBB, but templates loaded from these paths
- * will still be cached.
- *
- * @param array $style_paths An array of paths to style directories
- * @return null
- */
- public function set_paths($style_paths)
- {
- $this->roots = array();
- $this->files = array();
- $this->filenames = array();
-
- foreach ($style_paths as $key => $paths)
- {
- foreach ($paths as $path)
- {
- // Make sure $path has no ending slash
- if (substr($path, -1) === '/')
- {
- $path = substr($path, 0, -1);
- }
- $this->roots[$key][] = $path;
- }
- }
- }
-
- /**
- * Sets the location of templates directory within style directories.
- *
- * The location must be a relative path, with a trailing slash.
- * Typically it is one directory level deep, e.g. "template/".
- *
- * @param string $template_path Relative path to templates directory within style directories
- * @return null
- */
- public function set_template_path($template_path)
- {
- $this->template_path = $template_path;
- }
-
- /**
- * Sets the location of templates directory within style directories
- * to the default, which is "template/".
- *
- * @return null
- */
- public function set_default_template_path()
- {
- $this->template_path = 'template/';
- }
-
- /**
- * {@inheritDoc}
- */
- public function set_filenames(array $filename_array)
- {
- foreach ($filename_array as $handle => $filename)
- {
- if (empty($filename))
- {
- trigger_error("style resource locator: set_filenames: Empty filename specified for $handle", E_USER_ERROR);
- }
-
- $this->filename[$handle] = $filename;
-
- foreach ($this->roots as $root_key => $root_paths)
- {
- foreach ($root_paths as $root_index => $root)
- {
- $this->files[$root_key][$root_index][$handle] = $root . '/' . $this->template_path . $filename;
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public function get_filename_for_handle($handle)
- {
- if (!isset($this->filename[$handle]))
- {
- trigger_error("style resource locator: get_filename_for_handle: No file specified for handle $handle", E_USER_ERROR);
- }
- return $this->filename[$handle];
- }
-
- /**
- * {@inheritDoc}
- */
- public function get_virtual_source_file_for_handle($handle)
- {
- // If we don't have a file assigned to this handle, die.
- if (!isset($this->files['style'][0][$handle]))
- {
- trigger_error("style resource locator: No file specified for handle $handle", E_USER_ERROR);
- }
-
- $source_file = $this->files['style'][0][$handle];
- return $source_file;
- }
-
- /**
- * {@inheritDoc}
- */
- public function get_source_file_for_handle($handle, $find_all = false)
- {
- // If we don't have a file assigned to this handle, die.
- if (!isset($this->files['style'][0][$handle]))
- {
- trigger_error("style resource locator: No file specified for handle $handle", E_USER_ERROR);
- }
-
- // locate a source file that exists
- $source_file = $this->files['style'][0][$handle];
- $tried = $source_file;
- $found = false;
- $found_all = array();
- foreach ($this->roots as $root_key => $root_paths)
- {
- foreach ($root_paths as $root_index => $root)
- {
- $source_file = $this->files[$root_key][$root_index][$handle];
- $tried .= ', ' . $source_file;
- if (file_exists($source_file))
- {
- $found = true;
- break;
- }
- }
- if ($found)
- {
- if ($find_all)
- {
- $found_all[] = $source_file;
- $found = false;
- }
- else
- {
- break;
- }
- }
- }
-
- // search failed
- if (!$found && !$find_all)
- {
- trigger_error("style resource locator: File for handle $handle does not exist. Could not find: $tried", E_USER_ERROR);
- }
-
- return ($find_all) ? $found_all : $source_file;
- }
-
- /**
- * {@inheritDoc}
- */
- public function get_first_file_location($files, $return_default = false, $return_full_path = true)
- {
- // set default value
- $default_result = false;
-
- // check all available paths
- foreach ($this->roots as $root_paths)
- {
- foreach ($root_paths as $path)
- {
- // check all files
- foreach ($files as $filename)
- {
- $source_file = $path . '/' . $filename;
- if (file_exists($source_file))
- {
- return ($return_full_path) ? $source_file : $filename;
- }
-
- // assign first file as result if $return_default is true
- if ($return_default && $default_result === false)
- {
- $default_result = $source_file;
- }
- }
- }
- }
-
- // search failed
- return $default_result;
- }
-
- /**
- * Obtains filesystem path for a template file.
- *
- * The simplest use is specifying a single template file as a string
- * in the first argument. This template file should be a basename
- * of a template file in the selected style, or its parent styles
- * if template inheritance is being utilized.
- *
- * Note: "selected style" is whatever style the style resource locator
- * is configured for.
- *
- * The return value then will be a path, relative to the current
- * directory or absolute, to the template file in the selected style
- * or its closest parent.
- *
- * If the selected style does not have the template file being searched,
- * (and if inheritance is involved, none of the parents have it either),
- * false will be returned.
- *
- * Specifying true for $return_default will cause the function to
- * return the first path which was checked for existence in the event
- * that the template file was not found, instead of false.
- * This is the path in the selected style itself, not any of its
- * parents.
- *
- * $files can be given an array of templates instead of a single
- * template. When given an array, the function will try to resolve
- * each template in the array to a path, and will return the first
- * path that exists, or false if none exist.
- *
- * If $files is an array and template inheritance is involved, first
- * each of the files will be checked in the selected style, then each
- * of the files will be checked in the immediate parent, and so on.
- *
- * If $return_full_path is false, then instead of returning a usable
- * path (when the template is found) only the template's basename
- * will be returned. This can be used to check which of the templates
- * specified in $files exists. Naturally more than one template must
- * be given in $files.
- *
- * This function works identically to get_first_file_location except
- * it operates on a list of templates, not files. Practically speaking,
- * the templates given in the first argument first are prepended with
- * the template path (property in this class), then given to
- * get_first_file_location for the rest of the processing.
- *
- * Templates given to this function can be relative paths for templates
- * located in subdirectories of the template directories. The paths
- * should be relative to the templates directory (template/ by default).
- *
- * @param string or array $files List of templates to locate. If there is only
- * one template, $files can be a string to make code easier to read.
- * @param bool $return_default Determines what to return if template does not
- * exist. If true, function will return location where template is
- * supposed to be. If false, function will return false.
- * @param bool $return_full_path If true, function will return full path
- * to template. If false, function will return template file name.
- * This parameter can be used to check which one of set of template
- * files is available.
- * @return string or boolean Source template path if template exists or $return_default is
- * true. False if template does not exist and $return_default is false
- */
- public function get_first_template_location($templates, $return_default = false, $return_full_path = true)
- {
- // add template path prefix
- $files = array();
- if (is_string($templates))
- {
- $files[] = $this->template_path . $templates;
- }
- else
- {
- foreach ($templates as $template)
- {
- $files[] = $this->template_path . $template;
- }
- }
-
- return $this->get_first_file_location($files, $return_default, $return_full_path);
- }
-}
diff --git a/phpBB/phpbb/style/style.php b/phpBB/phpbb/style/style.php
deleted file mode 100644
index d3bacdb1ec..0000000000
--- a/phpBB/phpbb/style/style.php
+++ /dev/null
@@ -1,243 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-namespace phpbb\style;
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Base Style class.
-* @package phpBB3
-*/
-class style
-{
- /**
- * Template class.
- * Handles everything related to templates.
- * @var \phpbb\template\template
- */
- private $template;
-
- /**
- * phpBB root path
- * @var string
- */
- private $phpbb_root_path;
-
- /**
- * PHP file extension
- * @var string
- */
- private $php_ext;
-
- /**
- * phpBB config instance
- * @var \phpbb\config\config
- */
- private $config;
-
- /**
- * Current user
- * @var \phpbb\user
- */
- private $user;
-
- /**
- * Style resource locator
- * @var \phpbb\style\resource_locator
- */
- private $locator;
-
- /**
- * Style path provider
- * @var \phpbb\style\path_provider
- */
- private $provider;
-
- /**
- * Constructor.
- *
- * @param string $phpbb_root_path phpBB root path
- * @param user $user current user
- * @param \phpbb\style\resource_locator $locator style resource locator
- * @param \phpbb\style\path_provider $provider style path provider
- * @param \phpbb\template\template $template template
- */
- public function __construct($phpbb_root_path, $php_ext, $config, $user, \phpbb\style\resource_locator $locator, \phpbb\style\path_provider_interface $provider, \phpbb\template\template $template)
- {
- $this->phpbb_root_path = $phpbb_root_path;
- $this->php_ext = $php_ext;
- $this->config = $config;
- $this->user = $user;
- $this->locator = $locator;
- $this->provider = $provider;
- $this->template = $template;
- }
-
- /**
- * Get the style tree of the style preferred by the current user
- *
- * @return array Style tree, most specific first
- */
- public function get_user_style()
- {
- $style_list = array(
- $this->user->style['style_path'],
- );
-
- if ($this->user->style['style_parent_id'])
- {
- $style_list = array_merge($style_list, array_reverse(explode('/', $this->user->style['style_parent_tree'])));
- }
-
- return $style_list;
- }
-
- /**
- * Set style location based on (current) user's chosen style.
- *
- * @param array $style_directories The directories to add style paths for
- * E.g. array('ext/foo/bar/styles', 'styles')
- * Default: array('styles') (phpBB's style directory)
- * @return bool true
- */
- public function set_style($style_directories = array('styles'))
- {
- $this->names = $this->get_user_style();
-
- $paths = array();
- foreach ($style_directories as $directory)
- {
- foreach ($this->names as $name)
- {
- $path = $this->get_style_path($name, $directory);
-
- if (is_dir($path))
- {
- $paths[] = $path;
- }
- }
- }
-
- $this->provider->set_styles($paths);
- $this->locator->set_paths($this->provider);
-
- $new_paths = array();
- foreach ($paths as $path)
- {
- $new_paths[] = $path . '/template/';
- }
-
- $this->template->set_style_names($this->names, $new_paths, ($style_directories === array('styles')));
-
- return true;
- }
-
- /**
- * Set custom style location (able to use directory outside of phpBB).
- *
- * Note: Templates are still compiled to phpBB's cache directory.
- *
- * @param string $name Name of style, used for cache prefix. Examples: "admin", "prosilver"
- * @param array or string $paths Array of style paths, relative to current root directory
- * @param array $names Array of names of templates in inheritance tree order, used by extensions. If empty, $name will be used.
- * @param string $template_path Path to templates, relative to style directory. False if path should be set to default (templates/).
- * @return bool true
- */
- public function set_custom_style($name, $paths, $names = array(), $template_path = false)
- {
- if (is_string($paths))
- {
- $paths = array($paths);
- }
-
- if (empty($names))
- {
- $names = array($name);
- }
- $this->names = $names;
-
- $this->provider->set_styles($paths);
- $this->locator->set_paths($this->provider);
-
- if ($template_path !== false)
- {
- $this->locator->set_template_path($template_path);
- }
-
- $new_paths = array();
- foreach ($paths as $path)
- {
- $new_paths[] = $path . '/' . (($template_path !== false) ? $template_path : 'template/');
- }
-
- $this->template->set_style_names($names, $new_paths);
-
- return true;
- }
-
- /**
- * Get location of style directory for specific style_path
- *
- * @param string $path Style path, such as "prosilver"
- * @param string $style_base_directory The base directory the style is in
- * E.g. 'styles', 'ext/foo/bar/styles'
- * Default: 'styles'
- * @return string Path to style directory, relative to current path
- */
- public function get_style_path($path, $style_base_directory = 'styles')
- {
- return $this->phpbb_root_path . trim($style_base_directory, '/') . '/' . $path;
- }
-
- /**
- * Defines a prefix to use for style paths in extensions
- *
- * @param string $ext_dir_prefix The prefix including trailing slash
- * @return null
- */
- public function set_ext_dir_prefix($ext_dir_prefix)
- {
- $this->provider->set_ext_dir_prefix($ext_dir_prefix);
- }
-
- /**
- * Locates source file path, accounting for styles tree and verifying that
- * the path exists.
- *
- * @param string or array $files List of files to locate. If there is only
- * one file, $files can be a string to make code easier to read.
- * @param bool $return_default Determines what to return if file does not
- * exist. If true, function will return location where file is
- * supposed to be. If false, function will return false.
- * @param bool $return_full_path If true, function will return full path
- * to file. If false, function will return file name. This
- * parameter can be used to check which one of set of files
- * is available.
- * @return string or boolean Source file path if file exists or $return_default is
- * true. False if file does not exist and $return_default is false
- */
- public function locate($files, $return_default = false, $return_full_path = true)
- {
- // convert string to array
- if (is_string($files))
- {
- $files = array($files);
- }
-
- // use resource locator to find files
- return $this->locator->get_first_file_location($files, $return_default, $return_full_path);
- }
-}
diff --git a/phpBB/phpbb/template/base.php b/phpBB/phpbb/template/base.php
new file mode 100644
index 0000000000..3778424a96
--- /dev/null
+++ b/phpBB/phpbb/template/base.php
@@ -0,0 +1,148 @@
+<?php
+/**
+*
+* @package phpBB3
+* @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;
+}
+
+abstract class phpbb_template_base implements phpbb_template
+{
+ /**
+ * Template context.
+ * Stores template data used during template rendering.
+ *
+ * @var phpbb_template_context
+ */
+ protected $context;
+
+ /**
+ * Array of filenames assigned to set_filenames
+ *
+ * @var array
+ */
+ protected $filenames = array();
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_filenames(array $filename_array)
+ {
+ $this->filenames = array_merge($this->filenames, $filename_array);
+
+ return $this;
+ }
+
+ /**
+ * Get a filename from the handle
+ *
+ * @param string $handle
+ * @return string
+ */
+ protected function get_filename_from_handle($handle)
+ {
+ return (isset($this->filenames[$handle])) ? $this->filenames[$handle] : $handle;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function destroy()
+ {
+ $this->context->clear();
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function destroy_block_vars($blockname)
+ {
+ $this->context->destroy_block_vars($blockname);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function assign_vars(array $vararray)
+ {
+ foreach ($vararray as $key => $val)
+ {
+ $this->assign_var($key, $val);
+ }
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function assign_var($varname, $varval)
+ {
+ $this->context->assign_var($varname, $varval);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function append_var($varname, $varval)
+ {
+ $this->context->append_var($varname, $varval);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function assign_block_vars($blockname, array $vararray)
+ {
+ $this->context->assign_block_vars($blockname, $vararray);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert')
+ {
+ return $this->context->alter_block_array($blockname, $vararray, $key, $mode);
+ }
+
+ /**
+ * Calls hook if any is defined.
+ *
+ * @param string $handle Template handle being displayed.
+ * @param string $method Method name of the caller.
+ */
+ protected function call_hook($handle, $method)
+ {
+ global $phpbb_hook;
+
+ if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, $method), $handle, $this))
+ {
+ if ($phpbb_hook->hook_return(array(__CLASS__, $method)))
+ {
+ $result = $phpbb_hook->hook_return_result(array(__CLASS__, $method));
+ return array($result);
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/phpBB/phpbb/template/locator.php b/phpBB/phpbb/template/locator.php
deleted file mode 100644
index c930609b80..0000000000
--- a/phpBB/phpbb/template/locator.php
+++ /dev/null
@@ -1,165 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-namespace phpbb\template;
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-
-/**
-* Resource locator interface.
-*
-* Objects implementing this interface maintain mapping from template handles
-* to source template file paths and locate templates.
-*
-* Locates style files.
-*
-* Resource locator is aware of styles tree, and can return actual
-* filesystem paths (i.e., the "child" style or the "parent" styles)
-* depending on what files exist.
-*
-* Root paths stored in locator are paths to style directories. Templates are
-* stored in subdirectory that $template_path points to.
-*
-* @package phpBB3
-*/
-interface locator
-{
- /**
- * Sets the template filenames for handles. $filename_array
- * should be a hash of handle => filename pairs.
- *
- * @param array $filename_array Should be a hash of handle => filename pairs.
- */
- public function set_filenames(array $filename_array);
-
- /**
- * Determines the filename for a template handle.
- *
- * The filename comes from array used in a set_filenames call,
- * which should have been performed prior to invoking this function.
- * Return value is a file basename (without path).
- *
- * @param $handle string Template handle
- * @return string Filename corresponding to the template handle
- */
- public function get_filename_for_handle($handle);
-
- /**
- * Determines the source file path for a template handle without
- * regard for styles tree.
- *
- * This function returns the path in "primary" style directory
- * corresponding to the given template handle. That path may or
- * may not actually exist on the filesystem. Because this function
- * does not perform stat calls to determine whether the path it
- * returns actually exists, it is faster than get_source_file_for_handle.
- *
- * Use get_source_file_for_handle to obtain the actual path that is
- * guaranteed to exist (which might come from the parent style
- * directory if primary style has parent styles).
- *
- * This function will trigger an error if the handle was never
- * associated with a template file via set_filenames.
- *
- * @param $handle string Template handle
- * @return string Path to source file path in primary style directory
- */
- public function get_virtual_source_file_for_handle($handle);
-
- /**
- * Determines the source file path for a template handle, accounting
- * for styles tree and verifying that the path exists.
- *
- * This function returns the actual path that may be compiled for
- * the specified template handle. It will trigger an error if
- * the template handle was never associated with a template path
- * via set_filenames or if the template file does not exist on the
- * filesystem.
- *
- * Use get_virtual_source_file_for_handle to just resolve a template
- * handle to a path without any filesystem or styles tree checks.
- *
- * @param string $handle Template handle (i.e. "friendly" template name)
- * @param bool $find_all If true, each root path will be checked and function
- * will return array of files instead of string and will not
- * trigger a error if template does not exist
- * @return string Source file path
- */
- public function get_source_file_for_handle($handle, $find_all = false);
-
- /**
- * Obtains a complete filesystem path for a file in a style.
- *
- * This function traverses the style tree (selected style and
- * its parents in order, if inheritance is being used) and finds
- * the first file on the filesystem matching specified relative path,
- * or the first of the specified paths if more than one path is given.
- *
- * This function can be used to determine filesystem path of any
- * file under any style, with the consequence being that complete
- * relative to the style directory path must be provided as an argument.
- *
- * In particular, this function can be used to locate templates
- * and javascript files.
- *
- * For locating templates get_first_template_location should be used
- * as it prepends the configured template path to the template basename.
- *
- * Note: "selected style" is whatever style the style resource locator
- * is configured for.
- *
- * The return value then will be a path, relative to the current
- * directory or absolute, to the first existing file in the selected
- * style or its closest parent.
- *
- * If the selected style does not have the file being searched,
- * (and if inheritance is involved, none of the parents have it either),
- * false will be returned.
- *
- * Multiple files can be specified, in which case the first file in
- * the list that can be found on the filesystem is returned.
- *
- * If multiple files are specified and inheritance is involved,
- * first each of the specified files is checked in the selected style,
- * then each of the specified files is checked in the immediate parent,
- * etc.
- *
- * Specifying true for $return_default will cause the function to
- * return the first path which was checked for existence in the event
- * that the template file was not found, instead of false.
- * This is always a path in the selected style itself, not any of its
- * parents.
- *
- * If $return_full_path is false, then instead of returning a usable
- * path (when the file is found) the file's path relative to the style
- * directory will be returned. This is the same path as was given to
- * the function as a parameter. This can be used to check which of the
- * files specified in $files exists. Naturally this requires passing
- * more than one file in $files.
- *
- * @param array $files List of files to locate.
- * @param bool $return_default Determines what to return if file does not
- * exist. If true, function will return location where file is
- * supposed to be. If false, function will return false.
- * @param bool $return_full_path If true, function will return full path
- * to file. If false, function will return file name. This
- * parameter can be used to check which one of set of files
- * is available.
- * @return string or boolean Source file path if file exists or $return_default is
- * true. False if file does not exist and $return_default is false
- */
- public function get_first_file_location($files, $return_default = false, $return_full_path = true);
-}
diff --git a/phpBB/phpbb/template/template.php b/phpBB/phpbb/template/template.php
index 4b337f9980..cf38bba522 100644
--- a/phpBB/phpbb/template/template.php
+++ b/phpBB/phpbb/template/template.php
@@ -36,14 +36,32 @@ interface template
public function set_filenames(array $filename_array);
/**
- * Sets the style names/paths corresponding to style hierarchy being compiled
- * and/or rendered.
+ * Get the style tree of the style preferred by the current user
*
- * @param array $style_names List of style names in inheritance tree order
- * @param array $style_paths List of style paths in inheritance tree order
+ * @return array Style tree, most specific first
+ */
+ public function get_user_style();
+
+ /**
+ * Set style location based on (current) user's chosen style.
+ *
+ * @param array $style_directories The directories to add style paths for
+ * E.g. array('ext/foo/bar/styles', 'styles')
+ * Default: array('styles') (phpBB's style directory)
+ * @return \phpbb\template\template $this
+ */
+ public function set_style($style_directories = array('styles'));
+
+ /**
+ * Set custom style location (able to use directory outside of phpBB).
+ *
+ * Note: Templates are still compiled to phpBB's cache directory.
+ *
+ * @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions.
+ * @param string|array or string $paths Array of style paths, relative to current root directory
* @return \phpbb\template\template $this
*/
- public function set_style_names(array $style_names, array $style_paths);
+ public function set_custom_style($names, $paths);
/**
* Clears all variables and blocks assigned to this template.
diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php
index 64f3ace52d..7a97c1fc3d 100644
--- a/phpBB/phpbb/template/twig/environment.php
+++ b/phpBB/phpbb/template/twig/environment.php
@@ -139,4 +139,39 @@ class environment extends \Twig_Environment
return parent::loadTemplate($name, $index);
}
}
+
+ /**
+ * Finds a template by name.
+ *
+ * @param string $name The template name
+ * @return string
+ */
+ public function findTemplate($name)
+ {
+ if (strpos($name, '@') === false)
+ {
+ foreach ($this->getNamespaceLookUpOrder() as $namespace)
+ {
+ try
+ {
+ if ($namespace === '__main__')
+ {
+ return parent::getLoader()->getCacheKey($name);
+ }
+
+ return parent::getLoader()->getCacheKey('@' . $namespace . '/' . $name);
+ }
+ catch (Twig_Error_Loader $e)
+ {
+ }
+ }
+
+ // We were unable to load any templates
+ throw $e;
+ }
+ else
+ {
+ return parent::getLoader()->getCacheKey($name);
+ }
+ }
}
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php
index 4f10e9594f..a73d276e62 100644
--- a/phpBB/phpbb/template/twig/lexer.php
+++ b/phpBB/phpbb/template/twig/lexer.php
@@ -77,7 +77,7 @@ class lexer extends \Twig_Lexer
// Fix tokens that may have inline variables (e.g. <!-- DEFINE $TEST = '{FOO}')
$code = $this->fix_inline_variable_tokens(array(
- 'DEFINE.+=',
+ 'DEFINE \$[a-zA-Z0-9_]+ =',
'INCLUDE',
'INCLUDEPHP',
'INCLUDEJS',
@@ -128,10 +128,14 @@ class lexer extends \Twig_Lexer
{
$callback = function($matches)
{
- // Remove any quotes that may have been used in different implementations
- // E.g. DEFINE $TEST = 'blah' vs INCLUDE foo
- // Replace {} with start/end to parse variables (' ~ TEST ~ '.html)
- $matches[2] = str_replace(array('"', "'", '{', '}'), array('', '', "' ~ ", " ~ '"), $matches[2]);
+ // Remove matching quotes at the beginning/end if a statement;
+ // E.g. 'asdf'"' -> asdf'"
+ // E.g. "asdf'"" -> asdf'"
+ // E.g. 'asdf'" -> 'asdf'"
+ $matches[2] = preg_replace('#^([\'"])?(.*?)\1$#', '$2', $matches[2]);
+
+ // Replace template variables with start/end to parse variables (' ~ TEST ~ '.html)
+ $matches[2] = preg_replace('#{([a-zA-Z0-9_\.$]+)}#', "'~ \$1 ~'", $matches[2]);
// Surround the matches in single quotes ('' ~ TEST ~ '.html')
return "<!-- {$matches[1]} '{$matches[2]}' -->";
@@ -159,6 +163,9 @@ class lexer extends \Twig_Lexer
$subset = trim(substr($matches[2], 1, -1)); // Remove parenthesis
$body = $matches[3];
+ // Replace <!-- BEGINELSE -->
+ $body = str_replace('<!-- BEGINELSE -->', '{% else %}', $body);
+
// Is the designer wanting to call another loop in a loop?
// <!-- BEGIN loop -->
// <!-- BEGIN !loop2 -->
@@ -189,25 +196,20 @@ class lexer extends \Twig_Lexer
// Recursive...fix any child nodes
$body = $parent_class->fix_begin_tokens($body, $parent_nodes);
- // Rename loopname vars (to prevent collisions, loop children are named (loop name)_loop_element)
- $body = str_replace($name . '.', $name . '_loop_element.', $body);
-
// Need the parent variable name
array_pop($parent_nodes);
- $parent = (!empty($parent_nodes)) ? end($parent_nodes) . '_loop_element.' : '';
+ $parent = (!empty($parent_nodes)) ? end($parent_nodes) . '.' : '';
if ($subset !== '')
{
$subset = '|subset(' . $subset . ')';
}
- // Turn into a Twig for loop, using (loop name)_loop_element for each child
- return "{% for {$name}_loop_element in {$parent}{$name}{$subset} %}{$body}{% endfor %}";
+ $parent = ($parent) ?: 'loops.';
+ // Turn into a Twig for loop
+ return "{% for {$name} in {$parent}{$name}{$subset} %}{$body}{% endfor %}";
};
- // Replace <!-- BEGINELSE --> correctly, only needs to be done once
- $code = str_replace('<!-- BEGINELSE -->', '{% else %}', $code);
-
return preg_replace_callback('#<!-- BEGIN ([!a-zA-Z0-9_]+)(\([0-9,\-]+\))? -->(.+?)<!-- END \1 -->#s', $callback, $code);
}
@@ -219,21 +221,28 @@ class lexer extends \Twig_Lexer
*/
protected function fix_if_tokens($code)
{
+ // Replace ELSE IF with ELSEIF
+ $code = preg_replace('#<!-- ELSE IF (.+?) -->#', '<!-- ELSEIF $1 -->', $code);
+
+ // Replace our "div by" with Twig's divisibleby (Twig does not like test names with spaces)
+ $code = preg_replace('# div by ([0-9]+)#', ' divisibleby($1)', $code);
+
$callback = function($matches)
{
+ $inner = $matches[2];
// Replace $TEST with definition.TEST
- $matches[1] = preg_replace('#\s\$([a-zA-Z_0-9]+)#', ' definition.$1', $matches[1]);
+ $inner = preg_replace('#(\s\(?!?)\$([a-zA-Z_0-9]+)#', '$1definition.$2', $inner);
- // Replace .test with test|length
- $matches[1] = preg_replace('#\s\.([a-zA-Z_0-9\.]+)#', ' $1|length', $matches[1]);
+ // Replace .foo with loops.foo|length
+ $inner = preg_replace('#(\s\(?!?)\.([a-zA-Z_0-9]+)([^a-zA-Z_0-9\.])#', '$1loops.$2|length$3', $inner);
- return '<!-- IF' . $matches[1] . '-->';
- };
+ // Replace .foo.bar with foo.bar|length
+ $inner = preg_replace('#(\s\(?!?)\.([a-zA-Z_0-9\.]+)([^a-zA-Z_0-9\.])#', '$1$2|length$3', $inner);
- // Replace our "div by" with Twig's divisibleby (Twig does not like test names with spaces)
- $code = preg_replace('# div by ([0-9]+)#', ' divisibleby($1)', $code);
+ return "<!-- {$matches[1]}IF{$inner}-->";
+ };
- return preg_replace_callback('#<!-- IF((.*)[\s][\$|\.|!]([^\s]+)(.*))-->#', $callback, $code);
+ return preg_replace_callback('#<!-- (ELSE)?IF((.*?) \(?!?[\$|\.]([^\s]+)(.*?))-->#', $callback, $code);
}
/**
@@ -257,10 +266,10 @@ class lexer extends \Twig_Lexer
*/
// Replace <!-- DEFINE $NAME with {% DEFINE definition.NAME
- $code = preg_replace('#<!-- DEFINE \$(.*)-->#', '{% DEFINE $1 %}', $code);
+ $code = preg_replace('#<!-- DEFINE \$(.*?) -->#', '{% DEFINE $1 %}', $code);
// Changing UNDEFINE NAME to DEFINE NAME = null to save from creating an extra token parser/node
- $code = preg_replace('#<!-- UNDEFINE \$(.*)-->#', '{% DEFINE $1= null %}', $code);
+ $code = preg_replace('#<!-- UNDEFINE \$(.*?)-->#', '{% DEFINE $1= null %}', $code);
// Replace all of our variables, {$VARNAME}, with Twig style, {{ definition.VARNAME }}
$code = preg_replace('#{\$([a-zA-Z0-9_\.]+)}#', '{{ definition.$1 }}', $code);
diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php
new file mode 100644
index 0000000000..0829e519f7
--- /dev/null
+++ b/phpBB/phpbb/template/twig/loader.php
@@ -0,0 +1,150 @@
+<?php
+/**
+*
+* @package phpBB3
+* @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;
+}
+
+/**
+* Twig Template loader
+* @package phpBB3
+*/
+class phpbb_template_twig_loader extends Twig_Loader_Filesystem
+{
+ protected $safe_directories = array();
+
+ /**
+ * Set safe directories
+ *
+ * @param array $directories Array of directories that are safe (empty to clear)
+ * @return Twig_Loader_Filesystem
+ */
+ public function setSafeDirectories($directories = array())
+ {
+ $this->safe_directories = array();
+
+ if (!empty($directories))
+ {
+ foreach ($directories as $directory)
+ {
+ $this->addSafeDirectory($directory);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add safe directory
+ *
+ * @param string $directory Directory that should be added
+ * @return Twig_Loader_Filesystem
+ */
+ public function addSafeDirectory($directory)
+ {
+ $directory = phpbb_realpath($directory);
+
+ if ($directory !== false)
+ {
+ $this->safe_directories[] = $directory;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get current safe directories
+ *
+ * @return array
+ */
+ public function getSafeDirectories()
+ {
+ return $this->safe_directories;
+ }
+
+ /**
+ * Override for parent::validateName()
+ *
+ * This is done because we added support for safe directories, and when Twig
+ * findTemplate() is called, validateName() is called first, which would
+ * always throw an exception if the file is outside of the configured
+ * template directories.
+ */
+ protected function validateName($name)
+ {
+ return;
+ }
+
+ /**
+ * Find the template
+ *
+ * Override for Twig_Loader_Filesystem::findTemplate to add support
+ * for loading from safe directories.
+ */
+ protected function findTemplate($name)
+ {
+ $name = (string) $name;
+
+ // normalize name
+ $name = preg_replace('#/{2,}#', '/', strtr($name, '\\', '/'));
+
+ // If this is in the cache we can skip the entire process below
+ // as it should have already been validated
+ if (isset($this->cache[$name])) {
+ return $this->cache[$name];
+ }
+
+ // First, find the template name. The override above of validateName
+ // causes the validateName process to be skipped for this call
+ $file = parent::findTemplate($name);
+
+ try
+ {
+ // Try validating the name (which may throw an exception)
+ parent::validateName($name);
+ }
+ catch (Twig_Error_Loader $e)
+ {
+ if (strpos($e->getRawMessage(), 'Looks like you try to load a template outside configured directories') === 0)
+ {
+ // Ok, so outside of the configured template directories, we
+ // can now check if we're within a "safe" directory
+
+ // Find the real path of the directory the file is in
+ $directory = phpbb_realpath(dirname($file));
+
+ if ($directory === false)
+ {
+ // Some sort of error finding the actual path, must throw the exception
+ throw $e;
+ }
+
+ foreach ($this->safe_directories as $safe_directory)
+ {
+ if (strpos($directory, $safe_directory) === 0)
+ {
+ // The directory being loaded is below a directory
+ // that is "safe". We're good to load it!
+ return $file;
+ }
+ }
+ }
+
+ // Not within any safe directories
+ throw $e;
+ }
+
+ // No exception from validateName, safe to load.
+ return $file;
+ }
+}
diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php
index a55e68fb04..1fc85ab4a2 100644
--- a/phpBB/phpbb/template/twig/node/event.php
+++ b/phpBB/phpbb/template/twig/node/event.php
@@ -20,6 +20,12 @@ if (!defined('IN_PHPBB'))
class event extends \Twig_Node
{
+ /**
+ * The subdirectory in which all template listener files must be placed
+ * @var string
+ */
+ protected $listener_directory = 'event/';
+
/** @var Twig_Environment */
protected $environment;
@@ -39,7 +45,7 @@ class event extends \Twig_Node
{
$compiler->addDebugInfo($this);
- $location = $this->getNode('expr')->getAttribute('name');
+ $location = $this->listener_directory . $this->getNode('expr')->getAttribute('name');
foreach ($this->environment->get_phpbb_extensions() as $ext_namespace => $ext_path)
{
diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php
index 3c899b96e8..d632469c9e 100644
--- a/phpBB/phpbb/template/twig/node/includeasset.php
+++ b/phpBB/phpbb/template/twig/node/includeasset.php
@@ -9,7 +9,7 @@
namespace phpbb\template\twig\node;
-class includeasset extends \Twig_Node
+abstract class includeasset extends \Twig_Node
{
/** @var Twig_Environment */
protected $environment;
@@ -42,10 +42,10 @@ class includeasset extends \Twig_Node
->write("\$local_file = \$this->getEnvironment()->get_phpbb_root_path() . \$asset_path;\n")
->write("if (!file_exists(\$local_file)) {\n")
->indent()
- ->write("\$local_file = \$this->getEnvironment()->getLoader()->getCacheKey(\$asset_path);\n")
+ ->write("\$local_file = \$this->getEnvironment()->findTemplate(\$asset_path);\n")
->write("\$asset->set_path(\$local_file, true);\n")
->outdent()
- ->write("\$asset->add_assets_version({$config['assets_version']});\n")
+ ->write("\$asset->add_assets_version('{$config['assets_version']}');\n")
->write("\$asset_file = \$asset->get_url();\n")
->write("}\n")
->outdent()
@@ -59,4 +59,19 @@ class includeasset extends \Twig_Node
->raw("\n');\n")
;
}
+
+ /**
+ * Get the definition name
+ *
+ * @return string (e.g. 'SCRIPTS')
+ */
+ abstract public function get_definition_name();
+
+ /**
+ * Append the output code for the asset
+ *
+ * @param Twig_Compiler A Twig_Compiler instance
+ * @return null
+ */
+ abstract protected function append_asset(Twig_Compiler $compiler);
}
diff --git a/phpBB/phpbb/template/twig/node/includecss.php b/phpBB/phpbb/template/twig/node/includecss.php
index 45ff9107a0..9601cc5155 100644
--- a/phpBB/phpbb/template/twig/node/includecss.php
+++ b/phpBB/phpbb/template/twig/node/includecss.php
@@ -11,17 +11,18 @@ namespace phpbb\template\twig\node;
class includecss extends \phpbb\template\twig\node\includeasset
{
+ /**
+ * {@inheritdoc}
+ */
public function get_definition_name()
{
return 'STYLESHEETS';
}
/**
- * Compiles the node to PHP.
- *
- * @param Twig_Compiler A Twig_Compiler instance
- */
- public function append_asset(\Twig_Compiler $compiler)
+ * {@inheritdoc}
+ */
+ public function append_asset(Twig_Compiler $compiler)
{
$compiler
->raw("<link href=\"' . ")
diff --git a/phpBB/phpbb/template/twig/node/includejs.php b/phpBB/phpbb/template/twig/node/includejs.php
index 7b400d9154..510e221e07 100644
--- a/phpBB/phpbb/template/twig/node/includejs.php
+++ b/phpBB/phpbb/template/twig/node/includejs.php
@@ -11,17 +11,18 @@ namespace phpbb\template\twig\node;
class includejs extends \phpbb\template\twig\node\includeasset
{
+ /**
+ * {@inheritdoc}
+ */
public function get_definition_name()
{
return 'SCRIPTS';
}
/**
- * Compiles the node to PHP.
- *
- * @param Twig_Compiler A Twig_Compiler instance
- */
- protected function append_asset(\Twig_Compiler $compiler)
+ * {@inheritdoc}
+ */
+ protected function append_asset(Twig_Compiler $compiler)
{
$config = $this->environment->get_phpbb_config();
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
index 2ba6f66a35..4856dd483e 100644
--- a/phpBB/phpbb/template/twig/twig.php
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -21,16 +21,9 @@ if (!defined('IN_PHPBB'))
* Twig Template class.
* @package phpBB3
*/
-class twig implements \phpbb\template\template
+class twig extends \phpbb\template\base
{
/**
- * Template context.
- * Stores template data used during template rendering.
- * @var \phpbb\template\context
- */
- protected $context;
-
- /**
* Path of the cache directory for the template
*
* Cannot be changed during runtime.
@@ -46,12 +39,6 @@ class twig implements \phpbb\template\template
protected $phpbb_root_path;
/**
- * adm relative path
- * @var string
- */
- protected $adm_relative_path;
-
- /**
* PHP file extension
* @var string
*/
@@ -77,16 +64,6 @@ class twig implements \phpbb\template\template
protected $extension_manager;
/**
- * Name of the style that the template being compiled and/or rendered
- * belongs to, and its parents, in inheritance tree order.
- *
- * Used to invoke style-specific template events.
- *
- * @var array
- */
- protected $style_names;
-
- /**
* Twig Environment
*
* @var Twig_Environment
@@ -94,13 +71,6 @@ class twig implements \phpbb\template\template
protected $twig;
/**
- * Array of filenames assigned to set_filenames
- *
- * @var array
- */
- protected $filenames = array();
-
- /**
* Constructor.
*
* @param string $phpbb_root_path phpBB root path
@@ -114,7 +84,6 @@ class twig implements \phpbb\template\template
public function __construct($phpbb_root_path, $php_ext, $config, $user, \phpbb\template\context $context, \phpbb\extension\manager $extension_manager = null, $adm_relative_path = null)
{
$this->phpbb_root_path = $phpbb_root_path;
- $this->adm_relative_path = $adm_relative_path;
$this->php_ext = $php_ext;
$this->config = $config;
$this->user = $user;
@@ -124,7 +93,7 @@ class twig implements \phpbb\template\template
$this->cachepath = $phpbb_root_path . 'cache/twig/';
// Initiate the loader, __main__ namespace paths will be setup later in set_style_names()
- $loader = new \Twig_Loader_Filesystem('');
+ $loader = new \phpbb\template\twig\loader('');
$this->twig = new \phpbb\template\twig\environment(
$this->config,
@@ -149,6 +118,12 @@ class twig implements \phpbb\template\template
$lexer = new \phpbb\template\twig\lexer($this->twig);
$this->twig->setLexer($lexer);
+
+ // Add admin namespace
+ if ($adm_relative_path !== null && is_dir($this->phpbb_root_path . $adm_relative_path . 'style/'))
+ {
+ $this->twig->getLoader()->setPaths($this->phpbb_root_path . $adm_relative_path . 'style/', 'admin');
+ }
}
/**
@@ -167,51 +142,94 @@ class twig implements \phpbb\template\template
}
/**
- * Sets the template filenames for handles.
+ * Get the style tree of the style preferred by the current user
*
- * @param array $filename_array Should be a hash of handle => filename pairs.
- * @return \phpbb\template\template $this
+ * @return array Style tree, most specific first
*/
- public function set_filenames(array $filename_array)
+ public function get_user_style()
{
- $this->filenames = array_merge($this->filenames, $filename_array);
+ $style_list = array(
+ $this->user->style['style_path'],
+ );
- return $this;
+ if ($this->user->style['style_parent_id'])
+ {
+ $style_list = array_merge($style_list, array_reverse(explode('/', $this->user->style['style_parent_tree'])));
+ }
+
+ return $style_list;
}
/**
- * Sets the style names/paths corresponding to style hierarchy being compiled
- * and/or rendered.
+ * Set style location based on (current) user's chosen style.
*
- * @param array $style_names List of style names in inheritance tree order
- * @param array $style_paths List of style paths in inheritance tree order
- * @param bool $is_core True if the style names are the "core" styles for this page load
- * Core means the main phpBB template files
+ * @param array $style_directories The directories to add style paths for
+ * E.g. array('ext/foo/bar/styles', 'styles')
+ * Default: array('styles') (phpBB's style directory)
* @return \phpbb\template\template $this
*/
- public function set_style_names(array $style_names, array $style_paths, $is_core = false)
+ public function set_style($style_directories = array('styles'))
{
- $this->style_names = $style_names;
+ if ($style_directories !== array('styles') && $this->twig->getLoader()->getPaths('core') === array())
+ {
+ // We should set up the core styles path since not already setup
+ $this->set_style();
+ }
- // Set as __main__ namespace
- $this->twig->getLoader()->setPaths($style_paths);
+ $names = $this->get_user_style();
- // Core style namespace from \phpbb\style\style::set_style()
- if ($is_core)
+ $paths = array();
+ foreach ($style_directories as $directory)
{
- $this->twig->getLoader()->setPaths($style_paths, 'core');
+ foreach ($names as $name)
+ {
+ $path = $this->phpbb_root_path . trim($directory, '/') . "/{$name}/";
+ $template_path = $path . 'template/';
+
+ if (is_dir($template_path))
+ {
+ // Add the base style directory as a safe directory
+ $this->twig->getLoader()->addSafeDirectory($path);
+
+ $paths[] = $template_path;
+ }
+ }
}
- // Add admin namespace
- if (is_dir($this->phpbb_root_path . $this->adm_relative_path . 'style/'))
+ // If we're setting up the main phpBB styles directory and the core
+ // namespace isn't setup yet, we will set it up now
+ if ($style_directories === array('styles') && $this->twig->getLoader()->getPaths('core') === array())
{
- $this->twig->getLoader()->setPaths($this->phpbb_root_path . $this->adm_relative_path . 'style/', 'admin');
+ // Set up the core style paths namespace
+ $this->twig->getLoader()->setPaths($paths, 'core');
}
+ $this->set_custom_style($names, $paths);
+
+ return $this;
+ }
+
+ /**
+ * Set custom style location (able to use directory outside of phpBB).
+ *
+ * Note: Templates are still compiled to phpBB's cache directory.
+ *
+ * @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions.
+ * @param string|array or string $paths Array of style paths, relative to current root directory
+ * @return phpbb_template $this
+ */
+ public function set_custom_style($names, $paths)
+ {
+ $paths = (is_string($paths)) ? array($paths) : $paths;
+ $names = (is_string($names)) ? array($names) : $names;
+
+ // Set as __main__ namespace
+ $this->twig->getLoader()->setPaths($paths);
+
// Add all namespaces for all extensions
if ($this->extension_manager instanceof \phpbb\extension\manager)
{
- $style_names[] = 'all';
+ $names[] = 'all';
foreach ($this->extension_manager->all_enabled() as $ext_namespace => $ext_path)
{
@@ -219,13 +237,17 @@ class twig implements \phpbb\template\template
$namespace = str_replace('/', '_', $ext_namespace);
$paths = array();
- foreach ($style_names as $style_name)
+ foreach ($names as $style_name)
{
- $ext_style_path = $ext_path . 'styles/' . $style_name . '/template';
+ $ext_style_path = $ext_path . 'styles/' . $style_name . '/';
+ $ext_style_template_path = $ext_style_path . 'template/';
- if (is_dir($ext_style_path))
+ if (is_dir($ext_style_template_path))
{
- $paths[] = $ext_style_path;
+ // Add the base style directory as a safe directory
+ $this->twig->getLoader()->addSafeDirectory($ext_style_path);
+
+ $paths[] = $ext_style_template_path;
}
}
@@ -237,31 +259,6 @@ class twig implements \phpbb\template\template
}
/**
- * Clears all variables and blocks assigned to this template.
- *
- * @return \phpbb\template\template $this
- */
- public function destroy()
- {
- $this->context = array();
-
- return $this;
- }
-
- /**
- * Reset/empty complete block
- *
- * @param string $blockname Name of block to destroy
- * @return \phpbb\template\template $this
- */
- public function destroy_block_vars($blockname)
- {
- $this->context->destroy_block_vars($blockname);
-
- return $this;
- }
-
- /**
* Display a template for provided handle.
*
* The template will be loaded and compiled, if necessary, first.
@@ -285,28 +282,6 @@ class twig implements \phpbb\template\template
}
/**
- * Calls hook if any is defined.
- *
- * @param string $handle Template handle being displayed.
- * @param string $method Method name of the caller.
- */
- protected function call_hook($handle, $method)
- {
- global $phpbb_hook;
-
- if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, $method), $handle, $this))
- {
- if ($phpbb_hook->hook_return(array(__CLASS__, $method)))
- {
- $result = $phpbb_hook->hook_return_result(array(__CLASS__, $method));
- return array($result);
- }
- }
-
- return false;
- }
-
- /**
* Display the handle and assign the output to a template variable
* or return the compiled result.
*
@@ -328,134 +303,30 @@ class twig implements \phpbb\template\template
}
/**
- * Assign key variable pairs from an array
- *
- * @param array $vararray A hash of variable name => value pairs
- * @return \phpbb\template\template $this
- */
- public function assign_vars(array $vararray)
- {
- foreach ($vararray as $key => $val)
- {
- $this->assign_var($key, $val);
- }
-
- return $this;
- }
-
- /**
- * Assign a single scalar value to a single key.
- *
- * Value can be a string, an integer or a boolean.
- *
- * @param string $varname Variable name
- * @param string $varval Value to assign to variable
- * @return \phpbb\template\template $this
- */
- public function assign_var($varname, $varval)
- {
- $this->context->assign_var($varname, $varval);
-
- return $this;
- }
-
- /**
- * Append text to the string value stored in a key.
- *
- * Text is appended using the string concatenation operator (.).
- *
- * @param string $varname Variable name
- * @param string $varval Value to append to variable
- * @return \phpbb\template\template $this
- */
- public function append_var($varname, $varval)
- {
- $this->context->append_var($varname, $varval);
-
- return $this;
- }
-
- /**
- * Assign key variable pairs from an array to a specified block
- * @param string $blockname Name of block to assign $vararray to
- * @param array $vararray A hash of variable name => value pairs
- * @return \phpbb\template\template $this
- */
- public function assign_block_vars($blockname, array $vararray)
- {
- $this->context->assign_block_vars($blockname, $vararray);
-
- return $this;
- }
-
- /**
- * Change already assigned key variable pair (one-dimensional - single loop entry)
- *
- * An example of how to use this function:
- * {@example alter_block_array.php}
- *
- * @param string $blockname the blockname, for example 'loop'
- * @param array $vararray the var array to insert/add or merge
- * @param mixed $key Key to search for
- *
- * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position]
- *
- * int: Position [the position to change or insert at directly given]
- *
- * If key is false the position is set to 0
- * If key is true the position is set to the last entry
- *
- * @param string $mode Mode to execute (valid modes are 'insert' and 'change')
- *
- * If insert, the vararray is inserted at the given position (position counting from zero).
- * If change, the current block gets merged with the vararray (resulting in new \key/value pairs be added and existing keys be replaced by the new \value).
- *
- * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
- * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
- *
- * @return bool false on error, true on success
- */
- public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert')
- {
- return $this->context->alter_block_array($blockname, $vararray, $key, $mode);
- }
-
- /**
* Get template vars in a format Twig will use (from the context)
*
* @return array
*/
- public function get_template_vars()
+ protected function get_template_vars()
{
$context_vars = $this->context->get_data_ref();
$vars = array_merge(
$context_vars['.'][0], // To get normal vars
- $context_vars, // To get loops
array(
'definition' => new \phpbb\template\twig\definition(),
'user' => $this->user,
+ 'loops' => $context_vars, // To get loops
)
);
// cleanup
- unset($vars['.']);
+ unset($vars['loops']['.']);
return $vars;
}
/**
- * Get a filename from the handle
- *
- * @param string $handle
- * @return string
- */
- protected function get_filename_from_handle($handle)
- {
- return (isset($this->filenames[$handle])) ? $this->filenames[$handle] : $handle;
- }
-
- /**
* Get path to template for handle (required for BBCode parser)
*
* @return string
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
index 5a9aa21e8a..a5b3308288 100644
--- a/phpBB/phpbb/user.php
+++ b/phpBB/phpbb/user.php
@@ -77,7 +77,7 @@ class user extends \phpbb\session
*/
function setup($lang_set = false, $style_id = false)
{
- global $db, $phpbb_style, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
+ global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
global $phpbb_dispatcher;
if ($this->data['user_id'] != ANONYMOUS)
@@ -130,6 +130,7 @@ class user extends \phpbb\session
}
$user_data = $this->data;
+ $lang_set_ext = array();
/**
* Event to load language files and modify user data on every page
@@ -141,10 +142,18 @@ class user extends \phpbb\session
* @var string user_timezone User's timezone, should be one of
* http://www.php.net/manual/en/timezones.php
* @var mixed lang_set String or array of language files
+ * @var array lang_set_ext Array containing entries of format
+ * array(
+ * 'ext_name' => (string) [extension name],
+ * 'lang_set' => (string|array) [language files],
+ * )
+ * For performance reasons, only load translations
+ * that are absolutely needed globally using this
+ * event. Use local events otherwise.
* @var mixed style_id Style we are going to display
* @since 3.1-A1
*/
- $vars = array('user_data', 'user_lang_name', 'user_date_format', 'user_timezone', 'lang_set', 'style_id');
+ $vars = array('user_data', 'user_lang_name', 'user_date_format', 'user_timezone', 'lang_set', 'lang_set_ext', 'style_id');
extract($phpbb_dispatcher->trigger_event('core.user_setup', compact($vars)));
$this->data = $user_data;
@@ -175,6 +184,12 @@ class user extends \phpbb\session
$this->add_lang($lang_set);
unset($lang_set);
+ foreach ($lang_set_ext as $ext_lang_pair)
+ {
+ $this->add_lang_ext($ext_lang_pair['ext_name'], $ext_lang_pair['lang_set']);
+ }
+ unset($lang_set_ext);
+
$style_request = request_var('style', 0);
if ($style_request && $auth->acl_get('a_styles') && !defined('ADMIN_START'))
{
@@ -238,7 +253,7 @@ class user extends \phpbb\session
}
}
- $phpbb_style->set_style();
+ $template->set_style();
$this->img_lang = $this->lang_name;
@@ -592,6 +607,13 @@ class user extends \phpbb\session
$language_filename = $lang_path . $this->lang_name . '/' . $filename . '.' . $phpEx;
}
+ // If we are in install, try to use the updated version, when available
+ $install_language_filename = str_replace('language/', 'install/update/new/language/', $language_filename);
+ if (defined('IN_INSTALL') && file_exists($install_language_filename))
+ {
+ $language_filename = $install_language_filename;
+ }
+
if (!file_exists($language_filename))
{
global $config;
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 942821a233..1609382551 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1152,8 +1152,14 @@ if ($submit || $preview || $refresh)
$data['topic_posts_softdeleted'] = $post_data['topic_posts_softdeleted'];
}
+ // Only return the username when it is either a guest posting or we are editing a post and
+ // the username was supplied; otherwise post_data might hold the data of the post that is
+ // being quoted (which could result in the username being returned being that of the quoted
+ // post's poster, not the poster of the current post). See: PHPBB3-11769 for more information.
+ $post_author_name = ((!$user->data['is_registered'] || $mode == 'edit') && $post_data['username'] !== '') ? $post_data['username'] : '';
+
// The last parameter tells submit_post if search indexer has to be run
- $redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
+ $redirect_url = submit_post($mode, $post_data['post_subject'], $post_author_name, $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === true) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
{
diff --git a/phpBB/report.php b/phpBB/report.php
index 3f2e7a91ff..5081f90ad1 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -139,15 +139,16 @@ else
$reported_post_text = $report_data['message_text'];
$reported_post_bitfield = $report_data['bbcode_bitfield'];
- $reported_post_enable_bbcode = $report_data['reported_post_enable_bbcode'];
- $reported_post_enable_smilies = $report_data['reported_post_enable_smilies'];
- $reported_post_enable_magic_url = $report_data['reported_post_enable_magic_url'];
+ $reported_post_uid = $report_data['bbcode_uid'];
+ $reported_post_enable_bbcode = $report_data['enable_bbcode'];
+ $reported_post_enable_smilies = $report_data['enable_smilies'];
+ $reported_post_enable_magic_url = $report_data['enable_magic_url'];
}
if ($config['enable_post_confirm'] && !$user->data['is_registered'])
{
include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
- $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+ $captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_REPORT);
}
@@ -157,10 +158,13 @@ $s_hidden_fields = '';
// Submit report?
if ($submit && $reason_id)
{
- $visual_confirmation_response = $captcha->validate();
- if ($visual_confirmation_response)
+ if (isset($captcha))
{
- $error[] = $visual_confirmation_response;
+ $visual_confirmation_response = $captcha->validate();
+ if ($visual_confirmation_response)
+ {
+ $error[] = $visual_confirmation_response;
+ }
}
$sql = 'SELECT *
diff --git a/phpBB/search.php b/phpBB/search.php
index fe6535c3d1..ae573b18e8 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -366,7 +366,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
$sql = "SELECT p.post_id
FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
- WHERE t.topic_replies = 0
+ WHERE t.topic_posts_approved = 1
AND p.topic_id = t.topic_id
$last_post_time
AND $m_approve_posts_fid_sql
@@ -378,7 +378,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
$sql = 'SELECT DISTINCT ' . $sort_by_sql[$sort_key] . ", p.topic_id
FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
- WHERE t.topic_replies = 0
+ WHERE t.topic_posts_approved = 1
AND t.topic_moved_id = 0
AND p.topic_id = t.topic_id
$last_post_time
@@ -687,6 +687,18 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}
+ /**
+ * Event to modify the SQL query before the topic data is retrieved
+ *
+ * @event core.search_get_topic_data
+ * @var string sql_select The SQL SELECT string used by search to get topic data
+ * @var string sql_from The SQL FROM string used by search to get topic data
+ * @var string sql_where The SQL WHERE string used by search to get topic data
+ * @since 3.1-A1
+ */
+ $vars = array('sql_select', 'sql_from', 'sql_where');
+ extract($phpbb_dispatcher->trigger_event('core.search_get_topic_data', compact($vars)));
+
$sql = "SELECT $sql_select
FROM $sql_from
WHERE $sql_where";
@@ -952,14 +964,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
else
{
- // Second parse bbcode here
- if ($row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield']);
- }
-
- $row['post_text'] = bbcode_nl2br($row['post_text']);
- $row['post_text'] = smiley_text($row['post_text']);
+ $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $row['post_text'] = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false);
if (!empty($attachments[$row['post_id']]))
{
@@ -989,7 +995,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
);
}
- $template->assign_block_vars('searchresults', array_merge($tpl_ary, array(
+ $tpl_ary = array_merge($tpl_ary, array(
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $result_topic_id,
'POST_ID' => ($show_results == 'posts') ? $row['post_id'] : false,
@@ -1001,9 +1007,22 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'U_VIEW_TOPIC' => $view_topic_url,
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
- 'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=" . $row['topic_id'] . '&amp;p=' . $row['post_id'] . (($u_hilit) ? '&amp;hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '')
+ 'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=" . $row['topic_id'] . '&amp;p=' . $row['post_id'] . (($u_hilit) ? '&amp;hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '',
));
+ /**
+ * Modify the topic data before it is assigned to the template
+ *
+ * @event core.search_modify_tpl_ary
+ * @var array row Array with topic data
+ * @var array tpl_ary Template block array with topic data
+ * @since 3.1-A1
+ */
+ $vars = array('row', 'tpl_ary');
+ extract($phpbb_dispatcher->trigger_event('core.search_modify_tpl_ary', compact($vars)));
+
+ $template->assign_block_vars('searchresults', $tpl_ary);
+
if ($show_results == 'topics')
{
phpbb_generate_template_pagination($template, $view_topic_url, 'searchresults.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true);
diff --git a/phpBB/styles/prosilver/template/bbcode.html b/phpBB/styles/prosilver/template/bbcode.html
index c0c0a2da46..909c09df5a 100644
--- a/phpBB/styles/prosilver/template/bbcode.html
+++ b/phpBB/styles/prosilver/template/bbcode.html
@@ -12,8 +12,8 @@
<!-- BEGIN quote_open --><blockquote class="uncited"><div><!-- END quote_open -->
<!-- BEGIN quote_close --></div></blockquote><!-- END quote_close -->
-<!-- BEGIN code_open --><dl class="codebox"><dt>{L_CODE}{L_COLON} <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></dt><dd><code><!-- END code_open -->
-<!-- BEGIN code_close --></code></dd></dl><!-- END code_close -->
+<!-- BEGIN code_open --><div class="codebox"><p>{L_CODE}{L_COLON} <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></p><code><!-- END code_open -->
+<!-- BEGIN code_close --></code></div><!-- END code_close -->
<!-- BEGIN inline_attachment_open --><div class="inline-attachment"><!-- END inline_attachment_open -->
<!-- BEGIN inline_attachment_close --></div><!-- END inline_attachment_close -->
diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js
index 235cc0025b..4c70ee345f 100644
--- a/phpBB/styles/prosilver/template/editor.js
+++ b/phpBB/styles/prosilver/template/editor.js
@@ -301,7 +301,7 @@ function colorPalette(dir, width, height) {
var r = 0,
g = 0,
b = 0,
- numberList = new Array(6);
+ numberList = new Array(6),
color = '',
html = '';
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index eccb12e827..693211983f 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -25,8 +25,19 @@ function popup(url, width, height, name) {
/**
* Jump to page
*/
-function jumpto() {
- var page = prompt(jump_page, on_page);
+function jumpto(item) {
+ if (!item || !item.length) {
+ item = $('a.pagination-trigger[data-lang-jump-page]');
+ if (!item.length) {
+ return;
+ }
+ }
+
+ var jump_page = item.attr('data-lang-jump-page'),
+ on_page = item.attr('data-on-page'),
+ per_page = item.attr('data-per-page'),
+ base_url = item.attr('data-base-url'),
+ page = prompt(jump_page, on_page);
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) {
if (base_url.indexOf('?') === -1) {
@@ -42,19 +53,12 @@ function jumpto() {
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
function marklist(id, name, state) {
- var parent = document.getElementById(id) || document[id];
-
- if (!parent) {
- return;
- }
-
- var rb = parent.getElementsByTagName('input');
-
- for (var r = 0; r < rb.length; r++) {
- if (rb[r].name.substr(0, name.length) === name) {
- rb[r].checked = state;
+ jQuery('#' + id + ' input[type=checkbox][name]').each(function() {
+ var $this = jQuery(this);
+ if ($this.attr('name').substr(0, name.length) == name) {
+ $this.prop('checked', state);
}
- }
+ });
}
/**
@@ -124,29 +128,15 @@ jQuery(document).ready(function() {
}
function subPanels(p) {
- var i, e, t;
+ var i;
if (typeof(p) === 'string') {
show_panel = p;
}
for (i = 0; i < panels.length; i++) {
- e = document.getElementById(panels[i]);
- t = document.getElementById(panels[i] + '-tab');
-
- if (e) {
- if (panels[i] === show_panel) {
- e.style.display = 'block';
- if (t) {
- t.className = 'activetab';
- }
- } else {
- e.style.display = 'none';
- if (t) {
- t.className = '';
- }
- }
- }
+ jQuery('#' + panels[i]).css('display', panels[i] === show_panel ? 'block' : 'none');
+ jQuery('#' + panels[i] + '-tab').toggleClass('activetab', panels[i] === show_panel);
}
}
});
@@ -255,57 +245,6 @@ function play_qt_file(obj) {
obj.Play();
}
-/**
-* Check if the nodeName of elem is name
-* @author jQuery
-*/
-function is_node_name(elem, name) {
- return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
-}
-
-/**
-* Check if elem is in array, return position
-* @author jQuery
-*/
-function is_in_array(elem, array) {
- for (var i = 0, length = array.length; i < length; i++) {
- // === is correct (IE)
- if (array[i] === elem) {
- return i;
- }
- }
-
- return -1;
-}
-
-/**
-* Find Element, type and class in tree
-* Not used, but may come in handy for those not using JQuery
-* @author jQuery.find, Meik Sievertsen
-*/
-function find_in_tree(node, tag, type, class_name) {
- var result, element, i = 0, length = node.childNodes.length;
-
- for (element = node.childNodes[0]; i < length; element = node.childNodes[++i]) {
- if (!element || element.nodeType !== 1) {
- continue;
- }
-
- if ((!tag || is_node_name(element, tag)) && (!type || element.type === type)
- && (!class_name || is_in_array(class_name, (element.className || element).toString().split(/\s+/)) > -1)) {
- return element;
- }
-
- if (element.childNodes.length) {
- result = find_in_tree(element, tag, type, class_name);
- }
-
- if (result) {
- return result;
- }
- }
-}
-
var in_autocomplete = false;
var last_key_entered = '';
@@ -337,50 +276,7 @@ function phpbb_check_key(event) {
}
/**
-* Usually used for onkeypress event, to submit a form on enter
-*/
-function submit_default_button(event, selector, class_name) {
- // Add which for key events
- if (!event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode)) {
- event.which = event.charCode || event.keyCode;
- }
-
- if (phpbb_check_key(event)) {
- return true;
- }
-
- var current = selector.parentNode;
-
- // Search parent form element
- while (current && (!current.nodeName || current.nodeType !== 1 || !is_node_name(current, 'form')) && current !== document) {
- current = current.parentNode;
- }
-
- // Find the input submit button with the class name
- //current = find_in_tree(current, 'input', 'submit', class_name);
- var input_tags = current.getElementsByTagName('input');
- current = false;
-
- for (var i = 0, element = input_tags[0]; i < input_tags.length; element = input_tags[++i]) {
- if (element.type === 'submit' && is_in_array(class_name, (element.className || element).toString().split(/\s+/)) > -1) {
- current = element;
- }
- }
-
- if (!current) {
- return true;
- }
-
- // Submit form
- current.focus();
- current.click();
- return false;
-}
-
-/**
* Apply onkeypress event for forcing default submit button on ENTER key press
-* The jQuery snippet used is based on http://greatwebguy.com/programming/dom/default-html-button-submit-on-enter-with-jquery/
-* The non-jQuery code is a mimick of the jQuery code ;)
*/
function apply_onkeypress_event() {
jQuery('form input[type=text], form input[type=password]').on('keypress', function (e) {
@@ -406,20 +302,137 @@ function apply_onkeypress_event() {
jQuery(document).ready(apply_onkeypress_event);
/**
-* Adjust HTML code for IE8 and older versions
+* Run MSN action
+*/
+function msn_action(action, address)
+{
+ // Does the browser support the MSNM object?
+ var app = document.getElementById('objMessengerApp');
+
+ if (!app || !app.MyStatus) {
+ var lang = $('form[data-lang-im-msnm-browser]');
+ if (lang.length) {
+ alert(lang.attr('data-lang-im-msnm-browser'));
+ }
+ return false;
+ }
+
+ // Is MSNM connected?
+ if (app.MyStatus == 1) {
+ var lang = $('form[data-lang-im-msnm-connect]');
+ if (lang.length) {
+ alert(lang.attr('data-lang-im-msnm-connect'));
+ }
+ return false;
+ }
+
+ // Do stuff
+ try {
+ switch (action) {
+ case 'add':
+ app.AddContact(0, address);
+ break;
+
+ case 'im':
+ app.InstantMessage(address);
+ break;
+ }
+ }
+ catch (e) {
+ return;
+ }
+}
+
+/**
+* Add to your contact list
+*/
+function add_contact(address)
+{
+ msn_action('add', address);
+}
+
+/**
+* Write IM to contact
+*/
+function im_contact(address)
+{
+ msn_action('im', address);
+}
+
+/**
+* Functions for user search popup
+*/
+function insert_user(formId, value)
+{
+ var form = jQuery(formId),
+ formName = form.attr('data-form-name'),
+ fieldName = form.attr('data-field-name'),
+ item = opener.document.forms[formName][fieldName];
+
+ if (item.value.length && item.type == 'textarea') {
+ value = item.value + "\n" + value;
+ }
+
+ item.value = value;
+}
+
+function insert_marked_users(formId, users)
+{
+ if (typeof(users.length) == "undefined")
+ {
+ if (users.checked)
+ {
+ insert_user(formId, users.value);
+ }
+ }
+ else if (users.length > 0)
+ {
+ for (i = 0; i < users.length; i++)
+ {
+ if (users[i].checked)
+ {
+ insert_user(formId, users[i].value);
+ }
+ }
+ }
+
+ self.close();
+}
+
+function insert_single_user(formId, user)
+{
+ insert_user(formId, user);
+ self.close();
+}
+
+/**
+* Run onload functions
*/
(function($) {
$(document).ready(function() {
+ // Focus forms
+ $('form[data-focus]:first').each(function() {
+ $('#' + this.getAttribute('data-focus')).focus();
+ });
+
+ // Reset avatar dimensions when changing URL or EMAIL
+ $('input[data-reset-on-edit]').bind('keyup', function() {
+ $(this.getAttribute('data-reset-on-edit')).val('');
+ });
+
+ // Pagination
+ $('a.pagination-trigger').click(function() {
+ jumpto($(this));
+ });
+
+ // Adjust HTML code for IE8 and older versions
var test = document.createElement('div'),
oldBrowser = (typeof test.style.borderRadius == 'undefined');
delete test;
- if (!oldBrowser) {
- return;
+ if (oldBrowser) {
+ // Fix .linkslist.bulletin lists
+ $('ul.linklist.bulletin li:first-child, ul.linklist.bulletin li.rightside:last-child').addClass('no-bulletin');
}
-
- // Fix .linkslist.bulletin lists
- $('ul.linklist.bulletin li:first-child, ul.linklist.bulletin li.rightside:last-child').addClass('no-bulletin');
});
})(jQuery);
-
diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html
index 89ef8acd6f..38d9f8c68b 100644
--- a/phpBB/styles/prosilver/template/login_body.html
+++ b/phpBB/styles/prosilver/template/login_body.html
@@ -1,14 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<script type="text/javascript">
-// <![CDATA[
- onload_functions.push(function () {
- document.getElementById("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->").focus();
- });
-// ]]>
-</script>
-
-<form action="{S_LOGIN_ACTION}" method="post" id="login">
+<form action="{S_LOGIN_ACTION}" method="post" id="login" data-focus="<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->">
<div class="panel">
<div class="inner">
@@ -47,6 +39,10 @@
</dl>
</fieldset>
</div>
+
+ <!-- IF not S_ADMIN_AUTH and PROVIDER_TEMPLATE_FILE -->
+ <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} -->
+ <!-- ENDIF -->
</div>
</div>
diff --git a/phpBB/styles/prosilver/template/login_body_oauth.html b/phpBB/styles/prosilver/template/login_body_oauth.html
new file mode 100644
index 0000000000..156485d211
--- /dev/null
+++ b/phpBB/styles/prosilver/template/login_body_oauth.html
@@ -0,0 +1,8 @@
+<div class="content">
+ <!-- BEGIN oauth -->
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd><a href="{oauth.REDIRECT_URL}" class="button2">{oauth.SERVICE_NAME}</a></dd>
+ </dl>
+ <!-- END oauth -->
+</div>
diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html
index 45e6c10d46..e5dcb94855 100644
--- a/phpBB/styles/prosilver/template/mcp_forum.html
+++ b/phpBB/styles/prosilver/template/mcp_forum.html
@@ -100,20 +100,7 @@
<li class="rightside pagination">
<!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} &bull; <!-- ENDIF -->
<!-- IF .pagination -->
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull;
- <ul>
- <!-- BEGIN pagination -->
- <!-- IF pagination.S_IS_PREV -->
- <!-- ELSEIF pagination.S_IS_CURRENT -->
- <li class="active"><span>{pagination.PAGE_NUMBER}</span></li>
- <!-- ELSEIF pagination.S_IS_ELLIPSIS -->
- <li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
- <!-- ELSEIF pagination.S_IS_NEXT -->
- <!-- ELSE -->
- <li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li>
- <!-- ENDIF -->
- <!-- END pagination -->
- </ul>
+ <!-- INCLUDE pagination.html -->
<!-- ELSE -->
{PAGE_NUMBER}
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html
index e88b7c62df..402cfe029a 100644
--- a/phpBB/styles/prosilver/template/mcp_front.html
+++ b/phpBB/styles/prosilver/template/mcp_front.html
@@ -13,7 +13,7 @@
<p>{L_UNAPPROVED_TOTAL}</p>
<!-- IF .unapproved -->
- <ul class="topiclist two-long-columns">
+ <ul class="topiclist missing-column">
<li class="header">
<dl>
<dt><div class="list-inner">{L_VIEW_DETAILS}</div></dt>
@@ -21,7 +21,7 @@
</dl>
</li>
</ul>
- <ul class="topiclist cplist two-long-columns">
+ <ul class="topiclist cplist missing-column">
<!-- BEGIN unapproved -->
<li class="row<!-- IF unapproved.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html
index 1738e45045..eb954fd11d 100644
--- a/phpBB/styles/prosilver/template/mcp_notes_user.html
+++ b/phpBB/styles/prosilver/template/mcp_notes_user.html
@@ -88,7 +88,7 @@
<tr>
<td class="bg1" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->" align="center"><span class="gen">{L_NO_ENTRIES}</span></td>
</tr>
- <!-- END usernames -->
+ <!-- END usernotes -->
</tbody>
</table>
diff --git a/phpBB/styles/prosilver/template/mcp_post.html b/phpBB/styles/prosilver/template/mcp_post.html
index 4cdd62957c..a205164e60 100644
--- a/phpBB/styles/prosilver/template/mcp_post.html
+++ b/phpBB/styles/prosilver/template/mcp_post.html
@@ -13,8 +13,8 @@
<div class="postbody">
<h3>{L_REPORT_REASON}{L_COLON} {REPORT_REASON_TITLE}</h3>
<p class="author">{L_REPORTED} {L_POST_BY_AUTHOR} {REPORTER_FULL} &laquo; {REPORT_DATE}</p>
- <!-- IF not S_POST_REPORTED -->
- <p class="rules">{L_REPORT_CLOSED}</p>
+ <!-- IF S_REPORT_CLOSED -->
+ <p class="post-notice reported">{L_REPORT_CLOSED}</p>
<!-- ENDIF -->
<div class="content">
<!-- IF REPORT_TEXT -->
@@ -31,7 +31,7 @@
<form method="post" id="mcp_report" action="{S_CLOSE_ACTION}">
<fieldset class="submit-buttons">
- <!-- IF S_POST_REPORTED -->
+ <!-- IF not S_REPORT_CLOSED -->
<input class="button1" type="submit" value="{L_CLOSE_REPORT}" name="action[close]" /> &nbsp;
<!-- ENDIF -->
<input class="button2" type="submit" value="{L_DELETE_REPORT}" name="action[delete]" />
@@ -71,7 +71,7 @@
<!-- IF S_POST_UNAPPROVED -->
<form method="post" id="mcp_approve" action="{U_APPROVE_ACTION}">
- <p class="rules">
+ <p class="post-notice unapproved">
<input class="button2" type="submit" value="{L_DISAPPROVE}" name="action[disapprove]" /> &nbsp;
<input class="button1" type="submit" value="{L_APPROVE}" name="action[approve]" />
<!-- IF not S_FIRST_POST --><input type="hidden" name="mode" value="unapproved_posts" /><!-- ENDIF -->
@@ -82,7 +82,7 @@
<!-- ELSEIF S_POST_DELETED -->
<form method="post" id="mcp_approve" action="{U_APPROVE_ACTION}">
- <p class="rules">
+ <p class="post-notice deleted">
<input class="button2" type="submit" value="{L_DELETE}" name="action[disapprove]" /> &nbsp;
<input class="button1" type="submit" value="{L_RESTORE}" name="action[restore]" />
<!-- IF not S_FIRST_POST --><input type="hidden" name="mode" value="unapproved_posts" /><!-- ENDIF -->
@@ -93,7 +93,7 @@
<!-- ENDIF -->
<!-- IF S_MESSAGE_REPORTED -->
- <p class="rules">
+ <p class="post-notice reported">
{REPORTED_IMG} <a href="{U_MCP_REPORT}"><strong>{L_MESSAGE_REPORTED}</strong></a>
</p>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html
index 0fd5a9455f..bfe18579a6 100644
--- a/phpBB/styles/prosilver/template/mcp_topic.html
+++ b/phpBB/styles/prosilver/template/mcp_topic.html
@@ -101,11 +101,21 @@
<h3><a href="{postrow.U_POST_DETAILS}">{postrow.POST_SUBJECT}</a></h3>
<p class="author"><a href="#pr{postrow.POST_ID}">{postrow.MINI_POST_IMG}</a> {L_POSTED} {postrow.POST_DATE} {L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong><!-- IF postrow.U_MCP_DETAILS --> [ <a href="{postrow.U_MCP_DETAILS}">{L_POST_DETAILS}</a> ]<!-- ENDIF --></p>
- <!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_DELETED or postrow.S_POST_REPORTED -->
- <p class="rules">
- <!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><br /><!-- ENDIF -->
- <!-- IF postrow.S_POST_DELETED -->{DELETED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_DELETED}</strong></a><br /><!-- ENDIF -->
- <!-- IF postrow.S_POST_REPORTED -->{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF -->
+ <!-- IF postrow.S_POST_UNAPPROVED -->
+ <p class="post-notice unapproved">
+ <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a>
+ </p>
+ <!-- ENDIF -->
+
+ <!-- IF postrow.S_POST_DELETED -->
+ <p class="post-notice deleted">
+ <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_DELETED}</strong></a>
+ </p>
+ <!-- ENDIF -->
+
+ <!-- IF postrow.S_POST_REPORTED -->
+ <p class="post-notice reported">
+ <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a>
</p>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/mcp_warn_list.html b/phpBB/styles/prosilver/template/mcp_warn_list.html
index 69aa185391..cdf2aecc0e 100644
--- a/phpBB/styles/prosilver/template/mcp_warn_list.html
+++ b/phpBB/styles/prosilver/template/mcp_warn_list.html
@@ -14,20 +14,7 @@
<li class="rightside pagination">
<!-- IF TOTAL_USERS -->{TOTAL_USERS} &bull; <!-- ENDIF -->
<!-- IF .pagination -->
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull;
- <ul>
- <!-- BEGIN pagination -->
- <!-- IF pagination.S_IS_PREV -->
- <!-- ELSEIF pagination.S_IS_CURRENT -->
- <li class="active"><span>{pagination.PAGE_NUMBER}</span></li>
- <!-- ELSEIF pagination.S_IS_ELLIPSIS -->
- <li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
- <!-- ELSEIF pagination.S_IS_NEXT -->
- <!-- ELSE -->
- <li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li>
- <!-- ENDIF -->
- <!-- END pagination -->
- </ul>
+ <!-- INCLUDE pagination.html -->
<!-- ELSE -->
{PAGE_NUMBER}
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html
index 07a7e2e182..46b35eae2c 100644
--- a/phpBB/styles/prosilver/template/memberlist_body.html
+++ b/phpBB/styles/prosilver/template/memberlist_body.html
@@ -1,7 +1,7 @@
<!-- IF S_IN_SEARCH_POPUP -->
<!-- INCLUDE simple_header.html -->
<!-- INCLUDE memberlist_search.html -->
- <form method="post" id="results" action="{S_MODE_ACTION}" onsubmit="insert_marked(this.user); return false">
+ <form method="post" id="results" action="{S_MODE_ACTION}" onsubmit="insert_marked_users('#results', this.user); return false;" data-form-name="{S_FORM_NAME}" data-field-name="{S_FIELD_NAME}">
<!-- ELSE -->
<!-- INCLUDE overall_header.html -->
@@ -109,7 +109,7 @@
<!-- ENDIF -->
<tr class="<!-- IF memberrow.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
- <td><!-- IF memberrow.RANK_IMG --><span class="rank-img">{memberrow.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{memberrow.RANK_TITLE}</span><!-- ENDIF --><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input type="checkbox" name="user" value="{memberrow.USERNAME}" /> <!-- ENDIF -->{memberrow.USERNAME_FULL}<!-- IF S_SELECT_SINGLE --><br />[&nbsp;<a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a>&nbsp;]<!-- ENDIF --></td>
+ <td><!-- IF memberrow.RANK_IMG --><span class="rank-img">{memberrow.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{memberrow.RANK_TITLE}</span><!-- ENDIF --><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input type="checkbox" name="user" value="{memberrow.USERNAME}" /> <!-- ENDIF --><!-- EVENT memberlist_body_username_prepend -->{memberrow.USERNAME_FULL}<!-- EVENT memberlist_body_username_append --><!-- IF S_IN_SEARCH_POPUP --><br />[&nbsp;<a href="#" onclick="insert_single_user('#results', '{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a>&nbsp;]<!-- ENDIF --></td>
<td class="posts"><!-- IF memberrow.POSTS and S_DISPLAY_SEARCH --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td>
<td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}{L_COLON} {memberrow.U_WWW}">{memberrow.U_SHORT_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
<td>{memberrow.JOINED}</td>
diff --git a/phpBB/styles/prosilver/template/memberlist_im.html b/phpBB/styles/prosilver/template/memberlist_im.html
index 68aed0b3dd..8e7842e631 100644
--- a/phpBB/styles/prosilver/template/memberlist_im.html
+++ b/phpBB/styles/prosilver/template/memberlist_im.html
@@ -3,7 +3,7 @@
<!-- MSNM info from http://www.cdolive.net/ - doesn't seem to work with MSN Messenger -->
<h2 class="solo">{L_SEND_IM}</h2>
-<form method="post" action="{S_IM_ACTION}">
+<form method="post" action="{S_IM_ACTION}" data-lang-im-msnm-connect="{L_IM_MSNM_CONNECT|e('html_attr')}" data-lang-im-msnm-browser="{L_IM_MSNM_BROWSER|e('html_attr')}">
<div class="panel bg2">
<div class="inner">
@@ -85,74 +85,4 @@
<a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
-<script type="text/javascript">
-// <![CDATA[
-
- /** The following will not work with Windows Vista **/
-
- var app = document.getElementById('objMessengerApp');
-
- /**
- * Check whether the browser supports this and whether MSNM is connected
- */
- function msn_supported()
- {
- // Does the browser support the MSNM object?
- if (app.MyStatus)
- {
- // Is MSNM connected?
- if (app.MyStatus == 1)
- {
- alert('{LA_IM_MSNM_CONNECT}');
- return false;
- }
- }
- else
- {
- alert('{LA_IM_MSNM_BROWSER}');
- return false;
- }
- return true;
- }
-
- /**
- * Add to your contact list
- */
- function add_contact(address)
- {
- if (msn_supported())
- {
- // Could return an error while MSNM is connecting, don't want that
- try
- {
- app.AddContact(0, address);
- }
- catch (e)
- {
- return;
- }
- }
-}
-
-/**
-* Write IM to contact
-*/
-function im_contact(address)
-{
- if (msn_supported())
- {
- // Could return an error while MSNM is connecting, don't want that
- try
- {
- app.InstantMessage(address);
- }
- catch (e)
- {
- return;
- }
- }
-}
-// ]]>
-</script>
-
<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html
index 4f029627fc..0b04d0087c 100644
--- a/phpBB/styles/prosilver/template/memberlist_search.html
+++ b/phpBB/styles/prosilver/template/memberlist_search.html
@@ -1,44 +1,3 @@
-<!-- IF S_IN_SEARCH_POPUP -->
-<!-- You should retain this javascript in your own template! -->
-<script type="text/javascript">
-// <![CDATA[
-function insert_user(user)
-{
- opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = ( opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value.length && opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.type == "textarea" ) ? opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value + "\n" + user : user;
-}
-
-function insert_marked(users)
-{
- if (typeof(users.length) == "undefined")
- {
- if (users.checked)
- {
- insert_user(users.value);
- }
- }
- else if (users.length > 0)
- {
- for (i = 0; i < users.length; i++)
- {
- if (users[i].checked)
- {
- insert_user(users[i].value);
- }
- }
- }
-
- self.close();
-}
-
-function insert_single(user)
-{
- opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = user;
- self.close();
-}
-// ]]>
-</script>
-<!-- ENDIF -->
-<!-- INCLUDEJS forum_fn.js -->
<h2 class="solo">{L_FIND_USERNAME}</h2>
<form method="post" action="{S_MODE_ACTION}" id="search_memberlist">
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index 57cfcb86d9..0d103b5914 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -77,6 +77,7 @@
<div class="column2">
<h3>{L_USER_FORUM}</h3>
<dl class="details">
+ <!-- EVENT memberlist_view_user_statistics_before -->
<dt>{L_JOINED}{L_COLON}</dt> <dd>{JOINED}</dd>
<dt>{L_VISITED}{L_COLON}</dt> <dd>{VISITED}</dd>
<!-- IF S_WARNINGS -->
@@ -92,6 +93,7 @@
<dt>{L_ACTIVE_IN_FORUM}{L_COLON}</dt> <dd><!-- IF ACTIVE_FORUM != '' --><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})<!-- ELSE --> - <!-- ENDIF --></dd>
<dt>{L_ACTIVE_IN_TOPIC}{L_COLON}</dt> <dd><!-- IF ACTIVE_TOPIC != '' --><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})<!-- ELSE --> - <!-- ENDIF --></dd>
<!-- ENDIF -->
+ <!-- EVENT memberlist_view_user_statistics_after -->
</dl>
</div>
<span class="clear"></span></div>
diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html
index b948d9f627..15a298053b 100644
--- a/phpBB/styles/prosilver/template/overall_footer.html
+++ b/phpBB/styles/prosilver/template/overall_footer.html
@@ -58,8 +58,8 @@
<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
+<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
<!-- INCLUDEJS forum_fn.js -->
-<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/core.js -->
<!-- INCLUDEJS ajax.js -->
<!-- EVENT overall_footer_after -->
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index ddbd917bd6..0b0c7a4172 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -24,44 +24,6 @@
Modified by:
-->
-<script type="text/javascript">
-// <![CDATA[
- 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 style_cookie = 'phpBBstyle';
- var style_cookie_settings = '{A_COOKIE_SETTINGS}';
- var onload_functions = new Array();
- var onunload_functions = new Array();
-
- <!-- IF S_USER_PM_POPUP and S_NEW_PM -->
- var url = '{UA_POPUP_PM}';
- window.open(url.replace(/&amp;/g, '&'), '_phpbbprivmsg', 'height=225,resizable=yes,scrollbars=yes, width=400');
- <!-- ENDIF -->
-
- /**
- * New function for handling multiple calls to window.onload and window.unload by pentapenguin
- */
- window.onload = function()
- {
- for (var i = 0; i < onload_functions.length; i++)
- {
- onload_functions[i]();
- }
- };
-
- window.onunload = function()
- {
- for (var i = 0; i < onunload_functions.length; i++)
- {
- onunload_functions[i]();
- }
- };
-
-// ]]>
-</script>
-
<link href="{T_THEME_PATH}/print.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="print" title="printonly" />
<link href="{T_STYLESHEET_LINK}" rel="stylesheet" type="text/css" media="screen, projection" />
<link href="{T_STYLESHEET_LANG_LINK}" rel="stylesheet" type="text/css" media="screen, projection" />
@@ -177,7 +139,6 @@
<!-- IF U_RESTORE_PERMISSIONS -->
<li class="icon-restore-permissions"><a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a></li>
<!-- ENDIF -->
- </li>
</ul>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html
index 1c8441a9fd..172bc952e4 100644
--- a/phpBB/styles/prosilver/template/pagination.html
+++ b/phpBB/styles/prosilver/template/pagination.html
@@ -1,5 +1,4 @@
-
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull;
+ <a href="#" class="pagination-trigger" title="{L_JUMP_TO_PAGE}" data-lang-jump-page="{L_JUMP_PAGE|e('html_attr')}{L_COLON}" data-on-page="{ON_PAGE}" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}">{PAGE_NUMBER}</a> &bull;
<ul>
<!-- BEGIN pagination -->
<!-- IF pagination.S_IS_PREV -->
diff --git a/phpBB/styles/prosilver/template/posting_poll_body.html b/phpBB/styles/prosilver/template/posting_poll_body.html
index 5bb7e1a3df..a131c10533 100644
--- a/phpBB/styles/prosilver/template/posting_poll_body.html
+++ b/phpBB/styles/prosilver/template/posting_poll_body.html
@@ -26,7 +26,7 @@
<dl>
<dt><label for="poll_max_options">{L_POLL_MAX_OPTIONS}{L_COLON}</label></dt>
- <dd><input type="number" min="1" max="999" name="poll_max_options" id="poll_max_options" size="3" maxlength="3" value="{POLL_MAX_OPTIONS}" class="inputbox autowidth" /></dd>
+ <dd><input type="number" min="0" max="999" name="poll_max_options" id="poll_max_options" size="3" maxlength="3" value="{POLL_MAX_OPTIONS}" class="inputbox autowidth" /></dd>
<dd>{L_POLL_MAX_OPTIONS_EXPLAIN}</dd>
</dl>
<dl>
diff --git a/phpBB/styles/prosilver/template/posting_smilies.html b/phpBB/styles/prosilver/template/posting_smilies.html
index 01b74c710c..3d56a932b7 100644
--- a/phpBB/styles/prosilver/template/posting_smilies.html
+++ b/phpBB/styles/prosilver/template/posting_smilies.html
@@ -2,8 +2,8 @@
<script type="text/javascript">
// <![CDATA[
- var form_name = 'postform';
- var text_name = 'message';
+ var form_name = opener.form_name;
+ var text_name = opener.text_name;
// ]]>
</script>
<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/editor.js"></script>
diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html
index fedbdc6642..d4c1f98a2a 100644
--- a/phpBB/styles/prosilver/template/search_body.html
+++ b/phpBB/styles/prosilver/template/search_body.html
@@ -1,16 +1,8 @@
<!-- INCLUDE overall_header.html -->
-<script type="text/javascript">
-// <![CDATA[
- onload_functions.push(function () {
- document.getElementById("keywords").focus();
- });
-// ]]>
-</script>
-
<h2 class="solo">{L_SEARCH}</h2>
-<form method="get" action="{S_SEARCH_ACTION}">
+<form method="get" action="{S_SEARCH_ACTION}" data-focus="keywords">
<div class="panel">
<div class="inner">
diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html
index f0424c45db..7603cf4db8 100644
--- a/phpBB/styles/prosilver/template/search_results.html
+++ b/phpBB/styles/prosilver/template/search_results.html
@@ -63,6 +63,7 @@
<dt <!-- IF searchresults.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{searchresults.TOPIC_FOLDER_IMG_ALT}">
<div class="list-inner">
+ <!-- EVENT topiclist_row_prepend -->
<!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->
<a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a> {searchresults.ATTACH_ICON_IMG}
<!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED --><a href="{searchresults.U_MCP_QUEUE}">{searchresults.UNAPPROVED_IMG}</a> <!-- ENDIF -->
@@ -83,6 +84,7 @@
</div>
<!-- ENDIF -->
{L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} &raquo; {searchresults.FIRST_POST_TIME} &raquo; {L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a>
+ <!-- EVENT topiclist_row_append -->
</div>
</dt>
@@ -174,20 +176,7 @@
{SEARCH_MATCHES}
<!-- IF .pagination -->
&bull;
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull;
- <ul>
- <!-- BEGIN pagination -->
- <!-- IF pagination.S_IS_PREV -->
- <!-- ELSEIF pagination.S_IS_CURRENT -->
- <li class="active"><span>{pagination.PAGE_NUMBER}</span></li>
- <!-- ELSEIF pagination.S_IS_ELLIPSIS -->
- <li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
- <!-- ELSEIF pagination.S_IS_NEXT -->
- <!-- ELSE -->
- <li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li>
- <!-- ENDIF -->
- <!-- END pagination -->
- </ul>
+ <!-- INCLUDE pagination.html -->
<!-- ELSE -->
{PAGE_NUMBER}
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/simple_footer.html b/phpBB/styles/prosilver/template/simple_footer.html
index 144ae8e462..b6afc2fdba 100644
--- a/phpBB/styles/prosilver/template/simple_footer.html
+++ b/phpBB/styles/prosilver/template/simple_footer.html
@@ -8,9 +8,11 @@
<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
-<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/forum_fn.js?assets_version={T_ASSETS_VERSION}"></script>
-{SCRIPTS}
+<!-- INCLUDEJS forum_fn.js -->
<!-- EVENT simple_footer_after -->
+
+{$SCRIPTS}
+
</body>
</html>
diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html
index 667698c371..08b212363e 100644
--- a/phpBB/styles/prosilver/template/simple_header.html
+++ b/phpBB/styles/prosilver/template/simple_header.html
@@ -7,40 +7,6 @@
{META}
<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
-<script type="text/javascript">
-// <![CDATA[
-
- 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 style_cookie = 'phpBBstyle';
- var onload_functions = new Array();
- var onunload_functions = new Array();
- var style_cookie_settings = '{A_COOKIE_SETTINGS}';
-
- /**
- * New function for handling multiple calls to window.onload and window.unload by pentapenguin
- */
- window.onload = function()
- {
- for (var i = 0; i < onload_functions.length; i++)
- {
- onload_functions[i]();
- }
- }
-
- window.onunload = function()
- {
- for (var i = 0; i < onunload_functions.length; i++)
- {
- onunload_functions[i]();
- }
- }
-
-// ]]>
-</script>
-
<link href="{T_THEME_PATH}/print.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="print" title="printonly" />
<link href="{T_STYLESHEET_LINK}" rel="stylesheet" type="text/css" media="screen, projection" />
<link href="{T_STYLESHEET_LANG_LINK}" rel="stylesheet" type="text/css" media="screen, projection" />
diff --git a/phpBB/styles/prosilver/template/ucp_auth_link.html b/phpBB/styles/prosilver/template/ucp_auth_link.html
new file mode 100644
index 0000000000..078da58d19
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_auth_link.html
@@ -0,0 +1,15 @@
+<!-- INCLUDE ucp_header.html -->
+
+<h2>{L_UCP_AUTH_LINK_TITLE}</h2>
+
+<div class="panel">
+ <div class="inner">
+ <!-- IF ERROR --><dl><dd class="error">{ERROR}</dd></dl><!-- ENDIF -->
+
+ <!-- IF PROVIDER_TEMPLATE_FILE -->
+ <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} -->
+ <!-- ENDIF -->
+ </div>
+</div>
+
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html b/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html
new file mode 100644
index 0000000000..a3e27328cd
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html
@@ -0,0 +1,29 @@
+<!-- BEGIN oauth -->
+ <form id="ucp" method="post" action="{S_UCP_ACTION}">
+ <h3>{oauth.SERVICE_NAME}</h3>
+
+ <fieldset class="fields2">
+ <!-- IF oauth.UNIQUE_ID -->
+ <dl>
+ <dt>{L_UCP_AUTH_LINK_ID}{L_COLON}</dt>
+ <dd>{oauth.UNIQUE_ID}</dd>
+ </dl>
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd><input type="submit" name="submit" tabindex="6" value="{L_UCP_AUTH_LINK_UNLINK}" class="button1" /></dd>
+ </dl>
+ <!-- ELSE -->
+ <dl>
+ <dd>{L_UCP_AUTH_LINK_ASK}</dd>
+ </dl>
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd><input type="submit" name="submit" tabindex="6" value="{L_UCP_AUTH_LINK_LINK}" class="button1" /></dd>
+ </dl>
+ <!-- ENDIF-->
+ </fieldset>
+ {oauth.HIDDEN_FIELDS}
+ {S_HIDDEN_FIELDS}
+ {S_FORM_TOKEN}
+ </form>
+<!-- END oauth -->
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
index 88e0e69f53..b1076c2d14 100644
--- a/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
@@ -1,20 +1,6 @@
-<script type="text/javascript">
-// <![CDATA[
-
-onload_functions.push(function() {
- $('#avatar_gravatar_email').bind('keyup', function () {
- $('#avatar_gravatar_width').val('');
- $('#avatar_gravatar_height').val('');
- $('#avatar_gravatar_email').unbind('keyup');
- });
-});
-
-// ]]>
-</script>
-
<dl>
<dt><label for="avatar_gravatar_email">{L_GRAVATAR_AVATAR_EMAIL}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_EMAIL_EXPLAIN}</span></dt>
- <dd><input type="email" name="avatar_gravatar_email" id="avatar_gravatar_email" value="{AVATAR_GRAVATAR_EMAIL}" class="inputbox" /></dd>
+ <dd><input type="email" name="avatar_gravatar_email" id="avatar_gravatar_email" value="{AVATAR_GRAVATAR_EMAIL}" class="inputbox" data-reset-on-edit="#avatar_gravatar_width, #avatar_gravatar_height" /></dd>
</dl>
<dl>
<dt><label for="avatar_gravatar_width">{L_GRAVATAR_AVATAR_SIZE}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}</span></dt>
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
index 59adf10058..a8f6135fb2 100644
--- a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
@@ -1,20 +1,6 @@
-<script type="text/javascript">
-// <![CDATA[
-
-onload_functions.push(function() {
- $('#avatar_remote_url').bind('keyup', function () {
- $('#avatar_remote_width').val('');
- $('#avatar_remote_height').val('');
- $('#avatar_remote_url').unbind('keyup');
- });
-});
-
-// ]]>
-</script>
-
<dl>
<dt><label for="avatar_remote_url">{L_LINK_REMOTE_AVATAR}{L_COLON}</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt>
- <dd><input type="url" name="avatar_remote_url" id="avatar_remote_url" value="{AVATAR_REMOTE_URL}" class="inputbox" /></dd>
+ <dd><input type="url" name="avatar_remote_url" id="avatar_remote_url" value="{AVATAR_REMOTE_URL}" class="inputbox" data-reset-on-edit="#avatar_remote_width, #avatar_remote_height" /></dd>
</dl>
<dl>
<dt><label for="avatar_remote_width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
diff --git a/phpBB/styles/prosilver/template/ucp_login_link.html b/phpBB/styles/prosilver/template/ucp_login_link.html
new file mode 100644
index 0000000000..d3c6931ce3
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_login_link.html
@@ -0,0 +1,58 @@
+<!-- INCLUDE overall_header.html -->
+
+<div class="panel">
+ <div class="inner">
+
+ <h2>{SITENAME} - {L_LOGIN_LINK}</h2>
+
+ <p>{L_LOGIN_LINK_EXPLAIN}</p>
+
+ <!-- IF LOGIN_LINK_ERROR --><div class="content">
+ <div class="error">{LOGIN_LINK_ERROR}</div>
+ </div><!-- ENDIF -->
+
+ <div class="content">
+ <h2>{L_REGISTER}</h2>
+
+ <form action="{REGISTER_ACTION}" method="post" id="register">
+ <fieldset class="fields1">
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd>{S_HIDDEN_FIELDS}<input type="submit" name="register" tabindex="1" value="{L_REGISTER}" class="button1" /></dd>
+ </dl>
+ </fieldset>
+ </form>
+ </div>
+
+ <div class="content">
+ <h2>{L_LOGIN}</h2>
+
+ <form action="{LOGIN_ACTION}" method="post" id="login">
+ <fieldset class="fields1">
+ <!-- IF LOGIN_ERROR --><div class="error">{LOGIN_ERROR}</div><!-- ENDIF -->
+ <dl>
+ <dt><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}{L_COLON}</label></dt>
+ <dd><input type="text" tabindex="2" name="{USERNAME_CREDENTIAL}" id="{USERNAME_CREDENTIAL}" size="25" value="{LOGIN_USERNAME}" class="inputbox autowidth" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="{PASSWORD_CREDENTIAL}">{L_PASSWORD}{L_COLON}</label></dt>
+ <dd><input type="password" tabindex="3" id="{PASSWORD_CREDENTIAL}" name="{PASSWORD_CREDENTIAL}" size="25" class="inputbox autowidth" /></dd>
+ </dl>
+ <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
+ <!-- DEFINE $CAPTCHA_TAB_INDEX = 4 -->
+ <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
+ <!-- ENDIF -->
+
+ {S_LOGIN_REDIRECT}
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="5" value="{L_LOGIN}" class="button1" /></dd>
+ </dl>
+ </fieldset>
+ </form>
+ </div>
+
+ </div>
+</div>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html
index 6a1d3b8de4..2088de49e8 100644
--- a/phpBB/styles/prosilver/template/ucp_notifications.html
+++ b/phpBB/styles/prosilver/template/ucp_notifications.html
@@ -83,7 +83,7 @@
</div>
</dt>
- <dd class="mark">&nbsp;<!-- IF notification_list.UNREAD --><input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}" /> <dfn>{L_MARK_READ}</dfn><!-- ENDIF -->&nbsp;</dd>
+ <dd class="mark">&nbsp;<input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}"<!-- IF not notification_list.UNREAD --> disabled="disabled"<!-- ENDIF --> /> <dfn>{L_MARK_READ}</dfn>&nbsp;</dd>
</dl>
</li>
<!-- END notification_list -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
index c5078df268..9cbff64a6a 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
@@ -53,7 +53,7 @@
</dl>
</li>
</ul>
- <ul class="topiclist cplist pmlist two-columns">
+ <ul class="topiclist cplist pmlist <!-- IF S_SHOW_RECIPIENTS -->missing-column<!-- ELSE -->two-columns<!-- ENDIF -->">
<!-- BEGIN messagerow -->
<li class="row<!-- IF messagerow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF messagerow.PM_CLASS --> {messagerow.PM_CLASS}<!-- ENDIF -->">
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
index 22149c8b80..50e76f5b75 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
@@ -62,7 +62,7 @@
<!-- ENDIF -->
<!-- IF S_DISPLAY_NOTICE -->
- <div class="rules">{L_DOWNLOAD_NOTICE}</div>
+ <div class="post-notice error">{L_DOWNLOAD_NOTICE}</div>
<!-- ENDIF -->
<!-- IF EDITED_MESSAGE or EDIT_REASON -->
@@ -85,9 +85,11 @@
<!-- IF AUTHOR_JOINED --><dd><strong>{L_JOINED}{L_COLON}</strong> {AUTHOR_JOINED}</dd><!-- ENDIF -->
<!-- IF AUTHOR_FROM --><dd><strong>{L_LOCATION}{L_COLON}</strong> {AUTHOR_FROM}</dd><!-- ENDIF -->
+ <!-- EVENT ucp_pm_viewmessage_custom_fields_before -->
<!-- BEGIN custom_fields -->
<dd><strong>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</strong> {custom_fields.PROFILE_FIELD_VALUE}</dd>
<!-- END custom_fields -->
+ <!-- EVENT ucp_pm_viewmessage_custom_fields_after -->
<!-- IF U_PM or U_EMAIL or U_WWW or U_MSN or U_ICQ or U_YIM or U_AIM or U_JABBER -->
diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
index 9a639786b7..8111496dcb 100644
--- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html
+++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
@@ -9,6 +9,7 @@
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <!-- EVENT ucp_prefs_personal_prepend -->
<dl>
<dt><label for="viewemail0">{L_SHOW_EMAIL}{L_COLON}</label></dt>
<dd>
@@ -71,6 +72,7 @@
</dd>
<dd id="custom_date" style="display:none;"><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="inputbox narrow" style="margin-top: 3px;" /></dd>
</dl>
+ <!-- EVENT ucp_prefs_personal_append -->
</fieldset>
</div>
diff --git a/phpBB/styles/prosilver/template/ucp_prefs_post.html b/phpBB/styles/prosilver/template/ucp_prefs_post.html
index 6c68b2bccc..891e49af6f 100644
--- a/phpBB/styles/prosilver/template/ucp_prefs_post.html
+++ b/phpBB/styles/prosilver/template/ucp_prefs_post.html
@@ -8,6 +8,7 @@
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <!-- EVENT ucp_prefs_post_prepend -->
<dl>
<dt><label for="bbcode1">{L_DEFAULT_BBCODE}{L_COLON}</label></dt>
<dd>
@@ -36,6 +37,7 @@
<label for="notify0"><input type="radio" name="notify" id="notify0" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
+ <!-- EVENT ucp_prefs_post_append -->
</fieldset>
</div>
diff --git a/phpBB/styles/prosilver/template/ucp_prefs_view.html b/phpBB/styles/prosilver/template/ucp_prefs_view.html
index 51561349c3..7f8d0a344c 100644
--- a/phpBB/styles/prosilver/template/ucp_prefs_view.html
+++ b/phpBB/styles/prosilver/template/ucp_prefs_view.html
@@ -9,6 +9,7 @@
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <!-- EVENT ucp_prefs_view_radio_buttons_prepend -->
<dl>
<dt><label for="images1">{L_VIEW_IMAGES}{L_COLON}</label></dt>
<dd>
@@ -53,7 +54,9 @@
</dd>
</dl>
<!-- ENDIF -->
+ <!-- EVENT ucp_prefs_view_radio_buttons_append -->
<hr />
+ <!-- EVENT ucp_prefs_view_select_menu_prepend -->
<dl>
<dt><label>{L_VIEW_TOPICS_DAYS}{L_COLON}</label></dt>
<dd>{S_TOPIC_SORT_DAYS}</dd>
@@ -79,6 +82,7 @@
<dt><label>{L_VIEW_POSTS_DIR}{L_COLON}</label></dt>
<dd>{S_POST_SORT_DIR}</dd>
</dl>
+ <!-- EVENT ucp_prefs_view_select_menu_append -->
</fieldset>
</div>
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index 69b0608a64..ecd993d7fb 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -144,6 +144,7 @@
<dl class="icon {topicrow.TOPIC_IMG_STYLE}">
<dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
<div class="list-inner">
+ <!-- EVENT topiclist_row_prepend -->
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_DELETED --><a href="{topicrow.U_MCP_QUEUE}">{DELETED_IMG}</a> <!-- ENDIF -->
@@ -164,6 +165,7 @@
<!-- ENDIF -->
<!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
<!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --> &raquo; {L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a><!-- ENDIF -->
+ <!-- EVENT topiclist_row_append -->
</div>
</dt>
<dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd>
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index a8bac42842..e104257e12 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -136,12 +136,14 @@
<!-- IF not S_IS_BOT -->
<!-- IF postrow.U_EDIT or postrow.U_DELETE or postrow.U_REPORT or postrow.U_WARN or postrow.U_INFO or postrow.U_QUOTE -->
<ul class="profile-icons">
+ <!-- EVENT viewtopic_body_post_buttons_before -->
<!-- IF postrow.U_EDIT --><li class="edit-icon"><a href="{postrow.U_EDIT}" title="{L_EDIT_POST}"><span>{L_EDIT_POST}</span></a></li><!-- ENDIF -->
<!-- IF postrow.U_DELETE --><li class="delete-icon"><a href="{postrow.U_DELETE}" title="{L_DELETE_POST}"><span>{L_DELETE_POST}</span></a></li><!-- ENDIF -->
<!-- IF postrow.U_REPORT --><li class="report-icon"><a href="{postrow.U_REPORT}" title="{L_REPORT_POST}"><span>{L_REPORT_POST}</span></a></li><!-- ENDIF -->
<!-- IF postrow.U_WARN --><li class="warn-icon"><a href="{postrow.U_WARN}" title="{L_WARN_USER}"><span>{L_WARN_USER}</span></a></li><!-- ENDIF -->
<!-- IF postrow.U_INFO --><li class="info-icon"><a href="{postrow.U_INFO}" title="{L_INFORMATION}"><span>{L_INFORMATION}</span></a></li><!-- ENDIF -->
<!-- IF postrow.U_QUOTE --><li class="quote-icon"><a href="{postrow.U_QUOTE}" title="{L_REPLY_WITH_QUOTE}"><span>{L_REPLY_WITH_QUOTE}</span></a></li><!-- ENDIF -->
+ <!-- EVENT viewtopic_body_post_buttons_after -->
</ul>
<!-- ENDIF -->
<!-- ENDIF -->
@@ -149,31 +151,34 @@
<h3 <!-- IF postrow.S_FIRST_ROW -->class="first"<!-- ENDIF -->><!-- IF postrow.POST_ICON_IMG --><img src="{T_ICONS_PATH}{postrow.POST_ICON_IMG}" width="{postrow.POST_ICON_IMG_WIDTH}" height="{postrow.POST_ICON_IMG_HEIGHT}" alt="" /> <!-- ENDIF --><a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></h3>
<p class="author"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF -->{L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong> &raquo; {postrow.POST_DATE} </p>
- <!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_DELETED or postrow.S_POST_REPORTED -->
+ <!-- IF postrow.S_POST_UNAPPROVED -->
<form method="post" class="mcp_approve" action="{postrow.U_APPROVE_ACTION}">
- <p class="rules">
- <!-- IF postrow.S_POST_UNAPPROVED -->
- {UNAPPROVED_IMG} <strong>{L_POST_UNAPPROVED}</strong>
- <input class="button2" type="submit" value="{L_DISAPPROVE}" name="action[disapprove]" />
- <input class="button1" type="submit" value="{L_APPROVE}" name="action[approve]" />
- <input type="hidden" name="post_id_list[]" value="{postrow.POST_ID}" />
- {S_FORM_TOKEN}
- <br />
- <!-- ELSEIF postrow.S_POST_DELETED -->
- {DELETED_IMG} <strong>{L_POST_DELETED}</strong>
- <input class="button2" type="submit" value="{L_DELETE}" name="action[disapprove]" />
- <input class="button1" type="submit" value="{L_RESTORE}" name="action[restore]" />
- <input type="hidden" name="post_id_list[]" value="{postrow.POST_ID}" />
- {S_FORM_TOKEN}
- <br />
- <!-- ENDIF -->
- <!-- IF postrow.S_POST_REPORTED -->
- {REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a>
- <!-- ENDIF -->
+ <p class="post-notice unapproved">
+ <strong>{L_POST_UNAPPROVED}</strong>
+ <input class="button2" type="submit" value="{L_DISAPPROVE}" name="action[disapprove]" />
+ <input class="button1" type="submit" value="{L_APPROVE}" name="action[approve]" />
+ <input type="hidden" name="post_id_list[]" value="{postrow.POST_ID}" />
+ {S_FORM_TOKEN}
+ </p>
+ </form>
+ <!-- ELSEIF postrow.S_POST_DELETED -->
+ <form method="post" class="mcp_approve" action="{postrow.U_APPROVE_ACTION}">
+ <p class="post-notice deleted">
+ <strong>{L_POST_DELETED}</strong>
+ <input class="button2" type="submit" value="{L_DELETE}" name="action[disapprove]" />
+ <input class="button1" type="submit" value="{L_RESTORE}" name="action[restore]" />
+ <input type="hidden" name="post_id_list[]" value="{postrow.POST_ID}" />
+ {S_FORM_TOKEN}
</p>
</form>
<!-- ENDIF -->
+ <!-- IF postrow.S_POST_REPORTED -->
+ <p class="post-notice reported">
+ <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a>
+ </p>
+ <!-- ENDIF -->
+
<div class="content">{postrow.MESSAGE}</div>
<!-- IF postrow.S_HAS_ATTACHMENTS -->
@@ -237,9 +242,11 @@
<dd><strong>{postrow.PROFILE_FIELD1_NAME}{L_COLON}</strong> {postrow.PROFILE_FIELD1_VALUE}</dd>
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_postrow_custom_fields_before -->
<!-- BEGIN custom_fields -->
<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON}</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
<!-- END custom_fields -->
+ <!-- EVENT viewtopic_body_postrow_custom_fields_after -->
<!-- IF not S_IS_BOT -->
<!-- IF postrow.U_PM or postrow.U_EMAIL or postrow.U_WWW or postrow.U_MSN or postrow.U_ICQ or postrow.U_YIM or postrow.U_AIM or postrow.U_JABBER -->
@@ -308,17 +315,7 @@
<div class="pagination">
{TOTAL_POSTS} &bull;
<!-- IF .pagination -->
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull;
- <ul>
- <!-- BEGIN pagination -->
- <!-- IF pagination.S_IS_PREV -->
- <!-- ELSEIF pagination.S_IS_CURRENT --><li class="active"><span>{pagination.PAGE_NUMBER}</span></li>
- <!-- ELSEIF pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
- <!-- ELSEIF pagination.S_IS_NEXT -->
- <!-- ELSE --><li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li>
- <!-- ENDIF -->
- <!-- END pagination -->
- </ul>
+ <!-- INCLUDE pagination.html -->
<!-- ELSE -->
{PAGE_NUMBER}
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css
index f617428565..41a9874a18 100644
--- a/phpBB/styles/prosilver/theme/bidi.css
+++ b/phpBB/styles/prosilver/theme/bidi.css
@@ -371,6 +371,13 @@
float: right;
}
+.rtl p.post-notice:before {
+ left: auto;
+ right: 0;
+ padding-left: 5px;
+ padding-right: 26px;
+}
+
/* Topic review panel
----------------------------------------*/
.rtl #topicreview {
@@ -422,7 +429,7 @@
margin-left: 0;
}
-.rtl blockquote dl.codebox {
+.rtl blockquote .codebox {
margin-right: 0;
}
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
index 7d0462be1b..9e3d29bec2 100644
--- a/phpBB/styles/prosilver/theme/colours.css
+++ b/phpBB/styles/prosilver/theme/colours.css
@@ -77,7 +77,7 @@ hr {
}
.bg1 { background-color: #ECF3F7; }
-.bg2 { background-color: #e1ebf2; }
+.bg2 { background-color: #e1ebf2; }
.bg3 { background-color: #cadceb; }
.ucprowbg {
@@ -214,11 +214,24 @@ div.rules {
color: #BC2A4D;
}
-p.rules {
+p.post-notice {
background-color: #ECD5D8;
background-image: none;
}
+p.post-notice.deleted:before {
+ background-image: url("./images/icon_topic_deleted.png");
+}
+
+p.post-notice.unapproved:before {
+ background-image: url("./images/icon_topic_unapproved.gif");
+}
+
+p.post-notice.reported:before, p.post-notice.error:before {
+ background-image: url("./images/icon_topic_reported.gif");
+}
+
+
/*
--------------------------------------------------------------
Colours and backgrounds for links.css
@@ -331,10 +344,10 @@ a.top2 {
}
/* Arrow links */
-a.arrow-up { background-image: url("./images/arrow_up.gif") }
-a.arrow-down { background-image: url("./images/arrow_down.gif") }
-a.arrow-left { background-image: url("./images/arrow_left.gif") }
-a.arrow-right { background-image: url("./images/arrow_right.gif") }
+a.arrow-up { background-image: url("./images/arrow_up.gif"); }
+a.arrow-down { background-image: url("./images/arrow_down.gif"); }
+a.arrow-left { background-image: url("./images/arrow_left.gif"); }
+a.arrow-right { background-image: url("./images/arrow_right.gif"); }
a.arrow-up:hover {
background-color: transparent;
@@ -470,16 +483,16 @@ blockquote blockquote blockquote {
}
/* Code block */
-dl.codebox {
+.codebox {
background-color: #FFFFFF;
border-color: #C9D2D8;
}
-dl.codebox dt {
+.codebox p {
border-bottom-color: #CCCCCC;
}
-dl.codebox code {
+.codebox code {
color: #2E8B57;
}
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index e58386de45..4a77dc78d0 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -685,23 +685,28 @@ div.rules ul, div.rules ol {
margin-left: 20px;
}
-p.rules {
- background-image: none;
+p.post-notice {
+ position: relative;
padding: 5px;
+ padding-left: 26px;
+ min-height: 14px;
+ margin-bottom: 1em;
}
-p.rules img {
- vertical-align: middle;
-}
-
-p.rules strong {
- vertical-align: middle;
- padding-top: 5px;
+p.post-notice:before {
+ content: '';
+ display: block;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ width: 28px;
+ background: transparent none 50% 50% no-repeat;
+ pointer-events: none;
}
-p.rules a {
- vertical-align: middle;
- clear: both;
+form > p.post-notice strong {
+ line-height: 20px;
}
#top {
@@ -758,6 +763,10 @@ p.rules a {
clear: both;
}
+#notification_list ul li:before, #notification_list ul li:after {
+ display: none;
+}
+
#notification_list > .header {
padding: 0 10px;
font-family: Arial, "Helvetica Neue", Helvetica, Arial, sans-serif;
diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css
index 4b8c972697..c56c7f9ef8 100644
--- a/phpBB/styles/prosilver/theme/content.css
+++ b/phpBB/styles/prosilver/theme/content.css
@@ -472,13 +472,13 @@ blockquote.uncited {
}
/* Code block */
-dl.codebox {
+.codebox {
padding: 3px;
border: 1px solid transparent;
font-size: 1em;
}
-dl.codebox dt {
+.codebox p {
text-transform: uppercase;
border-bottom: 1px solid transparent;
margin-bottom: 3px;
@@ -487,11 +487,11 @@ dl.codebox dt {
display: block;
}
-blockquote dl.codebox {
+blockquote .codebox {
margin-left: 0;
}
-dl.codebox code {
+.codebox code {
/* Also see tweaks.css */
overflow: auto;
display: block;
diff --git a/phpBB/styles/prosilver/theme/en/button_pm_forward.gif b/phpBB/styles/prosilver/theme/en/button_pm_forward.gif
deleted file mode 100644
index 3384df34be..0000000000
--- a/phpBB/styles/prosilver/theme/en/button_pm_forward.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/en/button_pm_new.gif b/phpBB/styles/prosilver/theme/en/button_pm_new.gif
deleted file mode 100644
index cc0381c6b2..0000000000
--- a/phpBB/styles/prosilver/theme/en/button_pm_new.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/en/button_pm_reply.gif b/phpBB/styles/prosilver/theme/en/button_pm_reply.gif
deleted file mode 100644
index 3275b06d52..0000000000
--- a/phpBB/styles/prosilver/theme/en/button_pm_reply.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/en/button_topic_locked.gif b/phpBB/styles/prosilver/theme/en/button_topic_locked.gif
deleted file mode 100644
index b08918a24f..0000000000
--- a/phpBB/styles/prosilver/theme/en/button_topic_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/en/button_topic_new.gif b/phpBB/styles/prosilver/theme/en/button_topic_new.gif
deleted file mode 100644
index 5b7b1e0e60..0000000000
--- a/phpBB/styles/prosilver/theme/en/button_topic_new.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/en/button_topic_reply.gif b/phpBB/styles/prosilver/theme/en/button_topic_reply.gif
deleted file mode 100644
index e900c80c70..0000000000
--- a/phpBB/styles/prosilver/theme/en/button_topic_reply.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/en/stylesheet.css b/phpBB/styles/prosilver/theme/en/stylesheet.css
index 1a3d0acb4b..82b7df0830 100644
--- a/phpBB/styles/prosilver/theme/en/stylesheet.css
+++ b/phpBB/styles/prosilver/theme/en/stylesheet.css
@@ -32,33 +32,3 @@ ul.profile-icons li.edit-icon { width: 42px; height: 20px; }
padding-left: 58px;
padding-top: 58px;
}
-.imageset.button_pm_forward {
- background-image: url("./button_pm_forward.gif");
- padding-left: 96px;
- padding-top: 25px;
-}
-.imageset.button_pm_new {
- background-image: url("./button_pm_new.gif");
- padding-left: 84px;
- padding-top: 25px;
-}
-.imageset.button_pm_reply {
- background-image: url("./button_pm_reply.gif");
- padding-left: 96px;
- padding-top: 25px;
-}
-.imageset.button_topic_locked {
- background-image: url("./button_topic_locked.gif");
- padding-left: 88px;
- padding-top: 25px;
-}
-.imageset.button_topic_new {
- background-image: url("./button_topic_new.gif");
- padding-left: 96px;
- padding-top: 25px;
-}
-.imageset.button_topic_reply {
- background-image: url("./button_topic_reply.gif");
- padding-left: 96px;
- padding-top: 25px;
-}
diff --git a/phpBB/styles/prosilver/theme/forms.css b/phpBB/styles/prosilver/theme/forms.css
index b66544acf7..34f8bc8c32 100644
--- a/phpBB/styles/prosilver/theme/forms.css
+++ b/phpBB/styles/prosilver/theme/forms.css
@@ -28,6 +28,10 @@ select {
font-size: 1em;
}
+select:focus {
+ outline-style: none;
+}
+
option {
padding-right: 1em;
}
@@ -271,6 +275,7 @@ fieldset.submit-buttons input {
.inputbox:hover, .inputbox:focus {
border: 1px solid transparent;
+ outline-style: none;
}
input.inputbox { width: 85%; }
@@ -347,6 +352,11 @@ input.disabled {
font-weight: normal;
}
+/* Focus states */
+input.button1:focus, input.button2:focus, input.button3:focus {
+ outline-style: none;
+}
+
/* Topic and forum Search */
.search-box {
margin-top: 3px;
diff --git a/phpBB/styles/prosilver/theme/imageset.css b/phpBB/styles/prosilver/theme/imageset.css
index 296c617f17..7aa19df06e 100644
--- a/phpBB/styles/prosilver/theme/imageset.css
+++ b/phpBB/styles/prosilver/theme/imageset.css
@@ -378,33 +378,3 @@ span.imageset {
padding-left: 58px;
padding-top: 58px;
}
-.imageset.button_pm_forward {
- background-image: url("./en/button_pm_forward.gif");
- padding-left: 96px;
- padding-top: 25px;
-}
-.imageset.button_pm_new {
- background-image: url("./en/button_pm_new.gif");
- padding-left: 84px;
- padding-top: 25px;
-}
-.imageset.button_pm_reply {
- background-image: url("./en/button_pm_reply.gif");
- padding-left: 96px;
- padding-top: 25px;
-}
-.imageset.button_topic_locked {
- background-image: url("./en/button_topic_locked.gif");
- padding-left: 88px;
- padding-top: 25px;
-}
-.imageset.button_topic_new {
- background-image: url("./en/button_topic_new.gif");
- padding-left: 96px;
- padding-top: 25px;
-}
-.imageset.button_topic_reply {
- background-image: url("./en/button_topic_reply.gif");
- padding-left: 96px;
- padding-top: 25px;
-}
diff --git a/phpBB/styles/prosilver/theme/print.css b/phpBB/styles/prosilver/theme/print.css
index bc3ca80fdc..88de620493 100644
--- a/phpBB/styles/prosilver/theme/print.css
+++ b/phpBB/styles/prosilver/theme/print.css
@@ -136,4 +136,4 @@ div.spacer { clear: both; }
/* Accessibility tweaks: Mozilla.org */
.skip_link { display: none; }
-dl.codebox dt { display: none; }
+.codebox p { display: none; }
diff --git a/phpBB/styles/subsilver2/template/bbcode.html b/phpBB/styles/subsilver2/template/bbcode.html
index efcf5e1acb..5558716cad 100644
--- a/phpBB/styles/subsilver2/template/bbcode.html
+++ b/phpBB/styles/subsilver2/template/bbcode.html
@@ -21,11 +21,11 @@
<!-- END quote_close -->
<!-- BEGIN code_open -->
-<div class="codetitle"><b>{L_CODE}{L_COLON}</b></div><div class="codecontent">
+<div class="codetitle"><b>{L_CODE}{L_COLON}</b></div><pre class="codecontent">
<!-- END code_open -->
<!-- BEGIN code_close -->
-</div>
+</pre>
<!-- END code_close -->
<!-- BEGIN inline_attachment_open -->
diff --git a/phpBB/styles/subsilver2/template/login_body.html b/phpBB/styles/subsilver2/template/login_body.html
index 2b895dda89..ed63e748cf 100644
--- a/phpBB/styles/subsilver2/template/login_body.html
+++ b/phpBB/styles/subsilver2/template/login_body.html
@@ -61,6 +61,9 @@
<td><input type="checkbox" class="radio" name="viewonline" tabindex="4" /> <span class="gensmall">{L_HIDE_ME}</span></td>
</tr>
<!-- ENDIF -->
+ <!-- IF not S_ADMIN_AUTH and PROVIDER_TEMPLATE_FILE -->
+ <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} -->
+ <!-- ENDIF -->
</table>
</td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/login_body_oauth.html b/phpBB/styles/subsilver2/template/login_body_oauth.html
new file mode 100644
index 0000000000..6f374fa4f2
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/login_body_oauth.html
@@ -0,0 +1,7 @@
+<!-- BEGIN oauth -->
+ <tr>
+ <td>
+ <a href="{oauth.REDIRECT_URL}">{oauth.SERVICE_NAME}</a>
+ </td>
+ </tr>
+<!-- END oauth -->
diff --git a/phpBB/styles/subsilver2/template/mcp_post.html b/phpBB/styles/subsilver2/template/mcp_post.html
index a3ebb00d06..0f000ca931 100644
--- a/phpBB/styles/subsilver2/template/mcp_post.html
+++ b/phpBB/styles/subsilver2/template/mcp_post.html
@@ -28,7 +28,7 @@
</tr>
<!-- ENDIF -->
<tr>
- <td class="cat" align="center" colspan="2"><!-- IF S_POST_REPORTED --><input class="btnmain" type="submit" value="{L_CLOSE_REPORT}" name="action[close]" /><!-- ELSE -->{L_REPORT_CLOSED}<!-- ENDIF --> &nbsp; <input class="btnlite" type="submit" value="{L_DELETE_REPORT}" name="action[delete]" /></td>
+ <td class="cat" align="center" colspan="2"><!-- IF not S_REPORT_CLOSED --><input class="btnmain" type="submit" value="{L_CLOSE_REPORT}" name="action[close]" /><!-- ELSE -->{L_REPORT_CLOSED}<!-- ENDIF --> &nbsp; <input class="btnlite" type="submit" value="{L_DELETE_REPORT}" name="action[delete]" /></td>
</tr>
</table>
diff --git a/phpBB/styles/subsilver2/template/memberlist_body.html b/phpBB/styles/subsilver2/template/memberlist_body.html
index 09336fb8a3..7c4d301de7 100644
--- a/phpBB/styles/subsilver2/template/memberlist_body.html
+++ b/phpBB/styles/subsilver2/template/memberlist_body.html
@@ -66,7 +66,7 @@
<!-- IF memberrow.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --> <tr class="row1"><!-- ENDIF -->
<td class="gen" align="center">&nbsp;{memberrow.ROW_NUMBER}&nbsp;</td>
- <td class="genmed" align="{S_CONTENT_FLOW_BEGIN}">{memberrow.USERNAME_FULL}<!-- IF S_SELECT_SINGLE --> [&nbsp;<a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a>&nbsp;]<!-- ENDIF --></td>
+ <td class="genmed" align="{S_CONTENT_FLOW_BEGIN}"><!-- EVENT memberlist_body_username_prepend -->{memberrow.USERNAME_FULL}<!-- EVENT memberlist_body_username_append --><!-- IF S_SELECT_SINGLE --> [&nbsp;<a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a>&nbsp;]<!-- ENDIF --></td>
<td class="genmed" align="center" nowrap="nowrap">&nbsp;{memberrow.JOINED}&nbsp;</td>
<td class="gen" align="center">{memberrow.POSTS}</td>
<td class="gen" align="center"><!-- IF memberrow.RANK_IMG -->{memberrow.RANK_IMG}<!-- ELSE -->{memberrow.RANK_TITLE}<!-- ENDIF --></td>
diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html
index 464369a7a8..06b5af3322 100644
--- a/phpBB/styles/subsilver2/template/memberlist_view.html
+++ b/phpBB/styles/subsilver2/template/memberlist_view.html
@@ -18,7 +18,7 @@
<table cellspacing="1" cellpadding="2" border="0">
<!-- IF S_USER_INACTIVE -->
<tr>
- <td align="center" style="color: red;"><b class="gen">{L_USER_IS_INACTIVE}</b><br />{L_INACTIVE_REASON}{L_COLON} {USER_INACTIVE_REASON}<br /><br /></td>
+ <td align="center"><b class="gen inactive">{L_USER_IS_INACTIVE}</b><br />{L_INACTIVE_REASON}{L_COLON} {USER_INACTIVE_REASON}<br /><br /></td>
</tr>
<!-- ENDIF -->
<tr>
@@ -66,6 +66,7 @@
</td>
<td class="row1">
<table width="100%" cellspacing="1" cellpadding="2" border="0">
+ <!-- EVENT memberlist_view_user_statistics_before -->
<tr>
<td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}{L_COLON} </td>
<td width="100%"><b class="gen">{JOINED}</b></td>
@@ -96,6 +97,7 @@
<td><!-- IF ACTIVE_TOPIC != '' --><b><a class="gen" href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></b><br /><span class="genmed">[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT memberlist_view_user_statistics_after -->
</table>
</td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/overall_footer.html b/phpBB/styles/subsilver2/template/overall_footer.html
index d2b30c22a0..348db5d309 100644
--- a/phpBB/styles/subsilver2/template/overall_footer.html
+++ b/phpBB/styles/subsilver2/template/overall_footer.html
@@ -13,7 +13,7 @@
<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
-<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/core.js -->
+<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
<!-- EVENT overall_footer_after -->
diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html
index bc2307154b..7bfb85017a 100644
--- a/phpBB/styles/subsilver2/template/overall_header.html
+++ b/phpBB/styles/subsilver2/template/overall_header.html
@@ -22,9 +22,6 @@
<script type="text/javascript">
// <![CDATA[
-<!-- IF S_USER_PM_POPUP and S_NEW_PM -->
- popup('{UA_POPUP_PM}', 400, 225, '_phpbbprivmsg');
-<!-- ENDIF -->
function popup(url, width, height, name)
{
@@ -41,7 +38,7 @@ function jumpto()
{
var page = prompt('{LA_JUMP_PAGE}{L_COLON}', '{ON_PAGE}');
var per_page = '{PER_PAGE}';
- var base_url = '{A_BASE_URL}';
+ var base_url = '{BASE_URL|e('js')}';
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
{
@@ -154,8 +151,8 @@ function marklist(id, name, state)
<table width="100%" cellspacing="0">
<tr>
<td class="genmed">
- <!-- IF S_NOTIFICATIONS_DISPLAY -->
- [ <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button">{NOTIFICATIONS_COUNT}</a> ] &bull;
+ <!-- IF S_NOTIFICATIONS_DISPLAY and not S_IS_BOT and S_USER_LOGGED_IN -->
+ [ <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button">{NOTIFICATIONS_COUNT}</a> ]&nbsp;
<div id="notification_list" class="notification_list">
<div class="row1 header">
{L_NOTIFICATIONS}
@@ -196,7 +193,7 @@ function marklist(id, name, state)
<!-- ENDIF -->
<!-- IF not S_IS_BOT --><a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_LOGIN_LOGOUT}</a>&nbsp;<!-- ENDIF -->
<!-- IF U_RESTORE_PERMISSIONS --> &nbsp;<a href="{U_RESTORE_PERMISSIONS}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_RESTORE_PERMISSIONS}</a><!-- ENDIF -->
- <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN --> &nbsp;<span style="color: red;">{L_BOARD_DISABLED}</span><!-- ENDIF -->
+ <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN --> &nbsp;<span class="error">{L_BOARD_DISABLED}</span><!-- ENDIF -->
<!-- IF not S_IS_BOT -->
<!-- IF S_USER_LOGGED_IN -->
<!-- IF S_DISPLAY_PM --> &nbsp;<a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/posting_smilies.html b/phpBB/styles/subsilver2/template/posting_smilies.html
index 30a80e26ab..d0ced9ff12 100644
--- a/phpBB/styles/subsilver2/template/posting_smilies.html
+++ b/phpBB/styles/subsilver2/template/posting_smilies.html
@@ -2,8 +2,8 @@
<script type="text/javascript">
// <![CDATA[
- var form_name = 'postform';
- var text_name = 'message';
+ var form_name = opener.form_name;
+ var text_name = opener.text_name;
// ]]>
</script>
<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/editor.js"></script>
diff --git a/phpBB/styles/subsilver2/template/search_results.html b/phpBB/styles/subsilver2/template/search_results.html
index d98079de20..19ba0b196a 100644
--- a/phpBB/styles/subsilver2/template/search_results.html
+++ b/phpBB/styles/subsilver2/template/search_results.html
@@ -34,6 +34,7 @@
<!-- ENDIF -->
</td>
<td class="row1">
+ <!-- EVENT topiclist_row_prepend -->
<!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
{searchresults.ATTACH_ICON_IMG} <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a>
<!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED -->
@@ -58,6 +59,7 @@
] </p>
<!-- ENDIF -->
<p class="gensmall">{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></p>
+ <!-- EVENT topiclist_row_append -->
</td>
<td class="row2" width="100" align="center"><p class="topicauthor">{searchresults.TOPIC_AUTHOR_FULL}</p></td>
<td class="row1" width="50" align="center"><p class="topicdetails">{searchresults.TOPIC_REPLIES}</p></td>
diff --git a/phpBB/styles/subsilver2/template/simple_footer.html b/phpBB/styles/subsilver2/template/simple_footer.html
index c847bfedcc..48d3d934f8 100644
--- a/phpBB/styles/subsilver2/template/simple_footer.html
+++ b/phpBB/styles/subsilver2/template/simple_footer.html
@@ -7,8 +7,9 @@
<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
-{SCRIPTS}
<!-- EVENT simple_footer_after -->
+
+{$SCRIPTS}
</body>
</html>
diff --git a/phpBB/styles/subsilver2/template/ucp_auth_link.html b/phpBB/styles/subsilver2/template/ucp_auth_link.html
new file mode 100644
index 0000000000..75e3133fcf
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_auth_link.html
@@ -0,0 +1,19 @@
+<!-- INCLUDE ucp_header.html -->
+
+<table class="tablebg" width="100%" cellspacing="1">
+ <tr>
+ <th colspan="4">{L_UCP_AUTH_LINK_TITLE}</th>
+ </tr>
+
+ <!-- IF ERROR -->
+ <tr>
+ <td class="row1" colspan="2" align="center"><span class="genmed error">{ERROR}</span></td>
+ </tr>
+ <!-- ENDIF -->
+
+ <!-- IF PROVIDER_TEMPLATE_FILE -->
+ <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} -->
+ <!-- ENDIF -->
+</table>
+
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html b/phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html
new file mode 100644
index 0000000000..56a4c89125
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html
@@ -0,0 +1,34 @@
+<!-- BEGIN oauth -->
+ <tr>
+ <th>{oauth.SERVICE_NAME}</th>
+ </tr>
+
+ <tr>
+ <td class="row1">
+ <form id="ucp" method="post" action="{S_UCP_ACTION}">
+ <table>
+ <!-- IF oauth.UNIQUE_ID -->
+ <tr>
+ <td class="row1">{L_UCP_AUTH_LINK_ID}{L_COLON}</td>
+ <td class="row1">{oauth.UNIQUE_ID}</td>
+ </tr>
+ <tr>
+ <td class="row1">&nbsp;</td>
+ <td class="row1"><input type="submit" name="submit" tabindex="6" value="{L_UCP_AUTH_LINK_UNLINK}" class="button1" /></td>
+ </tr>
+ <!-- ELSE -->
+ <tr>
+ <td class="row1">{L_UCP_AUTH_LINK_ASK}</td>
+ </tr>
+ <tr>
+ <td class="row1"><input type="submit" name="submit" tabindex="6" value="{L_UCP_AUTH_LINK_LINK}" class="button1" /></td>
+ </tr>
+ <!-- ENDIF-->
+ </table>
+ {oauth.HIDDEN_FIELDS}
+ {S_HIDDEN_FIELDS}
+ {S_FORM_TOKEN}
+ </form>
+ </td>
+ </tr>
+<!-- END oauth -->
diff --git a/phpBB/styles/subsilver2/template/ucp_header.html b/phpBB/styles/subsilver2/template/ucp_header.html
index 1ac426d5c3..e3aaef6943 100644
--- a/phpBB/styles/subsilver2/template/ucp_header.html
+++ b/phpBB/styles/subsilver2/template/ucp_header.html
@@ -123,7 +123,7 @@
<tr>
<td class="row1" align="center">
- <b class="genmed" style="color:green">{L_FRIENDS_ONLINE}</b>
+ <b class="genmed online">{L_FRIENDS_ONLINE}</b>
<ul class="nav" style="margin: 0; padding: 0; list-style-type: none; line-height: 175%;">
<!-- BEGIN friends_online -->
@@ -139,7 +139,7 @@
<hr />
- <b class="genmed" style="color:red">{L_FRIENDS_OFFLINE}</b>
+ <b class="genmed offline">{L_FRIENDS_OFFLINE}</b>
<ul class="nav" style="margin: 0; padding: 0; list-style-type: none; line-height: 175%;">
<!-- BEGIN friends_offline -->
diff --git a/phpBB/styles/subsilver2/template/ucp_login_link.html b/phpBB/styles/subsilver2/template/ucp_login_link.html
new file mode 100644
index 0000000000..5d8e3ee27b
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_login_link.html
@@ -0,0 +1,74 @@
+<!-- INCLUDE overall_header.html -->
+
+<table class="tablebg" width="100%" cellspacing="1">
+ <tr>
+ <th>{SITENAME} - {L_LOGIN_LINK}</th>
+ </tr>
+
+ <tr>
+ <td class="row1" align="center"><span class="genmed">{L_LOGIN_LINK_EXPLAIN}</span></td>
+ </tr>
+
+ <!-- IF LOGIN_LINK_ERROR -->
+ <tr>
+ <td class="row1" align="center"><span class="genmed error">{LOGIN_LINK_ERROR}</span></td>
+ </tr>
+ <!-- ENDIF -->
+
+ <tr>
+ <td class="row1">
+ <form action="{REGISTER_ACTION}" method="post" id="register">
+ <table width="100%" cellspacing="1">
+ <tr>
+ <th colspan="2">{L_REGISTER}</th>
+ </tr>
+
+ <tr>
+ <td>{S_HIDDEN_FIELDS}<input type="submit" name="register" tabindex="1" value="{L_REGISTER}" class="button1" /></td>
+ </tr>
+ </table>
+ </form>
+ </td>
+ </tr>
+
+ <tr>
+ <td class="row1">
+ <form action="{LOGIN_ACTION}" method="post" id="login">
+ <table width="100%" cellspacing="1">
+ <tr>
+ <th colspan="2">{L_LOGIN}</th>
+ </tr>
+
+ <!-- IF LOGIN_ERROR -->
+ <tr>
+ <td class="row1" align="center" colspan="2"><span class="genmed error">{LOGIN_ERROR}</span></td>
+ </tr>
+ <!-- ENDIF -->
+
+ <tr>
+ <td><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}{L_COLON}</label></td>
+ <td><input type="text" tabindex="2" name="{USERNAME_CREDENTIAL}" id="{USERNAME_CREDENTIAL}" size="25" value="{LOGIN_USERNAME}" class="inputbox autowidth" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="{PASSWORD_CREDENTIAL}">{L_PASSWORD}{L_COLON}</label></td>
+ <td><input type="password" tabindex="3" id="{PASSWORD_CREDENTIAL}" name="{PASSWORD_CREDENTIAL}" size="25" class="inputbox autowidth" /></td>
+ </tr>
+
+ <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
+ <!-- DEFINE $CAPTCHA_TAB_INDEX = 4 -->
+ <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
+ <!-- ENDIF -->
+
+ {S_LOGIN_REDIRECT}
+ <tr>
+ <td>&nbsp;</td>
+ <td>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="5" value="{L_LOGIN}" class="button1" /></td>
+ </tr>
+ </table>
+ </form>
+ </td>
+ </tr>
+</table>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_notifications.html b/phpBB/styles/subsilver2/template/ucp_notifications.html
index d85584d20e..4a1630786a 100644
--- a/phpBB/styles/subsilver2/template/ucp_notifications.html
+++ b/phpBB/styles/subsilver2/template/ucp_notifications.html
@@ -102,7 +102,7 @@
</span>
</td>
<td align="center">
- <!-- IF notification_list.UNREAD --><input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}" /><!-- ENDIF -->
+ <input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}"<!-- IF not notification_list.UNREAD --> disabled="disabled"<!-- ENDIF --> />
</td>
</tr>
<!-- END notification_list -->
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_history.html b/phpBB/styles/subsilver2/template/ucp_pm_history.html
index 4f2b627b50..ad06da2b7e 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_history.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_history.html
@@ -25,7 +25,7 @@
</tr>
</table>
</td>
- <td width="100%"<!-- IF history_row.S_CURRENT_MSG --> style="background-color:lightblue"<!-- ENDIF -->>
+ <td width="100%"<!-- IF history_row.S_CURRENT_MSG --> class="current"<!-- ENDIF -->>
<div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"><b>{L_PM_SUBJECT}{L_COLON}</b>&nbsp;{history_row.SUBJECT}</div><div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><b>{L_FOLDER}{L_COLON}</b>&nbsp;{history_row.FOLDER}</div>
</td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
index 8f6e345e69..cd5fc9a13f 100644
--- a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
+++ b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
@@ -29,6 +29,7 @@
<td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_prefs_personal_prepend -->
<tr>
<td class="row1" width="50%"><b class="genmed">{L_SHOW_EMAIL}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="viewemail" value="1"<!-- IF S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="viewemail" value="0"<!-- IF not S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
@@ -75,6 +76,7 @@
<div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="post" style="margin-top: 3px;" /></div>
</td>
</tr>
+<!-- EVENT ucp_prefs_personal_append -->
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_post.html b/phpBB/styles/subsilver2/template/ucp_prefs_post.html
index 03f1472942..0a558b863c 100644
--- a/phpBB/styles/subsilver2/template/ucp_prefs_post.html
+++ b/phpBB/styles/subsilver2/template/ucp_prefs_post.html
@@ -9,6 +9,7 @@
<td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_prefs_post_prepend -->
<tr>
<td class="row1" width="50%"><b class="genmed">{L_DEFAULT_BBCODE}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="bbcode" value="1"<!-- IF S_BBCODE --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="bbcode" value="0"<!-- IF not S_BBCODE --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
@@ -25,6 +26,7 @@
<td class="row1" width="50%"><b class="genmed">{L_DEFAULT_NOTIFY}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="notify" value="1"<!-- IF S_NOTIFY --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="notify" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
+<!-- EVENT ucp_prefs_post_append -->
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_view.html b/phpBB/styles/subsilver2/template/ucp_prefs_view.html
index cc1b20a987..c10c458627 100644
--- a/phpBB/styles/subsilver2/template/ucp_prefs_view.html
+++ b/phpBB/styles/subsilver2/template/ucp_prefs_view.html
@@ -9,6 +9,7 @@
<td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_prefs_view_radio_buttons_prepend -->
<tr>
<td class="row1" width="50%"><b class="genmed">{L_VIEW_IMAGES}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="images" value="1"<!-- IF S_IMAGES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="images" value="0"<!-- IF not S_IMAGES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
@@ -35,9 +36,11 @@
<td class="row2"><input type="radio" class="radio" name="wordcensor" value="1"<!-- IF S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="wordcensor" value="0"<!-- IF not S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_prefs_view_radio_buttons_append -->
<tr>
<td colspan="2" class="spacer"></td>
</tr>
+<!-- EVENT ucp_prefs_view_select_menu_prepend -->
<tr>
<td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DAYS}{L_COLON}</b></td>
<td class="row2">{S_TOPIC_SORT_DAYS}</td>
@@ -65,6 +68,7 @@
<td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DIR}{L_COLON}</b></td>
<td class="row2">{S_POST_SORT_DIR}</td>
</tr>
+<!-- EVENT ucp_prefs_view_select_menu_append -->
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_signature.html b/phpBB/styles/subsilver2/template/ucp_profile_signature.html
index 467018dd1c..85c8b0f616 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_signature.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_signature.html
@@ -1,13 +1,22 @@
<!-- INCLUDE ucp_header.html -->
+<script type="text/javascript">
+// <![CDATA[
+ var form_name = 'ucp';
+ var text_name = 'signature';
+// ]]>
+</script>
+
<!-- DEFINE $S_SIGNATURE = 1 -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th colspan="2">{L_TITLE}</th>
</tr>
+<!-- IF not S_SMILIES_ALLOWED -->
<tr>
<td colspan="2" class="row1">{L_SIGNATURE_EXPLAIN}</td>
</tr>
+<!-- ENDIF -->
<!-- IF ERROR -->
<tr>
@@ -16,14 +25,32 @@
<!-- ENDIF -->
<tr>
- <td colspan="2" class="row2">
- <script type="text/javascript">
- // <![CDATA[
- var form_name = 'ucp';
- var text_name = 'signature';
- // ]]>
- </script>
-
+ <!-- IF S_SMILIES_ALLOWED -->
+ <td class="row1" width="22%" valign="top">
+ {L_SIGNATURE_EXPLAIN}
+ <table width="100%" cellspacing="5" cellpadding="0" border="0" align="center">
+ <tr>
+ <td class="gensmall" align="center"><b>{L_SMILIES}</b></td>
+ </tr>
+ <tr>
+ <td align="center">
+ <!-- BEGIN smiley -->
+ <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;" style="line-height: 20px;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a>
+ <!-- END smiley -->
+ </td>
+ </tr>
+ <!-- IF S_SHOW_SMILEY_LINK -->
+ <tr>
+ <td align="center"><a class="nav" href="{U_MORE_SMILIES}" onclick="popup(this.href, 300, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a></td>
+ </tr>
+ <!-- ENDIF -->
+ </table>
+ </td>
+ <td class="row2">
+ <!-- ELSE -->
+ <td class="row2" colspan="2">
+ <!-- ENDIF -->
+
<table cellspacing="0" cellpadding="2" border="0" width="99%">
<!-- INCLUDE posting_buttons.html -->
<tr>
diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html
index d07e9a1372..dfbe0a605b 100644
--- a/phpBB/styles/subsilver2/template/viewforum_body.html
+++ b/phpBB/styles/subsilver2/template/viewforum_body.html
@@ -40,6 +40,7 @@
<td class="row1" width="25" align="center"><!-- IF topicrow.TOPIC_ICON_IMG --><img src="{T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}" width="{topicrow.TOPIC_ICON_IMG_WIDTH}" height="{topicrow.TOPIC_ICON_IMG_HEIGHT}" alt="" title="" /><!-- ENDIF --></td>
<!-- ENDIF -->
<td class="row1">
+ <!-- EVENT topiclist_row_prepend -->
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
{topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}{L_COLON} {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}"class="topictitle">{topicrow.TOPIC_TITLE}</a>
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
@@ -63,6 +64,7 @@
<!-- END pagination -->
] </p>
<!-- ENDIF -->
+ <!-- EVENT topiclist_row_append -->
</td>
<td class="row2" width="130" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR_FULL}</p></td>
<td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td>
@@ -203,6 +205,7 @@
<td class="row1" width="25" align="center"><!-- IF topicrow.TOPIC_ICON_IMG --><img src="{T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}" width="{topicrow.TOPIC_ICON_IMG_WIDTH}" height="{topicrow.TOPIC_ICON_IMG_HEIGHT}" alt="" title="" /><!-- ENDIF --></td>
<!-- ENDIF -->
<td class="row1">
+ <!-- EVENT topiclist_row_prepend -->
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
{topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}{L_COLON} {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
@@ -227,6 +230,7 @@
] </p>
<!-- ENDIF -->
<!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --><p class="gensmall">{L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></p><!-- ENDIF -->
+ <!-- EVENT topiclist_row_append -->
</td>
<td class="row2" width="130" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR_FULL}</p></td>
<td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td>
diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html
index 299b8219eb..26e74b8c38 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_body.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_body.html
@@ -208,9 +208,11 @@
<br /><b>{postrow.PROFILE_FIELD1_NAME}{L_COLON}</b> {postrow.PROFILE_FIELD1_VALUE}
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_postrow_custom_fields_before -->
<!-- BEGIN custom_fields -->
<br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON}</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}
<!-- END custom_fields -->
+ <!-- EVENT viewtopic_body_postrow_custom_fields_after -->
</span>
</td>
@@ -315,7 +317,21 @@
<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td class="profile"><strong><a href="#wrapheader">{L_BACK_TO_TOP}</a></strong></td>
- <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}" class="imageset">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_PM --><a href="{postrow.U_PM}" class="imageset">{PM_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_EMAIL --><a href="{postrow.U_EMAIL}" class="imageset">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF not S_IS_BOT --><!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}" class="imageset">{EDIT_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}" class="imageset">{QUOTE_IMG}</a> <!-- ENDIF --> <!-- ENDIF -->&nbsp;</div></td>
+ <td>
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">
+ &nbsp;<!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}" class="imageset">{PROFILE_IMG}</a><!-- ENDIF -->
+ <!-- IF postrow.U_PM --><a href="{postrow.U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF -->
+ <!-- IF postrow.U_EMAIL --><a href="{postrow.U_EMAIL}" class="imageset">{EMAIL_IMG}</a><!-- ENDIF -->
+ &nbsp;</div>
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_END};">
+ <!-- EVENT viewtopic_body_post_buttons_before -->
+ <!-- IF not S_IS_BOT -->
+ <!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}" class="imageset">{EDIT_IMG}</a><!-- ENDIF -->
+ <!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}" class="imageset">{QUOTE_IMG}</a><!-- ENDIF -->
+ <!-- ENDIF -->
+ <!-- EVENT viewtopic_body_post_buttons_after -->
+ &nbsp;</div>
+ </td>
<!-- ENDIF -->
</tr>
diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css
index bfb80a53b5..7d14376454 100644
--- a/phpBB/styles/subsilver2/theme/stylesheet.css
+++ b/phpBB/styles/subsilver2/theme/stylesheet.css
@@ -292,7 +292,11 @@ p.topicdetails {
text-decoration: none;
}
-.error {
+.online {
+ color: green;
+}
+
+.offline, .error, .inactive {
color: red;
}
@@ -360,6 +364,10 @@ td.profile {
background-color: #D1D7DC;
}
+.current {
+ background-color: lightblue;
+}
+
hr {
height: 1px;
border-width: 0;
@@ -544,6 +552,9 @@ input.radio {
border-style: none;
}
+input:focus, select:focus, textarea:focus {
+ outline-style: none;
+}
/* BBCode
------------ */
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index ee0584c081..0c587cbf28 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -21,7 +21,7 @@ require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
$id = request_var('i', '');
$mode = request_var('mode', '');
-if (in_array($mode, array('login', 'logout', 'confirm', 'sendpassword', 'activate')))
+if (in_array($mode, array('login', 'login_link', 'logout', 'confirm', 'sendpassword', 'activate')))
{
define('IN_LOGIN', true);
}
@@ -80,6 +80,16 @@ switch ($mode)
login_box(request_var('redirect', "index.$phpEx"));
break;
+ case 'login_link':
+ if ($user->data['is_registered'])
+ {
+ redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ }
+
+ $module->load('ucp', 'login_link');
+ $module->display($user->lang['UCP_LOGIN_LINK']);
+ break;
+
case 'logout':
if ($user->data['user_id'] != ANONYMOUS && $request->is_set('sid') && $request->variable('sid', '') === $user->session_id)
{
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index e991f9dba8..c6712db46c 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -372,6 +372,16 @@ $sql_array = array(
'LEFT_JOIN' => array(),
);
+/**
+* Event to modify the SQL query before the topic data is retrieved
+*
+* @event core.viewforum_get_topic_data
+* @var array sql_array The SQL array to get the data of all topics
+* @since 3.1-A1
+*/
+$vars = array('sql_array');
+extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_data', compact($vars)));
+
$sql_approved = ' AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.');
if ($user->data['is_registered'])
@@ -554,6 +564,17 @@ if (sizeof($shadow_topic_list))
$sql = 'SELECT *
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', array_keys($shadow_topic_list));
+
+ /**
+ * Event to modify the SQL query before the shadowtopic data is retrieved
+ *
+ * @event core.viewforum_get_shadowtopic_data
+ * @var string sql The SQL string to get the data of any shadowtopics
+ * @since 3.1-A1
+ */
+ $vars = array('sql');
+ extract($phpbb_dispatcher->trigger_event('core.viewforum_get_shadowtopic_data', compact($vars)));
+
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index d3581b5fa2..6880b6882d 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -832,39 +832,14 @@ if (!empty($topic_data['poll_start']))
$poll_total += $poll_option['poll_option_total'];
}
- if ($poll_info[0]['bbcode_bitfield'])
- {
- $poll_bbcode = new bbcode();
- }
- else
- {
- $poll_bbcode = false;
- }
+ $parse_flags = ($poll_info[0]['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
{
- $poll_info[$i]['poll_option_text'] = censor_text($poll_info[$i]['poll_option_text']);
-
- if ($poll_bbcode !== false)
- {
- $poll_bbcode->bbcode_second_pass($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield']);
- }
-
- $poll_info[$i]['poll_option_text'] = bbcode_nl2br($poll_info[$i]['poll_option_text']);
- $poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']);
- }
-
- $topic_data['poll_title'] = censor_text($topic_data['poll_title']);
-
- if ($poll_bbcode !== false)
- {
- $poll_bbcode->bbcode_second_pass($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield']);
+ $poll_info[$i]['poll_option_text'] = generate_text_for_display($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield'], $parse_flags, true);
}
- $topic_data['poll_title'] = bbcode_nl2br($topic_data['poll_title']);
- $topic_data['poll_title'] = smiley_text($topic_data['poll_title']);
-
- unset($poll_bbcode);
+ $topic_data['poll_title'] = generate_text_for_display($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield'], $parse_flags, true);
foreach ($poll_info as $poll_option)
{
@@ -1037,7 +1012,7 @@ while ($row = $db->sql_fetchrow($result))
}
}
- $rowset[$row['post_id']] = array(
+ $rowset_data = array(
'hide_post' => (($row['foe'] || $row['post_visibility'] == ITEM_DELETED) && ($view != 'show' || $post_id != $row['post_id'])) ? true : false,
'post_id' => $row['post_id'],
@@ -1072,6 +1047,19 @@ while ($row = $db->sql_fetchrow($result))
'foe' => $row['foe'],
);
+ /**
+ * Modify the post rowset containing data to be displayed with posts
+ *
+ * @event core.viewtopic_post_rowset_data
+ * @var array rowset_data Array with the rowset data for this post
+ * @var array row Array with original user and post data
+ * @since 3.1-A1
+ */
+ $vars = array('rowset_data', 'row');
+ extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_rowset_data', compact($vars)));
+
+ $rowset[$row['post_id']] = $rowset_data;
+
// Define the global bbcode bitfield, will be used to load bbcodes
$bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
@@ -1406,29 +1394,13 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
// End signature parsing, only if needed
if ($user_cache[$poster_id]['sig'] && $row['enable_sig'] && empty($user_cache[$poster_id]['sig_parsed']))
{
- $user_cache[$poster_id]['sig'] = censor_text($user_cache[$poster_id]['sig']);
-
- if ($user_cache[$poster_id]['sig_bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield']);
- }
-
- $user_cache[$poster_id]['sig'] = bbcode_nl2br($user_cache[$poster_id]['sig']);
- $user_cache[$poster_id]['sig'] = smiley_text($user_cache[$poster_id]['sig']);
- $user_cache[$poster_id]['sig_parsed'] = true;
+ $parse_flags = ($user_cache[$poster_id]['sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $user_cache[$poster_id]['sig'] = generate_text_for_display($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield'], $parse_flags, true);
}
// Parse the message and subject
- $message = censor_text($row['post_text']);
-
- // Second parse bbcode here
- if ($row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, true);
if (!empty($attachments[$row['post_id']]))
{
diff --git a/tests/auth/fixtures/oauth_tokens.xml b/tests/auth/fixtures/oauth_tokens.xml
new file mode 100644
index 0000000000..9bfb5a4422
--- /dev/null
+++ b/tests/auth/fixtures/oauth_tokens.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_oauth_tokens">
+ <column>user_id</column>
+ <column>session_id</column>
+ <column>provider</column>
+ <column>oauth_token</column>
+ </table>
+</dataset>
+
diff --git a/tests/auth/provider_oauth_token_storage_test.php b/tests/auth/provider_oauth_token_storage_test.php
new file mode 100644
index 0000000000..401f049405
--- /dev/null
+++ b/tests/auth/provider_oauth_token_storage_test.php
@@ -0,0 +1,207 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+use OAuth\OAuth2\Token\StdOAuth2Token;
+
+class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_case
+{
+ protected $db;
+ protected $service_name;
+ protected $session_id;
+ protected $token_storage;
+ protected $token_storage_table;
+ protected $user;
+
+ protected function setup()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path, $phpEx;
+
+ $this->db = $this->new_dbal();
+ $this->user = $this->getMock('phpbb_user');
+ $this->service_name = 'auth.provider.oauth.service.testing';
+ $this->token_storage_table = 'phpbb_oauth_tokens';
+
+ // Give the user a session_id that we will remember
+ $this->session_id = '12345';
+ $this->user->data['session_id'] = $this->session_id;
+
+ // Set the user id to anonymous
+ $this->user->data['user_id'] = ANONYMOUS;
+
+ $this->token_storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->token_storage_table);
+ }
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/oauth_tokens.xml');
+ }
+
+ public static function retrieveAccessToken_data()
+ {
+ return array(
+ array(new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES, array('extra' => 'param')), null),
+ array(null, 'OAuth\Common\Storage\Exception\TokenNotFoundException'),
+ );
+ }
+
+ /**
+ * @dataProvider retrieveAccessToken_data
+ */
+ public function test_retrieveAccessToken($cache_token, $exception)
+ {
+ if ($cache_token)
+ {
+ $this->token_storage->storeAccessToken($this->service_name, $cache_token);
+ $token = $cache_token;
+ }
+
+ $this->setExpectedException($exception);
+
+ $stored_token = $this->token_storage->retrieveAccessToken($this->service_name);
+ $this->assertEquals($token, $stored_token);
+ }
+
+ public function test_retrieveAccessToken_from_db()
+ {
+ $expected_token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES);
+
+ // Store a token in the database
+ $temp_storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->token_storage_table);
+ $temp_storage->storeAccessToken($this->service_name, $expected_token);
+ unset($temp_storage);
+
+ // Test to see if the token can be retrieved
+ $stored_token = $this->token_storage->retrieveAccessToken($this->service_name);
+ $this->assertEquals($expected_token, $stored_token);
+ }
+
+ /**
+ * @dataProvider retrieveAccessToken_data
+ */
+ public function test_retrieve_access_token_by_session($cache_token, $exception)
+ {
+ if ($cache_token)
+ {
+ $this->token_storage->storeAccessToken($this->service_name, $cache_token);
+ $token = $cache_token;
+ }
+
+ $this->setExpectedException($exception);
+
+ $stored_token = $this->token_storage->retrieve_access_token_by_session($this->service_name);
+ $this->assertEquals($token, $stored_token);
+ }
+
+ public function test_retrieve_access_token_by_session_from_db()
+ {
+ $expected_token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES);
+
+ // Store a token in the database
+ $temp_storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->token_storage_table);
+ $temp_storage->storeAccessToken($this->service_name, $expected_token);
+ unset($temp_storage);
+
+ // Test to see if the token can be retrieved
+ $stored_token = $this->token_storage->retrieve_access_token_by_session($this->service_name);
+ $this->assertEquals($expected_token, $stored_token);
+ }
+
+ public function test_storeAccessToken()
+ {
+ $token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES, array('extra' => 'param') );
+ $this->token_storage->storeAccessToken($this->service_name, $token);
+
+ // Confirm that the token is cached
+ $extraParams = $this->token_storage->retrieveAccessToken($this->service_name)->getExtraParams();
+ $this->assertEquals( 'param', $extraParams['extra'] );
+ $this->assertEquals( 'access', $this->token_storage->retrieveAccessToken($this->service_name)->getAccessToken() );
+
+ $row = $this->get_token_row_by_session_id($this->session_id);
+
+ // The token is serialized before stored in the database
+ $this->assertEquals($this->token_storage->json_encode_token($token), $row['oauth_token']);
+ }
+
+ public static function hasAccessToken_data()
+ {
+ return array(
+ array(null, false),
+ array(new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES, array('extra' => 'param') ), true),
+ );
+ }
+
+ /**
+ * @dataProvider hasAccessToken_data
+ */
+ public function test_hasAccessToken($token, $expected)
+ {
+ if ($token)
+ {
+ $this->token_storage->storeAccessToken($this->service_name, $token);
+ }
+
+ $has_access_token = $this->token_storage->hasAccessToken($this->service_name);
+ $this->assertEquals($expected, $has_access_token);
+ }
+
+ /**
+ * @dataProvider hasAccessToken_data
+ */
+ public function test_has_access_token_by_session($token, $expected)
+ {
+ if ($token)
+ {
+ $this->token_storage->storeAccessToken($this->service_name, $token);
+ }
+
+ $has_access_token = $this->token_storage->has_access_token_by_session($this->service_name);
+ $this->assertEquals($expected, $has_access_token);
+ }
+
+ public function test_clearToken()
+ {
+ $token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES, array('extra' => 'param') );
+ $this->token_storage->storeAccessToken($this->service_name, $token);
+
+ $this->token_storage->clearToken($this->service_name);
+
+ // Check that the database has been cleared
+ $row = $this->get_token_row_by_session_id($this->session_id);
+ $this->assertFalse($row);
+
+ // Check that the token is no longer in memory
+ $this->assertFalse($this->token_storage->hasAccessToken($this->service_name));
+ }
+
+ public function test_set_user_id()
+ {
+ $token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES, array('extra' => 'param') );
+ $this->token_storage->storeAccessToken($this->service_name, $token);
+
+ $new_user_id = ANONYMOUS + 1;
+ $this->token_storage->set_user_id($new_user_id);
+
+ $row = $this->get_token_row_by_session_id($this->session_id);
+ $this->assertEquals($new_user_id, $row['user_id']);
+ }
+
+ protected function get_token_row_by_session_id($session_id)
+ {
+ // Test that the token is stored in the database
+ $sql = 'SELECT * FROM phpbb_oauth_tokens
+ WHERE session_id = \'' . $this->db->sql_escape($session_id) . '\'';
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ return $row;
+ }
+}
diff --git a/tests/controller/helper_url_test.php b/tests/controller/helper_url_test.php
index d5d61d40d9..9a75015c9f 100644
--- a/tests/controller/helper_url_test.php
+++ b/tests/controller/helper_url_test.php
@@ -12,50 +12,92 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_controller_helper_url_test extends phpbb_test_case
{
- public function helper_url_data()
+ public function helper_url_data_no_rewrite()
{
return array(
- array('foo/bar?t=1&amp;f=2', false, true, false, 'app.php?t=1&amp;f=2&amp;controller=foo/bar', 'parameters in url-argument'),
- array('foo/bar', 't=1&amp;f=2', true, false, 'app.php?controller=foo/bar&amp;t=1&amp;f=2', 'parameters in params-argument using amp'),
- array('foo/bar', 't=1&f=2', false, false, 'app.php?controller=foo/bar&t=1&f=2', 'parameters in params-argument using &'),
- array('foo/bar', array('t' => 1, 'f' => 2), true, false, 'app.php?controller=foo/bar&amp;t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('foo/bar?t=1&amp;f=2', false, true, false, 'app.php/foo/bar?t=1&amp;f=2', 'parameters in url-argument'),
+ array('foo/bar', 't=1&amp;f=2', true, false, 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument using amp'),
+ array('foo/bar', 't=1&f=2', false, false, 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument using &'),
+ array('foo/bar', array('t' => 1, 'f' => 2), true, false, 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
// Custom sid parameter
- array('foo/bar', 't=1&amp;f=2', true, 'custom-sid', 'app.php?controller=foo/bar&amp;t=1&amp;f=2&amp;sid=custom-sid', 'using session_id'),
+ array('foo/bar', 't=1&amp;f=2', true, 'custom-sid', 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'using session_id'),
// Testing anchors
- array('foo/bar?t=1&amp;f=2#anchor', false, true, false, 'app.php?t=1&amp;f=2&amp;controller=foo/bar#anchor', 'anchor in url-argument'),
- array('foo/bar', 't=1&amp;f=2#anchor', true, false, 'app.php?controller=foo/bar&amp;t=1&amp;f=2#anchor', 'anchor in params-argument'),
- array('foo/bar', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'app.php?controller=foo/bar&amp;t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('foo/bar?t=1&amp;f=2#anchor', false, true, false, 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in url-argument'),
+ array('foo/bar', 't=1&amp;f=2#anchor', true, false, 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument'),
+ array('foo/bar', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid
- array('foo/bar?t=1&amp;f=2#anchor', false, true, 'custom-sid', 'app.php?t=1&amp;f=2&amp;controller=foo/bar&amp;sid=custom-sid#anchor', 'anchor in url-argument using session_id'),
- array('foo/bar', 't=1&amp;f=2#anchor', true, 'custom-sid', 'app.php?controller=foo/bar&amp;t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument using session_id'),
- array('foo/bar', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'app.php?controller=foo/bar&amp;t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('foo/bar?t=1&amp;f=2#anchor', false, true, 'custom-sid', 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in url-argument using session_id'),
+ array('foo/bar', 't=1&amp;f=2#anchor', true, 'custom-sid', 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument using session_id'),
+ array('foo/bar', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp;
- array('foo/bar', false, true, false, 'app.php?controller=foo/bar', 'no params using bool false'),
- array('foo/bar', '', true, false, 'app.php?controller=foo/bar', 'no params using empty string'),
- array('foo/bar', array(), true, false, 'app.php?controller=foo/bar', 'no params using empty array'),
+ array('foo/bar', false, true, false, 'app.php/foo/bar', 'no params using bool false'),
+ array('foo/bar', '', true, false, 'app.php/foo/bar', 'no params using empty string'),
+ array('foo/bar', array(), true, false, 'app.php/foo/bar', 'no params using empty array'),
);
}
/**
- * @dataProvider helper_url_data
+ * @dataProvider helper_url_data_no_rewrite()
*/
- public function test_helper_url($route, $params, $is_amp, $session_id, $expected, $description)
+ public function test_helper_url_no_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
{
global $phpbb_dispatcher, $phpbb_root_path, $phpEx;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
- $this->style_resource_locator = new \phpbb\style\resource_locator();
$this->user = $this->getMock('\phpbb\user');
$this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $this->user, new \phpbb\template\context());
- $this->style_resource_locator = new \phpbb\style\resource_locator();
- $this->style_provider = new \phpbb\style\path_provider();
- $this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, new \phpbb\config\config(array()), $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
- $helper = new \phpbb\controller\helper($this->template, $this->user, '', 'php');
+ // We don't use mod_rewrite in these tests
+ $config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
+ $helper = new \phpbb\controller\helper($this->template, $this->user, $config, '', 'php');
+ $this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
+ }
+
+ public function helper_url_data_with_rewrite()
+ {
+ return array(
+ array('foo/bar?t=1&amp;f=2', false, true, false, 'foo/bar?t=1&amp;f=2', 'parameters in url-argument'),
+ array('foo/bar', 't=1&amp;f=2', true, false, 'foo/bar?t=1&amp;f=2', 'parameters in params-argument using amp'),
+ array('foo/bar', 't=1&f=2', false, false, 'foo/bar?t=1&f=2', 'parameters in params-argument using &'),
+ array('foo/bar', array('t' => 1, 'f' => 2), true, false, 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('foo/bar', 't=1&amp;f=2', true, 'custom-sid', 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'using session_id'),
+
+ // Testing anchors
+ array('foo/bar?t=1&amp;f=2#anchor', false, true, false, 'foo/bar?t=1&amp;f=2#anchor', 'anchor in url-argument'),
+ array('foo/bar', 't=1&amp;f=2#anchor', true, false, 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument'),
+ array('foo/bar', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('foo/bar?t=1&amp;f=2#anchor', false, true, 'custom-sid', 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in url-argument using session_id'),
+ array('foo/bar', 't=1&amp;f=2#anchor', true, 'custom-sid', 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument using session_id'),
+ array('foo/bar', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the &amp;
+ array('foo/bar', false, true, false, 'foo/bar', 'no params using bool false'),
+ array('foo/bar', '', true, false, 'foo/bar', 'no params using empty string'),
+ array('foo/bar', array(), true, false, 'foo/bar', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider helper_url_data_with_rewrite()
+ */
+ public function test_helper_url_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
+ {
+ global $phpbb_dispatcher, $phpbb_root_path, $phpEx;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher;
+ $this->user = $this->getMock('\phpbb\user');
+ $this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $this->user, new \phpbb\template\context());
+
+ $config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
+ $helper = new \phpbb\controller\helper($this->template, $this->user, $config, '', 'php');
$this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
}
}
diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php
index 8d3dfea780..a3a1ad3597 100644
--- a/tests/di/create_container_test.php
+++ b/tests/di/create_container_test.php
@@ -19,7 +19,7 @@ namespace
$phpbb_root_path = __DIR__ . '/../../phpBB/';
$extensions = array(
new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
- new \phpbb\di\extension\core($phpbb_root_path),
+ new \phpbb\di\extension\core($phpbb_root_path . 'config'),
);
$container = phpbb_create_container($extensions, $phpbb_root_path, 'php');
@@ -31,7 +31,7 @@ namespace
$phpbb_root_path = __DIR__ . '/../../phpBB/';
$extensions = array(
new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
- new \phpbb\di\extension\core($phpbb_root_path),
+ new \phpbb\di\extension\core($phpbb_root_path . 'config'),
);
$container = phpbb_create_install_container($phpbb_root_path, 'php');
@@ -45,7 +45,7 @@ namespace
$config_file = __DIR__ . '/fixtures/config.php';
$extensions = array(
new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
- new \phpbb\di\extension\core($phpbb_root_path),
+ new \phpbb\di\extension\core($phpbb_root_path . 'config'),
);
$container = phpbb_create_compiled_container($config_file, $extensions, array(), $phpbb_root_path, 'php');
diff --git a/tests/extension/style_path_provider_test.php b/tests/extension/style_path_provider_test.php
deleted file mode 100644
index f2ee957f4c..0000000000
--- a/tests/extension/style_path_provider_test.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
-class phpbb_extension_style_path_provider_test extends phpbb_test_case
-{
- protected $relative_root_path;
- protected $root_path;
-
- public function setUp()
- {
- $this->relative_root_path = './';
- $this->root_path = dirname(__FILE__) . '/';
- }
-
- public function test_find()
- {
- $phpbb_style_path_provider = new \phpbb\style\path_provider();
- $phpbb_style_path_provider->set_styles(array($this->relative_root_path . 'styles/prosilver'));
- $phpbb_style_extension_path_provider = new \phpbb\style\extension_path_provider(new phpbb_mock_extension_manager(
- $this->root_path,
- array(
- 'foo' => array(
- 'ext_name' => 'foo',
- 'ext_active' => '1',
- 'ext_path' => 'ext/foo/',
- ),
- 'bar' => array(
- 'ext_name' => 'bar',
- 'ext_active' => '1',
- 'ext_path' => 'ext/bar/',
- ),
- )), $phpbb_style_path_provider, $this->relative_root_path);
-
- $this->assertEquals(array(
- 'style' => array(
- $this->relative_root_path . 'styles/prosilver',
- ),
- 'bar' => array(
- $this->root_path . 'ext/bar/styles/prosilver',
- ),
- ), $phpbb_style_extension_path_provider->find());
- }
-}
diff --git a/tests/extension/subdir/style_path_provider_test.php b/tests/extension/subdir/style_path_provider_test.php
deleted file mode 100644
index 1b5ce62e5f..0000000000
--- a/tests/extension/subdir/style_path_provider_test.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-require_once dirname(__FILE__) . '/../style_path_provider_test.php';
-
-class phpbb_extension_subdir_style_path_provider_test extends phpbb_extension_style_path_provider_test
-{
- public function setUp()
- {
- $this->relative_root_path = '../';
- $this->root_path = dirname(__FILE__) . '/../';
- }
-}
diff --git a/tests/functional/avatar_acp_groups_test.php b/tests/functional/avatar_acp_groups_test.php
new file mode 100644
index 0000000000..9fdc29cc76
--- /dev/null
+++ b/tests/functional/avatar_acp_groups_test.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/common_avatar_test.php';
+
+/**
+ * @group functional
+ */
+class phpbb_functional_avatar_acp_groups_test extends phpbb_functional_common_avatar_test
+{
+ public function get_url()
+ {
+ return 'adm/index.php?i=acp_groups&mode=manage&action=edit&g=5';
+ }
+
+ public function avatar_acp_groups_data()
+ {
+ return array(
+ // Correct Gravatar
+ array(
+ 'GROUP_UPDATED',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_gravatar_email' => 'test@example.com',
+ 'avatar_gravatar_width' => 80,
+ 'avatar_gravatar_height' => 80,
+ ),
+ ),
+ // Gravatar with incorrect size
+ array(
+ 'The submitted avatar is 120 wide and 120 high. Avatars must be at least 20 wide and 20 high, but no larger than 90 wide and 90 high.',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_gravatar_email' => 'test@example.com',
+ 'avatar_gravatar_width' => 120,
+ 'avatar_gravatar_height' => 120,
+ ),
+ ),
+ // Delete avatar image to reset group settings
+ array(
+ 'GROUP_UPDATED',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_delete' => array('tick', ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider avatar_acp_groups_data
+ */
+ public function test_avatar_acp_groups($expected, $avatar_type, $data)
+ {
+ $this->assert_avatar_submit($expected, $avatar_type, $data);
+ }
+}
diff --git a/tests/functional/avatar_acp_users_test.php b/tests/functional/avatar_acp_users_test.php
new file mode 100644
index 0000000000..0afd05e530
--- /dev/null
+++ b/tests/functional/avatar_acp_users_test.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/common_avatar_test.php';
+
+/**
+ * @group functional
+ */
+class phpbb_functional_avatar_acp_users_test extends phpbb_functional_common_avatar_test
+{
+ public function get_url()
+ {
+ return 'adm/index.php?i=acp_users&u=2&mode=avatar';
+ }
+
+ public function avatar_acp_users_data()
+ {
+ return array(
+ // Gravatar with incorrect email
+ array(
+ 'EMAIL_INVALID_EMAIL',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_gravatar_email' => 'test.example.com',
+ 'avatar_gravatar_width' => 80,
+ 'avatar_gravatar_height' => 80,
+ ),
+ ),
+ // Remote avatar with correct link
+ array(
+ 'USER_AVATAR_UPDATED',
+ 'avatar_driver_upload',
+ array(
+ 'avatar_upload_url' => 'https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg',
+ ),
+ ),
+ // Reset avatar settings
+ array(
+ 'USER_AVATAR_UPDATED',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_delete' => array('tick', ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider avatar_acp_users_data
+ */
+ public function test_avatar_acp_users($expected, $avatar_type, $data)
+ {
+ $this->assert_avatar_submit($expected, $avatar_type, $data);
+ }
+}
diff --git a/tests/functional/avatar_ucp_groups_test.php b/tests/functional/avatar_ucp_groups_test.php
new file mode 100644
index 0000000000..233b7d36e1
--- /dev/null
+++ b/tests/functional/avatar_ucp_groups_test.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/common_avatar_test.php';
+
+/**
+ * @group functional
+ */
+class phpbb_functional_avatar_ucp_groups_test extends phpbb_functional_common_avatar_test
+{
+ public function get_url()
+ {
+ return 'ucp.php?i=ucp_groups&mode=manage&action=edit&g=5';
+ }
+
+ public function avatar_ucp_groups_data()
+ {
+ return array(
+ // Incorrect URL
+ array(
+ 'AVATAR_URL_INVALID',
+ 'avatar_driver_upload',
+ array(
+ 'avatar_upload_url' => 'https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?s=80',
+ ),
+ ),
+ /*
+ // Does not work due to DomCrawler issue
+ // Valid file upload
+ array(
+ 'GROUP_UPDATED',
+ 'avatar_driver_upload',
+ array(
+ 'avatar_upload_file' => array('upload', $this->path . 'valid.jpg'),
+ ),
+ ),
+ */
+ // Correct remote avatar
+ array(
+ 'GROUP_UPDATED',
+ 'avatar_driver_remote',
+ array(
+ 'avatar_remote_url' => 'https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg',
+ 'avatar_remote_width' => 80,
+ 'avatar_remote_height' => 80,
+ ),
+ ),
+ array(
+ 'GROUP_UPDATED',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_delete' => array('tick', ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider avatar_ucp_groups_data
+ */
+ public function test_avatar_ucp_groups($expected, $avatar_type, $data)
+ {
+ $this->assert_avatar_submit($expected, $avatar_type, $data);
+ }
+}
diff --git a/tests/functional/avatar_ucp_users_test.php b/tests/functional/avatar_ucp_users_test.php
new file mode 100644
index 0000000000..f828559e0d
--- /dev/null
+++ b/tests/functional/avatar_ucp_users_test.php
@@ -0,0 +1,78 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/common_avatar_test.php';
+
+/**
+ * @group functional
+ */
+class phpbb_functional_avatar_ucp_users_test extends phpbb_functional_common_avatar_test
+{
+ public function get_url()
+ {
+ return 'ucp.php?i=ucp_profile&mode=avatar';
+ }
+
+ public function avatar_ucp_groups_data()
+ {
+ return array(
+ // Gravatar with correct settings
+ array(
+ 'PROFILE_UPDATED',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_gravatar_email' => 'test@example.com',
+ 'avatar_gravatar_width' => 80,
+ 'avatar_gravatar_height' => 80,
+ ),
+ ),
+ // Wrong driver selected
+ array(
+ 'NO_AVATAR_SELECTED',
+ 'avatar_driver_upload',
+ array(
+ 'avatar_remote_url' => 'https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg',
+ 'avatar_remote_width' => 80,
+ 'avatar_remote_height' => 80,
+ ),
+ ),
+ array(
+ 'PROFILE_UPDATED',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_delete' => array('tick', ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider avatar_ucp_groups_data
+ */
+ public function test_avatar_ucp_groups($expected, $avatar_type, $data)
+ {
+ $this->assert_avatar_submit($expected, $avatar_type, $data);
+ }
+
+ public function test_display_upload_avatar()
+ {
+ $this->assert_avatar_submit('PROFILE_UPDATED',
+ 'avatar_driver_upload',
+ array(
+ 'avatar_upload_url' => 'https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg',
+ )
+ );
+
+ $crawler = self::request('GET', $this->get_url() . '&sid=' . $this->sid);
+ $avatar_link = $crawler->filter('img')->attr('src');
+ $crawler = self::request('GET', $avatar_link . '&sid=' . $this->sid, array(), false);
+ $content = self::$client->getResponse()->getContent();
+ self::assertEquals(false, stripos(trim($content), 'debug'), 'Output contains debug message');
+ }
+}
diff --git a/tests/functional/browse_test.php b/tests/functional/browse_test.php
index 18a2ad9464..c3be301762 100644
--- a/tests/functional/browse_test.php
+++ b/tests/functional/browse_test.php
@@ -29,4 +29,11 @@ class phpbb_functional_browse_test extends phpbb_functional_test_case
$crawler = self::request('GET', 'viewtopic.php?t=1');
$this->assertGreaterThan(0, $crawler->filter('.postbody')->count());
}
+
+ public function test_feed()
+ {
+ $crawler = self::request('GET', 'feed.php', array(), false);
+ self::assert_response_xml();
+ $this->assertGreaterThan(0, $crawler->filter('entry')->count());
+ }
}
diff --git a/tests/functional/common_avatar_test.php b/tests/functional/common_avatar_test.php
new file mode 100644
index 0000000000..c0f21d07c2
--- /dev/null
+++ b/tests/functional/common_avatar_test.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+/**
+ * @group functional
+ */
+abstract class phpbb_functional_common_avatar_test extends phpbb_functional_test_case
+{
+ private $path;
+ private $form_content;
+
+ abstract function get_url();
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->path = __DIR__ . '/fixtures/files/';
+ $this->login();
+ $this->admin_login();
+ $this->add_lang(array('acp/board', 'ucp', 'acp/users', 'acp/groups'));
+ $this->set_acp_settings();
+ }
+
+ private function set_acp_settings()
+ {
+ $crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=avatar&sid=' . $this->sid);
+ // Check the default entries we should have
+ $this->assertContainsLang('ALLOW_GRAVATAR', $crawler->text());
+ $this->assertContainsLang('ALLOW_REMOTE', $crawler->text());
+ $this->assertContainsLang('ALLOW_AVATARS', $crawler->text());
+ $this->assertContainsLang('ALLOW_LOCAL', $crawler->text());
+
+ // Now start setting the needed settings
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form['config[allow_avatar_local]']->select(1);
+ $form['config[allow_avatar_gravatar]']->select(1);
+ $form['config[allow_avatar_remote]']->select(1);
+ $form['config[allow_avatar_remote_upload]']->select(1);
+ $crawler = self::submit($form);
+ $this->assertContainsLang('CONFIG_UPDATED', $crawler->text());
+ }
+
+ public function assert_avatar_submit($expected, $type, $data, $button_text = 'SUBMIT')
+ {
+ $crawler = self::request('GET', $this->get_url() . '&sid=' . $this->sid);
+
+ // Test if setting a gravatar avatar properly works
+ $form = $crawler->selectButton($this->lang($button_text))->form();
+ $form['avatar_driver']->select($type);
+
+ foreach ($data as $key => $value)
+ {
+ if (is_array($value))
+ {
+ $form[$key]->$value[0]($value[1]);
+ }
+ else
+ {
+ $form[$key]->setValue($value);
+ }
+ }
+
+ $crawler = self::submit($form);
+
+ try
+ {
+ $this->assertContainsLang($expected, $crawler->text());
+ }
+ catch (Exception $e)
+ {
+ $this->assertContains($expected, $crawler->text());
+ }
+ }
+}
diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php
index 7d29f0000c..dc6d9c0f65 100644
--- a/tests/functional/extension_controller_test.php
+++ b/tests/functional/extension_controller_test.php
@@ -52,7 +52,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_foo_bar()
{
$this->phpbb_extension_manager->enable('foo/bar');
- $crawler = self::request('GET', 'app.php?controller=foo/bar', array(), false);
+ $crawler = self::request('GET', 'app.php/foo/bar', array(), false);
self::assert_response_status_code();
$this->assertContains("foo/bar controller handle() method", $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/bar');
@@ -64,7 +64,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_controller_with_template()
{
$this->phpbb_extension_manager->enable('foo/bar');
- $crawler = self::request('GET', 'app.php?controller=foo/template');
+ $crawler = self::request('GET', 'app.php/foo/template');
$this->assertContains("I am a variable", $crawler->filter('#content')->text());
$this->phpbb_extension_manager->purge('foo/bar');
}
@@ -76,7 +76,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_missing_argument()
{
$this->phpbb_extension_manager->enable('foo/bar');
- $crawler = self::request('GET', 'app.php?controller=foo/baz', array(), false);
+ $crawler = self::request('GET', 'app.php/foo/baz', array(), false);
$this->assert_response_html(500);
$this->assertContains('Missing value for argument #1: test in class phpbb_ext_foo_bar_controller:baz', $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/bar');
@@ -88,7 +88,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_exception_should_result_in_500_status_code()
{
$this->phpbb_extension_manager->enable('foo/bar');
- $crawler = self::request('GET', 'app.php?controller=foo/exception', array(), false);
+ $crawler = self::request('GET', 'app.php/foo/exception', array(), false);
$this->assert_response_html(500);
$this->assertContains('Exception thrown from foo/exception route', $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/bar');
@@ -105,7 +105,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
*/
public function test_error_ext_disabled_or_404()
{
- $crawler = self::request('GET', 'app.php?controller=does/not/exist', array(), false);
+ $crawler = self::request('GET', 'app.php/does/not/exist', array(), false);
$this->assert_response_html(404);
$this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text());
}
diff --git a/tests/functional/extension_global_lang_test.php b/tests/functional/extension_global_lang_test.php
new file mode 100644
index 0000000000..fb8f87e6de
--- /dev/null
+++ b/tests/functional/extension_global_lang_test.php
@@ -0,0 +1,63 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_case
+{
+ protected $phpbb_extension_manager;
+
+ static private $helper;
+
+ static protected $fixtures = array(
+ 'foo/bar/language/en/',
+ 'foo/bar/event/',
+ );
+
+ static public function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ self::$helper = new phpbb_test_case_helpers(self);
+ self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
+ }
+
+ static public function tearDownAfterClass()
+ {
+ parent::tearDownAfterClass();
+
+ self::$helper->restore_original_ext_dir();
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->get_db();
+
+ $this->phpbb_extension_manager = $this->get_extension_manager();
+
+ $this->purge_cache();
+ }
+
+ public function test_load_extension_lang_globally()
+ {
+ $this->phpbb_extension_manager->enable('foo/bar');
+
+ // The board index, which should contain an overwritten translation
+ $crawler = self::request('GET', 'index.php');
+
+ // language from language/en/common.php
+ $this->assertNotContains('Skip to content', $crawler->filter('.skiplink')->text());
+
+ // language from ext/foo/bar/language/en/foo_global.php
+ $this->assertContains('Overwritten by foo', $crawler->filter('.skiplink')->text());
+ }
+}
diff --git a/tests/functional/extension_permission_lang_test.php b/tests/functional/extension_permission_lang_test.php
index 6c1720735c..19adb89819 100644
--- a/tests/functional/extension_permission_lang_test.php
+++ b/tests/functional/extension_permission_lang_test.php
@@ -18,6 +18,7 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t
static protected $fixtures = array(
'foo/bar/language/en/',
+ 'foo/bar/event/',
);
static public function setUpBeforeClass()
@@ -75,6 +76,6 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t
$this->assertContains('Can attach files', $crawler->filter('body')->text());
// language from ext/foo/bar/language/en/permissions_foo.php
- $this->assertContains('Can view foo', $crawler->filter('body')->text());
+ $this->assertContains('Can view foobar', $crawler->filter('body')->text());
}
}
diff --git a/tests/functional/fileupload_remote_test.php b/tests/functional/fileupload_remote_test.php
index 8e361ab77b..65c4b6b7c4 100644
--- a/tests/functional/fileupload_remote_test.php
+++ b/tests/functional/fileupload_remote_test.php
@@ -44,14 +44,14 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
public function test_invalid_extension()
{
$upload = new fileupload('', array('jpg'), 100);
- $file = $upload->remote_upload('http://example.com/image.gif');
+ $file = $upload->remote_upload(self::$root_url . 'develop/blank.gif');
$this->assertEquals('URL_INVALID', $file->error[0]);
}
- public function test_non_existant()
+ public function test_empty_file()
{
$upload = new fileupload('', array('jpg'), 100);
- $file = $upload->remote_upload('http://example.com/image.jpg');
+ $file = $upload->remote_upload(self::$root_url . 'develop/blank.jpg');
$this->assertEquals('EMPTY_REMOTE_DATA', $file->error[0]);
}
diff --git a/tests/functional/fixtures/ext/foo/bar/event/permission.php b/tests/functional/fixtures/ext/foo/bar/event/permission.php
new file mode 100644
index 0000000000..48688a586a
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/event/permission.php
@@ -0,0 +1,40 @@
+<?php
+
+/**
+*
+* @package testing
+* @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;
+}
+
+/**
+* Event listener
+*/
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+class phpbb_ext_foo_bar_event_permission implements EventSubscriberInterface
+{
+ static public function getSubscribedEvents()
+ {
+ return array(
+ 'core.permissions' => 'add_permissions',
+ );
+ }
+
+ public function add_permissions($event)
+ {
+ $permissions = $event['permissions'];
+ $permissions['u_foo'] = array('lang' => 'ACL_U_FOOBAR', 'cat' => 'post');
+ $event['permissions'] = $permissions;
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/event/user_setup.php b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php
new file mode 100644
index 0000000000..3d2d0c5325
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php
@@ -0,0 +1,43 @@
+<?php
+
+/**
+*
+* @package testing
+* @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;
+}
+
+/**
+* Event listener
+*/
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+class phpbb_ext_foo_bar_event_user_setup implements EventSubscriberInterface
+{
+ static public function getSubscribedEvents()
+ {
+ return array(
+ 'core.user_setup' => 'add_global_translations',
+ );
+ }
+
+ public function add_global_translations($event)
+ {
+ $lang_set_ext = $event['lang_set_ext'];
+ $lang_set_ext[] = array(
+ 'ext_name' => 'foo/bar',
+ 'lang_set' => 'foo_global',
+ );
+ $event['lang_set_ext'] = $lang_set_ext;
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php b/tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php
new file mode 100644
index 0000000000..a6af8680d3
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php
@@ -0,0 +1,5 @@
+<?php
+
+$lang = array_merge($lang, array(
+ 'SKIP' => 'Overwritten by foo',
+));
diff --git a/tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php b/tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php
index cd4b9a32d1..64b497c394 100644
--- a/tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php
+++ b/tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php
@@ -1,6 +1,5 @@
<?php
-// Admin Permissions
$lang = array_merge($lang, array(
- 'acl_u_foo' => array('lang' => 'Can view foo', 'cat' => 'misc'),
+ 'ACL_U_FOOBAR' => 'Can view foobar with permission foo',
));
diff --git a/tests/functional/mcp_test.php b/tests/functional/mcp_test.php
new file mode 100644
index 0000000000..f65a7d0784
--- /dev/null
+++ b/tests/functional/mcp_test.php
@@ -0,0 +1,67 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_mcp_test extends phpbb_functional_test_case
+{
+ public function test_post_new_topic()
+ {
+ $this->login();
+
+ // Test creating topic
+ $post = $this->create_topic(2, 'Test Topic 2', 'Testing move post with "Move posts" option from Quick-Moderator Tools.');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+ $this->assertContains('Testing move post with "Move posts" option from Quick-Moderator Tools.', $crawler->filter('html')->text());
+
+ return $crawler;
+ }
+
+ /**
+ * @depends test_post_new_topic
+ */
+ public function test_handle_quickmod($crawler)
+ {
+ // Test moving a post
+ $form = $crawler->selectButton('Go')->eq(1)->form();
+ $form['action']->select('merge');
+ $crawler = self::submit($form);
+
+ return $crawler;
+ }
+
+ /**
+ * @depends test_handle_quickmod
+ */
+ public function test_move_post_to_topic($crawler)
+ {
+ // Select the post in MCP
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form(array(
+ 'to_topic_id' => 1,
+ ));
+ $form['post_id_list'][0]->tick();
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('MERGE_POSTS'), $crawler->filter('html')->text());
+
+ return $crawler;
+ }
+
+ /**
+ * @depends test_move_post_to_topic
+ */
+ public function test_confirm_result($crawler)
+ {
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text());
+ }
+}
diff --git a/tests/functional/report_post_captcha.php b/tests/functional/report_post_captcha_test.php
index af713775c5..8283465041 100644
--- a/tests/functional/report_post_captcha.php
+++ b/tests/functional/report_post_captcha_test.php
@@ -12,13 +12,6 @@
*/
class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_case
{
- public function test_user_report_post()
- {
- $this->login();
- $crawler = self::request('GET', 'report.php?f=2&p=1');
- $this->assertNotContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text());
- }
-
public function test_guest_report_post()
{
$crawler = self::request('GET', 'report.php?f=2&p=1');
@@ -31,6 +24,18 @@ class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_ca
$this->set_reporting_guest(-1);
}
+ public function test_user_report_post()
+ {
+ $this->login();
+ $crawler = self::request('GET', 'report.php?f=2&p=1');
+ $this->assertNotContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text());
+
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('POST_REPORTED_SUCCESS'), $crawler->text());
+ }
+
protected function set_reporting_guest($report_post_allowed)
{
$this->login();
diff --git a/tests/mock/auth_provider.php b/tests/mock/auth_provider.php
new file mode 100644
index 0000000000..a576ef6b67
--- /dev/null
+++ b/tests/mock/auth_provider.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+/**
+ * Mock auth provider class with basic functions to help test sessions.
+ */
+class phpbb_mock_auth_provider extends phpbb_auth_provider_base
+{
+ public function login($username, $password)
+ {
+ return array(
+ 'status' => "",
+ 'error_msg' => "",
+ 'user_row' => "",
+ );
+ }
+}
diff --git a/tests/mock/request.php b/tests/mock/request.php
index b71361e33e..ed0744c8cf 100644
--- a/tests/mock/request.php
+++ b/tests/mock/request.php
@@ -74,6 +74,11 @@ class phpbb_mock_request implements \phpbb\request\request_interface
return array_keys($this->data[$super_global]);
}
+ public function get_super_global($super_global = phpbb_request_interface::REQUEST)
+ {
+ return $this->data[$super_global];
+ }
+
/* custom methods */
public function set_header($header_name, $value)
diff --git a/tests/mock/session_testable.php b/tests/mock/session_testable.php
index 38e66ec67a..d81ae3163e 100644
--- a/tests/mock/session_testable.php
+++ b/tests/mock/session_testable.php
@@ -58,5 +58,9 @@ class phpbb_mock_session_testable extends \phpbb\session
}
}
}
+
+ public function setup()
+ {
+ }
}
diff --git a/tests/notification/base.php b/tests/notification/base.php
new file mode 100644
index 0000000000..8de162a1fb
--- /dev/null
+++ b/tests/notification/base.php
@@ -0,0 +1,131 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/manager_helper.php';
+
+abstract class phpbb_tests_notification_base extends phpbb_database_test_case
+{
+ protected $notifications, $db, $container, $user, $config, $auth, $cache;
+
+ protected function get_notification_types()
+ {
+ return array(
+ 'test',
+ 'approve_post',
+ 'approve_topic',
+ 'bookmark',
+ 'disapprove_post',
+ 'disapprove_topic',
+ 'pm',
+ 'post',
+ 'post_in_queue',
+ 'quote',
+ 'report_pm',
+ 'report_pm_closed',
+ 'report_post',
+ 'report_post_closed',
+ 'topic',
+ 'topic_in_queue',
+ );
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path, $phpEx;
+
+ include_once(__DIR__ . '/ext/test/notification/type/test.' . $phpEx);
+
+ global $db, $config, $user, $auth, $cache, $phpbb_container;
+
+ $db = $this->db = $this->new_dbal();
+ $config = $this->config = new phpbb_config(array(
+ 'allow_privmsg' => true,
+ 'allow_bookmarks' => true,
+ 'allow_topic_notify' => true,
+ 'allow_forum_notify' => true,
+ ));
+ $user = $this->user = new phpbb_user();
+ $this->user_loader = new phpbb_user_loader($this->db, $phpbb_root_path, $phpEx, 'phpbb_users');
+ $auth = $this->auth = new phpbb_mock_notifications_auth();
+ $cache = $this->cache = new phpbb_cache_service(
+ new phpbb_cache_driver_null(),
+ $this->config,
+ $this->db,
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ $phpbb_container = $this->container = new phpbb_mock_container_builder();
+
+ $this->notifications = new phpbb_notification_manager_helper(
+ array(),
+ array(),
+ $this->container,
+ $this->user_loader,
+ $this->db,
+ $this->cache,
+ $this->user,
+ $phpbb_root_path,
+ $phpEx,
+ 'phpbb_notification_types',
+ 'phpbb_notifications',
+ 'phpbb_user_notifications'
+ );
+
+ $phpbb_container->set('notification_manager', $this->notifications);
+
+ $this->notifications->setDependencies($this->auth, $this->config);
+
+ $types = array();
+ foreach ($this->get_notification_types() as $type)
+ {
+ $class = $this->build_type('phpbb_notification_type_' . $type);
+
+ $types[$type] = $class;
+ $this->container->set('notification.type.' . $type, $class);
+ }
+
+ $this->notifications->set_var('notification_types', $types);
+
+ $this->db->sql_query('DELETE FROM phpbb_notification_types');
+ $this->db->sql_query('DELETE FROM phpbb_notifications');
+ $this->db->sql_query('DELETE FROM phpbb_user_notifications');
+ }
+
+ protected function build_type($type)
+ {
+ global $phpbb_root_path, $phpEx;
+
+ return new $type($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $phpbb_root_path, $phpEx, 'phpbb_notification_types', 'phpbb_notifications', 'phpbb_user_notifications');
+ }
+
+ protected function assert_notifications($expected, $options = array())
+ {
+ $notifications = $this->notifications->load_notifications(array_merge(array(
+ 'count_unread' => true,
+ 'order_by' => 'notification_time',
+ 'order_dir' => 'ASC',
+ ), $options));
+
+ $this->assertEquals(sizeof($expected), $notifications['unread_count']);
+
+ $i = 0;
+ foreach ($notifications['notifications'] as $notification)
+ {
+ foreach ($expected[$i] as $key => $value)
+ {
+ $this->assertEquals($value, $notification->$key, $i . ' ' . $key);
+ }
+
+ $i++;
+ }
+ }
+}
diff --git a/tests/notification/fixtures/group_request.xml b/tests/notification/fixtures/group_request.xml
new file mode 100644
index 0000000000..1eb73f1e15
--- /dev/null
+++ b/tests/notification/fixtures/group_request.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>2</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>3</value>
+ <value>3</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/notification/group_request_test.php b/tests/notification/group_request_test.php
new file mode 100644
index 0000000000..368e4ae973
--- /dev/null
+++ b/tests/notification/group_request_test.php
@@ -0,0 +1,109 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/base.php';
+
+class phpbb_notification_group_request_test extends phpbb_tests_notification_base
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/group_request.xml');
+ }
+
+ protected function get_notification_types()
+ {
+ return array_merge(
+ parent::get_notification_types(),
+ array(
+ 'group_request',
+ 'group_request_approved',
+ )
+ );
+ }
+
+ public function test_notifications()
+ {
+ global $phpbb_root_path, $phpEx, $phpbb_dispatcher, $phpbb_log;
+
+ include_once($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+ include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include_once($phpbb_root_path . 'includes/functions_content.' . $phpEx);
+
+ set_config(false, false, false, $this->config);
+
+ $this->container->set('groupposition.legend', new phpbb_groupposition_legend(
+ $this->db,
+ $this->user
+ ));
+ $this->container->set('groupposition.teampage', new phpbb_groupposition_teampage(
+ $this->db,
+ $this->user,
+ $this->cache->get_driver()
+ ));
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher;
+ $phpbb_log = new phpbb_log_null();
+
+ // Now on to the actual test
+
+ $group_id = false;
+ group_create($group_id, GROUP_OPEN, 'test', 'test group', array());
+
+ // Add user 2 as group leader
+ group_user_add($group_id, 2, false, false, false, true, false);
+
+ // Add user 3 as pending
+ group_user_add($group_id, 3, false, false, false, false, true);
+
+ $this->assert_notifications(
+ array(
+ // user 3 pending notification
+ array(
+ 'item_id' => 3, // user_id of requesting join
+ 'item_parent_id' => $group_id,
+ 'user_id' => 2,
+ 'notification_read' => 0,
+ 'notification_data' => array(
+ 'group_name' => 'test',
+ ),
+ ),
+ ),
+ array(
+ 'user_id' => 2,
+ )
+ );
+
+ // Approve user 3 joining the group
+ group_user_attributes('approve', $group_id, array(3));
+
+ // user 3 pending notification should have been deleted
+ $this->assert_notifications(
+ array(),
+ array(
+ 'user_id' => 2,
+ )
+ );
+
+ $this->assert_notifications(
+ array(
+ // user 3 approved notification
+ array(
+ 'item_id' => $group_id, // user_id of requesting join
+ 'user_id' => 3,
+ 'notification_read' => 0,
+ 'notification_data' => array(
+ 'group_name' => 'test',
+ ),
+ ),
+ ),
+ array(
+ 'user_id' => 3,
+ )
+ );
+ }
+}
diff --git a/tests/notification/notification_test.php b/tests/notification/notification_test.php
index 4c7ce9a784..e1788e8670 100644
--- a/tests/notification/notification_test.php
+++ b/tests/notification/notification_test.php
@@ -7,9 +7,9 @@
*
*/
-require_once dirname(__FILE__) . '/manager_helper.php';
+require_once dirname(__FILE__) . '/base.php';
-class phpbb_notification_test extends phpbb_database_test_case
+class phpbb_notification_test extends phpbb_tests_notification_base
{
protected $notifications, $db, $container, $user, $config, $auth, $cache;
@@ -18,98 +18,17 @@ class phpbb_notification_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/notification.xml');
}
- protected function setUp()
- {
- parent::setUp();
-
- global $phpbb_root_path, $phpEx;
-
- include_once(__DIR__ . '/ext/test/notification/type/test.' . $phpEx);
-
- $this->db = $this->new_dbal();
- $this->config = new \phpbb\config\config(array(
- 'allow_privmsg' => true,
- 'allow_bookmarks' => true,
- 'allow_topic_notify' => true,
- 'allow_forum_notify' => true,
- ));
- $this->user = new \phpbb\user();
- $this->user_loader = new \phpbb\user_loader($this->db, $phpbb_root_path, $phpEx, 'phpbb_users');
- $this->auth = new phpbb_mock_notifications_auth();
- $this->cache = new \phpbb\cache\service(
- new \phpbb\cache\driver\null(),
- $this->config,
- $this->db,
- $phpbb_root_path,
- $phpEx
- );
-
- $this->container = new phpbb_mock_container_builder();
-
- $this->notifications = new phpbb_notification_manager_helper(
- array(),
- array(),
- $this->container,
- $this->user_loader,
- $this->db,
- $this->cache,
- $this->user,
- $phpbb_root_path,
- $phpEx,
- 'phpbb_notification_types',
- 'phpbb_notifications',
- 'phpbb_user_notifications'
- );
-
- $this->notifications->setDependencies($this->auth, $this->config);
-
- $types = array();
- foreach (array(
- 'test',
- 'approve_post',
- 'approve_topic',
- 'bookmark',
- 'disapprove_post',
- 'disapprove_topic',
- 'pm',
- 'post',
- 'post_in_queue',
- 'quote',
- 'report_pm',
- 'report_pm_closed',
- 'report_post',
- 'report_post_closed',
- 'topic',
- 'topic_in_queue',
- ) as $type)
- {
- $class = $this->build_type('\phpbb\notification\type\\' . $type);
-
- $types[$type] = $class;
- $this->container->set('notification.type.' . $type, $class);
- }
-
- $this->notifications->set_var('notification_types', $types);
- }
-
- protected function build_type($type)
- {
- global $phpbb_root_path, $phpEx;
-
- return new $type($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $phpbb_root_path, $phpEx, 'phpbb_notification_types', 'phpbb_notifications', 'phpbb_user_notifications');
- }
-
public function test_get_notification_type_id()
{
// They should be inserted the first time
- $this->assertEquals(1, $this->notifications->get_notification_type_id('post'));
- $this->assertEquals(2, $this->notifications->get_notification_type_id('quote'));
- $this->assertEquals(3, $this->notifications->get_notification_type_id('test'));
+ $post_type_id = $this->notifications->get_notification_type_id('post');
+ $quote_type_id = $this->notifications->get_notification_type_id('quote');
+ $test_type_id = $this->notifications->get_notification_type_id('test');
$this->assertEquals(array(
- 'test' => 3,
- 'quote' => 2,
- 'post' => 1,
+ 'test' => $test_type_id,
+ 'quote' => $quote_type_id,
+ 'post' => $post_type_id,
),
$this->notifications->get_notification_type_ids(array(
'test',
@@ -117,11 +36,11 @@ class phpbb_notification_test extends phpbb_database_test_case
'post',
)
));
- $this->assertEquals(2, $this->notifications->get_notification_type_id('quote'));
+ $this->assertEquals($quote_type_id, $this->notifications->get_notification_type_id('quote'));
try
{
- $this->assertEquals(3, $this->notifications->get_notification_type_id('fail'));
+ $this->assertEquals(false, $this->notifications->get_notification_type_id('fail'));
$this->fail('Non-existent type should throw an exception');
}
@@ -241,88 +160,65 @@ class phpbb_notification_test extends phpbb_database_test_case
'post_time' => 1349413326,
));
- $notifications = $this->notifications->load_notifications(array(
- 'count_unread' => true,
- ));
-
- $expected = array(
- 1 => array(
- 'notification_type_id' => 4,
- 'item_id' => 1,
- 'item_parent_id' => 1,
- 'user_id' => 0,
- 'notification_read' => 0,
- 'notification_time' => 1349413321,
- 'notification_data' => array(),
- ),
- 2 => array(
- 'notification_type_id' => 4,
- 'item_id' => 2,
- 'item_parent_id' => 2,
- 'user_id' => 0,
- 'notification_read' => 0,
- 'notification_time' => 1349413322,
- 'notification_data' => array(),
- ),
- 3 => array(
- 'notification_type_id' => 4,
- 'item_id' => 3,
- 'item_parent_id' => 2,
- 'user_id' => 0,
- 'notification_read' => 0,
- 'notification_time' => 1349413323,
- 'notification_data' => array(),
- ),
- 4 => array(
- 'notification_type_id' => 3,
- 'item_id' => 4,
- 'item_parent_id' => 2,
- 'user_id' => 0,
- 'notification_read' => 0,
- 'notification_time' => 1349413324,
- 'notification_data' => array(
- 'poster_id' => 2,
- 'topic_title' => 'test-title',
- 'post_subject' => 'Re: test-title',
- 'post_username' => '',
- 'forum_id' => 2,
- 'forum_name' => 'Your first forum',
+ $this->assert_notifications(
+ array(
+ array(
+ 'item_id' => 1,
+ 'item_parent_id' => 1,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413321,
+ 'notification_data' => array(),
),
- ),
- 5 => array(
- 'notification_type_id' => 2,
- 'item_id' => 5,
- 'item_parent_id' => 2,
- 'user_id' => 0,
- 'notification_read' => 0,
- 'notification_time' => 1349413325,
- 'notification_data' => array(
- 'poster_id' => 2,
- 'topic_title' => 'test-title',
- 'post_subject' => 'Re: test-title',
- 'post_username' => '',
- 'forum_id' => 2,
- 'forum_name' => 'Your first forum',
+ array(
+ 'item_id' => 2,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413322,
+ 'notification_data' => array(),
),
- ),
+ array(
+ 'item_id' => 3,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413323,
+ 'notification_data' => array(),
+ ),
+ array(
+ 'item_id' => 4,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413324,
+ 'notification_data' => array(
+ 'poster_id' => 2,
+ 'topic_title' => 'test-title',
+ 'post_subject' => 'Re: test-title',
+ 'post_username' => '',
+ 'forum_id' => 2,
+ 'forum_name' => 'Your first forum',
+ ),
+ ),
+ array(
+ 'item_id' => 5,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413325,
+ 'notification_data' => array(
+ 'poster_id' => 2,
+ 'topic_title' => 'test-title',
+ 'post_subject' => 'Re: test-title',
+ 'post_username' => '',
+ 'forum_id' => 2,
+ 'forum_name' => 'Your first forum',
+ ),
+ ),
+ )
);
- $this->assertEquals(sizeof($expected), $notifications['unread_count']);
-
- $notifications = $notifications['notifications'];
-
- foreach ($expected as $notification_id => $notification_data)
- {
- //echo $notifications[$notification_id];
-
- $this->assertEquals($notification_id, $notifications[$notification_id]->notification_id, 'notification_id');
-
- foreach ($notification_data as $key => $value)
- {
- $this->assertEquals($value, $notifications[$notification_id]->$key, $key . ' ' . $notification_id);
- }
- }
-
// Now test updating -------------------------------
$this->notifications->update_notifications('test', array(
@@ -347,86 +243,63 @@ class phpbb_notification_test extends phpbb_database_test_case
'forum_name' => 'Your second forum', // change forum_name
));
- $notifications = $this->notifications->load_notifications(array(
- 'count_unread' => true,
- ));
-
- $expected = array(
- 1 => array(
- 'notification_type_id' => 4,
- 'item_id' => 1,
- 'item_parent_id' => 2,
- 'user_id' => 0,
- 'notification_read' => 0,
- 'notification_time' => 1349413321,
- 'notification_data' => array(),
- ),
- 2 => array(
- 'notification_type_id' => 4,
- 'item_id' => 2,
- 'item_parent_id' => 2,
- 'user_id' => 0,
- 'notification_read' => 0,
- 'notification_time' => 1349413322,
- 'notification_data' => array(),
- ),
- 3 => array(
- 'notification_type_id' => 4,
- 'item_id' => 3,
- 'item_parent_id' => 2,
- 'user_id' => 0,
- 'notification_read' => 0,
- 'notification_time' => 1234,
- 'notification_data' => array(),
- ),
- 4 => array(
- 'notification_type_id' => 3,
- 'item_id' => 4,
- 'item_parent_id' => 2,
- 'user_id' => 0,
- 'notification_read' => 0,
- 'notification_time' => 1349413324,
- 'notification_data' => array(
- 'poster_id' => 2,
- 'topic_title' => 'test-title',
- 'post_subject' => 'Re: test-title',
- 'post_username' => '',
- 'forum_id' => 2,
- 'forum_name' => 'Your first forum',
+ $this->assert_notifications(
+ array(
+ array(
+ 'item_id' => 3,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1234,
+ 'notification_data' => array(),
),
- ),
- 5 => array(
- 'notification_type_id' => 2,
- 'item_id' => 5,
- 'item_parent_id' => 2,
- 'user_id' => 0,
- 'notification_read' => 0,
- 'notification_time' => 1349413325,
- 'notification_data' => array(
- 'poster_id' => 2,
- 'topic_title' => 'test-title2',
- 'post_subject' => 'Re: test-title2',
- 'post_username' => '',
- 'forum_id' => 3,
- 'forum_name' => 'Your second forum',
+ array(
+ 'item_id' => 1,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413321,
+ 'notification_data' => array(),
),
- ),
+ array(
+ 'item_id' => 2,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413322,
+ 'notification_data' => array(),
+ ),
+ array(
+ 'item_id' => 4,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413324,
+ 'notification_data' => array(
+ 'poster_id' => 2,
+ 'topic_title' => 'test-title',
+ 'post_subject' => 'Re: test-title',
+ 'post_username' => '',
+ 'forum_id' => 2,
+ 'forum_name' => 'Your first forum',
+ ),
+ ),
+ array(
+ 'item_id' => 5,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413325,
+ 'notification_data' => array(
+ 'poster_id' => 2,
+ 'topic_title' => 'test-title2',
+ 'post_subject' => 'Re: test-title2',
+ 'post_username' => '',
+ 'forum_id' => 3,
+ 'forum_name' => 'Your second forum',
+ ),
+ ),
+ )
);
-
- $this->assertEquals(sizeof($expected), $notifications['unread_count']);
-
- $notifications = $notifications['notifications'];
-
- foreach ($expected as $notification_id => $notification_data)
- {
- //echo $notifications[$notification_id];
-
- $this->assertEquals($notification_id, $notifications[$notification_id]->notification_id, 'notification_id');
-
- foreach ($notification_data as $key => $value)
- {
- $this->assertEquals($value, $notifications[$notification_id]->$key, $key . ' ' . $notification_id);
- }
- }
}
}
diff --git a/tests/session/check_ban_test.php b/tests/session/check_ban_test.php
new file mode 100644
index 0000000000..8d6c9a866d
--- /dev/null
+++ b/tests/session/check_ban_test.php
@@ -0,0 +1,78 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_check_ban_test extends phpbb_session_test_case
+{
+ protected $user_id = 4;
+ protected $key_id = 4;
+ protected $session;
+ protected $backup_cache;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_banlist.xml');
+ }
+
+ static function check_banned_data()
+ {
+ return array(
+ array('All false values, should not be banned',
+ false, false, false, false, /* should be banned? -> */ false),
+ array('Matching values in the database, should be banned',
+ 4, '127.0.0.1', 'bar@example.org', true, /* should be banned? -> */ true),
+ array('IP Banned, should be banned',
+ false, '127.1.1.1', false, false, /* should be banned? -> */ true),
+ );
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ // Get session here so that config is mocked correctly
+ $this->session = $this->session_factory->get_session($this->db);
+ global $cache, $config, $phpbb_root_path, $phpEx;
+ $this->backup_cache = $cache;
+ // Change the global cache object for this test because
+ // the mock cache object does not hit the database as is needed
+ // for this test.
+ $cache = new phpbb_cache_service(
+ new phpbb_cache_driver_file(),
+ $config,
+ $this->db,
+ $phpbb_root_path,
+ $phpEx
+ );
+ }
+
+ public function tearDown()
+ {
+ parent::tearDown();
+ // Set cache back to what it was before the test changed it
+ global $cache;
+ $cache = $this->backup_cache;
+ }
+
+ /** @dataProvider check_banned_data */
+ public function test_check_is_banned($test_msg, $user_id, $user_ips, $user_email, $return, $should_be_banned)
+ {
+ try
+ {
+ $is_banned = $this->session->check_ban($user_id, $user_ips, $user_email, $return);
+ }
+ catch (PHPUnit_Framework_Error_Notice $e)
+ {
+ // User error was triggered, user must have been banned
+ $is_banned = true;
+ }
+
+ $this->assertEquals($should_be_banned, $is_banned, $test_msg);
+ }
+}
diff --git a/tests/session/check_isvalid_test.php b/tests/session/check_isvalid_test.php
new file mode 100644
index 0000000000..760e2a6f24
--- /dev/null
+++ b/tests/session/check_isvalid_test.php
@@ -0,0 +1,61 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_check_isvalid_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_full.xml');
+ }
+
+ protected function access_with($session_id, $user_id, $user_agent, $ip)
+ {
+ $this->session_factory->merge_test_data($session_id, $user_id, $user_agent, $ip);
+
+ $session = $this->session_factory->get_session($this->db);
+ $session->page = array('page' => 'page', 'forum' => 0);
+
+ $session->session_begin();
+ $this->session_factory->check($this);
+ return $session;
+ }
+
+ public function test_session_valid_session_exists()
+ {
+ $session = $this->access_with('bar_session000000000000000000000', '4', 'user agent', '127.0.0.1');
+ $session->check_cookies($this, array());
+
+ $this->check_sessions_equals(array(
+ array('session_id' => 'anon_session00000000000000000000', 'session_user_id' => 1),
+ array('session_id' => 'bar_session000000000000000000000', 'session_user_id' => 4),
+ ),
+ 'If a request comes with a valid session id with matching user agent and IP, no new session should be created.'
+ );
+ }
+
+ public function test_session_invalid_make_new_annon_session()
+ {
+ $session = $this->access_with('anon_session00000000000000000000', '4', 'user agent', '127.0.0.1');
+ $session->check_cookies($this, array(
+ 'u' => array('1', null),
+ 'k' => array(null, null),
+ 'sid' => array($session->session_id, null),
+ ));
+
+ $this->check_sessions_equals(array(
+ array('session_id' => $session->session_id, 'session_user_id' => 1), // use generated SID
+ array('session_id' => 'bar_session000000000000000000000', 'session_user_id' => 4),
+ ),
+ 'If a request comes with a valid session id and IP but different user id and user agent,
+ a new anonymous session is created and the session matching the supplied session id is deleted.'
+ );
+ }
+}
diff --git a/tests/session/continue_test.php b/tests/session/continue_test.php
deleted file mode 100644
index 28019b54b5..0000000000
--- a/tests/session/continue_test.php
+++ /dev/null
@@ -1,133 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-require_once dirname(__FILE__) . '/testable_factory.php';
-
-class phpbb_session_continue_test extends phpbb_database_test_case
-{
- public function getDataSet()
- {
- return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/sessions_full.xml');
- }
-
- static public function session_begin_attempts()
- {
- // The session_id field is defined as CHAR(32) in the database schema.
- // Thus the data we put in session_id fields has to have a length of 32 characters on stricter DBMSes.
- // Thus we fill those strings up with zeroes until they have a string length of 32.
-
- return array(
- array(
- 'bar_session000000000000000000000', '4', 'user agent', '127.0.0.1',
- array(
- array('session_id' => 'anon_session00000000000000000000', 'session_user_id' => 1),
- array('session_id' => 'bar_session000000000000000000000', 'session_user_id' => 4),
- ),
- array(),
- 'If a request comes with a valid session id with matching user agent and IP, no new session should be created.',
- ),
- array(
- 'anon_session00000000000000000000', '4', 'user agent', '127.0.0.1',
- array(
- array('session_id' => '__new_session_id__', 'session_user_id' => 1), // use generated SID
- array('session_id' => 'bar_session000000000000000000000', 'session_user_id' => 4),
- ),
- array(
- 'u' => array('1', null),
- 'k' => array(null, null),
- 'sid' => array('__new_session_id__', null),
- ),
- 'If a request comes with a valid session id and IP but different user id and user agent, a new anonymous session is created and the session matching the supplied session id is deleted.',
- ),
- );
- }
-
- /**
- * @dataProvider session_begin_attempts
- */
- public function test_session_begin_valid_session($session_id, $user_id, $user_agent, $ip, $expected_sessions, $expected_cookies, $message)
- {
- global $phpbb_container, $phpbb_root_path, $phpEx;
-
- $db = $this->new_dbal();
- $config = new \phpbb\config\config(array());
- $request = $this->getMock('\phpbb\request\request');
- $user = $this->getMock('\phpbb\user');
-
- $auth_provider = new \phpbb\auth\provider\db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
- $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
- $phpbb_container->expects($this->any())
- ->method('get')
- ->with('auth.provider.db')
- ->will($this->returnValue($auth_provider));
-
- $session_factory = new phpbb_session_testable_factory;
- $session_factory->set_cookies(array(
- '_sid' => $session_id,
- '_u' => $user_id,
- ));
- $session_factory->merge_config_data(array(
- 'session_length' => time(), // need to do this to allow sessions started at time 0
- ));
- $session_factory->merge_server_data(array(
- 'HTTP_USER_AGENT' => $user_agent,
- 'REMOTE_ADDR' => $ip,
- ));
-
- $session = $session_factory->get_session($db);
- $session->page = array('page' => 'page', 'forum' => 0);
-
- $session->session_begin();
-
- $sql = 'SELECT session_id, session_user_id
- FROM phpbb_sessions
- ORDER BY session_user_id';
-
- $expected_sessions = $this->replace_session($expected_sessions, $session->session_id);
- $expected_cookies = $this->replace_session($expected_cookies, $session->session_id);
-
- $this->assertSqlResultEquals(
- $expected_sessions,
- $sql,
- $message
- );
-
- $session->check_cookies($this, $expected_cookies);
-
- $session_factory->check($this);
- }
-
- /**
- * Replaces recursively the value __new_session_id__ with the given session
- * id.
- *
- * @param array $array An array of data
- * @param string $session_id The new session id to use instead of the
- * placeholder.
- * @return array The input array with all occurances of __new_session_id__
- * replaced.
- */
- public function replace_session($array, $session_id)
- {
- foreach ($array as $key => &$value)
- {
- if ($value === '__new_session_id__')
- {
- $value = $session_id;
- }
-
- if (is_array($value))
- {
- $value = $this->replace_session($value, $session_id);
- }
- }
-
- return $array;
- }
-}
diff --git a/tests/session/create_test.php b/tests/session/create_test.php
new file mode 100644
index 0000000000..442445599b
--- /dev/null
+++ b/tests/session/create_test.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_create_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_full.xml');
+ }
+
+ static function bot($bot_agent, $user_id, $bot_ip)
+ {
+ return array(array(
+ 'bot_agent' => $bot_agent,
+ 'user_id' => $user_id,
+ 'bot_ip' => $bot_ip,
+ ));
+ }
+
+ function test_bot_session()
+ {
+ $output = $this->session_facade->session_create(
+ false,
+ false,
+ false,
+ false,
+ array(),
+ 'user agent',
+ '127.0.0.1',
+ self::bot('user agent', 13, '127.0.0.1'),
+ ''
+ );
+ $this->assertEquals(true, $output->data['is_bot'], 'should be a bot');
+ }
+}
diff --git a/tests/session/creation_test.php b/tests/session/creation_test.php
deleted file mode 100644
index 6b1be61ade..0000000000
--- a/tests/session/creation_test.php
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-require_once dirname(__FILE__) . '/testable_factory.php';
-
-class phpbb_session_creation_test extends phpbb_database_test_case
-{
- public function getDataSet()
- {
- return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/sessions_empty.xml');
- }
-
- // also see security/extract_current_page.php
-
- public function test_login_session_create()
- {
- global $phpbb_container, $phpbb_root_path, $phpEx;
-
- $db = $this->new_dbal();
- $config = new \phpbb\config\config(array());
- $request = $this->getMock('\phpbb\request\request');
- $user = $this->getMock('\phpbb\user');
-
- $auth_provider = new \phpbb\auth\provider\db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
- $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
- $phpbb_container->expects($this->any())
- ->method('get')
- ->with('auth.provider.db')
- ->will($this->returnValue($auth_provider));
-
- $session_factory = new phpbb_session_testable_factory;
-
- $session = $session_factory->get_session($db);
- $session->page = array('page' => 'page', 'forum' => 0);
-
- $session->session_create(3);
-
- $sql = 'SELECT session_user_id
- FROM phpbb_sessions';
-
- $this->assertSqlResultEquals(
- array(array('session_user_id' => 3)),
- $sql,
- 'Check if exactly one session for user id 3 was created'
- );
-
- $one_year_in_seconds = 365 * 24 * 60 * 60;
- $cookie_expire = $session->time_now + $one_year_in_seconds;
-
- $session->check_cookies($this, array(
- 'u' => array(null, $cookie_expire),
- 'k' => array(null, $cookie_expire),
- 'sid' => array($session->session_id, $cookie_expire),
- ));
-
- global $SID, $_SID;
- $this->assertEquals($session->session_id, $_SID);
- $this->assertEquals('?sid=' . $session->session_id, $SID);
-
- $session_factory->check($this);
- }
-}
-
diff --git a/tests/session/extract_hostname_test.php b/tests/session/extract_hostname_test.php
new file mode 100644
index 0000000000..bd183fd438
--- /dev/null
+++ b/tests/session/extract_hostname_test.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_extract_hostname_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_empty.xml');
+ }
+
+ static public function extract_current_hostname_data()
+ {
+ return array (
+ // [Input] $host, $server_name_config, $cookie_domain_config, [Expected] $output
+ // If host is ip use that
+ // ipv4
+ array('127.0.0.1', 'skipped.org', 'skipped.org', '127.0.0.1'),
+ // ipv6
+ array('::1', 'skipped.org', 'skipped.org', ':'),
+ array('2002::3235:51f9', 'skipped.org', 'skipped.org', '2002::3235'),
+ // If no host but server name matches cookie_domain use that
+ array('', 'example.org', 'example.org', 'example.org'),
+ // If there is a host uri use that
+ array('example.org', false, false, 'example.org'),
+ // 'best approach' guessing
+ array('', 'example.org', false, 'example.org'),
+ array('', false, '127.0.0.1', '127.0.0.1'),
+ array('', false, false, php_uname('n')),
+ );
+ }
+
+ /** @dataProvider extract_current_hostname_data */
+ function test_extract_current_hostname($host, $server_name_config, $cookie_domain_config, $expected)
+ {
+ $output = $this->session_facade->extract_current_hostname(
+ $host,
+ $server_name_config,
+ $cookie_domain_config
+ );
+
+ $this->assertEquals($expected, $output);
+ }
+}
diff --git a/tests/session/extract_page_test.php b/tests/session/extract_page_test.php
new file mode 100644
index 0000000000..f4ae8de021
--- /dev/null
+++ b/tests/session/extract_page_test.php
@@ -0,0 +1,115 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_extract_page_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_empty.xml');
+ }
+
+ static public function extract_current_page_data()
+ {
+ return array(
+ array(
+ './',
+ '/phpBB/index.php',
+ '',
+ '/phpBB/',
+ array(
+ 'page_name' => 'index.php',
+ 'page_dir' => '',
+ 'query_string' => '',
+ 'script_path' => '/phpBB/',
+ 'root_script_path' => '/phpBB/',
+ 'page' => 'index.php',
+ 'forum' => 0,
+ ),
+ ),
+ array(
+ './',
+ '/phpBB/ucp.php',
+ 'mode=login',
+ '/phpBB/ucp.php?mode=login',
+ array(
+ 'page_name' => 'ucp.php',
+ 'page_dir' => '',
+ 'query_string' => 'mode=login',
+ 'script_path' => '/phpBB/',
+ 'root_script_path' => '/phpBB/',
+ 'page' => 'ucp.php?mode=login',
+ 'forum' => 0,
+ ),
+ ),
+ array(
+ './',
+ '/phpBB/ucp.php',
+ 'mode=register',
+ '/phpBB/ucp.php?mode=register',
+ array(
+ 'page_name' => 'ucp.php',
+ 'page_dir' => '',
+ 'query_string' => 'mode=register',
+ 'script_path' => '/phpBB/',
+ 'root_script_path' => '/phpBB/',
+ 'page' => 'ucp.php?mode=register',
+ 'forum' => 0,
+ ),
+ ),
+ array(
+ './',
+ '/phpBB/ucp.php',
+ 'mode=register',
+ '/phpBB/ucp.php?mode=register',
+ array(
+ 'page_name' => 'ucp.php',
+ 'page_dir' => '',
+ 'query_string' => 'mode=register',
+ 'script_path' => '/phpBB/',
+ 'root_script_path' => '/phpBB/',
+ 'page' => 'ucp.php?mode=register',
+ 'forum' => 0,
+ ),
+ ),
+ array(
+ './../',
+ '/phpBB/adm/index.php',
+ 'sid=e7215d958cdd41a6fc13509bebe53e42',
+ '/phpBB/adm/index.php?sid=e7215d958cdd41a6fc13509bebe53e42',
+ array(
+ 'page_name' => 'index.php',
+ //'page_dir' => 'adm',
+ // ^-- Ignored because .. returns different directory in live vs testing
+ 'query_string' => '',
+ 'script_path' => '/phpBB/adm/',
+ 'root_script_path' => '/phpBB/',
+ //'page' => 'adm/index.php',
+ 'forum' => 0,
+ ),
+ ),
+ );
+ }
+
+ /** @dataProvider extract_current_page_data */
+ function test_extract_current_page($root_path, $php_self, $query_string, $request_uri, $expected)
+ {
+ $output = $this->session_facade->extract_current_page(
+ $root_path,
+ $php_self,
+ $query_string,
+ $request_uri
+ );
+
+ // This compares the result of the output.
+ // Any keys that are not in the expected array are overwritten by the output (aka not checked).
+ $this->assert_array_content_equals(array_merge($output, $expected), $output);
+ }
+}
diff --git a/tests/session/fixtures/sessions_banlist.xml b/tests/session/fixtures/sessions_banlist.xml
new file mode 100644
index 0000000000..9422fc0665
--- /dev/null
+++ b/tests/session/fixtures/sessions_banlist.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
+ <row>
+ <value>1</value>
+ <value>anonymous</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_sessions">
+ <column>session_id</column>
+ <column>session_user_id</column>
+ <column>session_ip</column>
+ <column>session_browser</column>
+ <column>session_admin</column>
+ <row>
+ <value>bar_session000000000000000000000</value>
+ <value>4</value>
+ <value>127.0.0.1</value>
+ <value>user agent</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_banlist">
+ <column>ban_id</column>
+ <column>ban_userid</column>
+ <column>ban_ip</column>
+ <column>ban_email</column>
+ <column>ban_start</column>
+ <column>ban_end</column>
+ <column>ban_exclude</column>
+ <column>ban_reason</column>
+ <column>ban_give_reason</column>
+ <row>
+ <value>2</value>
+ <value>4</value>
+ <value>127.0.0.1</value>
+ <value>bar@example.org</value>
+ <value>1111</value>
+ <value>0</value>
+ <value>0</value>
+ <value>HAHAHA</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>0</value>
+ <value>127.1.1.1</value>
+ <value></value>
+ <value>1111</value>
+ <value>0</value>
+ <value>0</value>
+ <value>HAHAHA</value>
+ <value>1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/session/fixtures/sessions_full.xml b/tests/session/fixtures/sessions_full.xml
index 509687f4d2..6bbaf1c9d5 100644
--- a/tests/session/fixtures/sessions_full.xml
+++ b/tests/session/fixtures/sessions_full.xml
@@ -37,17 +37,20 @@
<column>session_user_id</column>
<column>session_ip</column>
<column>session_browser</column>
+ <column>session_admin</column>
<row>
<value>anon_session00000000000000000000</value>
<value>1</value>
<value>127.0.0.1</value>
<value>anonymous user agent</value>
+ <value>0</value>
</row>
<row>
<value>bar_session000000000000000000000</value>
<value>4</value>
<value>127.0.0.1</value>
<value>user agent</value>
+ <value>1</value>
</row>
</table>
</dataset>
diff --git a/tests/session/fixtures/sessions_garbage.xml b/tests/session/fixtures/sessions_garbage.xml
new file mode 100644
index 0000000000..23c44a975b
--- /dev/null
+++ b/tests/session/fixtures/sessions_garbage.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
+ <row>
+ <value>4</value>
+ <value>bar</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_sessions">
+ <column>session_id</column>
+ <column>session_user_id</column>
+ <column>session_ip</column>
+ <column>session_browser</column>
+ <column>session_admin</column>
+ <row>
+ <value>anon_session00000000000000000000</value>
+ <value>1</value>
+ <value>127.0.0.1</value>
+ <value>anonymous user agent</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>bar_session000000000000000000000</value>
+ <value>4</value>
+ <value>127.0.0.1</value>
+ <value>user agent</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_login_attempts">
+ <column>attempt_ip</column>
+ <column>attempt_browser</column>
+ <column>attempt_forwarded_for</column>
+ <column>attempt_time</column>
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <row>
+ <value>127.0.0.1</value>
+ <value>browser</value>
+ <value></value>
+ <value>0001</value>
+ <value>4</value>
+ <value>bar</value>
+ <value>bar</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/session/fixtures/sessions_key.xml b/tests/session/fixtures/sessions_key.xml
new file mode 100644
index 0000000000..246d284557
--- /dev/null
+++ b/tests/session/fixtures/sessions_key.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_sessions_keys">
+ <column>key_id</column>
+ <column>user_id</column>
+ <column>last_ip</column>
+ <column>last_login</column>
+ <row>
+ <value>a87ff679a2f3e71d9181a67b7542122c</value>
+ <value>4</value>
+ <value>127.0.0.1</value>
+ <value>0</value>
+ </row>
+ </table>
+ <table name="phpbb_sessions">
+ <column>session_id</column>
+ <column>session_user_id</column>
+ <column>session_ip</column>
+ <column>session_browser</column>
+ <row>
+ <value>bar_session000000000000000000000</value>
+ <value>4</value>
+ <value>127.0.0.1</value>
+ <value>user agent</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
+ <row>
+ <value>4</value>
+ <value>bar</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/session/garbage_collection_test.php b/tests/session/garbage_collection_test.php
new file mode 100644
index 0000000000..e7d01785dd
--- /dev/null
+++ b/tests/session/garbage_collection_test.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_garbage_collection_test extends phpbb_session_test_case
+{
+ public $session;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_garbage.xml');
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->session = $this->session_factory->get_session($this->db);
+ }
+
+ public function test_cleanup_all()
+ {
+ $this->check_sessions_equals(
+ array(
+ array(
+ 'session_id' => 'anon_session00000000000000000000',
+ 'session_user_id' => 1,
+ ),
+ array(
+ 'session_id' => 'bar_session000000000000000000000',
+ 'session_user_id' => 4,
+ ),
+ ),
+ 'Before test, should have some sessions.'
+ );
+ // Set session length so it clears all
+ global $config;
+ $config['session_length'] = 0;
+ // There is an error unless the captcha plugin is set
+ $config['captcha_plugin'] = 'phpbb_captcha_nogd';
+ $this->session->session_gc();
+ $this->check_sessions_equals(
+ array(),
+ 'After setting session time to 0, should remove all.'
+ );
+ }
+}
diff --git a/tests/session/session_key_test.php b/tests/session/session_key_test.php
new file mode 100644
index 0000000000..1cf2101385
--- /dev/null
+++ b/tests/session/session_key_test.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_login_keys_test extends phpbb_session_test_case
+{
+ protected $user_id = 4;
+ protected $key_id = 4;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_key.xml');
+ }
+
+ public function test_set_key_manually()
+ {
+ // With AutoLogin setup
+ $this->session_factory->merge_config_data(array('allow_autologin' => true));
+ $session = $this->session_factory->get_session($this->db);
+ // Using a user_id and key that is already in the database
+ $session->cookie_data['u'] = $this->user_id;
+ $session->cookie_data['k'] = $this->key_id;
+ // Try to access session
+ $session->session_create($this->user_id, false, $this->user_id);
+
+ $this->assertEquals($this->user_id, $session->data['user_id'], "session should automatically login");
+ }
+
+ public function test_reset_keys()
+ {
+ // With AutoLogin setup
+ $this->session_factory->merge_config_data(array('allow_autologin' => true));
+ $session = $this->session_factory->get_session($this->db);
+ // Reset of the keys for this user
+ $session->reset_login_keys($this->user_id);
+ // Using a user_id and key that was in the database (before reset)
+ $session->cookie_data['u'] = $this->user_id;
+ $session->cookie_data['k'] = $this->key_id;
+ // Try to access session
+ $session->session_create($this->user_id, false, $this->user_id);
+
+ $this->assertNotEquals($this->user_id, $session->data['user_id'], "session should be cleared");
+ }
+}
diff --git a/tests/session/testable_facade.php b/tests/session/testable_facade.php
new file mode 100644
index 0000000000..9f0a3c5f59
--- /dev/null
+++ b/tests/session/testable_facade.php
@@ -0,0 +1,142 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/testable_factory.php';
+require_once dirname(__FILE__) . '/../../phpBB/phpbb/session.php';
+
+/**
+ * This class exists to expose session.php's functions in a more testable way.
+ *
+ * Since many functions in session.php have global variables inside the function,
+ * this exposes those functions through a testable facade that uses
+ * testable_factory's mock global variables to modify global variables used in
+ * the functions.
+ *
+ * This is using the facade pattern to provide a testable "front" to the
+ * functions in sessions.php.
+ *
+ */
+class phpbb_session_testable_facade
+{
+ protected $db;
+ protected $session_factory;
+
+ function __construct($db, $session_factory)
+ {
+ $this->db = $db;
+ $this->session_factory = $session_factory;
+ }
+
+ function extract_current_page(
+ $root_path,
+ $php_self,
+ $query_string,
+ $request_uri
+ )
+ {
+ $this->session_factory->get_session($this->db);
+ global $request;
+ $request->overwrite('PHP_SELF', $php_self, phpbb_request_interface::SERVER);
+ $request->overwrite('QUERY_STRING', $query_string, phpbb_request_interface::SERVER);
+ $request->overwrite('REQUEST_URI', $request_uri, phpbb_request_interface::SERVER);
+ return phpbb_session::extract_current_page($root_path);
+ }
+
+ function extract_current_hostname(
+ $host,
+ $server_name_config,
+ $cookie_domain_config
+ )
+ {
+ $session = $this->session_factory->get_session($this->db);
+ global $config, $request;
+ $config['server_name'] = $server_name_config;
+ $config['cookie_domain'] = $cookie_domain_config;
+ $request->overwrite('SERVER_NAME', $host, phpbb_request_interface::SERVER);
+ $request->overwrite('Host', $host, phpbb_request_interface::SERVER);
+ // Note: There is a php_uname function used as a fallthrough
+ // that this function doesn't override
+ return $session->extract_current_hostname();
+ }
+
+ /**
+ *
+ * This function has a lot of dependencies, so instead of naming them all,
+ * just ask for overrides
+ *
+ * @param update_session_page Boolean of whether to set page of the session
+ * @param config_overrides An array of overrides for the global config object
+ * @param request_overrides An array of overrides for the global request object
+ * @return boolean False if the user is identified, otherwise true.
+ */
+ function session_begin(
+ $update_session_page = true,
+ $config_overrides = array(),
+ $request_overrides = array(),
+ $cookies_overrides = array()
+ )
+ {
+ $this->session_factory->merge_config_data($config_overrides);
+ $this->session_factory->merge_server_data($request_overrides);
+ $this->session_factory->set_cookies($cookies_overrides);
+ $session = $this->session_factory->get_session($this->db);
+ $session->session_begin($update_session_page);
+ return $session;
+ }
+
+ function session_create(
+ $user_id = false,
+ $set_admin = false,
+ $persist_login = false,
+ $viewonline = true,
+ array $config_overrides = array(),
+ $user_agent = 'user agent',
+ $ip_address = '127.0.0.1',
+ array $bot_overrides = array(),
+ $uri_sid = ""
+ )
+ {
+ $this->session_factory->merge_config_data($config_overrides);
+ // Bots
+ $this->session_factory->merge_cache_data(array('_bots' => $bot_overrides));
+ global $request;
+ $session = $this->session_factory->get_session($this->db);
+ $session->browser = $user_agent;
+ $session->ip = $ip_address;
+ // Uri sid
+ if ($uri_sid)
+ {
+ $_GET['sid'] = $uri_sid;
+ }
+ $session->session_create($user_id, $set_admin, $persist_login, $viewonline);
+ return $session;
+ }
+
+ function validate_referer(
+ $check_script_path,
+ $referer,
+ $host,
+ $force_server_vars,
+ $server_port,
+ $server_name,
+ $root_script_path
+ )
+ {
+ $session = $this->session_factory->get_session($this->db);
+ global $config, $request;
+ $session->referer = $referer;
+ $session->page['root_script_path'] = $root_script_path;
+ $session->host = $host;
+ $config['force_server_vars'] = $force_server_vars;
+ $config['server_name'] = $server_name;
+ $request->overwrite('SERVER_PORT', $server_port, phpbb_request_interface::SERVER);
+ return $session->validate_referer($check_script_path);
+ }
+}
+
diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php
index 1a7d27b30f..a58e208efc 100644
--- a/tests/session/testable_factory.php
+++ b/tests/session/testable_factory.php
@@ -2,11 +2,14 @@
/**
*
* @package testing
-* @copyright (c) 2011 phpBB Group
+* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
+require_once dirname(__FILE__) . '/../mock/container_builder.php';
+require_once dirname(__FILE__) . '/../mock/auth_provider.php';
+
/**
* This class exists to setup an instance of phpbb's session class for testing.
*
@@ -16,6 +19,7 @@
*/
class phpbb_session_testable_factory
{
+ protected $container;
protected $config_data;
protected $cache_data;
protected $cookies;
@@ -65,7 +69,7 @@ class phpbb_session_testable_factory
public function get_session(\phpbb\db\driver\driver $dbal)
{
// set up all the global variables used by session
- global $SID, $_SID, $db, $config, $cache, $request;
+ global $SID, $_SID, $db, $config, $cache, $request, $phpbb_container;
$request = $this->request = new phpbb_mock_request(
array(),
@@ -83,6 +87,12 @@ class phpbb_session_testable_factory
$cache = $this->cache = new phpbb_mock_cache($this->get_cache_data());
$SID = $_SID = null;
+ $phpbb_container = $this->container = new phpbb_mock_container_builder();
+ $phpbb_container->set(
+ 'auth.provider.db',
+ new phpbb_mock_auth_provider()
+ );
+
$session = new phpbb_mock_session_testable;
return $session;
}
@@ -165,6 +175,32 @@ class phpbb_session_testable_factory
}
/**
+ * Set cookies, merge config and server data in one step.
+ *
+ * New values overwrite old ones.
+ *
+ * @param $session_id
+ * @param $user_id
+ * @param $user_agent
+ * @param $ip
+ * @param int $time
+ */
+ public function merge_test_data($session_id, $user_id, $user_agent, $ip, $time = 0)
+ {
+ $this->set_cookies(array(
+ '_sid' => $session_id,
+ '_u' => $user_id,
+ ));
+ $this->merge_config_data(array(
+ 'session_length' => time() + $time, // need to do this to allow sessions started at time 0
+ ));
+ $this->merge_server_data(array(
+ 'HTTP_USER_AGENT' => $user_agent,
+ 'REMOTE_ADDR' => $ip,
+ ));
+ }
+
+ /**
* Retrieve all server variables to be passed to the session.
*
* @return array Server variables
diff --git a/tests/session/unset_admin_test.php b/tests/session/unset_admin_test.php
new file mode 100644
index 0000000000..1d5b1759ab
--- /dev/null
+++ b/tests/session/unset_admin_test.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_unset_admin_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_full.xml');
+ }
+
+ function get_test_session()
+ {
+ return $this->session_facade->session_begin(
+ true,
+ // Config
+ array(
+ 'session_length' => time(), // need to do this to allow sessions started at time 0
+ ),
+ // Server
+ array(
+ 'HTTP_USER_AGENT' => "user agent",
+ 'REMOTE_ADDR' => "127.0.0.1",
+ ),
+ // Cookies
+ array(
+ '_sid' => 'bar_session000000000000000000000',
+ '_u' => 4,
+ )
+ );
+ }
+
+ public function test_unset_admin()
+ {
+ $session = $this->get_test_session();
+ $this->assertEquals(1, $session->data['session_admin'], 'should be an admin before test starts');
+ $session->unset_admin();
+ $session = $this->get_test_session();
+ $this->assertEquals(0, $session->data['session_admin'], 'should be not be an admin after unset_admin');
+ }
+}
diff --git a/tests/session/validate_referrer_test.php b/tests/session/validate_referrer_test.php
new file mode 100644
index 0000000000..a302229287
--- /dev/null
+++ b/tests/session/validate_referrer_test.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_validate_referrer_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_empty.xml');
+ }
+
+ static function referrer_inputs()
+ {
+ $ex = "example.org";
+ $alt = "example.com";
+ return array(
+ // checkpath referrer host forcevars port servername rootpath pass?
+ // 0 Referrer or host wasn't collected, therefore should validate
+ array(false, '', $ex, false, 80, $ex, '', true),
+ array(false, $ex, '', false, 80, $ex, '', true),
+ // 2 Referrer doesn't match host or server_name
+ array(false, $alt, $ex, false, 80, $ex, '', false),
+ // 3 Everything should check out
+ array(false, $ex, $ex, false, 80, $ex, '', true),
+ // 4 Check Script Path
+ array(true, $ex, $ex, false, 80, $ex, '', true),
+ array(true, "$ex/foo", $ex, false, 80, $ex, "/foo", true),
+ array(true, "$ex/bar", $ex, false, 80, $ex, "/foo", false),
+ // 7 Port (This is not checked unless path is checked)
+ array(true, "$ex:80/foo", "$ex:80", false, 80, "$ex:80", "/foo", true),
+ array(true, "$ex:80/bar", "$ex:80", false, 80, "$ex:80", "/foo", false),
+ array(true, "$ex:79/foo", "$ex:81", false, 81, "$ex:81", "/foo", false),
+ );
+ }
+
+ /** @dataProvider referrer_inputs */
+ function test_referrer_inputs(
+ $check_script_path,
+ $referrer,
+ $host,
+ $force_server_vars,
+ $server_port,
+ $server_name,
+ $root_script_path,
+ $pass_or_fail
+ )
+ {
+ // Referrer needs http:// because it's going to get stripped in function.
+ $referrer = $referrer ? 'http://' . $referrer : '';
+ $this->assertEquals(
+ $pass_or_fail,
+ $this->session_facade->validate_referer(
+ $check_script_path,
+ $referrer,
+ $host,
+ $force_server_vars,
+ $server_port,
+ $server_name,
+ $root_script_path
+ ),
+ "referrer should" . ($pass_or_fail ? '' : "n't") . " be validated");
+ }
+}
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html
index 3eb906a09e..3eb906a09e 100644
--- a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html
index 3b65d80a6d..3b65d80a6d 100644
--- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html
index 26826d59e3..26826d59e3 100644
--- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html
index 003d193dc3..003d193dc3 100644
--- a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html
index 6bf06f5457..6bf06f5457 100644
--- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/two.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html
index 7f8058f4e4..7f8058f4e4 100644
--- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/two.html
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html
diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/test.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html
index 5fc7e5ac12..5fc7e5ac12 100644
--- a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/test.html
+++ b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event_variable_spacing.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html
index 028f8aa0d1..028f8aa0d1 100644
--- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event_variable_spacing.html
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html
new file mode 100644
index 0000000000..235e129f85
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html
@@ -0,0 +1 @@
+{event_loop.S_ROW_COUNT}<!-- IF not event_loop.S_LAST_ROW -->|<!-- ENDIF -->
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/universal.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html
index f2c5762ade..f2c5762ade 100644
--- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/universal.html
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/simple.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html
index fe32a1ed3f..fe32a1ed3f 100644
--- a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/simple.html
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html
diff --git a/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html b/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html
new file mode 100644
index 0000000000..c70d8f86d7
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html
@@ -0,0 +1,3 @@
+<!-- BEGIN event_loop -->
+event_loop<!-- EVENT test_event_loop -->
+<!-- END event_loop -->
diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php
index ff7b890d11..a0dd8368cf 100644
--- a/tests/template/includephp_test.php
+++ b/tests/template/includephp_test.php
@@ -46,7 +46,7 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case
$this->setup_engine(array('tpl_allow_php' => true));
- $this->style->set_custom_style('tests', $cache_dir, array(), '');
+ $this->template->set_custom_style('tests', $cache_dir);
$this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php");
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 857807bf89..801f0055c8 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -80,6 +80,16 @@ Zeta test event in all',
array(),
'two in silver in omega',
),
+ array(
+ 'EVENT in loop',
+ 'ext_trivial',
+ array('silver'),
+ 'event_loop.html',
+ array(),
+ array('event_loop' => array(array(), array(), array())),
+ array(),
+ 'event_loop0|event_loop1|event_loop2',
+ ),
);
}
@@ -103,13 +113,10 @@ Zeta test event in all',
$config = new \phpbb\config\config(array_merge($defaults, $new_config));
$this->template_path = dirname(__FILE__) . "/datasets/$dataset/styles/silver/template";
- $this->style_resource_locator = new \phpbb\style\resource_locator();
$this->extension_manager = new phpbb_mock_filesystem_extension_manager(
dirname(__FILE__) . "/datasets/$dataset/"
);
$this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context, $this->extension_manager);
- $this->style_provider = new \phpbb\style\path_provider();
- $this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
- $this->style->set_custom_style('silver', array($this->template_path), $style_names, '');
+ $this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path));
}
}
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 802f0c19ba..2cca20f4c2 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -64,6 +64,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
),
array(
'if.html',
+ array('S_OTHER_OTHER_VALUE' => true),
+ array(),
+ array(),
+ '|S_OTHER_OTHER_VALUE|!false',
+ ),
+ array(
+ 'if.html',
array('S_VALUE' => false, 'S_OTHER_VALUE' => true),
array(),
array(),
@@ -93,49 +100,49 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop.html',
array(),
- array('loop' => array(array())),
+ array('test_loop' => array(array())),
array(),
"loop\nloop",
),
array(
'loop.html',
array(),
- array('loop' => array(array(), array()), 'loop.block' => array(array())),
+ array('test_loop' => array(array(), array()), 'test_loop.block' => array(array())),
array(),
"loop\nloop\nloop\nloop",
),
array(
'loop.html',
array(),
- array('loop' => array(array(), array()), 'loop.block' => array(array()), 'block' => array(array(), array())),
+ array('test_loop' => array(array(), array()), 'test_loop.block' => array(array()), 'block' => array(array(), array())),
array(),
"loop\nloop\nloop\nloop\nloop#0-block#0\nloop#0-block#1\nloop#1-block#0\nloop#1-block#1",
),
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'))),
+ array('test_loop' => array(array('VARIABLE' => 'x'))),
array(),
"first\n0 - a\nx - b\nset\nlast",
),
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y'))),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y'))),
array(),
"first\n0 - a\nx - b\nset\n1 - a\ny - b\nset\nlast",
),
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
array(),
"first\n0 - a\nx - b\nset\n1 - a\ny - b\nset\nlast\n0 - c\n1 - c\nlast inner",
),
array(
'loop_advanced.html',
array(),
- array('loop' => array(array(), array(), array(), array(), array(), array(), array())),
+ array('test_loop' => array(array(), array(), array(), array(), array(), array(), array())),
array(),
"101234561\nx\n101234561\nx\n101234561\nx\n1234561\nx\n1\nx\n101\nx\n234\nx\n10\nx\n561\nx\n561",
),
@@ -149,14 +156,14 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'define.html',
array(),
- array('loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
+ array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
array(),
- "xyz\nabc\nabc\nbar\nbar\nabc",
+ "xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\n!\$DOESNT_EXIST\n(!\$DOESNT_EXIST)\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?[]|foobar|",
),
array(
'define_advanced.html',
array(),
- array('loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
+ array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
array(),
"abc\nzxc\ncde\nbcd",
),
@@ -200,7 +207,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'include_loop.html',
array(),
- array('loop' => array(array('NESTED_FILE' => 'include_loop1.html')), 'loop.inner' => array(array('NESTED_FILE' => 'include_loop1.html'), array('NESTED_FILE' => 'include_loop2.html'), array('NESTED_FILE' => 'include_loop3.html'))),
+ array('test_loop' => array(array('NESTED_FILE' => 'include_loop1.html')), 'test_loop.inner' => array(array('NESTED_FILE' => 'include_loop1.html'), array('NESTED_FILE' => 'include_loop2.html'), array('NESTED_FILE' => 'include_loop3.html'))),
array(),
"1\n_1\n_02\n_3",
),
@@ -221,8 +228,8 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
- array('loop'),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
+ array('test_loop'),
'',
),
array(
@@ -230,12 +237,12 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array('VARIABLE' => 'variable.html'),
array(),
array(),
- 'variable.html',
+ "variable.html\nvariable.html\nvariable.html",
),
array(
'include_loop_define.html',
array('VARIABLE' => 'value'),
- array('loop' => array(array('NESTED_FILE' => 'variable.html'))),
+ array('test_loop' => array(array('NESTED_FILE' => 'variable.html'))),
array(),
'value',
),
@@ -243,8 +250,8 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
- array('loop.inner'),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
+ array('test_loop.inner'),
"first\n0\n0\n2\nx\nset\n1\n1\n2\ny\nset\nlast",
),*/
array(
@@ -295,7 +302,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop_size.html',
array(),
- array('loop' => array(array()), 'empty_loop' => array()),
+ array('test_loop' => array(array()), 'empty_loop' => array()),
array(),
"nonexistent = 0\n! nonexistent\n\nempty = 0\n! empty\nloop\n\nin loop",
),
@@ -410,7 +417,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
$this->setup_engine(array('tpl_allow_php' => true));
- $this->style->set_custom_style('tests', $cache_dir, array(), '');
+ $this->template->set_custom_style('tests', $cache_dir);
$this->run_template('php.html', array(), array(), array(), 'test');
}
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 97c0728875..7251151ef0 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -11,11 +11,8 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_template_template_test_case extends phpbb_test_case
{
- protected $style;
protected $template;
protected $template_path;
- protected $style_resource_locator;
- protected $style_provider;
protected $user;
protected $test_path = 'tests/template';
@@ -67,11 +64,8 @@ class phpbb_template_template_test_case extends phpbb_test_case
$this->user = new \phpbb\user;
$this->template_path = $this->test_path . '/templates';
- $this->style_resource_locator = new \phpbb\style\resource_locator();
- $this->style_provider = new \phpbb\style\path_provider();
$this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $this->user, new \phpbb\template\context());
- $this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
- $this->style->set_custom_style('tests', $this->template_path, array(), '');
+ $this->template->set_custom_style('tests', $this->template_path);
}
protected function setUp()
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 9f97e92fd2..461534a49d 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -20,10 +20,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
$this->template_path = $this->test_path . '/templates';
$this->parent_template_path = $this->test_path . '/parent_templates';
- $this->style_resource_locator = new \phpbb\style\resource_locator();
- $this->style_provider = new \phpbb\style\path_provider();
- $this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context());
- $this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
- $this->style->set_custom_style('tests', array($this->template_path, $this->parent_template_path), array(), '');
+ $this->template = new \phpbb\template\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context());
+ $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
}
}
diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html
index 4e6d0ee793..bc20c02ed1 100644
--- a/tests/template/templates/define.html
+++ b/tests/template/templates/define.html
@@ -2,8 +2,27 @@
{$VALUE}
<!-- DEFINE $VALUE = 'abc' -->
{$VALUE}
+<!-- IF $VALUE != 'abc' -->
+$VALUE != 'abc'
+<!-- ELSEIF $VALUE == 'abc' -->
+$VALUE == 'abc'
+<!-- ENDIF -->
+<!-- IF ($VALUE == 'abc') -->
+($VALUE == 'abc')
+<!-- ENDIF -->
+<!-- IF !$DOESNT_EXIST -->
+!$DOESNT_EXIST
+<!-- ENDIF -->
+<!-- IF (!$DOESNT_EXIST) -->
+(!$DOESNT_EXIST)
+<!-- ENDIF -->
<!-- INCLUDE define_include.html -->
{$INCLUDED_VALUE}
{$VALUE}
<!-- UNDEFINE $VALUE -->
{$VALUE}
+<!-- DEFINE $VALUE = 'test!@#$%^&*()_-=+{}[]:;",<.>/?' -->
+{$VALUE}
+<!-- DEFINE $VALUE = '' -->
+[{$VALUE}]
+<!-- DEFINE $TEST -->foobar<!-- ENDDEFINE -->|{$TEST}|
diff --git a/tests/template/templates/if.html b/tests/template/templates/if.html
index c010aff7fa..f6ab6e575a 100644
--- a/tests/template/templates/if.html
+++ b/tests/template/templates/if.html
@@ -2,6 +2,8 @@
1
<!-- ELSEIF S_OTHER_VALUE -->
2
+<!-- ELSE IF S_OTHER_OTHER_VALUE -->
+|S_OTHER_OTHER_VALUE|
<!-- ELSE -->
03
<!-- ENDIF -->
diff --git a/tests/template/templates/include_define_variable.html b/tests/template/templates/include_define_variable.html
index aff9b574c2..6052657c97 100644
--- a/tests/template/templates/include_define_variable.html
+++ b/tests/template/templates/include_define_variable.html
@@ -1,2 +1,8 @@
<!-- DEFINE $DEF = '{VARIABLE}' -->
<!-- INCLUDE {$DEF} -->
+
+<!-- DEFINE $DEF_WITH_UNDERSCORES = '{VARIABLE}' -->
+<!-- INCLUDE {$DEF_WITH_UNDERSCORES} -->
+
+<!-- DEFINE $DEF123 = '{VARIABLE}' -->
+<!-- INCLUDE {$DEF123} -->
diff --git a/tests/template/templates/include_loop.html b/tests/template/templates/include_loop.html
index d5c3d9bc82..5cad34b363 100644
--- a/tests/template/templates/include_loop.html
+++ b/tests/template/templates/include_loop.html
@@ -1,4 +1,4 @@
-<!-- BEGIN loop -->
-<!-- INCLUDE {loop.NESTED_FILE} -->
-<!-- BEGIN inner -->_<!-- INCLUDE {inner.NESTED_FILE} --><!-- END inner -->
-<!-- END loop -->
+<!-- BEGIN test_loop -->
+<!-- INCLUDE {test_loop.NESTED_FILE} -->
+<!-- BEGIN inner -->_<!-- INCLUDE {test_loop.inner.NESTED_FILE} --><!-- END inner -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/include_loop_define.html b/tests/template/templates/include_loop_define.html
index f539b21396..4bab09422e 100644
--- a/tests/template/templates/include_loop_define.html
+++ b/tests/template/templates/include_loop_define.html
@@ -1,4 +1,4 @@
-<!-- BEGIN loop -->
-<!-- DEFINE $DEF = '{loop.NESTED_FILE}' -->
+<!-- BEGIN test_loop -->
+<!-- DEFINE $DEF = '{test_loop.NESTED_FILE}' -->
<!-- INCLUDE {$DEF} -->
-<!-- END loop -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop.html b/tests/template/templates/loop.html
index de1a10004d..f541e934df 100644
--- a/tests/template/templates/loop.html
+++ b/tests/template/templates/loop.html
@@ -1,21 +1,21 @@
-<!-- BEGIN loop -->
+<!-- BEGIN test_loop -->
loop
<!-- BEGINELSE -->
noloop
-<!-- END loop -->
+<!-- END test_loop -->
-<!-- IF .loop -->
+<!-- IF .test_loop -->
loop
<!-- ELSE -->
noloop
<!-- ENDIF -->
-<!-- IF .loop == 2 -->
+<!-- IF .test_loop == 2 -->
loop
<!-- ENDIF -->
-<!-- BEGIN loop -->
+<!-- BEGIN test_loop -->
<!-- BEGIN !block -->
-loop#{loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT}
+loop#{test_loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT}
<!-- END !block -->
-<!-- END loop -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_advanced.html b/tests/template/templates/loop_advanced.html
index c75fe55f03..1f56686eaa 100644
--- a/tests/template/templates/loop_advanced.html
+++ b/tests/template/templates/loop_advanced.html
@@ -1,19 +1,19 @@
-<!-- BEGIN loop -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0,-1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0,-1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(1,1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(1,1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0,1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0,1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(2,4) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(2,4) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0,-7) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0,-7) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(-2,6) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(-2,6) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(-2,-1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(-2,-1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
diff --git a/tests/template/templates/loop_size.html b/tests/template/templates/loop_size.html
index 8f581cef10..2b1fcd2dd4 100644
--- a/tests/template/templates/loop_size.html
+++ b/tests/template/templates/loop_size.html
@@ -22,18 +22,18 @@
! empty
<!-- ENDIF -->
-<!-- IF .loop -->
+<!-- IF .test_loop -->
loop
<!-- ENDIF -->
-<!-- IF .loop == 0 -->
+<!-- IF .test_loop == 0 -->
loop = 0
<!-- ENDIF -->
-<!-- IF ! .loop -->
+<!-- IF ! .test_loop -->
! loop
<!-- ENDIF -->
-<!-- BEGIN loop -->
+<!-- BEGIN test_loop -->
in loop
-<!-- END loop -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_vars.html b/tests/template/templates/loop_vars.html
index 7d86d4b7b6..70a3eb2cec 100644
--- a/tests/template/templates/loop_vars.html
+++ b/tests/template/templates/loop_vars.html
@@ -1,13 +1,13 @@
-<!-- BEGIN loop -->
-<!-- IF loop.S_FIRST_ROW -->first<!-- ENDIF -->
-{loop.S_ROW_NUM} - a
-{loop.VARIABLE} - b
-<!-- IF loop.VARIABLE -->set<!-- ENDIF -->
-<!-- IF loop.S_LAST_ROW -->
+<!-- BEGIN test_loop -->
+<!-- IF test_loop.S_FIRST_ROW -->first<!-- ENDIF -->
+{test_loop.S_ROW_NUM} - a
+{test_loop.VARIABLE} - b
+<!-- IF test_loop.VARIABLE -->set<!-- ENDIF -->
+<!-- IF test_loop.S_LAST_ROW -->
last
<!-- ENDIF -->
<!-- BEGIN inner -->
-{inner.S_ROW_NUM} - c
-<!-- IF inner.S_LAST_ROW and inner.S_ROW_COUNT and inner.S_NUM_ROWS -->last inner<!-- ENDIF -->
+{test_loop.inner.S_ROW_NUM} - c
+<!-- IF test_loop.inner.S_LAST_ROW and test_loop.inner.S_ROW_COUNT and test_loop.inner.S_NUM_ROWS -->last inner<!-- ENDIF -->
<!-- END inner -->
-<!-- END loop -->
+<!-- END test_loop -->
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index b6ba4e0c8c..af9bd22662 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -138,7 +138,7 @@ class phpbb_database_test_connection_manager
catch (PDOException $e)
{
$cleaned_dsn = str_replace($this->config['dbpasswd'], '*password*', $dsn);
- throw new Exception("Unable do connect to $cleaned_dsn using PDO with error: {$e->getMessage()}");
+ throw new Exception("Unable to connect to $cleaned_dsn using PDO with error: {$e->getMessage()}");
}
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 8929e93cfb..d5d3258b1b 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -532,13 +532,10 @@ class phpbb_functional_test_case extends phpbb_test_case
$phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$cache = new phpbb_mock_null_cache;
- $cache_driver = new \phpbb\cache\driver\null();
- $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
- $phpbb_container
- ->expects($this->any())
- ->method('get')
- ->with('cache.driver')
- ->will($this->returnValue($cache_driver));
+ $cache_driver = new phpbb_cache_driver_null();
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('cache.driver', $cache_driver);
+ $phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
if (!function_exists('utf_clean_string'))
{
@@ -747,6 +744,27 @@ class phpbb_functional_test_case extends phpbb_test_case
self::assertStringStartsWith('<!DOCTYPE', trim($content), 'Output found before DOCTYPE specification.');
}
+ /*
+ * Perform some basic assertions for an xml page
+ *
+ * Checks for debug/error output before the actual page content and the status code
+ *
+ * @param mixed $status_code Expected status code, false to disable check
+ * @return null
+ */
+ static public function assert_response_xml($status_code = 200)
+ {
+ if ($status_code !== false)
+ {
+ self::assert_response_status_code($status_code);
+ }
+
+ // Any output before the xml opening means there was an error
+ $content = self::$client->getResponse()->getContent();
+ self::assertNotContains('[phpBB Debug]', $content);
+ self::assertStringStartsWith('<?xml', trim($content), 'Output found before XML specification.');
+ }
+
/**
* Heuristic function to check that the response is success.
*
@@ -907,7 +925,7 @@ class phpbb_functional_test_case extends phpbb_test_case
$hidden_fields = array(
$crawler->filter('[type="hidden"]')->each(function ($node, $i) {
- return array('name' => $node->getAttribute('name'), 'value' => $node->getAttribute('value'));
+ return array('name' => $node->attr('name'), 'value' => $node->attr('value'));
}),
);
@@ -936,7 +954,7 @@ class phpbb_functional_test_case extends phpbb_test_case
);
}
- /*
+ /**
* Returns the requested parameter from a URL
*
* @param string $url
diff --git a/tests/test_framework/phpbb_session_test_case.php b/tests/test_framework/phpbb_session_test_case.php
new file mode 100644
index 0000000000..e6a2b03bba
--- /dev/null
+++ b/tests/test_framework/phpbb_session_test_case.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/../session/testable_factory.php';
+require_once dirname(__FILE__) . '/../session/testable_facade.php';
+
+abstract class phpbb_session_test_case extends phpbb_database_test_case
+{
+ protected $session_factory;
+ protected $session_facade;
+ protected $db;
+
+ function setUp()
+ {
+ parent::setUp();
+ $this->session_factory = new phpbb_session_testable_factory;
+ $this->db = $this->new_dbal();
+ $this->session_facade =
+ new phpbb_session_testable_facade($this->db, $this->session_factory);
+ }
+
+ protected function check_sessions_equals($expected_sessions, $message)
+ {
+ $sql = 'SELECT session_id, session_user_id
+ FROM phpbb_sessions
+ ORDER BY session_user_id';
+
+ $this->assertSqlResultEquals($expected_sessions, $sql, $message);
+ }
+}
diff --git a/tests/text_processing/generate_text_for_display_test.php b/tests/text_processing/generate_text_for_display_test.php
new file mode 100644
index 0000000000..a157fe7d9a
--- /dev/null
+++ b/tests/text_processing/generate_text_for_display_test.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../mock/user.php';
+require_once dirname(__FILE__) . '/../mock/cache.php';
+
+class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_case
+{
+ public function setUp()
+ {
+ global $cache, $user;
+
+ parent::setUp();
+
+ $cache = new phpbb_mock_cache;
+
+ $user = new phpbb_mock_user;
+ $user->optionset('viewcensors', false);
+ }
+
+ public function test_empty_string()
+ {
+ $this->assertSame('', generate_text_for_display('', '', '', 0));
+ }
+
+ public function test_zero_string()
+ {
+ $this->assertSame('0', generate_text_for_display('0', '', '', 0));
+ }
+}
diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml
index 9f281b4c21..c397882d3c 100644
--- a/travis/phpunit-postgres-travis.xml
+++ b/travis/phpunit-postgres-travis.xml
@@ -17,9 +17,6 @@
<exclude>tests/functional</exclude>
<exclude>tests/lint_test.php</exclude>
</testsuite>
- <testsuite name="phpBB Lint Test">
- <file>tests/lint_test.php</file>
- </testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh
index beb04b0fef..95fc4ec1f8 100755
--- a/travis/setup-webserver.sh
+++ b/travis/setup-webserver.sh
@@ -42,7 +42,7 @@ server {
root $PHPBB_ROOT_PATH/;
index index.php index.html;
- location ~ \.php$ {
+ location ~ \.php {
fastcgi_pass unix:$PHP_FPM_SOCK;
include fastcgi_params;
}