PageRenderTime 3ms CodeModel.GetById 22ms app.highlight 21ms RepoModel.GetById 1ms app.codeStats 1ms

/manager/index.php

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