X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Flogin.php;h=22d422f737e79e20db1a99c72425ebcf26832c23;hp=ea8d8effac122ab63df92334ad1a08481c2b9439;hb=c581cd05476d07f0fd17dab41cbb211a443fd57f;hpb=1c3c341f53ce5de7e9d4bcc63e43a925faec3f48
diff --git a/include/login.php b/include/login.php
index ea8d8ef..22d422f 100644
--- a/include/login.php
+++ b/include/login.php
@@ -1,19 +1,88 @@
+ *
+ * This file is part of e-DoKo.
+ *
+ * e-DoKo is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * e-DoKo is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with e-DoKo. If not, see
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']!='') { - $email = $_REQUEST["email"]; - $password = $_REQUEST["password"]; + OpenIDAskForVerification(OpenIDUrlEncode($_REQUEST['openid_url'])); + } +/* check if normal login information is present */ +else if(myisset('email','password')) + { + $email = $_REQUEST['email']; + $password = $_REQUEST['password']; /* verify password and email */ if(strlen($password)!=32) @@ -28,7 +97,13 @@ else { /* 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