aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/auth/auth_db.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/auth/auth_db.php')
-rw-r--r--phpBB/includes/auth/auth_db.php29
1 files changed, 29 insertions, 0 deletions
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 @@
+<?php
+
+//
+// Authentication plug-ins is largely down to
+// Sergey Kanareykin, our thanks to him.
+//
+function login_db(&$username, &$password)
+{
+ global $db, $board_config;
+
+ $sql = "SELECT user_id, username, user_password, user_email, user_active
+ FROM " . USERS_TABLE . "
+ WHERE username = '" . str_replace("\'", "''", $username) . "'";
+ $result = $db->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