PageRenderTime 51ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/manager/index.php

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