Source for file action.php

Documentation is available at action.php

  1. <?
  2. /**
  3. * action.php
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. * @package generator
  14. * @author Stephan Raabe
  15. */
  16.  
  17. // Logging START
  18. if (isAdmin())
  19. {
  20. if (isset($_POST["action"]))
  21. {
  22. writeLog($_SESSION["account_email"],$_POST["action"],$page["page_path"]);
  23. }
  24. if (isset($_GET["action"]))
  25. {
  26. writeLog($_SESSION["account_email"],$_GET["action"],$page["page_path"]);
  27. }
  28. }
  29.  
  30. if (isset($_POST["action"]))
  31. {
  32. switch ($_POST["action"]) {
  33. case "login":
  34. if (!login($_POST["account_email"],$_POST["account_password"],$_POST["page_path"]))
  35. {
  36. $admin_lang["profile"][1] = $admin_lang["profile"][2];
  37. }
  38. else
  39. {
  40. if ($_POST["page_path"] != $page["page_path"])
  41. {
  42. $path_redirect = $_POST["page_path"];
  43. }
  44. else
  45. {
  46. $path_redirect = $page["page_path"];
  47. }
  48. ?>
  49. <script language="javascript">
  50. location.href = "website.php?id=<?= $path_redirect; ?>";
  51. </script>
  52. <?
  53. }
  54. break;
  55. case "loginInt":
  56. if (!loginInt($_POST["account_email"],$_POST["account_password"],$_POST["page_path"]))
  57. {
  58. $admin_lang["profile"][1] = $admin_lang["profile"][2];
  59. }
  60. break;
  61.  
  62. case "logout": logout($_POST["page_path"]);
  63. break;
  64.  
  65. case "logoutInt": logoutInt($_POST["page_path"]);
  66. break;
  67.  
  68. case "newaccount":
  69. if ((isset($_POST["account_info"])) && ($_POST["account_info"] != ""))
  70. {
  71. $accountn_info = 1;
  72. }
  73. else
  74. {
  75. $accountn_info = 0;
  76. }
  77. if (isset($_POST["redirect"]))
  78. {
  79. $link_redirect = $_POST["redirect"];
  80. }
  81. else
  82. {
  83. $link_redirect = $site_home;
  84. }
  85. newAccountExt($_POST["account_firstname"],$_POST["account_lastname"],$_POST["account_telefon"],$_POST["account_company"],$_POST["account_homepage"],$_POST["account_email"],$_POST["account_password"],$accountn_info,$account_register,$link_redirect);
  86. break;
  87.  
  88. case "getaccount": getAccountExt($_POST["account_email"]);
  89. break;
  90.  
  91. case "deleteaccount":
  92. if (($_SESSION["account_group"] > 0) && ($_SESSION["account_key"] == $_POST["account_key"]))
  93. {
  94. deleteAccountExt($_POST["account_email"],$_POST["account_key"]);
  95. }
  96. break;
  97.  
  98. case "updateaccount":
  99. if (($_SESSION["account_group"] > 0) && ($_SESSION["account_key"] == $_POST["account_key"]))
  100. {
  101. if (isset($_POST["account_info"]))
  102. {
  103. $accountn_info = 1;
  104. }
  105. else
  106. {
  107. $accountn_info = 0;
  108. }
  109. updateAccountExt($_POST["account_firstname"],$_POST["account_lastname"],$_POST["account_telefon"],$_POST["account_company"],$_POST["account_homepage"],$_POST["account_email"],$_POST["account_emailnew"],$_POST["account_password"],$_POST["account_key"],$_POST["account_lang"],$accountn_info);
  110. }
  111. break;
  112. }
  113.  
  114. if (isset($_POST["action"]))
  115. {
  116. if (isAdmin())
  117. {
  118. switch ($_POST["action"])
  119. {
  120. case "settings": updateSettings($_POST["page_key"],$_POST["site_name"],$_POST["site_admin"],$_POST["site_home"],$_POST["site_url"],$_POST["lang_default"],$_POST["account_register"],$_POST["pool_path"],$_POST["site_staging"],$_POST["author_release"],$_POST["author_profile"],$_POST["site_static"],$_POST["author_export"],$_POST["site_help"],$_POST["menu_top"],$_POST["site_encoding"],$_POST["nl_timer"],$_POST["nl_stepsize"],$_POST["nl_encoding"],$_POST["export_timer"],$_POST["export_stepsize"],$_POST["author_delete"],$_POST["tree_static"],$_POST["check_useragent"],$_POST["log_path"]);break;
  121. case "updatecss": updateCss($_POST["page_key"],$_POST["site_css"]);break;
  122. case "properties": updateProperties($_POST["page_key"],$_POST["page_path"],$_POST["page_path_old"],$_POST["page_extern"],$_POST["page_status"],$_POST["page_headline"],$_POST["page_title"],$_POST["page_keywords"],$_POST["page_description"],$_POST["page_template"],$_POST["page_att1"],$_POST["page_att2"],$_POST["page_navigation"],$_POST["page_date_unformated"],$_POST["page_count"],$_POST["page_start"],$_POST["page_lang"],$_POST["page_lock"]);break;
  123. case "authorization": updateAuthorization($_POST["page_key"],$_POST["page_status"],$_POST["page_lock"],$_POST["page_lockexport"],$_POST["page_access"],$_POST["status_subpages"]);break;
  124. case "addpage": addPage($_POST["page_key"],$_POST["page_pathnew"],$_POST["page_status"],$_POST["page_headline"],$_POST["page_title"],$_POST["page_keywords"],$_POST["page_description"],$_POST["page_template"],$_POST["page_att1"],$_POST["page_att2"],$_POST["page_navigation"],$_POST["page_date"],$_POST["page_date_unformated"]);break;
  125. case "copypage": copyPage($_POST["page_key"],$_POST["page_keynew"]);break;
  126. case "cutpage": cutPage($_POST["page_key"],$_POST["page_keynew"]);break;
  127. case "user": updateUser($_POST["page_key"],$_POST["account_key"],$_POST["account_email"],$_POST["account_password"],$_POST["account_firstname"],$_POST["account_lastname"],$_POST["account_editor"],$_POST["account_menu"]);break;
  128. case "addnewsletter": addNewsletter($_POST["page_key"],$_POST["nl_subject"],$_POST["nl_sender"],$_POST["nl_date"],$_POST["nl_date_unformated"],$_POST["nl_test"],$_POST["nl_text"],$_POST["nl_html"],$_POST["nl_status"]);break;
  129. case "message": sendMessage($_POST["msg_receiver"],$_POST["msg_subject"],$_POST["msg_message"],$_POST["msg_from"]);break;
  130. case "editnewsletter": updateNewsletter($_POST["page_key"],$_POST["nl_multi"],$_POST["nl_subject"],$_POST["nl_sender"],$_POST["nl_date_unformated"],$_POST["nl_test"],$_POST["nl_text"],$_POST["nl_html"],$_POST["nl_status"],$_POST["nl_target"],$_POST["nl_key"]);break;
  131. case "addaccount": addAccount($_POST["page_key"],$_POST["account_email"],$_POST["account_password"],$_POST["account_firstname"],$_POST["account_lastname"],$_POST["account_telefon"],$_POST["account_company"],$_POST["account_group"],$_POST["account_lock"]);break;
  132. case "editaccount": updateAccount($_POST["page_key"],$_POST["account_key"],$_POST["account_email"],$_POST["account_password"],$_POST["account_firstname"],$_POST["account_lastname"],$_POST["account_telefon"],$_POST["account_company"],$_POST["account_homepage"],$_POST["account_group"],$_POST["account_lock"],$_POST["account_info"],$_POST["account_lang"],$_POST["account_editor"],$_POST["account_access"],$_POST["account_menu"]);break;
  133. case "deletepage": deletePage($_POST["page_key"]);break;
  134. case "changes": changesPage($_POST["page_key"]);break;
  135. case "savemenu": saveMenu($_POST["page_key"],$_POST["oemenux"],$_POST["oemenuy"]);break;
  136. case "deletecache": deleteCache($_POST["page_path"]);break;
  137. case "edittemplate": updateTemplate($_POST["page_key"],$_POST["template_key"],$_POST["template_name"],$_POST["template_description"],$_POST["template_select"],$_POST["template_hide"],$_POST["template_short"]);break;
  138. case "release": releasePage($_POST["page_key"],$_POST["block"]);break;
  139. case "edittext": updateText($_POST["page_key"],$_POST["page_edit"],$_POST["page_input"]);break;
  140. case "newdata": addPage($_POST["page_key"],$_POST["page_pathnew"],$_POST["page_status"],$_POST["page_headline"],$_POST["page_headline"],$_POST["page_keywords"],$_POST["page_description"],$_POST["page_template"],$_POST["page_att1"],$_POST["page_att2"],$_POST["page_headline"],$_POST["page_date"],$_POST["page_date_unformated"]);break;
  141. case "navigation": updateNavigation($_POST["page_key"],$_POST["keys"],$_POST["page_hide"]);break;
  142. case "grouporder": updateGroupOrder($_POST["page_key"],$_POST["keys"]);break;
  143. case "delstatistic": delStatistic();break;
  144. case "addTableItem": addTableItem();break;
  145. case "delTableItem": delTableItem();break;
  146. case "editTableItem": editTableItem();break;
  147. case "upload":
  148. if ($_POST["del"] != "true")
  149. {
  150. if ($_POST["page_fileexists"] == "")
  151. {
  152. if (move_uploaded_file($_FILES['upFile']['tmp_name'], $site_pool."/".$_POST["page_key"]."_".$_FILES['upFile']['name']))
  153. {
  154. $reloadkey = get_page_key($page["page_parent"]);
  155. if (isset($_POST["caching"]))
  156. {
  157. updateTextNoCache($_POST["page_key"],$_POST["field"],$_POST["page_key"]."_".$_FILES['upFile']['name']);
  158. }
  159. else
  160. {
  161. updateText($_POST["page_key"],$_POST["field"],$_POST["page_key"]."_".$_FILES['upFile']['name']);
  162. }
  163. }
  164. else
  165. {
  166. ?>
  167. <script language="Javascript">
  168. alert("Upload ERROR!");
  169. </script>
  170. <?
  171. }
  172. }
  173. else
  174. {
  175. updateText($_POST["page_key"],$_POST["field"],$_POST["page_fileexists"]);
  176. }
  177. }
  178. else
  179. {
  180. updateText($_POST["page_key"],$_POST["field"],"");
  181. }
  182. break;
  183. }
  184. }
  185. }
  186. }
  187.  
  188. if ((isset($_GET["action"])) && (isAdmin()))
  189. {
  190. switch ($_GET["action"])
  191. {
  192. case "delaccount": deleteAccount($_GET["account_key"]);break;
  193. case "delnewsletter": deleteNewsletter($_GET["nl_key"]);break;
  194. case "copynewsletter": copyNewsletter($_GET["nl_key"]);break;
  195. case "startexport": startExport($_GET["paKey"],1,$export_stepsize);break;
  196. case "unlocknewsletter": unlockNewsletter();break;
  197. }
  198. }
  199. ?>

Documentation generated on Tue, 16 Aug 2005 17:28:43 +0200 by phpDocumentor 1.3.0RC3