non working experimental status

This commit is contained in:
Marc Wäckerlin
2016-01-08 11:40:36 +00:00
parent d7bf59444e
commit 787eefc67c
11 changed files with 97 additions and 52 deletions

View File

@@ -24,12 +24,14 @@
function login($user, $pubkey) {
try {
require_once("opendb.php");
if (!$db) error("database access failed");
if ($user=="safechat") error("username safechat is reserved for server");
$verify = gnupg_import($pgp, $pubkey);
if (!$verify) error("wrong identity");
//$verify = gnupg_import($pgp, $pubkey);
//if (!$verify) error("wrong identity");
$user = $db->real_escape_string($user);
$pubkey = $db->real_escape_string($pubkey);
$q = $db->query("select * from user where name='$user' and pubkey='$pubkey';");
if (!$q) error("database query failed");
if ($q->num_rows==1) {
success("user $user found on server");
} elseif ($q->num_rows==0) {