MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mauth.class
Ir para a documentação deste ficheiro.
1
<?php
2
class
MAuth
extends
MService
3
{
4
var
$login
;
// objeto Login
5
var
$iduser
;
// iduser do usuario corrente
6
var
$module
;
// authentication module;
7
8
function
__construct
()
9
{
10
parent::__construct();
11
$this->module = $this->manager->GetConf(
'login.module'
);
12
}
13
14
function
SetLogin
(
$login
)
15
{
16
$this->manager->session->SetValue(
'login'
,
$login
);
17
$this->login = $GLOBALS[
'login'
] = $this->manager->login =
$login
;
18
$this->iduser = ($this->login instanceof
MLogin
? $this->login->id : NULL);
19
}
20
21
function
GetLogin
()
22
{
23
return
$this->login
;
24
}
25
26
function
CheckLogin
($handler =
true
)
27
{
28
$this->manager->LogMessage(
'[LOGIN] CheckLogin'
);
29
30
// we have a session login?
31
$login
= $this->manager->session->GetValue(
'login'
);
32
33
if
(
$login
->id)
34
{
35
$this->manager->LogMessage(
'[LOGIN] Using session login'
);
36
$this->
SetLogin
($login);
37
return
true
;
38
}
39
40
// if not checking logins, we are done
41
if
( (!
MUtil::getBooleanValue
($this->manager->GetConf(
'login.check'
))) )
42
{
43
$this->manager->LogMessage(
'[LOGIN] Not checking login'
);
44
return
true
;
45
}
46
47
// if we have already a login, assume it is valid and return
48
if
($this->login instanceof
MLogin
)
49
{
50
$this->manager->LogMessage(
'[LOGIN] Using existing login:'
. $this->login->id);
51
return
true
;
52
}
53
54
// still no login -- should we do an automatic login?
55
if
( ($auto = $this->manager->GetConf(
'login.auto'
)) && $this->manager->GetConf(
"login.$auto.id"
) )
56
{
57
$this->manager->LogMessage(
'[LOGIN] Using automatic login '
. $auto);
58
59
$login
=
new
MLogin
($this->manager->GetConf(
"login.$auto.id"
),
60
$this->manager->GetConf(
"login.$auto.password"
),
61
$this->manager->GetConf(
"login.$auto.name"
),
62
0);
63
64
$this->
SetLogin
($login);
65
66
return
true
;
67
}
68
69
$this->manager->LogMessage(
'[LOGIN] No Login but Login required'
);
70
71
if
($handler)
72
$this->manager->invokeHandler($this->manager->getConf(
'login.module'
),
'login'
);
73
74
return
false
;
75
}
76
77
function
Authenticate
($user, $pass)
78
{
79
return
false
;
80
}
81
82
function
IsLogged
()
83
{
84
return
($this->login->id != NULL);
85
}
86
87
function
IsLogging
()
88
{
89
$context = $this->manager->GetContext();
90
$isLogging = (($context->module == NULL) || (($context->module == $this->module) && (($context->action ==
'main'
) || ($context->action ==
'login'
) || ($context->action ==
'auth'
))));
91
return
$isLogging;
92
}
93
94
function
Logout
($forced =
''
)
95
{
96
if
($this->manager->GetConf(
"dbsession"
))
97
{
98
$session = $this->manager->GetBusinessMAD(
'session'
);
99
$session->RegisterOut($this->
GetLogin
());
100
}
101
102
$this->
SetLogin
(NULL);
103
$this->manager->GetSession()->destroy();
104
}
105
}
106
?>
MAuth
Definição
mauth.class:3
MAuth\IsLogging
IsLogging()
Definição
mauth.class:87
MAuth\__construct
__construct()
Definição
mauth.class:8
MAuth\IsLogged
IsLogged()
Definição
mauth.class:82
MAuth\CheckLogin
CheckLogin($handler=true)
Definição
mauth.class:26
MAuth\$iduser
$iduser
Definição
mauth.class:5
MAuth\GetLogin
GetLogin()
Definição
mauth.class:21
MAuth\$module
$module
Definição
mauth.class:6
MAuth\SetLogin
SetLogin($login)
Definição
mauth.class:14
MAuth\Authenticate
Authenticate($user, $pass)
Definição
mauth.class:77
MAuth\Logout
Logout($forced='')
Definição
mauth.class:94
MAuth\$login
$login
Definição
mauth.class:4
MLogin
Definição
mlogin.class:4
MService
Definição
mservice.class:7
MUtil\getBooleanValue
static getBooleanValue($value)
Definição
mutil.class:100
classes
security
mauth.class
Gerado por
1.10.0