aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-08-24 22:00:16 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-08-24 22:04:04 -0400
commita8ffbce99f9ea99bd1fdca0e009001026e2d6950 (patch)
tree1cae1d43fee4c417eedd8303f581eb3109d083ab /phpBB/includes/ucp/ucp_auth_link.php
parent[feature/oauth] Fix redirects (diff)
downloadphpbb-a8ffbce99f9ea99bd1fdca0e009001026e2d6950.tar.gz
phpbb-a8ffbce99f9ea99bd1fdca0e009001026e2d6950.tar.bz2
phpbb-a8ffbce99f9ea99bd1fdca0e009001026e2d6950.zip
[feature/oauth] Changes due to code review
PHPBB3-11673
Diffstat (limited to 'phpBB/includes/ucp/ucp_auth_link.php')
-rw-r--r--phpBB/includes/ucp/ucp_auth_link.php32
1 files changed, 14 insertions, 18 deletions
diff --git a/phpBB/includes/ucp/ucp_auth_link.php b/phpBB/includes/ucp/ucp_auth_link.php
index e2bf369984..4fa984c9e7 100644
--- a/phpBB/includes/ucp/ucp_auth_link.php
+++ b/phpBB/includes/ucp/ucp_auth_link.php
@@ -17,8 +17,17 @@ if (!defined('IN_PHPBB'))
class ucp_auth_link
{
+ /**
+ * @var string
+ */
public $u_action;
+ /**
+ * Generates the ucp_auth_link page and handles the auth link process
+ *
+ * @param int $id
+ * @param string $mode
+ */
public function main($id, $mode)
{
global $config, $request, $template, $phpbb_container, $user;
@@ -72,7 +81,7 @@ class ucp_auth_link
}
}
- // In some cases, an request to an external server may be required in
+ // In some cases, a request to an external server may be required. In
// these cases, the GET parameter 'link' should exist and should be true
if ($request->variable('link', false))
{
@@ -114,8 +123,11 @@ class ucp_auth_link
$s_hidden_fields = build_hidden_fields($s_hidden_fields);
+ // Replace "error" strings with their real, localised form
+ $error = array_map(array($user, 'lang'), $error);
+
$template->assign_vars(array(
- 'ERROR' => $this->build_error_text($error),
+ 'ERROR' => $error,
'PROVIDER_TEMPLATE_FILE' => $provider_data['TEMPLATE_FILE'],
@@ -126,20 +138,4 @@ class ucp_auth_link
$this->tpl_name = 'ucp_auth_link';
$this->page_title = 'UCP_AUTH_LINK';
}
-
- private function build_error_text(array $errors)
- {
- global $user;
-
- // Replace all errors that are language constants
- foreach ($errors as $key => $error)
- {
- if (isset($user->lang[$error]))
- {
- $errors[$key] = $user->lang($error);
- }
- }
-
- return implode('<br />', $errors);
- }
}