From 0cbfa8ffd465bdff113bdbc92326c2d272afe15d Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Tue, 30 Jul 2013 14:45:05 -0400 Subject: [PATCH] [feature/oauth] Start working on login_link registration support PHPBB3-11673 --- phpBB/includes/ucp/ucp_login_link.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/ucp/ucp_login_link.php b/phpBB/includes/ucp/ucp_login_link.php index 5b58e91b9a..73991dc1a4 100644 --- a/phpBB/includes/ucp/ucp_login_link.php +++ b/phpBB/includes/ucp/ucp_login_link.php @@ -89,8 +89,6 @@ class ucp_login_link } } - $register_link = redirect('ucp.php?mode=register', true); - $template->assign_vars(array( // Common template elements 'LOGIN_LINK_ERROR' => $login_link_error, @@ -98,7 +96,7 @@ class ucp_login_link 'USERNAME_CREDENTIAL' => 'login_username', // Registration elements - 'REGISTER_LINK' => $register_link, + 'REGISTER_ACTION' => $this->get_register_redirect($data), // Login elements 'LOGIN_ERROR' => $login_error, @@ -109,6 +107,20 @@ class ucp_login_link $this->page_title = 'UCP_LOGIN_LINK'; } + protected function get_register_redirect($data) + { + global $config, $phpbb_root_path, $phpEx, $request; + + $params = 'mode=register&login_link=1&auth_provider=' . $request->variable('auth_provider', $config['auth_method']); + + foreach ($data as $key => $value) + { + $params .= '&login_link_' . $key . '=' . $value; + } + + return append_sid("{$phpbb_root_path}ucp.$phpEx", $params); + } + protected function get_login_link_data_array() { global $request;