PageRenderTime 4ms CodeModel.GetById 21ms app.highlight 34ms RepoModel.GetById 3ms app.codeStats 0ms

/manager/index.php

http://modx-ja.googlecode.com/
PHP | 936 lines | 563 code | 44 blank | 329 comment | 42 complexity | 197b64f248a2379e3d9e35d887db9bf0 MD5 | raw file
  1<?php
  2/*
  3*************************************************************************
  4    MODx Content Management System and PHP Application Framework
  5    Managed and maintained by Raymond Irving, Ryan Thrash and the
  6    MODx community
  7*************************************************************************
  8    MODx is an opensource PHP/MySQL content management system and content
  9    management framework that is flexible, adaptable, supports XHTML/CSS
 10    layouts, and works with most web browsers, including Safari.
 11
 12    MODx is distributed under the GNU General Public License
 13*************************************************************************
 14
 15    MODx CMS and Application Framework ("MODx")
 16    Copyright 2005 and forever thereafter by Raymond Irving & Ryan Thrash.
 17    All rights reserved.
 18
 19    This file and all related or dependant files distributed with this filie
 20    are considered as a whole to make up MODx.
 21
 22    MODx is free software; you can redistribute it and/or modify
 23    it under the terms of the GNU General Public License as published by
 24    the Free Software Foundation; either version 2 of the License, or
 25    (at your option) any later version.
 26
 27    MODx is distributed in the hope that it will be useful,
 28    but WITHOUT ANY WARRANTY; without even the implied warranty of
 29    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 30    GNU General Public License for more details.
 31
 32    You should have received a copy of the GNU General Public License
 33    along with MODx (located in "/assets/docs/"); if not, write to the Free Software
 34    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 35
 36    For more information on MODx please visit http://modx.com/
 37
 38**************************************************************************
 39    Originally based on Etomite by Alex Butter
 40**************************************************************************
 41*/
 42
 43
 44/**
 45 *  Filename: manager/index.php
 46 *  Function: This file is the main root file for MODx. It is
 47 *          only file that will be directly requested, and
 48 *          depending on the request, will branch different
 49 *          content
 50 */
 51
 52// get start time
 53$mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime;
 54
 55define("IN_MANAGER_MODE", "true");  // we use this to make sure files are accessed through
 56                                    // the manager instead of seperately.
 57
 58// harden it
 59require_once('./includes/protect.inc.php');
 60
 61// send anti caching headers
 62header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
 63header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
 64header("Cache-Control: no-store, no-cache, must-revalidate");
 65header("Cache-Control: post-check=0, pre-check=0", false);
 66header("Pragma: no-cache");
 67header("X-UA-Compatible: IE=edge;FF=3;OtherUA=4");
 68
 69// set error reporting
 70error_reporting(E_ALL & ~E_NOTICE);
 71
 72// check PHP version. MODX Evolution is compatible with php 4 (4.4.2+)
 73$php_ver_comp =  version_compare(phpversion(), "4.4.2");
 74        // -1 if left is less, 0 if equal, +1 if left is higher
 75if($php_ver_comp < 0) {
 76    echo sprintf($_lang['php_version_check'], phpversion());
 77    exit;
 78}
 79
 80// set some runtime options
 81$incPath = str_replace("\\","/",dirname(__FILE__)."/includes/"); // Mod by Raymond
 82set_include_path(get_include_path() . PATH_SEPARATOR . $incPath);
 83
 84if (version_compare(phpversion(), "5.3") < 0) {
 85    @set_magic_quotes_runtime(0);
 86
 87}
 88// include_once the magic_quotes_gpc workaround
 89if(get_magic_quotes_gpc()) include_once "quotes_stripper.inc.php";
 90
 91if (!defined("ENT_COMPAT")) define("ENT_COMPAT", 2);
 92if (!defined("ENT_NOQUOTES")) define("ENT_NOQUOTES", 0);
 93if (!defined("ENT_QUOTES")) define("ENT_QUOTES", 3);
 94
 95// set the document_root :|
 96if(!isset($_SERVER["DOCUMENT_ROOT"]) || empty($_SERVER["DOCUMENT_ROOT"])) {
 97    $_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PATH_INFO"], "", preg_replace("/\\\\/", "/", $_SERVER["PATH_TRANSLATED"]))."/";
 98}
 99
