summaryrefslogtreecommitdiff
path: root/check_user.php
diff options
context:
space:
mode:
Diffstat (limited to 'check_user.php')
-rw-r--r--check_user.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/check_user.php b/check_user.php
new file mode 100644
index 0000000..4b89267
--- /dev/null
+++ b/check_user.php
@@ -0,0 +1,18 @@
+<?php
+require_once("db.class.php");
+
+function check_user($username, $password)
+{
+ require_once("config.php");
+ $db = new DB($conf['db']['user'], $conf['db']['password'], $conf['db']['host'], $conf['db']['database']);
+
+ $escaped_username = $db->escape_string($username);
+
+ $db->query("SELECT password FROM person WHERE email='".$escaped_username."'");
+ $data = $db->getNextObject();
+ if($data->password == md5($password))
+ return true;
+
+ return false;
+}
+?>