diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 7627ff0b56..12e2a1bf72 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -528,10 +528,10 @@ class acp_board
$old_auth_config = array();
foreach ($auth_providers as $provider)
{
- if ($fields = $provider->acp($this->new_config))
+ if ($fields = $provider->acp())
{
// Check if we need to create config fields for this plugin and save config when submit was pressed
- foreach ($fields['config'] as $field)
+ foreach ($fields as $field)
{
if (!isset($config[$field]))
{
@@ -655,15 +655,14 @@ class acp_board
foreach ($auth_providers as $provider)
{
- $fields = $provider->acp($this->new_config);
-
- if ($fields['tpl'])
+ $auth_tpl = $provider->get_acp_template($this->new_config);
+ if ($auth_tpl)
{
+ $template->assign_vars($auth_tpl['TEMPLATE_VARS']);
$template->assign_block_vars('auth_tpl', array(
- 'TPL' => $fields['tpl'],
+ 'TEMPLATE_FILE' => $auth_tpl['TEMPLATE_FILE'],
));
}
- unset($fields);
}
}
}
diff --git a/phpBB/includes/auth/provider/base.php b/phpBB/includes/auth/provider/base.php
index f28f352e2c..7eaf8bb2d3 100644
--- a/phpBB/includes/auth/provider/base.php
+++ b/phpBB/includes/auth/provider/base.php
@@ -41,7 +41,15 @@ abstract class phpbb_auth_provider_base implements phpbb_auth_provider_interface
/**
* {@inheritdoc}
*/
- public function acp($new)
+ public function acp()
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_acp_template($new_config)
{
return;
}
diff --git a/phpBB/includes/auth/provider/interface.php b/phpBB/includes/auth/provider/interface.php
index 2d1935f8f0..47043bc107 100644
--- a/phpBB/includes/auth/provider/interface.php
+++ b/phpBB/includes/auth/provider/interface.php
@@ -60,16 +60,28 @@ interface phpbb_auth_provider_interface
* This function is used to output any required fields in the authentication
* admin panel. It also defines any required configuration table fields.
*
- * @param array $new Contains the new configuration values that have
- * been set in acp_board.
* @return array|null Returns null if not implemented or an array of the
- * form:
+ * configuration fields of the provider.
+ */
+ public function acp();
+
+ /**
+ * This function updates the template with variables related to the acp
+ * options with whatever configuraton values are passed to it as an array.
+ * It then returns the name of the acp file related to this authentication
+ * provider.
+ * @param array $new_config Contains the new configuration values that
+ * have been set in acp_board.
+ * @return array|null Returns null if not implemented or an array with
+ * the template file name and an array of the vars
+ * that the template needs that must conform to the
+ * following example:
* array(
- * 'tpl' => string
- * 'config' => array
+ * 'TEMPLATE_FILE' => string,
+ * 'TEMPLATE_VARS' => array(...),
* )
*/
- public function acp($new);
+ public function get_acp_template($new_config);
/**
* Performs additional actions during logout.
diff --git a/phpBB/includes/auth/provider/ldap.php b/phpBB/includes/auth/provider/ldap.php
index e10986abf0..0196529408 100644
--- a/phpBB/includes/auth/provider/ldap.php
+++ b/phpBB/includes/auth/provider/ldap.php
@@ -286,48 +286,32 @@ class phpbb_auth_provider_ldap extends phpbb_auth_provider_base
/**
* {@inheritdoc}
*/
- public function acp($new)
+
+ public function acp()
{
- $tpl = '
-
-