aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-07-29 11:58:24 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-07-29 11:58:47 -0400
commit75206c74be23e17b2661faa0693cd308cab4d382 (patch)
tree76bf5ce2238d45b12f4318fd4e3c4a81921f8c81
parent59852b5997905ed6f815c3cc4b9220872e1090d2 (diff)
downloadforums-75206c74be23e17b2661faa0693cd308cab4d382.tar
forums-75206c74be23e17b2661faa0693cd308cab4d382.tar.gz
forums-75206c74be23e17b2661faa0693cd308cab4d382.tar.bz2
forums-75206c74be23e17b2661faa0693cd308cab4d382.tar.xz
forums-75206c74be23e17b2661faa0693cd308cab4d382.zip
[feature/oauth] Basic checking for data needed in login linking
PHPBB3-11673
-rw-r--r--phpBB/includes/ucp/ucp_login_link.php16
-rw-r--r--phpBB/language/en/ucp.php5
-rw-r--r--phpBB/styles/prosilver/template/ucp_login_link.html4
3 files changed, 22 insertions, 3 deletions
diff --git a/phpBB/includes/ucp/ucp_login_link.php b/phpBB/includes/ucp/ucp_login_link.php
index 62641f0367..1fb75deb61 100644
--- a/phpBB/includes/ucp/ucp_login_link.php
+++ b/phpBB/includes/ucp/ucp_login_link.php
@@ -27,17 +27,31 @@ class ucp_login_link
function main($id, $mode)
{
- global $config, $phpbb_container, $request, $template;
+ global $config, $phpbb_container, $request, $template, $user;
$auth_provider = 'auth.provider.' . $request->variable('auth_provider', $config['auth_method']);
$auth_provider = $phpbb_container->get($auth_provider);
+ // Initialize necessary variables
+ $login_link_error = null;
+
+ // Ensure the person was sent here with login_link data
+ $data = $request->variable('login_link', array());
+
+ if (empty($data))
+ {
+ $login_link_error = $user->lang['LOGIN_LINK_NO_DATA_PROVIDED'];
+ } else {
+
+ }
+
// Process POST and GET data
$login_error = false;
$login_username = '';
// Common template elements
$template->assign_vars(array(
+ 'LOGIN_LINK_ERROR' => $login_link_error,
'PASSWORD_CREDENTIAL' => 'password',
'USERNAME_CREDENTIAL' => 'username',
));
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index f44fd8905b..6e48e3b801 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -270,8 +270,9 @@ $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 External Account with phpBB',
- 'LOGIN_LINK_EXPLAIN' => 'You have attempted to login with an external service that is not yet connected to an account on these forums. You may now either link this account to an existing account or you may create a new account.',
+ 'LOGIN_LINK' => 'Link or Register Your External Account with phpBB',
+ 'LOGIN_LINK_EXPLAIN' => 'You have attempted to login with an external service that is not yet connected to an account on these forums. You may now either link this account to an existing account or you may create a new account.',
+ '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.',
diff --git a/phpBB/styles/prosilver/template/ucp_login_link.html b/phpBB/styles/prosilver/template/ucp_login_link.html
index 02a9873f2b..5a03e08bc5 100644
--- a/phpBB/styles/prosilver/template/ucp_login_link.html
+++ b/phpBB/styles/prosilver/template/ucp_login_link.html
@@ -7,6 +7,10 @@
<p>{L_LOGIN_LINK_EXPLAIN}</p>
+ <!-- IF LOGIN_LINK_ERROR --><div class="content">
+ <div class="error">{LOGIN_ERROR}</div>
+ </div><!-- ENDIF -->
+
<div class="content">
<h2>{L_REGISTER}</h2>
</div>