aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r--phpBB/includes/ucp/ucp_auth_link.php32
-rw-r--r--phpBB/includes/ucp/ucp_login_link.php4
2 files changed, 17 insertions, 19 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);
- }
}
diff --git a/phpBB/includes/ucp/ucp_login_link.php b/phpBB/includes/ucp/ucp_login_link.php
index 2ed6a985d5..4173c54c42 100644
--- a/phpBB/includes/ucp/ucp_login_link.php
+++ b/phpBB/includes/ucp/ucp_login_link.php
@@ -91,7 +91,9 @@ class ucp_login_link
if ($result)
{
$login_link_error = $user->lang[$result];
- } else {
+ }
+ else
+ {
// Finish login
$result = $user->session_create($login_result['user_row']['user_id'], false, false, true);