summaryrefslogtreecommitdiff
path: root/check_user.php
diff options
context:
space:
mode:
authorChristian Pointner <equinox@ffgraz.net>2009-02-08 04:48:53 +0000
committerChristian Pointner <equinox@ffgraz.net>2009-02-08 04:48:53 +0000
commitf6be9edd401664d95e60ae3c81aeaf36723ba891 (patch)
tree86f2127f51f0f16053c1b593c722cf0a5eeecba4 /check_user.php
parent0c420c393dba896e14972ecb5181904f1a1342a4 (diff)
added login capability
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;
+}
+?>