From 75206c74be23e17b2661faa0693cd308cab4d382 Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Mon, 29 Jul 2013 11:58:24 -0400 Subject: [PATCH] [feature/oauth] Basic checking for data needed in login linking PHPBB3-11673 --- phpBB/includes/ucp/ucp_login_link.php | 16 +++++++++++++++- phpBB/language/en/ucp.php | 5 +++-- .../prosilver/template/ucp_login_link.html | 4 ++++ 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 @@

{L_LOGIN_LINK_EXPLAIN}

+
+
{LOGIN_ERROR}
+
+

{L_REGISTER}