OpenSencillo  2015.002
loginManager Class Reference
+ Inheritance diagram for loginManager:
+ Collaboration diagram for loginManager:

Public Member Functions

 __construct ()
 lm_install ()
 lm_addUser ($name, $pass, $perm=1000)

Private Attributes

 $current_time
 $sql

Detailed Description

Definition at line 82 of file session.php.


Constructor & Destructor Documentation

Create time settings for loginManager

Reimplemented from sessionManager.

Definition at line 90 of file session.php.

        {
                $this->current_time = array('year'=>date('Y'),
                                                                        'month'=>date('m'),
                                                                        'day'=>date('d'),
                                                                        'hour'=>date('H'),
                                                                        'minute'=>date('i'),
                                                                        'second'=>date('s'),
                                                                        'session'=>date('YmdHis'));
        }

Member Function Documentation

lm_addUser ( name,
pass,
perm = 1000 
)

Add user

Parameters:
string$name
string$pass
integer$perm

Definition at line 137 of file session.php.

        {
                $mysql->openTable('users');
                $mysql->insert("'name',md5('$pass'),$perm");
        }

Install loginManager class

Definition at line 104 of file session.php.

        {
                $this->sql='
                CREATE TABLE IF NOT EXISTS `login` (
                        `id` bigint(20) NOT NULL AUTO_INCREMENT,
                        `userid` bigint(20) NOT NULL,
                        `sessionid` longtext NOT NULL,
                        `expiration` int(11) NOT NULL,
                        `perm` int(11) NOT NULL,
                        PRIMARY KEY (`id`)
                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
                ';
                $mysql->openTable('login');
                $mysql->write($this->sql);
                $this->sql='
                CREATE TABLE IF NOT EXISTS `users` (
                        `userid` bigint(20) NOT NULL AUTO_INCREMENT,
                        `name` longtext NOT NULL,
                        `pass` longtext NOT NULL,
                        `perm` int(4) NOT NULL,
                        PRIMARY KEY (`userid`)
                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
                ';
                $mysql->openTable('users');
                $mysql->write($this->sql);
        }

Field Documentation

$current_time [private]

Definition at line 84 of file session.php.

$sql [private]

Definition at line 85 of file session.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables