PageRenderTime 52ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/manager/index.php

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