aboutsummaryrefslogtreecommitdiff
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/auth_provider_oauth.html15
-rw-r--r--phpBB/includes/acp/acp_board.php10
-rw-r--r--phpBB/language/en/acp/board.php9
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php22
4 files changed, 55 insertions, 1 deletions
diff --git a/phpBB/adm/style/auth_provider_oauth.html b/phpBB/adm/style/auth_provider_oauth.html
new file mode 100644
index 0000000000..e3e246d727
--- /dev/null
+++ b/phpBB/adm/style/auth_provider_oauth.html
@@ -0,0 +1,15 @@
+<h2>{L_AUTH_PROVIDER_OAUTH_TITLE}</h2>
+
+<!-- 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><br /><span>{L_AUTH_PROVIDER_OAUTH_KEY_EXPLAIN}</span></dt>
+ <dd><input type="text" id="oauth_service_{oauth_services.NAME}_key" size="40" name="config[auth_oauth_{oauth_services.NAME}_key]" value="{AUTH_LDAP_SERVER}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="oauth_service_{oauth_services.NAME}_secret">{L_AUTH_PROVIDER_OAUTH_SECRET}{L_COLON}</label><br /><span>{L_AUTH_PROVIDER_OAUTH_SECRET_EXPLAIN}</span></dt>
+ <dd><input type="text" id="oauth_service_{oauth_services.NAME}_secret" size="40" name="config[auth_oauth_{oauth_services.NAME}_secret]" value="{AUTH_LDAP_SERVER}" /></dd>
+ </dl>
+</fieldset>
+<!-- END oauth_services -->
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 12e2a1bf72..0af0fbec86 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -658,7 +658,15 @@ class acp_board
$auth_tpl = $provider->get_acp_template($this->new_config);
if ($auth_tpl)
{
- $template->assign_vars($auth_tpl['TEMPLATE_VARS']);
+ if (array_key_exists('BLOCK_VAR_NAME', $auth_tpl))
+ {
+ foreach ($auth_tpl['TEMPLATE_VARS'] as $block_vars)
+ {
+ $template->assign_block_vars($auth_tpl['BLOCK_VAR_NAME'], $block_vars);
+ }
+ } else {
+ $template->assign_vars($auth_tpl['TEMPLATE_VARS']);
+ }
$template->assign_block_vars('auth_tpl', array(
'TEMPLATE_FILE' => $auth_tpl['TEMPLATE_FILE'],
));
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index ce15dfefb4..892d3f61fe 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -394,6 +394,15 @@ $lang = array_merge($lang, array(
'AUTH_METHOD' => 'Select an authentication method',
+ 'AUTH_PROVIDER_OAUTH_KEY' => 'Key',
+ 'AUTH_PROVIDER_OAUTH_KEY_EXPLAIN' => '',
+ 'AUTH_PROVIDER_OAUTH_SERVICE_BITLY' => 'Bitly',
+ 'AUTH_PROVIDER_OAUTH_SERVICE_FACEBOOK' => 'Facebook',
+ 'AUTH_PROVIDER_OAUTH_SERVICE_GOOGLE' => 'Google',
+ 'AUTH_PROVIDER_OAUTH_TITLE' => 'OAuth',
+ 'AUTH_PROVIDER_OAUTH_SECRET' => 'Secret',
+ 'AUTH_PROVIDER_OAUTH_SECRET_EXPLAIN' => '',
+
'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>',
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index e43579a740..31450a573f 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -256,4 +256,26 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
return $login_data;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_acp_template($new_config)
+ {
+ $ret = array(
+ 'BLOCK_VAR_NAME' => 'oauth_services',
+ '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['TEMPLATE_VARS'][$actual_name] = array();
+ $ret['TEMPLATE_VARS'][$actual_name]['NAME'] = $actual_name;
+ $ret['TEMPLATE_VARS'][$actual_name]['ACTUAL_NAME'] = 'L_AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name);
+ }
+
+ return $ret;
+ }
}