//-----------------------------------------------------------------------------------------------
+function get_user_by_email($email)
+{
+ $sql = "SELECT * FROM ".TB_PREF."users WHERE email=".db_escape($email);
+
+ $result = db_query($sql, "could not get user for email $email");
+
+ if (db_num_rows($result) != 1)
+ return false;
+
+ return db_fetch($result);
+}
+
+//-----------------------------------------------------------------------------------------------
+
function delete_user($id)
{
$sql="DELETE FROM ".TB_PREF."users WHERE id=".db_escape($id);
}
// Add user to database
- db_query("INSERT INTO ".TB_PREF."useronline (timestamp, ip, file) VALUES ('". $timestamp ."','". $ip ."','". $_SERVER['PHP_SELF'] ."')");
+ db_query("INSERT INTO ".TB_PREF."useronline (timestamp, ip, file) VALUES ('". $timestamp ."',". db_escape($ip) .",". db_escape($_SERVER['PHP_SELF']) .")");
//Remove users that were not online within $timeoutseconds.
db_query("DELETE FROM ".TB_PREF."useronline WHERE timestamp<". $timeout);
return "$users ".($users == 1 ? _("user online") : _("users online"));
}
-?>
\ No newline at end of file
+?>