summaryrefslogtreecommitdiff
blob: eef09772387369bb27c7a1415e4e9c0ca9c2913b (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
41
42
<?php
class sql_user extends sql_row_obj {
	protected $table='users', $primary_key=array('id'), $columns=array(
		'id' => array (
			'type' => 'INT',
			'length' => 10,
			'unsigned' => true,
			'not_null' => true,
			'auto_increment' => true
		),
		'email' => array (
			'type' => 'VARCHAR',
			'length' => 255,
			'not_null' => true,
			'default' => '',
			'unique' => true
		),
		'name' => array (
			'type' => 'VARCHAR',
			'length' => 255,
			'not_null' => true,
			'default' => ''
		),
		'passhash' => array (
			'type' => 'CHAR',
			'length' => 40,
			'not_null' => true,
			'default' => ''
		),
		'flags' => array (
			'type' => 'VARCHAR',
			'length' => 255,
			'not_null' => true,
			'default' => ''
		)

	);
	public function has_flag($flag) {
		return (strpos($this->flags, $flag) !== false);
	}
}
?>