Subversion Repositories ALCASAR

Rev

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

<?php
/*

*/
require_once('mysql.class.php');// the mysql class in already OK!

class user // rename to radius_user!
{
        // public properties
        public $username = "";
        public $properties = Array();
        
        // private properties
        private $mysql = null;

        // protected properties

        
        // Class constructor
        public function __construct($options = Array()) //see later how ti do the mysql init (init value in option or included with this file)
        {
                $this->mysql = new mysql("127.0.0.1","radius","the_radius_password","radius");

        }
        // Class destructor
        public function __destruct()
        {
                //$this->mysql->close();        //is private !
                $this->mysql = null;
        }
        // public methods
        public function find($options)
        {
                /*
                The differents $options values are :
                
                $distinct       -> only distinct response ?
                $username       -> only for this username
                $field          -> field to return (default : username)
                $search         -> search value to find
                $search_IN      -> search in this/those field(s)(text or array)
                $limit          -> to limit the resultset
                $offset         -> offset (work with $limit for pagination)
                $sort           -> sort (ASC/DESC) (default : no sorting)
                $radius_attr-> radius attribute to find (text or array) if search_IN = radius
                */
                
                // distinct option
                
                // field option (make sure that the field exist!)
                
                // where option
                
                // search option
                
                // limit / offset
                
                // sort
                
                // query
                
                // return the result values
        }
        public function add($username, $options = array())
        {
                /*
                $username : user to add
                $options  : others user infos or attribute to add 
                        userinfo table : Name, Mail, Departement, WorkPhone, HomePhone, Mobile)
                        radcheck table : see in attrmap.php (i get it from the "freeradius dialupadmin" package)
                        radreply table : see in attrmap.php             
                */
        }
        public function addAttribute($attribute)
        {
                // add attribute in radcheck or radreply table
                // return true or false
        }
        public function delete($username)
        {
                // $username : user to delete
        }
        public function deleteAttribute($attribute)
        {
                // delete attribute in radcheck or radreply table
                // return true or false
        }
        public function update($username, $options = array())
        {
                /*
                $username : user to update
                $options  : user infos or attribute to update 
                        userinfo table : Name, Mail, Departement, WorkPhone, HomePhone, Mobile)
                        radcheck table : see in attrmap.php (i get it from the "freeradius dialupadmin" package)
                        radreply table : see in attrmap.php             
                */
        }
        public function updateAttribute($attribute)
        {
                // update attribute in radcheck or radreply table
                // return true or false
        }
        public function passwordCheck($pwd, $username ="") // make it static?
        {
                //      Check the user password
                //      Return true or false
        }
        public function passwordSet($pwd, $username ="") // make it static?
        {
                //      Set or change the user password
        }
        
        // private methods
        
        // protected methods
}
?>

Generated by GNU Enscript 1.6.6.