From 59852b5997905ed6f815c3cc4b9220872e1090d2 Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Thu, 25 Jul 2013 14:53:05 -0400 Subject: [PATCH] [feature/oauth] More work on login linking accounts PHPBB3-11673 --- phpBB/includes/ucp/ucp_login_link.php | 23 +++++++++++++ phpBB/language/en/ucp.php | 1 + .../prosilver/template/ucp_login_link.html | 34 +++++++++++++++++++ 3 files changed, 58 insertions(+) diff --git a/phpBB/includes/ucp/ucp_login_link.php b/phpBB/includes/ucp/ucp_login_link.php index 7e6374ee83..62641f0367 100644 --- a/phpBB/includes/ucp/ucp_login_link.php +++ b/phpBB/includes/ucp/ucp_login_link.php @@ -32,6 +32,29 @@ class ucp_login_link $auth_provider = 'auth.provider.' . $request->variable('auth_provider', $config['auth_method']); $auth_provider = $phpbb_container->get($auth_provider); + // Process POST and GET data + $login_error = false; + $login_username = ''; + + // Common template elements + $template->assign_vars(array( + 'PASSWORD_CREDENTIAL' => 'password', + 'USERNAME_CREDENTIAL' => 'username', + )); + + // Registration template + $register_link = 'ucp.php?mode=register'; + + $template->assign_vars(array( + 'REGISTER_LINK' => redirect($register_link, true), + )); + + // Link to existing account template + $template->assign_vars(array( + 'LOGIN_ERROR' => $login_error, + 'LOGIN_USERNAME' => $login_username, + )); + $this->tpl_name = 'ucp_login_link'; $this->page_title = 'UCP_LOGIN_LINK'; } diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 32b70e661b..f44fd8905b 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -271,6 +271,7 @@ $lang = array_merge($lang, array( '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_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 ddde41f374..02a9873f2b 100644 --- a/phpBB/styles/prosilver/template/ucp_login_link.html +++ b/phpBB/styles/prosilver/template/ucp_login_link.html @@ -5,6 +5,40 @@

{SITENAME} - {L_LOGIN_LINK}

+

{L_LOGIN_LINK_EXPLAIN}

+ +
+

{L_REGISTER}

+
+ +
+

{L_LOGIN}

+ +
+
+
{LOGIN_ERROR}
+
+
+
+
+
+
+
+
+ + + + + + {S_LOGIN_REDIRECT} +
+
 
+
{S_HIDDEN_FIELDS}
+
+
+
+
+