100define("IN_ETOMITE_SYSTEM", "true"); // for backward compatibility with 0.6
101
102// include_once config file
103$config_filename = "./includes/config.inc.php";
104if (!file_exists($config_filename)) {
105    echo "<h3>Unable to load configuration settings</h3>";
106    echo "Please run the MODx <a href='../install/index.php?action=mode'>install utility</a>";
107    exit;
108}
109
110// include the database configuration file
111include_once "config.inc.php";
112
113// initiate the content manager class
114include_once "document.parser.class.inc.php";
115$modx = new DocumentParser;
116$modx->loadExtension("ManagerAPI");
117$modx->getSettings();
118$etomite = &$modx; // for backward compatibility
119
120// connect to the database
121if(@!$modxDBConn = mysql_connect($database_server, $database_user, $database_password)) {
122    die("<h2>Failed to create the database connection!</h2>. Please run the MODx <a href='../install/index.php?action=mode'>install utility</a>");
123} else {
124    mysql_select_db(str_replace('`', '', $dbase));
125    @mysql_query("{$database_connection_method} {$database_connection_charset}");
126}
127
128// start session
129startCMSSession();
130
131// get the settings from the database
132include_once "settings.inc.php";
133
134// get the user settings from the database
135include_once "user_settings.inc.php";
136
137// include_once the language file
138if(!isset($manager_language)) {
139    $manager_language = "english"; // if not set, get the english language file.
140}
141$_lang = array();
142include_once "lang/english.inc.php";
143$length_eng_lang = count($_lang);
144
145if($manager_language!="english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) {
146    include_once "lang/".$manager_language.".inc.php";
147}
148
149// send the charset header
150header('Content-Type: text/html; charset='.$modx_manager_charset);
151
152// include version info
153include_once "version.inc.php";
154
155// accesscontrol.php checks to see if the user is logged in. If not, a log in form is shown
156include_once "accesscontrol.inc.php";
157
158// double check the session
159if(!isset($_SESSION['mgrValidated'])){
160    echo "Not Logged In!";
161    exit;
162}
163
164// include_once the style variables file
165if(isset($manager_theme) && !isset($_style)) {
166    $_style = array();
167    include_once "media/style/".$manager_theme."/style.php";
168}
169
170// check if user is allowed to access manager interface
171if(isset($allow_manager_access) && $allow_manager_access==0) {
172    include_once "manager.lockout.inc.php";
173}
174
175// include_once the error handler
176include_once "error.class.inc.php";
177$e = new errorHandler;
178
179// Initialize System Alert Message Queque
180if (!isset($_SESSION['SystemAlertMsgQueque'])) $_SESSION['SystemAlertMsgQueque'] = array();
181$SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
182
183// first we check to see if this is a frameset request
184if(!isset($_POST['a']) && !isset($_GET['a']) && ($e->getError()==0) && !isset($_POST['updateMsgCount'])) {
185    // this looks to be a top-level frameset request, so let's serve up a frameset
186    include_once "frames/1.php";
187    exit;
188}
189
190// OK, let's retrieve the action directive from the request
191if(isset($_GET['a']) && isset($_POST['a'])) {
192    $e->setError(100);
193    $e->dumpError();
194    // set $e to a corresponding errorcode
195    // we know that if an error occurs here, something's wrong,
196    // so we dump the error, thereby stopping the script.
197
198} else {
199    $action= (int) $_REQUEST['a'];
200}
201
202if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) {
203    include_once 'messageCount.inc.php';
204}
205
206// save page to manager object
207$modx->manager->action = $action;
208
209// attempt to foil some simple types of CSRF attacks
210if (isset($modx->config['validate_referer']) && intval($modx->config['validate_referer'])) {
211    if (isset($_SERVER['HTTP_REFERER'])) {
212        $referer = $_SERVER['HTTP_REFERER'];
213
214        if (!empty($referer)) {
215            if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) {
216                echo "A possible CSRF attempt was detected from referer: {$referer}.";
217                exit();
218            }
219        } else {
220            echo "A possible CSRF attempt was detected. No referer was provided by the client.";
221            exit();
222        }
223    } else {
224        echo "A possible CSRF attempt was detected. No referer was provided by the server.";
225        exit();
226    }
227}
228
229// invoke OnManagerPageInit event
230$modx->invokeEvent("OnManagerPageInit", array("action" => $action));
231
232
233// Now we decide what to do according to the action request. This is a BIG list :)
234switch ($action) {
235/********************************************************************/
236/* frame management - show the requested frame                      */
237/********************************************************************/
238    case 1 :
239        // get the requested frame
240        $frame = preg_replace('/[^a-z0-9]/i','',$_REQUEST['f']);
241        if($frame>9) {
242            $enable_debug=false;    // this is to stop the debug thingy being attached to the framesets
243        }
244        include_once "frames/".$frame.".php";
245    break;
246/********************************************************************/
247/* show the homepage                                                */
248/********************************************************************/
249    case 2:
250        // get the home page
251        include_once "header.inc.php";
252        include_once "actions/welcome.static.php";
253        include_once "footer.inc.php";
254    break;
255/********************************************************************/
256/* document data                                                    */
257/********************************************************************/
258    case 3:
259        // get the page to show document's data
260        include_once "header.inc.php";
261        include_once "actions/document_data.static.php";
262        include_once "footer.inc.php";
263    break;
264/********************************************************************/
265/* content management                                               */
266/********************************************************************/
267    case 85:
268        // get the mutate page for adding a folder
269        include_once "header.inc.php";
270        include_once "actions/mutate_content.dynamic.php";
271        include_once "footer.inc.php";
272    break;
273    case 27:
274        // get the mutate page for changing content
275        include_once "header.inc.php";
276        include_once "actions/mutate_content.dynamic.php";
277        include_once "footer.inc.php";
278    break;
279    case 4:
280        // get the mutate page for adding content
281        include_once "header.inc.php";
282        include_once "actions/mutate_content.dynamic.php";
283        include_once "footer.inc.php";
284    break;
285    case 5:
286        // get the save processor
287        include_once "processors/save_content.processor.php";
288    break;
289    case 6:
290        // get the delete processor
291        include_once "processors/delete_content.processor.php";
292    break;
293    case 63:
294        // get the undelete processor
295        include_once "processors/undelete_content.processor.php";
296    break;
297    case 51:
298        // get the move action
299        include_once "header.inc.php";
300        include_once "actions/move_document.dynamic.php";
301        include_once "footer.inc.php";
302    break;
303    case 52:
304        // get the move document processor
305        include_once "processors/move_document.processor.php";
306    break;
307    case 61:
308        // get the processor for publishing content
309        include_once "processors/publish_content.processor.php";
310    break;
311    case 62:
312        // get the processor for publishing content
313        include_once "processors/unpublish_content.processor.php";
314    break;
315/********************************************************************/
316/* show the wait page - gives the tree time to refresh (hopefully)  */
317/********************************************************************/
318    case 7:
319        // get the wait page (so the tree can reload)
320        include_once "header.inc.php";
321        include_once "actions/wait.static.php";
322        include_once "footer.inc.php";
323    break;
324/********************************************************************/
325/* let the user log out                                             */
326/********************************************************************/
327    case 8:
328        // get the logout processor
329        include_once "processors/logout.processor.php";
330    break;
331/********************************************************************/
332/* user management                                                  */
333/********************************************************************/
334    case 87:
335        // get the new web user page
336        include_once "header.inc.php";
337        include_once "actions/mutate_web_user.dynamic.php";
338        include_once "footer.inc.php";
339    break;
340    case 88:
341        // get the edit web user page
342        include_once "header.inc.php";
343        include_once "actions/mutate_web_user.dynamic.php";
344        include_once "footer.inc.php";
345    break;
346    case 89:
347        // get the save web user processor
348        include_once "processors/save_web_user.processor.php";
349    break;
350    case 90:
351        // get the delete web user page
352        include_once "processors/delete_web_user.processor.php";
353    break;
354    case 11:
355        // get the new user page
356        include_once "header.inc.php";
357        include_once "actions/mutate_user.dynamic.php";
358        include_once "footer.inc.php";
359    break;
360    case 12:
361        // get the edit user page
362        include_once "header.inc.php";
363        include_once "actions/mutate_user.dynamic.php";
364        include_once "footer.inc.php";
365    break;
366    case 32:
367        // get the save user processor
368        include_once "processors/save_user.processor.php";
369    break;
370    case 28:
371        // get the change password page
372        include_once "header.inc.php";
373        include_once "actions/mutate_password.dynamic.php";
374        include_once "footer.inc.php";
375    break;
376    case 34:
377        // get the save new password page
378        include_once "processors/save_password.processor.php";
379    break;
380    case 33:
381        // get the delete user page
382        include_once "processors/delete_user.processor.php";
383    break;
384/********************************************************************/
385/* role management                                                  */
386/********************************************************************/
387    case 38:
388        // get the new role page
389        include_once "header.inc.php";
390        include_once "actions/mutate_role.dynamic.php";
391        include_once "footer.inc.php";
392    break;
393    case 35:
394        // get the edit role page
395        include_once "header.inc.php";
396        include_once "actions/mutate_role.dynamic.php";
397        include_once "footer.inc.php";
398    break;
399    case 36:
400        // get the save role page
401        include_once "processors/save_role.processor.php";
402    break;
403    case 37:
404        // get the delete role page
405        include_once "processors/delete_role.processor.php";
406    break;
407/********************************************************************/
408/* template management                                              */
409/********************************************************************/
410    case 16:
411        // get the edit template action
412        include_once "header.inc.php";
413        include_once "actions/mutate_templates.dynamic.php";
414        include_once "footer.inc.php";
415    break;
416    case 19:
417        // get the new template action
418        include_once "header.inc.php";
419        include_once "actions/mutate_templates.dynamic.php";
420        include_once "footer.inc.php";
421    break;
422    case 20:
423        // get the save processor
424        include_once "processors/save_template.processor.php";
425    break;
426    case 21:
427        // get the delete processor
428        include_once "processors/delete_template.processor.php";
429    break;
430    case 96:
431        // get the duplicate template processor
432        include_once "processors/duplicate_template.processor.php";
433    break;
434    case 117:
435        // change the tv rank for selected template
436        //include_once "header.inc.php"; - in action file
437        include_once "actions/mutate_template_tv_rank.dynamic.php";
438        include_once "footer.inc.php";
439        break;
440/********************************************************************/
441/* snippet management                                               */
442/********************************************************************/
443    case 22:
444        // get the edit snippet action
445        include_once "header.inc.php";
446        include_once "actions/mutate_snippet.dynamic.php";
447        include_once "footer.inc.php";
448    break;
449    case 23:
450        // get the new snippet action
451        include_once "header.inc.php";
452        include_once "actions/mutate_snippet.dynamic.php";
453        include_once "footer.inc.php";
454    break;
455    case 24:
456        // get the save processor
457        include_once "processors/save_snippet.processor.php";
458    break;
459    case 25:
460        // get the delete processor
461        include_once "processors/delete_snippet.processor.php";
462    break;
463    case 98:
464        // get the duplicate processor
465        include_once "processors/duplicate_snippet.processor.php";
466    break;
467/********************************************************************/
468/* htmlsnippet management                                               */
469/********************************************************************/
470    case 78:
471        // get the edit snippet action
472        include_once "header.inc.php";
473        include_once "actions/mutate_htmlsnippet.dynamic.php";
474        include_once "footer.inc.php";
475    break;
476    case 77:
477        // get the new snippet action
478        include_once "header.inc.php";
479        include_once "actions/mutate_htmlsnippet.dynamic.php";
480        include_once "footer.inc.php";
481    break;
482    case 79:
483        // get the save processor
484        include_once "processors/save_htmlsnippet.processor.php";
485    break;
486    case 80:
487        // get the delete processor
488        include_once "processors/delete_htmlsnippet.processor.php";
489    break;
490    case 97:
491        // get the duplicate processor
492        include_once "processors/duplicate_htmlsnippet.processor.php";
493    break;
494/********************************************************************/
495/* show the credits page                                            */
496/********************************************************************/
497    case 18:
498        // get the credits page
499        include_once "header.inc.php";
500        include_once "actions/credits.static.php";
501        include_once "footer.inc.php";
502    break;
503/********************************************************************/
504/* empty cache & synchronisation                                    */
505/********************************************************************/
506    case 26:
507        // get the cache emptying processor
508        include_once "header.inc.php";
509        include_once "actions/refresh_site.dynamic.php";
510        include_once "footer.inc.php";
511    break;
512/********************************************************************/
513/* Module management                                                */
514/********************************************************************/
515    case 106:
516        // get module management
517        include_once "header.inc.php";
518        include_once "actions/modules.static.php";
519        include_once "footer.inc.php";
520    break;
521    case 107:
522        // get the new module action
523        include_once "header.inc.php";
524        include_once "actions/mutate_module.dynamic.php";
525        include_once "footer.inc.php";
526    break;
527    case 108:
528        // get the edit module action
529        include_once "header.inc.php";
530        include_once "actions/mutate_module.dynamic.php";
531        include_once "footer.inc.php";
532    break;
533    case 109:
534        // get the save processor
535        include_once "processors/save_module.processor.php";
536    break;
537    case 110:
538        // get the delete processor
539        include_once "processors/delete_module.processor.php";
540    break;
541    case 111:
542        // get the duplicate processor
543        include_once "processors/duplicate_module.processor.php";
544    break;
545    case 112:
546        // execute/run the module
547        //include_once "header.inc.php";
548        include_once "processors/execute_module.processor.php";
549        //include_once "footer.inc.php";
550        break;
551    case 113:
552        // get the module resources (dependencies) action
553        include_once "header.inc.php";
554        include_once "actions/mutate_module_resources.dynamic.php";
555        include_once "footer.inc.php";
556    break;
557/********************************************************************/
558/* plugin management                                                */
559/********************************************************************/
560    case 100:
561        // change the plugin priority
562        //include_once "header.inc.php"; - in action file
563        include_once "actions/mutate_plugin_priority.dynamic.php";
564        include_once "footer.inc.php";
565    break;
566    case 101:
567        // get the new plugin action
568        include_once "header.inc.php";
569        include_once "actions/mutate_plugin.dynamic.php";
570        include_once "footer.inc.php";
571    break;
572    case 102:
573        // get the edit plugin action
574        include_once "header.inc.php";
575        include_once "actions/mutate_plugin.dynamic.php";
576        include_once "footer.inc.php";
577    break;
578    case 103:
579        // get the save processor
580        include_once "processors/save_plugin.processor.php";
581    break;
582    case 104:
583        // get the delete processor
584        include_once "processors/delete_plugin.processor.php";
585    break;
586    case 105:
587        // get the duplicate processor
588        include_once "processors/duplicate_plugin.processor.php";
589    break;
590/********************************************************************/
591/* view phpinfo                                                     */
592/********************************************************************/
593    case 200:
594        // show phpInfo
595        if($modx->hasPermission('logs')) {
596        include_once "header.inc.php";
597        include_once "actions/phpinfo.static.php";
598        include_once "footer.inc.php";
599        }
600    break;
601/********************************************************************/
602/* errorpage                                            */
603/********************************************************************/
604    case 29:
605        // get the error page
606        include_once "actions/error_dialog.static.php";
607    break;
608/********************************************************************/
609/* file manager                                                     */
610/********************************************************************/
611    case 31:
612        // get the page to manage files
613        include_once "header.inc.php";
614        include_once "actions/files.dynamic.php";
615        include_once "footer.inc.php";
616    break;
617/********************************************************************/
618/* access permissions                                               */
619/********************************************************************/
620    case 40:
621        include_once "header.inc.php";
622        include_once "actions/access_permissions.dynamic.php";
623        include_once "footer.inc.php";
624    break;
625    case 91:
626        include_once "header.inc.php";
627        include_once "actions/web_access_permissions.dynamic.php";
628        include_once "footer.inc.php";
629    break;
630/********************************************************************/
631/* access groups processor                                          */
632/********************************************************************/
633    case 41:
634        include_once "processors/access_groups.processor.php";
635    break;
636    case 92:
637        include_once "processors/web_access_groups.processor.php";
638    break;
639/********************************************************************/
640/* settings editor                                                  */
641/********************************************************************/
642    case 17:
643        // get the settings editor
644        include_once "header.inc.php";
645        include_once "actions/mutate_settings.dynamic.php";
646        include_once "footer.inc.php";
647    break;
648    case 118:
649        // call settings ajax include
650        ob_clean();
651        include_once "includes/mutate_settings.ajax.php";
652    break;
653/********************************************************************/
654/* save settings                                                    */
655/********************************************************************/
656    case 30:
657        // get the save settings processor
658        include_once "processors/save_settings.processor.php";
659    break;
660/********************************************************************/
661/* system information                                               */
662/********************************************************************/
663    case 53:
664        // get the settings editor
665        include_once "header.inc.php";
666        include_once "actions/sysinfo.static.php";
667        include_once "footer.inc.php";
668    break;
669/********************************************************************/
670/* optimise table                                               */
671/********************************************************************/
672    case 54:
673        // get the table optimizer/truncate processor
674        include_once "processors/optimize_table.processor.php";
675    break;
676/********************************************************************/
677/* view logging                                                     */
678/********************************************************************/
679    case 13:
680        // view logging
681        include_once "header.inc.php";
682        include_once "actions/logging.static.php";
683        include_once "footer.inc.php";
684    break;
685/********************************************************************/
686/* empty logs                                                       */
687/********************************************************************/
688    case 55:
689        // get the settings editor
690        include_once "processors/empty_table.processor.php";
691    break;
692/********************************************************************/
693/* calls test page                                                      */
694/********************************************************************/
695    case 999:
696        // get the test page
697        include_once "header.inc.php";
698        include_once "test_page.php";
699        include_once "footer.inc.php";
700    break;
701/********************************************************************/
702/* Empty recycle bin                                                */
703/********************************************************************/
704    case 64:
705        // get the Recycle bin emptier
706        include_once "processors/remove_content.processor.php";
707    break;
708/********************************************************************/
709/* Messages                                                     */
710/********************************************************************/
711    case 10:
712        // get the messages page
713        include_once "header.inc.php";
714        include_once "actions/messages.static.php";
715        include_once "footer.inc.php";
716    break;
717/********************************************************************/
718/* Delete a message                                                 */
719/********************************************************************/
720    case 65:
721        // get the message deleter
722        include_once "processors/delete_message.processor.php";
723    break;
724/********************************************************************/
725/* Send a message                                                   */
726/********************************************************************/
727    case 66:
728        // get the message deleter
729        include_once "processors/send_message.processor.php";
730    break;
731/********************************************************************/
732/* Remove locks                                                 */
733/********************************************************************/
734    case 67:
735        // get the lock remover
736        include_once "processors/remove_locks.processor.php";
737    break;
738/********************************************************************/
739/* Site schedule                                                    */
740/********************************************************************/
741    case 70:
742        // get the schedule page
743        include_once "header.inc.php";
744        include_once "actions/site_schedule.static.php";
745        include_once "footer.inc.php";
746    break;
747/********************************************************************/
748/* Search                                                           */
749/********************************************************************/
750    case 71:
751        // get the search page
752        include_once "header.inc.php";
753        include_once "actions/search.static.php";
754        include_once "footer.inc.php";
755    break;
756/********************************************************************/
757/* About                                                            */
758/********************************************************************/
759    case 59:
760        // get the about page
761        include_once "header.inc.php";
762        include_once "actions/about.static.php";
763        include_once "footer.inc.php";
764    break;
765/********************************************************************/
766/* Add weblink                                                          */
767/********************************************************************/
768    case 72:
769        // get the weblink page
770        include_once "header.inc.php";
771        include_once "actions/mutate_content.dynamic.php";
772        include_once "footer.inc.php";
773    break;
774/********************************************************************/
775/* User management                                                  */
776/********************************************************************/
777    case 75:
778        include_once "header.inc.php";
779        include_once "actions/user_management.static.php";
780        include_once "footer.inc.php";
781    break;
782    case 99:
783        include_once "header.inc.php";
784        include_once "actions/web_user_management.static.php";
785        include_once "footer.inc.php";
786    break;
787    case 86:
788        include_once "header.inc.php";
789        include_once "actions/role_management.static.php";
790        include_once "footer.inc.php";
791    break;
792/********************************************************************/
793/* template/ snippet management                                                 */
794/********************************************************************/
795    case 76:
796        include_once "header.inc.php";
797        include_once "actions/resources.static.php";
798        include_once "footer.inc.php";
799    break;
800/********************************************************************/
801/* keywords management                                              */
802/********************************************************************/
803    case 81:
804        include_once "header.inc.php";
805        include_once "actions/manage_metatags.dynamic.php";
806        include_once "footer.inc.php";
807    break;
808    case 82:
809        include_once "processors/metatags.processor.php";
810    break;
811/********************************************************************/
812/* Export to file                                                   */
813/********************************************************************/
814    case 83:
815        include_once "header.inc.php";
816        include_once "actions/export_site.static.php";
817        include_once "footer.inc.php";
818    break;
819/********************************************************************/
820/* Resource Selector                                                    */
821/********************************************************************/
822    case 84:
823        include_once "actions/resource_selector.static.php";
824    break;
825/********************************************************************/
826/* Backup Manager                                                   */
827/********************************************************************/
828    case 93:
829        # header and footer will be handled interally
830        include_once "actions/bkmanager.static.php";
831    break;
832/********************************************************************/
833/* Duplicate Document                                                   */
834/********************************************************************/
835    case 94:
836        // get the duplicate processor
837        include_once "processors/duplicate_content.processor.php";
838    break;
839/********************************************************************/
840/* Import Document from file                                        */
841/********************************************************************/
842    case 95:
843        include_once "header.inc.php";
844        include_once "actions/import_site.static.php";
845        include_once "footer.inc.php";
846    break;
847/********************************************************************/
848/* Help                                                             */
849/********************************************************************/
850    case 9:
851        // get the help page
852        include_once "header.inc.php";
853        include_once "actions/help.static.php";
854        include_once "footer.inc.php";
855    break;
856/********************************************************************/
857/* Template Variables - Based on Apodigm's Docvars                  */
858/********************************************************************/
859    case 300:
860        // get the new document variable action
861        include_once "header.inc.php";
862        include_once "actions/mutate_tmplvars.dynamic.php";
863        include_once "footer.inc.php";
864    break;
865    case 301:
866        // get the edit document variable action
867        include_once "header.inc.php";
868        include_once "actions/mutate_tmplvars.dynamic.php";
869        include_once "footer.inc.php";
870    break;
871    case 302:
872        // get the save processor
873        include_once "processors/save_tmplvars.processor.php";
874    break;
875    case 303:
876        // get the delete processor
877        include_once "processors/delete_tmplvars.processor.php";
878    break;
879    case 304:
880        // get the duplicate processor
881        include_once "processors/duplicate_tmplvars.processor.php";
882    break;
883
884/********************************************************************/
885/* Event viewer: show event message log                             */
886/********************************************************************/
887    case 114:
888        // get event logs
889        include_once "header.inc.php";
890        include_once "actions/eventlog.dynamic.php";
891        include_once "footer.inc.php";
892    break;
893    case 115:
894        // get event log details viewer
895        include_once "header.inc.php";
896        include_once "actions/eventlog_details.dynamic.php";
897        include_once "footer.inc.php";
898    break;
899    case 116:
900        // get the event log delete processor
901        include_once "processors/delete_eventlog.processor.php";
902    break;
903
904    case 501:
905        //delete category
906        include_once "processors/delete_category.processor.php";
907    break;
908/********************************************************************/
909/* default action: show not implemented message                     */
910/********************************************************************/
911    default :
912        // say that what was requested doesn't do anything yet
913        include_once "header.inc.php";
914        echo "
915            <div class='subTitle'>
916                <span class='right'>".$_lang['functionnotimpl']."</span>
917            </div>
918            <div class='sectionHeader'>".$_lang['functionnotimpl']."</div>
919			<div class='sectionBody'>
920                <p>".$_lang['functionnotimpl_message']."</p>
921            </div>
922        ";
923        include_once "footer.inc.php";
924}
925
926/********************************************************************/
927// log action, unless it's a frame request
928if($action!=1 && $action!=7 && $action!=2) {
929    include_once "log.class.inc.php";
930    $log = new logHandler;
931    $log->initAndWriteLog();
932}
933/********************************************************************/
934// show debug
935unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
936include_once "debug.inc.php";