PageRenderTime 36ms CodeModel.GetById 2ms app.highlight 27ms RepoModel.GetById 1ms app.codeStats 1ms

/manager/index.php

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