3 * Fichier racine - porte d'entrée principale du site
5 * Ce fichier permet de faire appel aux différentes entités (documents), via leur id, leur
6 * identifier (lien permanent). Il permet aussi d'appeler un template particulier (via l'argument
8 * Voici des exemples d'utilisations
10 * index.php?/histoire/france/charlemagne-le-pieux
12 * index.php?page=rss20
13 * index.php?do=view&idtype=2
18 * LODEL - Logiciel d'Edition ELectronique.
20 * Copyright (c) 2001-2002, Ghislain Picard, Marin Dacos
21 * Copyright (c) 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
22 * Copyright (c) 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
23 * Copyright (c) 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
24 * Copyright (c) 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
25 * Copyright (c) 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
26 * Copyright (c) 2008, Marin Dacos, Bruno Cénou, Pierre-Alain Mignot, Inès Secondat de Montesquieu, Jean-François Rivière
27 * Copyright (c) 2009, Marin Dacos, Bruno Cénou, Pierre-Alain Mignot, Inès Secondat de Montesquieu, Jean-François Rivière
29 * Home page: http://www.lodel.org
31 * E-Mail: lodel@lodel.org
35 * This program is free software; you can redistribute it and/or modify
36 * it under the terms of the GNU General Public License as published by
37 * the Free Software Foundation; either version 2 of the License, or
38 * (at your option) any later version.
40 * This program is distributed in the hope that it will be useful,
41 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43 * GNU General Public License for more details.
45 * You should have received a copy of the GNU General Public License
46 * along with this program; if not, write to the Free Software
47 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
49 * @author Ghislain Picard
51 * @author Pierre-Alain Mignot
52 * @copyright 2001-2002, Ghislain Picard, Marin Dacos
53 * @copyright 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
54 * @copyright 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
55 * @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
56 * @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
57 * @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
58 * @copyright 2008, Marin Dacos, Bruno Cénou, Pierre-Alain Mignot, Inès Secondat de Montesquieu, Jean-François Rivière
59 * @copyright 2009, Marin Dacos, Bruno Cénou, Pierre-Alain Mignot, Inès Secondat de Montesquieu, Jean-François Rivière
60 * @licence http://www.gnu.org/copyleft/gpl.html
62 * @package lodel/source
65 require 'siteconfig.php';
69 //gestion de l'authentification
73 // record the url if logged
74 if (C
::get('visitor', 'lodeluser')) {
78 if(!C
::get('debugMode', 'cfg') && !C
::get('visitor', 'lodeluser'))
80 if(View
::getView()->renderIfCacheIsValid()) exit();
83 $accepted_logic = array();
86 if ($do = C
::get('do'))
88 if ($do === 'edit' ||
$do === 'view')
90 // check for the right to change this document
91 if (!($idtype = C
::get('idtype'))) {
92 trigger_error('ERROR: idtype must be given', E_USER_ERROR
);
94 defined('INC_CONNECT') ||
include 'connect.php'; // init DB if not already done
95 $vo = DAO
::getDAO('types')->find("id='{$idtype}' and public>0 and status>0");
97 trigger_error("ERROR: you are not allowed to add this kind of document", E_USER_ERROR
);
100 if(!C
::get('editor', 'lodeluser'))
102 $lodeluser['temporary'] = true
;
103 $lodeluser['rights'] = LEVEL_REDACTOR
; // grant temporary
104 $lodeluser['visitor'] = 1;
105 $lodeluser['groups'] = 1;
106 $lodeluser['editor'] = 0;
107 $lodeluser['redactor'] = 1;
108 $lodeluser['admin'] = 0;
109 $lodeluser['adminlodel'] = 0;
110 $GLOBALS['nodesk'] = true
;
111 C
::setUser($lodeluser);
113 $_REQUEST['clearcache'] = false
;
114 C
::set('nocache', false
);
116 $accepted_logic = array('entities_edition');
117 C
::set('lo', 'entities_edition');
118 $called_logic = 'entities_edition';
119 } elseif('_' === $do{0}) {
120 $accepted_logic = array('plugins');
121 C
::set('lo', 'plugins');
123 trigger_error('ERROR: unknown action', E_USER_ERROR
);
127 Controller
::getController()->execute($accepted_logic, $called_logic);
130 catch(LodelException
$e)
132 echo $e->getContent();