From f8ea2a46a8910848ca00dbd3c9de5bbe7a5b925f Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 6 Aug 2002 16:56:14 +0000 Subject: Auth plug-in, say thanks to Sergey Kanareykin git-svn-id: file:///svn/phpbb/trunk@2828 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/auth/auth_apache.php | 27 +++++++++++++++++++++++ phpBB/includes/auth/auth_db.php | 29 ++++++++++++++++++++++++ phpBB/includes/auth/auth_ldap.php | 44 +++++++++++++++++++++++++++++++++++++ phpBB/includes/auth/index.htm | 10 +++++++++ 4 files changed, 110 insertions(+) create mode 100644 phpBB/includes/auth/auth_apache.php create mode 100644 phpBB/includes/auth/auth_db.php create mode 100644 phpBB/includes/auth/auth_ldap.php create mode 100644 phpBB/includes/auth/index.htm (limited to 'phpBB/includes/auth') diff --git a/phpBB/includes/auth/auth_apache.php b/phpBB/includes/auth/auth_apache.php new file mode 100644 index 0000000000..e5059724b9 --- /dev/null +++ b/phpBB/includes/auth/auth_apache.php @@ -0,0 +1,27 @@ +sql_query($sql); + + return ( $row = $db->sql_fetchrow($result) ? $row : false; + } + + return false; +} + +?> \ No newline at end of file diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php new file mode 100644 index 0000000000..0c9d0adf3e --- /dev/null +++ b/phpBB/includes/auth/auth_db.php @@ -0,0 +1,29 @@ +sql_query($sql); + + if ( $row = $db->sql_fetchrow($result) ) + { + $db->sql_freeresult($result); + + if ( md5($password) == $row['user_password'] && $row['user_active'] ) + { + return $row; + } + } + + return false; +} + +?> \ No newline at end of file diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php new file mode 100644 index 0000000000..0957b56949 --- /dev/null +++ b/phpBB/includes/auth/auth_ldap.php @@ -0,0 +1,44 @@ + 1 ) + { + if ( @ldap_bind($ldap, $result[0]['dn'], $password) ) + { + @ldap_close($ldap); + + $sql = "SELECT user_id, username, user_password, user_email, user_active + FROM " . USERS_TABLE . " + WHERE username = '" . str_replace("\'", "''", $username) . "'"; + $result = $db->sql_query($sql); + + return ( $row = $db->sql_fetchrow($result) ? $row : false; + } + } + + @ldap_close($ldap); + + return false; +} + +?> \ No newline at end of file diff --git a/phpBB/includes/auth/index.htm b/phpBB/includes/auth/index.htm new file mode 100644 index 0000000000..ee1f723a7d --- /dev/null +++ b/phpBB/includes/auth/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + -- cgit v1.2.1