summaryrefslogtreecommitdiffstats
path: root/include/user.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2013-02-25 21:25:57 -0800
committerArun Persaud <arun@nubati.net>2013-02-25 21:25:57 -0800
commit7a6c422d36beb00e0b6719fec7d3675b37d69af2 (patch)
tree38342197d733bc6eeee8c4e49885048c3a179a8d /include/user.php
parent34745273b4e8935b4423a0db050dcd75bc672209 (diff)
downloade-DoKo-7a6c422d36beb00e0b6719fec7d3675b37d69af2.tar.gz
e-DoKo-7a6c422d36beb00e0b6719fec7d3675b37d69af2.tar.bz2
e-DoKo-7a6c422d36beb00e0b6719fec7d3675b37d69af2.zip
replaced two DB queries with one that is indexed.
Diffstat (limited to 'include/user.php')
-rw-r--r--include/user.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/user.php b/include/user.php
index 6169495..546ea8d 100644
--- a/include/user.php
+++ b/include/user.php
@@ -25,11 +25,15 @@ if(!isset($HOST))
exit;
/* test id and password, should really be done in one step */
-if(isset($_SESSION['name']))
+if(isset($_SESSION['id']))
{
- $name = $_SESSION['name'];
- $email = DB_get_email('name',$name);
- $password = DB_get_passwd_by_name($name);
+ $myid = $_SESSION['id'];
+ $r = DB_query_array("SELECT email,password FROM User WHERE id=".DB_quote_smart($myid)."");
+ if($r)
+ {
+ $email = $r[0];
+ $password = $r[1];
+ };
};
global $ADMIN_NAME;