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. * @author Stephan Raabe
  14. */
  15.  
  16. // Logging START
  17. if (isAdmin())
  18. {
  19. if (isset($_POST["action"]))
  20. {
  21. writeLog($_SESSION["account_email"],$_POST["action"],$page["page_path"]);
  22. }
  23. if (isset($_GET["action"]))
  24. {
  25. writeLog($_SESSION["account_email"],$_GET["action"],$page["page_path"]);
  26. }
  27. }
  28.  
  29. if (isset($_POST["action"]))
  30. {
  31. switch ($_POST["action"]) {
  32. case "login":
  33. if (!login($_POST["account_email"],$_POST["account_password"],$_POST["page_path"]))
  34. {
  35. $admin_lang["profile"][1] = $admin_lang["profile"][2];
  36. }
  37. else
  38. {
  39. if ($_POST["page_path"] != $page["page_path"])
  40. {
  41. $path_redirect = $_POST["page_path"];
  42. }
  43. else
  44. {
  45. $path_redirect = $page["page_path"];
  46. }
  47. ?>
  48. <script language="javascript">
  49. location.href = "website.php?id=<?= $path_redirect; ?>";
  50. </script>
  51. <?
  52. }
  53. break;
  54. case "loginInt":
  55. if (!loginInt($_POST["account_email"],$_POST["account_password"],$_POST["page_path"]))
  56. {
  57. $admin_lang["profile"][1] = $admin_lang["profile"][2];
  58. }
  59. break;
  60.  
  61. case "logout": logout($_POST["page_path"]);
  62. break;
  63.  
  64. case "logoutInt": logoutInt($_POST["page_path"]);
  65. break;
  66.  
  67. case "newaccount":
  68. if ((isset($_POST["account_info"])) && ($_POST["account_info"] != ""))
  69. {
  70. $accountn_info = 1;
  71. }
  72. else
  73. {
  74. $accountn_info = 0;
  75. }
  76. if (isset($_POST["redirect"]))
  77. {
  78. $link_redirect = $_POST["redirect"];
  79. }
  80. else
  81. {
  82. $link_redirect = $site_home;
  83. }
  84. 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);
  85. break;
  86.  
  87. case "getaccount": getAccountExt($_POST["account_email"]);
  88. break;
  89.  
  90. case "deleteaccount":
  91. if (($_SESSION["account_group"] > 0) && ($_SESSION["account_key"] == $_POST["account_key"]))
  92. {
  93. deleteAccountExt($_POST["account_email"],$_POST["account_key"]);
  94. }
  95. break;
  96.  
  97. case "updateaccount":
  98. if (($_SESSION["account_group"] > 0) && ($_SESSION["account_key"] == $_POST["account_key"]))
  99. {
  100. if (isset($_POST["account_info"]))
  101. {
  102. $accountn_info = 1;
  103. }
  104. else
  105. {
  106. $accountn_info = 0;
  107. }
  108. 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);
  109. }
  110. break;
  111. }
  112.  
  113. if (isset($_POST["action"]))
  114. {
  115. if (isAdmin())
  116. {
  117. switch ($_POST["action"])
  118. {
  119. 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;
  120. case "updatecss": updateCss($_POST["page_key"],$_POST["site_css"]);break;
  121. 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;
  122. case "authorization": updateAuthorization($_POST["page_key"],$_POST["page_status"],$_POST["page_lock"],$_POST["page_lockexport"],$_POST["page_access"],$_POST["status_subpages"]);break;
  123. 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;
  124. case "copypage": copyPage($_POST["page_key"],$_POST["page_keynew"]);break;
  125. case "cutpage": cutPage($_POST["page_key"],$_POST["page_keynew"]);break;
  126. 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;
  127. 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;
  128. case "message": sendMessage($_POST["msg_receiver"],$_POST["msg_subject"],$_POST["msg_message"],$_POST["msg_from"]);break;
  129. 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;
  130. 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;
  131. 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;
  132. case "deletepage": deletePage($_POST["page_key"]);break;
  133. case "changes": changesPage($_POST["page_key"]);break;
  134. case "savemenu": saveMenu($_POST["page_key"],$_POST["oemenux"],$_POST["oemenuy"]);break;
  135. case "deletecache": deleteCache($_POST["page_path"]);break;
  136. 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;
  137. case "release": releasePage($_POST["page_key"],$_POST["block"]);break;
  138. case "edittext": updateText($_POST["page_key"],$_POST["page_edit"],$_POST["page_input"]);break;
  139. 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;
  140. case "navigation": updateNavigation($_POST["page_key"],$_POST["keys"],$_POST["page_hide"]);break;
  141. case "grouporder": updateGroupOrder($_POST["page_key"],$_POST["keys"]);break;
  142. case "delstatistic": delStatistic();break;
  143. case "addTableItem": addTableItem();break;
  144. case "delTableItem": delTableItem();break;
  145. case "editTableItem": editTableItem();break;
  146. case "upload":
  147. if ($_POST["del"] != "true")
  148. {
  149. if ($_POST["page_fileexists"] == "")
  150. {
  151. if (move_uploaded_file($_FILES['upFile']['tmp_name'], $site_pool."/".$_POST["page_key"]."_".$_FILES['upFile']['name']))
  152. {
  153. $reloadkey = get_page_key($page["page_parent"]);
  154. if (isset($_POST["caching"]))
  155. {
  156. updateTextNoCache($_POST["page_key"],$_POST["field"],$_POST["page_key"]."_".$_FILES['upFile']['name']);
  157. }
  158. else
  159. {
  160. updateText($_POST["page_key"],$_POST["field"],$_POST["page_key"]."_".$_FILES['upFile']['name']);
  161. }
  162. }
  163. else
  164. {
  165. ?>
  166. <script language="Javascript">
  167. alert("Upload ERROR!");
  168. </script>
  169. <?
  170. }
  171. }
  172. else
  173. {
  174. updateText($_POST["page_key"],$_POST["field"],$_POST["page_fileexists"]);
  175. }
  176. }
  177. else
  178. {
  179. updateText($_POST["page_key"],$_POST["field"],"");
  180. }
  181. break;
  182. }
  183. }
  184. }
  185. }
  186.  
  187. if ((isset($_GET["action"])) && (isAdmin()))
  188. {
  189. switch ($_GET["action"])
  190. {
  191. case "delaccount": deleteAccount($_GET["account_key"]);break;
  192. case "delnewsletter": deleteNewsletter($_GET["nl_key"]);break;
  193. case "copynewsletter": copyNewsletter($_GET["nl_key"]);break;
  194. case "startexport": startExport($_GET["paKey"],1,$export_stepsize);break;
  195. case "unlocknewsletter": unlockNewsletter();break;
  196. }
  197. }
  198. ?>

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