summaryrefslogtreecommitdiff
path: root/www/class.user.php
blob: 2de15e272ee073e1afc9f49dd5c1b5d5672416ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

class user {

	public $name;
	public $id;
	public $login = false;
	public $banned = false;

	private $db = $GLOBALS["db"];

	__construct(){
		$db=$this->$db;
		$query = $db->prepare("SELECT * FROM user WHERE name=?");
		$query->set("s", $_GET["name"]);
		$result = $query->exec();

		$this->name=
		$this->id=

		if(!isset($_SESSION["login"])){
			$_SESSION["login"] = false;
			$this->login=false;
		} else {
			$this->login=$_SESSION["login"];
		}
	}

	getName(){
		return $this->name;
	}

	getId(){
		return $this->id;
	}

	checkLogin(){
		return $this->login;
	}
}