Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
index.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Main program to activate action in WHAT software
8  *
9  * All HTTP requests call index.php to execute action within application
10  *
11  * @author Anakeen
12  * @version $Id: index.php,v 1.64 2008/12/16 15:51:53 jerome Exp $
13  * @package FDL
14  * @subpackage
15  */
16 /**
17  */
18 
19 include_once ('WHAT/Lib.Main.php');
20 include_once ('WHAT/Class.AuthenticatorManager.php');
21 include_once ('WHAT/Class.ActionRouter.php');
22 
23 register_shutdown_function('handleFatalShutdown');
24 
25 $guestMode = getDbAccessValue("useIndexAsGuest");
26 
28 
29 $noAsk = ($guestMode == true);
30 $status = AuthenticatorManager::checkAccess(null, $noAsk);
31 switch ($status) {
32  case AuthenticatorManager::AccessOk: // it'good, user is authentified
33  $_SERVER['PHP_AUTH_USER'] = AuthenticatorManager::$auth->getAuthUser();
34  break;
35 
37  // User must change his password
38  // $action->session->close();
39  AuthenticatorManager::$auth->logout("authent.php?sole=A&app=AUTHENT&action=ERRNO_BUG_639");
40  exit(0);
41  break;
42 
44  $needToBeGuest = true;
45  break;
46 
47  default:
48  sleep(1); // for robots
49  // Redirect to authentication
50  AuthenticatorManager::$auth->askAuthentication(array());
51 
52  exit(0);
53 }
54 
56 if ($account === false) {
57  if (!$needToBeGuest) {
58  throw new \Dcp\Exception("You are not supposed to be here...");
59  }
60 }
61 if ($needToBeGuest) {
62  $account = new Account();
63  if ($account->setLoginName("anonymous") === false) {
64  throw new \Dcp\Exception("anonymous account not found.");
65  }
66 }
68  if ($account->login != 'admin') {
69  include_once ('TOOLBOX/stop.php');
70  exit(0);
71  }
72 }
74 $actionRouter->executeAction();
$noAsk
Definition: index.php:29
$status
Definition: index.php:30
getDbAccessValue($varName)
Definition: Lib.Common.php:425
static inMaintenance()
$needToBeGuest
Definition: index.php:27
if($account===false) if($needToBeGuest) if(ActionRouter::inMaintenance()) $actionRouter
Definition: index.php:73
switch($status) $account
Definition: index.php:55
global $_SERVER
switch($command) exit
Definition: checkVault.php:46
$guestMode
Definition: index.php:25
← centre documentaire © anakeen