X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Flogin.php;h=3c3f6be51add51387d1a740fea2c66dc350671ba;hp=346c71e53e53b79173f9a64b1ec75ae1f43530db;hb=c757506a0a598593115c377a6e4acf399f4d2b83;hpb=924f395a39eeccbcd54d540613e440cbedd6ba3d diff --git a/include/login.php b/include/login.php index 346c71e..3c3f6be 100644 --- a/include/login.php +++ b/include/login.php @@ -1,33 +1,90 @@ Openid ok, but not registered with any account. If you have an account ". + "on E-DoKo, please log in and add your openid in your preferences first.

\n"; + + + /* or perhaps a new user...*/ + $email = $data['email']; + $name = $data['fullname']; + echo "

If you wan to register a new account with this OpenID, please follow this ". + "link.

"; + } + else + $ok=1; + } + + if($ok) + { + /* user information is ok, set session variabel */ + $email = DB_get_email('userid',$myid); + $myname = DB_get_name('email',$email); + $password = DB_get_passwd_by_userid($myid); + $_SESSION['name'] = $myname; + $_SESSION['id'] = $myid; + $_SESSION['pass'] = $password; + } } -else +else if($OPENIDPATH && myisset('openid_url') && $_REQUEST['openid_url']!='') + { + OpenIDAskForVerification(OpenIDUrlEncode($_REQUEST['openid_url'])); + } +/* check if normal login information is present */ +else if(myisset('email','password')) { - $email = $_REQUEST["email"]; - $password = $_REQUEST["password"]; + $email = $_REQUEST['email']; + $password = $_REQUEST['password']; /* verify password and email */ if(strlen($password)!=32) $password = md5($password); - + $ok = 1; $myid = DB_get_userid('email-password',$email,$password); if(!$myid) $ok = 0; - + if($ok) { - /* user information is ok */ + /* user information is ok, set session variabel */ $myname = DB_get_name('email',$email); - $_SESSION["name"] = $myname; + $_SESSION['name'] = $myname; + $_SESSION['id'] = $myid; + $_SESSION['pass'] = $password; } } +else + { + echo "can't log you in... missing login information."; + } ?> \ No newline at end of file