Skip to content

Commit

Permalink
Merge pull request phpbb#4184 from lavigor/ticket/14486
Browse files Browse the repository at this point in the history
[ticket/14486] Add an event and fix an event in login_box()
  • Loading branch information
marc1706 committed Mar 10, 2016
2 parents 61e0247 + 40bd4c8 commit 9bcf8df
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions phpBB/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2821,6 +2821,21 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$user->setup();
}

/**
* This event allows an extension to modify the login process
*
* @event core.login_box_before
* @var string redirect Redirect string
* @var string l_explain Explain language string
* @var string l_success Success language string
* @var bool admin Is admin?
* @var bool s_display Display full login form?
* @var string err Error string
* @since 3.1.9-RC1
*/
$vars = array('redirect', 'l_explain', 'l_success', 'admin', 's_display', 'err');
extract($phpbb_dispatcher->trigger_event('core.login_box_before', compact($vars)));

// Print out error if user tries to authenticate as an administrator without having the privileges...
if ($admin && !$auth->acl_get('a_'))
{
Expand All @@ -2833,7 +2848,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
trigger_error('NO_AUTH_ADMIN');
}

if ($request->is_set_post('login') || ($request->is_set('login') && $request->variable('login', '') == 'external'))
if (empty($err) && ($request->is_set_post('login') || ($request->is_set('login') && $request->variable('login', '') == 'external')))
{
// Get credential
if ($admin)
Expand Down Expand Up @@ -2902,11 +2917,11 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
*
* @event core.login_box_redirect
* @var string redirect Redirect string
* @var boolean admin Is admin?
* @var bool return If true, do not redirect but return the sanitized URL.
* @var bool admin Is admin?
* @since 3.1.0-RC5
* @changed 3.1.9-RC1 Removed undefined return variable
*/
$vars = array('redirect', 'admin', 'return');
$vars = array('redirect', 'admin');
extract($phpbb_dispatcher->trigger_event('core.login_box_redirect', compact($vars)));

// append/replace SID (may change during the session for AOL users)
Expand Down

0 comments on commit 9bcf8df

Please sign in to comment.