Subversion Repositories ALCASAR

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
600 stephane 1
<?php
2
/*
3
 
4
*/
5
require_once('mysql.class.php');// the mysql class in already OK!
6
 
7
class user // rename to radius_user!
8
{
9
	// public properties
10
	public $username = "";
11
	public $properties = Array();
12
 
13
	// private properties
14
	private $mysql = null;
15
 
16
	// protected properties
17
 
18
 
19
	// Class constructor
20
	public function __construct($options = Array()) //see later how ti do the mysql init (init value in option or included with this file)
21
	{
22
		$this->mysql = new mysql("127.0.0.1","radius","the_radius_password","radius");
23
 
24
	}
25
	// Class destructor
26
	public function __destruct()
27
	{
28
		//$this->mysql->close();	//is private !
29
		$this->mysql = null;
30
	}
31
	// public methods
32
	public function find($options)
33
	{
34
		/*
35
		The differents $options values are :
36
 
37
		$distinct	-> only distinct response ?
38
		$username	-> only for this username
39
		$field		-> field to return (default : username)
40
		$search		-> search value to find
41
		$search_IN	-> search in this/those field(s)(text or array)
42
		$limit		-> to limit the resultset
43
		$offset		-> offset (work with $limit for pagination)
44
		$sort		-> sort (ASC/DESC) (default : no sorting)
45
		$radius_attr-> radius attribute to find (text or array) if search_IN = radius
46
		*/
47
 
48
		// distinct option
49
 
50
		// field option (make sure that the field exist!)
51
 
52
		// where option
53
 
54
		// search option
55
 
56
		// limit / offset
57
 
58
		// sort
59
 
60
		// query
61
 
62
		// return the result values
63
	}
64
	public function add($username, $options = array())
65
	{
66
		/*
67
		$username : user to add
68
		$options  : others user infos or attribute to add 
69
			userinfo table : Name, Mail, Departement, WorkPhone, HomePhone, Mobile)
70
			radcheck table : see in attrmap.php (i get it from the "freeradius dialupadmin" package)
71
			radreply table : see in attrmap.php		
72
		*/
73
	}
74
	public function addAttribute($attribute)
75
	{
76
		// add attribute in radcheck or radreply table
77
		// return true or false
78
	}
79
	public function delete($username)
80
	{
81
		// $username : user to delete
82
	}
83
	public function deleteAttribute($attribute)
84
	{
85
		// delete attribute in radcheck or radreply table
86
		// return true or false
87
	}
88
	public function update($username, $options = array())
89
	{
90
		/*
91
		$username : user to update
92
		$options  : user infos or attribute to update 
93
			userinfo table : Name, Mail, Departement, WorkPhone, HomePhone, Mobile)
94
			radcheck table : see in attrmap.php (i get it from the "freeradius dialupadmin" package)
95
			radreply table : see in attrmap.php		
96
		*/
97
	}
98
	public function updateAttribute($attribute)
99
	{
100
		// update attribute in radcheck or radreply table
101
		// return true or false
102
	}
103
	public function passwordCheck($pwd, $username ="") // make it static?
104
	{
105
		//	Check the user password
106
		//	Return true or false
107
	}
108
	public function passwordSet($pwd, $username ="") // make it static?
109
	{
110
		//	Set or change the user password
111
	}
112
 
113
	// private methods
114
 
115
	// protected methods
116
}
117
?>