From 2e025f1655293d3032f04907e5d74a812e1a659a Mon Sep 17 00:00:00 2001 From: Cesar G Date: Tue, 6 May 2014 17:50:22 -0700 Subject: [PATCH 1/8] [ticket/9388] Add support for making 1) ? ' size="' . $size . '"' : '') . '>' . $return . ''; + $tpl = ''; } else { From d95164e64155ea3bdbca69532af5dd49c093b351 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Tue, 6 May 2014 17:52:12 -0700 Subject: [PATCH 2/8] [ticket/9388] Display only the settings for the auth method that's selected. PHPBB3-9388 --- phpBB/adm/style/acp_board.html | 1 + phpBB/adm/style/auth_provider_ldap.html | 67 +++++++++++++----------- phpBB/adm/style/auth_provider_oauth.html | 30 ++++++----- phpBB/includes/acp/acp_board.php | 4 +- phpBB/language/en/acp/board.php | 1 + 5 files changed, 55 insertions(+), 48 deletions(-) diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html index 1a09c4eee6..4cc0c9a9c3 100644 --- a/phpBB/adm/style/acp_board.html +++ b/phpBB/adm/style/acp_board.html @@ -33,6 +33,7 @@ + diff --git a/phpBB/adm/style/auth_provider_ldap.html b/phpBB/adm/style/auth_provider_ldap.html index 81afa44373..9e0567dfed 100644 --- a/phpBB/adm/style/auth_provider_ldap.html +++ b/phpBB/adm/style/auth_provider_ldap.html @@ -1,32 +1,35 @@ -
-

{L_LDAP_SERVER_EXPLAIN}
-
-
-
-

{L_LDAP_PORT_EXPLAIN}
-
-
-
-

{L_LDAP_DN_EXPLAIN}
-
-
-
-

{L_LDAP_UID_EXPLAIN}
-
-
-
-

{L_LDAP_USER_FILTER_EXPLAIN}
-
-
-
-

{L_LDAP_EMAIL_EXPLAIN}
-
-
-
-

{L_LDAP_USER_EXPLAIN}
-
-
-
-

{L_LDAP_PASSWORD_EXPLAIN}
-
-
+
+ {L_LDAP} +
+

{L_LDAP_SERVER_EXPLAIN}
+
+
+
+

{L_LDAP_PORT_EXPLAIN}
+
+
+
+

{L_LDAP_DN_EXPLAIN}
+
+
+
+

{L_LDAP_UID_EXPLAIN}
+
+
+
+

{L_LDAP_USER_FILTER_EXPLAIN}
+
+
+
+

{L_LDAP_EMAIL_EXPLAIN}
+
+
+
+

{L_LDAP_USER_EXPLAIN}
+
+
+
+

{L_LDAP_PASSWORD_EXPLAIN}
+
+
+
diff --git a/phpBB/adm/style/auth_provider_oauth.html b/phpBB/adm/style/auth_provider_oauth.html index 25e40ff596..3e994ec721 100644 --- a/phpBB/adm/style/auth_provider_oauth.html +++ b/phpBB/adm/style/auth_provider_oauth.html @@ -1,17 +1,19 @@ -

{L_AUTH_PROVIDER_OAUTH_TITLE}

+
+ {L_AUTH_PROVIDER_OAUTH_TITLE} -

{L_AUTH_PROVIDER_OAUTH_EXPLAIN}

+

{L_AUTH_PROVIDER_OAUTH_EXPLAIN}

- -
- {oauth_services.ACTUAL_NAME} -
-
-
-
-
-
-
-
+ +
+ {oauth_services.ACTUAL_NAME} +
+
+
+
+
+
+
+
+
+
- diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index cf0f23a16e..f054e82de3 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -363,7 +363,7 @@ class acp_board 'title' => 'ACP_AUTH_SETTINGS', 'vars' => array( 'legend1' => 'ACP_AUTH_SETTINGS', - 'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false), + 'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select:1:toggable', 'method' => 'select_auth_method', 'explain' => false), ) ); break; @@ -715,7 +715,7 @@ class acp_board foreach ($auth_plugins as $method) { $selected = ($selected_method == $method) ? ' selected="selected"' : ''; - $auth_select .= ''; + $auth_select .= "'; } return $auth_select; diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 505709d513..b796206261 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -406,6 +406,7 @@ $lang = array_merge($lang, array( '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' => 'LDAP', 'LDAP_DN' => 'LDAP base dn', 'LDAP_DN_EXPLAIN' => 'This is the Distinguished Name, locating the user information, e.g. o=My Company,c=US.', 'LDAP_EMAIL' => 'LDAP email attribute', From e378037516903ed612c88e8ad0138ec956077b58 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Tue, 6 May 2014 17:57:33 -0700 Subject: [PATCH 3/8] [ticket/9388] Display only the settings for the selected search backend. PHPBB3-9388 --- phpBB/adm/style/acp_search.html | 4 ++-- phpBB/includes/acp/acp_search.php | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index 496a8b2675..dd63eac7d5 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -46,13 +46,13 @@ {L_SEARCH_TYPE}

{L_SEARCH_TYPE_EXPLAIN}
-
+
-
+
{backend.NAME} {backend.SETTINGS}
diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index 11a2511aee..ce1e4afa9b 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -79,7 +79,8 @@ class acp_search $name = $search->get_name(); $selected = ($config['search_type'] == $type) ? ' selected="selected"' : ''; - $search_options .= ''; + $identifier = substr($type, strrpos($type, '\\') + 1); + $search_options .= ""; if (method_exists($search, 'acp')) { @@ -88,9 +89,10 @@ class acp_search if (!$submit) { $template->assign_block_vars('backend', array( - 'NAME' => $name, - 'SETTINGS' => $vars['tpl']) - ); + 'NAME' => $name, + 'SETTINGS' => $vars['tpl'], + 'IDENTIFIER' => $identifier, + )); } else if (is_array($vars['config'])) { From 1836b0130362dafba294f0fbd87a9c1d2fb181b9 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Tue, 6 May 2014 18:19:05 -0700 Subject: [PATCH 4/8] [ticket/9388] Use the new toggle function for the avatar type +
@@ -139,8 +139,6 @@
- - « {L_BACK} diff --git a/phpBB/adm/style/acp_users_avatar.html b/phpBB/adm/style/acp_users_avatar.html index 0a72bb0b62..ba0b896e6c 100644 --- a/phpBB/adm/style/acp_users_avatar.html +++ b/phpBB/adm/style/acp_users_avatar.html @@ -13,10 +13,10 @@ {L_AVATAR_SELECT}
-
- +
@@ -35,5 +35,3 @@ {S_FORM_TOKEN} - - diff --git a/phpBB/adm/style/avatars.js b/phpBB/adm/style/avatars.js deleted file mode 100644 index 26ea24c0db..0000000000 --- a/phpBB/adm/style/avatars.js +++ /dev/null @@ -1,15 +0,0 @@ -(function($) { // Avoid conflicts with other libraries - -"use strict"; - -function avatarHide() { - $('#avatar_options > div').hide(); - - var selected = $('#avatar_driver').val(); - $('#avatar_option_' + selected).show(); -} - -avatarHide(); -$('#avatar_driver').bind('change', avatarHide); - -})(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/styles/prosilver/template/avatars.js b/phpBB/styles/prosilver/template/avatars.js deleted file mode 100644 index 26ea24c0db..0000000000 --- a/phpBB/styles/prosilver/template/avatars.js +++ /dev/null @@ -1,15 +0,0 @@ -(function($) { // Avoid conflicts with other libraries - -"use strict"; - -function avatarHide() { - $('#avatar_options > div').hide(); - - var selected = $('#avatar_driver').val(); - $('#avatar_option_' + selected).show(); -} - -avatarHide(); -$('#avatar_driver').bind('change', avatarHide); - -})(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options.html b/phpBB/styles/prosilver/template/ucp_avatar_options.html index 072f235eb1..63e1fe3336 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options.html @@ -16,10 +16,10 @@
-
- +
@@ -46,5 +46,3 @@ - - diff --git a/phpBB/styles/subsilver2/template/avatars.js b/phpBB/styles/subsilver2/template/avatars.js deleted file mode 100644 index 146aca94d3..0000000000 --- a/phpBB/styles/subsilver2/template/avatars.js +++ /dev/null @@ -1,15 +0,0 @@ -(function($) { // Avoid conflicts with other libraries - -"use strict"; - -function avatarHide() { - $('.[class^="avatar_option_"]').hide(); - - var selected = $('#avatar_driver').val(); - $('.avatar_option_' + selected).show(); -} - -avatarHide(); -$('#avatar_driver').bind('change', avatarHide); - -})(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html index 60a816d00a..11eb537b5c 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html @@ -27,10 +27,10 @@ {L_AVATAR_TYPE}{L_COLON} - - + @@ -48,6 +48,4 @@ - - From 0832d34192765f47c58840bdb29b97ce841c7b46 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Tue, 6 May 2014 20:05:22 -0700 Subject: [PATCH 5/8] [ticket/9388] Fix unit tests. PHPBB3-9388 --- tests/acp_board/select_auth_method_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/acp_board/select_auth_method_test.php b/tests/acp_board/select_auth_method_test.php index b943554564..1eb442bb3d 100644 --- a/tests/acp_board/select_auth_method_test.php +++ b/tests/acp_board/select_auth_method_test.php @@ -18,8 +18,8 @@ class phpbb_acp_board_select_auth_method_test extends phpbb_test_case public static function select_auth_method_data() { return array( - array('acp_board_valid', ''), - array('acp_board_invalid', ''), + array('acp_board_valid', ''), + array('acp_board_invalid', ''), ); } From f95a7b0222a8c223644db08edf0b5364b6847a2f Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 8 May 2014 08:32:54 -0700 Subject: [PATCH 6/8] [ticket/9388] Reopen
after auth templates. PHPBB3-9388 --- phpBB/adm/style/acp_board.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html index 4cc0c9a9c3..64592a5de2 100644 --- a/phpBB/adm/style/acp_board.html +++ b/phpBB/adm/style/acp_board.html @@ -33,10 +33,12 @@ -
+
+
+ {L_ACP_SUBMIT_CHANGES}

From 2ca01bdcbee86cdbf9971c356c2224e9ea8358f4 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 8 May 2014 13:39:31 -0700 Subject: [PATCH 7/8] [ticket/9388] Do not nest the

tags in the OAuth settings. PHPBB3-9388 --- phpBB/adm/style/auth_provider_oauth.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/phpBB/adm/style/auth_provider_oauth.html b/phpBB/adm/style/auth_provider_oauth.html index 3e994ec721..4c8ff4d36c 100644 --- a/phpBB/adm/style/auth_provider_oauth.html +++ b/phpBB/adm/style/auth_provider_oauth.html @@ -1,6 +1,5 @@ -
- {L_AUTH_PROVIDER_OAUTH_TITLE} +

{L_AUTH_PROVIDER_OAUTH_EXPLAIN}

@@ -16,4 +15,4 @@
-
+ From e233f0af3615070a003a49bf055ae9fa582cc899 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 9 May 2014 13:49:41 -0700 Subject: [PATCH 8/8] [ticket/9388] Use "togglable" instead of "toggable" PHPBB3-9388 --- phpBB/adm/style/acp_groups.html | 2 +- phpBB/adm/style/acp_search.html | 2 +- phpBB/adm/style/acp_users_avatar.html | 2 +- phpBB/assets/javascript/core.js | 2 +- phpBB/includes/functions_acp.php | 2 +- phpBB/styles/prosilver/template/ucp_avatar_options.html | 2 +- phpBB/styles/subsilver2/template/ucp_profile_avatar.html | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index 0641398185..cf189f979f 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -114,7 +114,7 @@
-
diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index dd63eac7d5..1cde52acf3 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -46,7 +46,7 @@ {L_SEARCH_TYPE}

{L_SEARCH_TYPE_EXPLAIN}
-
+
diff --git a/phpBB/adm/style/acp_users_avatar.html b/phpBB/adm/style/acp_users_avatar.html index ba0b896e6c..0d06d088e8 100644 --- a/phpBB/adm/style/acp_users_avatar.html +++ b/phpBB/adm/style/acp_users_avatar.html @@ -13,7 +13,7 @@ {L_AVATAR_SELECT}
-
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 2502ca6a1c..cd633ed2ae 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -1533,7 +1533,7 @@ $(document).ready(function() { phpbb.history.replaceUrl($('#unread[data-url]').data('url')); // Hide settings that are not selected via select element. - $('select[data-toggable-settings]').each(function() { + $('select[data-togglable-settings]').each(function() { var select = $(this); select.change(function() { diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 0d19fc4d6a..1c4d6966da 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -364,7 +364,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) if ($tpl_type[0] == 'select') { $size = (isset($tpl_type[1])) ? (int) $tpl_type[1] : 1; - $data_toggle = (!empty($tpl_type[2])) ? ' data-toggable-settings="true"' : ''; + $data_toggle = (!empty($tpl_type[2])) ? ' data-togglable-settings="true"' : ''; $tpl = ''; } diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options.html b/phpBB/styles/prosilver/template/ucp_avatar_options.html index 63e1fe3336..4b4581a59c 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options.html @@ -16,7 +16,7 @@
-
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html index 11eb537b5c..07b3edb498 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html @@ -27,7 +27,7 @@ {L_AVATAR_TYPE}{L_COLON} -