Core
3.2
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
Class.apacheAuthenticator.php
Go to the documentation of this file.
1
<?php
2
include_once (
'WHAT/Class.Authenticator.php'
);
3
4
class
apacheAuthenticator
extends
Authenticator
5
{
6
function
checkAuthentication
()
7
{
8
if
(!isset(
$_SERVER
[
'PHP_AUTH_USER'
]) || !isset(
$_SERVER
[
'REMOTE_USER'
]) || empty(
$_SERVER
[
'PHP_AUTH_PW'
]) || (
$_SERVER
[
'PHP_AUTH_USER'
] !==
$_SERVER
[
'REMOTE_USER'
])) {
9
header(
'HTTP/1.0 403 Forbidden'
);
10
echo _(
"User must be authenticate"
);
11
echo
"\nApache authentication module does not seems to be active."
;
12
return
self::AUTH_NOK;
13
}
14
return
self::AUTH_OK;
15
}
16
17
function
checkAuthorization
($opt)
18
{
19
return
TRUE;
20
}
21
22
function
askAuthentication
(
$args
)
23
{
24
header(
'HTTP/1.0 403 Forbidden'
);
25
echo _(
"User must be authenticate"
);
26
echo
"\nApache authentication module does not seems to be active."
;
27
}
28
29
function
getAuthUser
()
30
{
31
return
$_SERVER
[
'PHP_AUTH_USER'
];
32
}
33
34
function
getAuthPw
()
35
{
36
return
$_SERVER
[
'PHP_AUTH_PW'
];
37
}
38
39
function
logout
($redir_uri =
''
)
40
{
41
if
($redir_uri ==
''
) {
42
$pUri = parse_url(
$_SERVER
[
'REQUEST_URI'
]);
43
if
(preg_match(
':(?P<path>.*/)[^/]*$:'
, $pUri[
'path'
], $m)) {
44
$redir_uri = $m[
'path'
];
45
}
46
}
47
header(
'Location: '
. $redir_uri);
48
return
true
;
49
}
50
51
function
setSessionVar
($name,
$value
)
52
{
53
return
true
;
54
}
55
56
function
getSessionVar
($name)
57
{
58
return
''
;
59
}
60
}
$args
if(substr($wsh, 0, 1)!= '/') $args
Definition:
Api/freedom_import.php:26
apacheAuthenticator\logout
logout($redir_uri= '')
Definition:
Class.apacheAuthenticator.php:39
apacheAuthenticator\setSessionVar
setSessionVar($name, $value)
Definition:
Class.apacheAuthenticator.php:51
apacheAuthenticator\askAuthentication
askAuthentication($args)
Definition:
Class.apacheAuthenticator.php:22
apacheAuthenticator
Definition:
Class.apacheAuthenticator.php:4
apacheAuthenticator\getAuthPw
getAuthPw()
Definition:
Class.apacheAuthenticator.php:34
Authenticator
Definition:
Class.Authenticator.php:19
apacheAuthenticator\checkAuthentication
checkAuthentication()
Definition:
Class.apacheAuthenticator.php:6
$_SERVER
global $_SERVER
Definition:
cleanContext.php:41
apacheAuthenticator\getSessionVar
getSessionVar($name)
Definition:
Class.apacheAuthenticator.php:56
apacheAuthenticator\checkAuthorization
checkAuthorization($opt)
Definition:
Class.apacheAuthenticator.php:17
apacheAuthenticator\getAuthUser
getAuthUser()
Definition:
Class.apacheAuthenticator.php:29
$value
$value
Definition:
change_action.php:32
← centre documentaire
© anakeen