Core  3.2
PHP API documentation
 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 
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 
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 }
if(substr($wsh, 0, 1)!= '/') $args
global $_SERVER
$value
← centre documentaire © anakeen