MCMS
[ class tree: MCMS ] [ index: MCMS ] [ all elements ]

Source for file do.php

Documentation is available at do.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | MCMS: a PHP Content Management System for creating accessible sites. |
  5. // | Copyright (C) 2005  Silvio Moioli                                    |
  6. // |                                                                      |
  7. // | This program is free software; you can redistribute it and/or modify |
  8. // | it under the terms of the GNU General Public License as published by |
  9. // | the Free Software Foundation; either version 2 of the License, or    |
  10. // | (at your option) any later version.                                  |
  11. // |                                                                      |
  12. // | This program is distributed in the hope that it will be useful,      |
  13. // | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
  14. // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
  15. // | GNU General Public License for more details.                         |
  16. // |                                                                      |
  17. // | You should have received a copy of the GNU General Public License    |
  18. // | along with this program; if not, write to the Free Software          |
  19. // | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 |
  20. // +----------------------------------------------------------------------+
  21. // | Authors: Silvio Moioli <silvio at moioli dot net> www.moioli.net     |
  22. // +----------------------------------------------------------------------+
  23. //
  24. //$Id:
  25.         require_once $_SERVER["DOCUMENT_ROOT"]."/admin/lib/controller/all.inc";
  26.     
  27.     //Inizializzazione delle variabili
  28.         $get array();
  29.     if (isset($_GET)){
  30.         $get $_GET;
  31.     }
  32.     $post array();
  33.     if (isset($_POST)){
  34.         $post $_POST;
  35.     }
  36.     $engine new Engine();
  37.     $authManager new AuthManager($engine);
  38.     $validator new Validator($engine,$authManager);
  39.     $dispatcher new Dispatcher($engine,$authManager);
  40.     $compiler new Compiler();
  41.     
  42.     //Gestione dell'ActionEvent (se presente) 
  43.         if (array_key_exists("action"$get)){
  44.         $event new ActionEvent($engine$get$post);
  45.         $result null;
  46.         if ($validator->validate($event$result)){
  47.             //Tutto bene, gestisco
  48.                         $dispatcher->dispatch($event);
  49.         }
  50.         else{
  51.             if (is_a($result,"Author")){
  52.                 //l'autore deve rifare il login
  53.                                 $authManager->reLogin($result);
  54.                 exit();
  55.             }
  56.             elseif (is_a($result,"AdminError")){
  57.                 //si è verificato un errore, notifico
  58.                                 $compiler->display($result);
  59.                 exit();
  60.             }
  61.         }
  62.     }
  63.     
  64.     //Gestione del GoToEvent (se presente) 
  65.         if (array_key_exists("goTo"$get)){
  66.         $event new GoToEvent($engine$get$post);
  67.         $result null;
  68.         if ($validator->validate($event$result)){
  69.             //Tutto bene, gestisco
  70.                         $dispatcher->dispatch($event);
  71.         }
  72.         else{
  73.             if (is_a($result,"Author")){
  74.                 //l'autore deve rifare il login
  75.                                 $authManager->reLogin($result);
  76.                 exit();
  77.             }
  78.             elseif (is_a($result,"AdminError")){
  79.                 //si è verificato un errore, notifico
  80.                                 $compiler->display($result);
  81.  
  82.             }
  83.         }
  84.     }
  85.     
  86.     $engine->disconnect();
  87. ?>

Documentation generated on Wed, 26 Jul 2006 21:44:53 +0200 by phpDocumentor 1.3.0RC6