diff options
author | Nils Adermann <naderman@naderman.de> | 2006-07-07 12:36:44 +0000 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2006-07-07 12:36:44 +0000 |
commit | a5c23243c7a0a86ccd749b7733b11d30a6c349e1 (patch) | |
tree | f7cd509c0db4efb62f212e483ba5a83bff0d457d /phpBB/includes/auth.php | |
parent | 8c128de642207142bf599fcf9d78c2b0e705e351 (diff) | |
download | forums-a5c23243c7a0a86ccd749b7733b11d30a6c349e1.tar forums-a5c23243c7a0a86ccd749b7733b11d30a6c349e1.tar.gz forums-a5c23243c7a0a86ccd749b7733b11d30a6c349e1.tar.bz2 forums-a5c23243c7a0a86ccd749b7733b11d30a6c349e1.tar.xz forums-a5c23243c7a0a86ccd749b7733b11d30a6c349e1.zip |
- display age in user profile and make it available on viewtopic
- various tiny bugfixes including [Bug #2351] [Bug #2549] [Bug #2681] [Bug #3015]
- strip first, then change newlines [Bug #2403]
- added support for creating user profiles to the login function (makes use of user_add), triggered by LOGIN_SUCCESS_CREATE_PROFILE constant
- moved newest user updating from ucp_register to user_add function
- renamed the admin_ auth module function to acp_
- added initialisation code to auth_apache which checks whether it will work
- added user_add support to both auth_ldap and auth_apache
- some auth_ldap tweaks, should work with users deeper in the organisation structure too now
- adjusted global topics in mcp_report to work like mcp_queue
git-svn-id: file:///svn/phpbb/trunk@6151 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/auth.php')
-rw-r--r-- | phpBB/includes/auth.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index b226f0b13b..06b2ac0689 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -717,6 +717,40 @@ class auth { $login = $method($username, $password); + // If the auth module wants us to create an empty profile do so and then treat the status as LOGIN_SUCCESS + if ($login['status'] == LOGIN_SUCCESS_CREATE_PROFILE) + { + // we are going to use the user_add function so include functions_user.php if it wasn't defined yet + if (!function_exists('user_add')) + { + include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + + user_add($login['user_row'], (isset($login['cp_data'])) ? $login['cp_data'] : false); + + $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type + FROM ' . USERS_TABLE . " + WHERE username = '" . $db->sql_escape($username) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + return array( + 'status' => LOGIN_ERROR_EXTERNAL_AUTH, + 'error_msg' => 'AUTH_NO_PROFILE_CREATED', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + $login = array( + 'status' => LOGIN_SUCCESS, + 'error_msg' => false, + 'user_row' => $row, + ); + } + // If login succeeded, we will log the user in... else we pass the login array through... if ($login['status'] == LOGIN_SUCCESS) { |