mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 23:25:30 +02:00
[ticket/11626] Change interface to match functionality
Changes the interface so that it matches the new functionality of phpbb_provider_auth_interface::acp(). PHPBB3-11626
This commit is contained in:
parent
29b472c2e5
commit
60100b62f3
@ -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]))
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ abstract class phpbb_auth_provider_base implements phpbb_auth_provider_interface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function acp($new)
|
||||
public function acp()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -60,16 +60,10 @@ 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:
|
||||
* array(
|
||||
* 'tpl' => string
|
||||
* 'config' => array
|
||||
* )
|
||||
* configuration fields of the provider.
|
||||
*/
|
||||
public function acp($new);
|
||||
public function acp();
|
||||
|
||||
/**
|
||||
* This function updates the template with variables related to the acp
|
||||
|
@ -288,48 +288,12 @@ class phpbb_auth_provider_ldap extends phpbb_auth_provider_base
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function acp($new)
|
||||
|
||||
public function acp()
|
||||
{
|
||||
$tpl = '
|
||||
|
||||
<dl>
|
||||
<dt><label for="ldap_server">' . $this->user->lang['LDAP_SERVER'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['LDAP_SERVER_EXPLAIN'] . '</span></dt>
|
||||
<dd><input type="text" id="ldap_server" size="40" name="config[ldap_server]" value="' . $new['ldap_server'] . '" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="ldap_port">' . $this->user->lang['LDAP_PORT'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['LDAP_PORT_EXPLAIN'] . '</span></dt>
|
||||
<dd><input type="text" id="ldap_port" size="40" name="config[ldap_port]" value="' . $new['ldap_port'] . '" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="ldap_dn">' . $this->user->lang['LDAP_DN'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['LDAP_DN_EXPLAIN'] . '</span></dt>
|
||||
<dd><input type="text" id="ldap_dn" size="40" name="config[ldap_base_dn]" value="' . $new['ldap_base_dn'] . '" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="ldap_uid">' . $this->user->lang['LDAP_UID'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['LDAP_UID_EXPLAIN'] . '</span></dt>
|
||||
<dd><input type="text" id="ldap_uid" size="40" name="config[ldap_uid]" value="' . $new['ldap_uid'] . '" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="ldap_user_filter">' . $this->user->lang['LDAP_USER_FILTER'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['LDAP_USER_FILTER_EXPLAIN'] . '</span></dt>
|
||||
<dd><input type="text" id="ldap_user_filter" size="40" name="config[ldap_user_filter]" value="' . $new['ldap_user_filter'] . '" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="ldap_email">' . $this->user->lang['LDAP_EMAIL'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['LDAP_EMAIL_EXPLAIN'] . '</span></dt>
|
||||
<dd><input type="email" id="ldap_email" size="40" name="config[ldap_email]" value="' . $new['ldap_email'] . '" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="ldap_user">' . $this->user->lang['LDAP_USER'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['LDAP_USER_EXPLAIN'] . '</span></dt>
|
||||
<dd><input type="text" id="ldap_user" size="40" name="config[ldap_user]" value="' . $new['ldap_user'] . '" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="ldap_password">' . $this->user->lang['LDAP_PASSWORD'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['LDAP_PASSWORD_EXPLAIN'] . '</span></dt>
|
||||
<dd><input type="password" id="ldap_password" size="40" name="config[ldap_password]" value="' . $new['ldap_password'] . '" autocomplete="off" /></dd>
|
||||
</dl>
|
||||
';
|
||||
|
||||
// These are fields required in the config table
|
||||
return array(
|
||||
'tpl' => $tpl,
|
||||
'config' => array('ldap_server', 'ldap_port', 'ldap_base_dn', 'ldap_uid', 'ldap_user_filter', 'ldap_email', 'ldap_user', 'ldap_password')
|
||||
'ldap_server', 'ldap_port', 'ldap_base_dn', 'ldap_uid', 'ldap_user_filter', 'ldap_email', 'ldap_user', 'ldap_password',
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user