BUGFIX: added email-list name to invitation emails
[e-DoKo.git] / include / login.php
1 <?php
2 /* make sure that we are not called from outside the scripts, 
3  * use a variable defined in config.php to check this
4  */
5 if(!isset($HOST))
6   exit;
7
8 if(!myisset("email","password"))
9   {
10     "can't log you in";
11   }
12 else
13   {
14     $email     = $_REQUEST["email"];
15     $password  = $_REQUEST["password"];
16
17     /* verify password and email */
18     if(strlen($password)!=32)
19       $password = md5($password);
20     
21     $ok  = 1;
22     $myid = DB_get_userid('email-password',$email,$password);
23     if(!$myid)
24       $ok = 0;
25     
26     if($ok)
27       {
28         /* user information is ok */
29         $myname = DB_get_name('email',$email);
30         $_SESSION["name"] = $myname;
31       }
32   }
33 ?>