diff options
author | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-22 16:23:13 -0400 |
---|---|---|
committer | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-22 16:23:41 -0400 |
commit | cd49cfacfb0faddce8343837b69eb919b8652352 (patch) | |
tree | 52614c152448ee1eb9a6a77b9f30fe0aad14fe03 /phpBB/includes/functions.php | |
parent | d804842cef945dbc7ec2c6c1d145587c62f06f65 (diff) | |
download | forums-cd49cfacfb0faddce8343837b69eb919b8652352.tar forums-cd49cfacfb0faddce8343837b69eb919b8652352.tar.gz forums-cd49cfacfb0faddce8343837b69eb919b8652352.tar.bz2 forums-cd49cfacfb0faddce8343837b69eb919b8652352.tar.xz forums-cd49cfacfb0faddce8343837b69eb919b8652352.zip |
[feature/oauth] Initial step in creating OAuth login support
PHPBB3-11673
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 49f2e469bc..1bb9cc8299 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3199,7 +3199,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true) { global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config; - global $request; + global $request, $phpbb_container; if (!class_exists('phpbb_captcha_factory', false)) { @@ -3367,12 +3367,22 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa $s_hidden_fields['credential'] = $credential; } + $oauth_login = ($config['auth_method'] == 'oauth') ? true : false; + + if ($oauth_login) + { + $auth_provider = $phpbb_container->get('auth.provider.oauth'); + $oauth_box_data = $auth_provider->get_login_data(); + } + $s_hidden_fields = build_hidden_fields($s_hidden_fields); $template->assign_vars(array( 'LOGIN_ERROR' => $err, 'LOGIN_EXPLAIN' => $l_explain, + 'OAUTH_LOGIN' => $oauth_login, + 'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '', 'U_RESEND_ACTIVATION' => ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '', 'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'), |