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"],$_POST["page_lang"]); 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"],$_POST["template_tree"]);break;
  137. case "release": releasePage($_POST["page_key"],$_POST["block"]);break;
  138. case "updateremark": remarkPage($_POST["page_key"],$_POST["page_remark"]);break;
  139. case "edittext":
  140. if (isset($_POST["htmlentities"]))
  141. {
  142. $page_input_new = htmlencode($_POST["page_input"]);
  143. }
  144. else
  145. {
  146. $page_input_new = $_POST["page_input"];
  147. }
  148. updateText($_POST["page_key"],$_POST["page_edit"],$page_input_new);
  149. break;
  150. 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"],$_POST["page_lang"]); break;
  151. case "navigation": updateNavigation($_POST["page_key"],$_POST["keys"],$_POST["page_hide"]);break;
  152. case "grouporder": updateGroupOrder($_POST["page_key"],$_POST["keys"]);break;
  153. case "delstatistic": delStatistic();break;
  154. case "addTableItem": addTableItem();break;
  155. case "delTableItem": delTableItem();break;
  156. case "editTableItem": editTableItem();break;
  157. case "upload":
  158. $uppar = "";
  159. if ($_POST["upparam"] != "")
  160. {
  161. $uppar = "?".$_POST["upparam"];
  162. }
  163. if ($_POST["del"] == "true")
  164. {
  165. updateText($_POST["page_key"],$_POST["field"],"");
  166. }
  167. else
  168. {
  169. if ((isset($_FILES['upFile']['tmp_name'])) && ($_FILES['upFile']['tmp_name'] != ""))
  170. {
  171. if (move_uploaded_file($_FILES['upFile']['tmp_name'], $site_pool."/".$_POST["page_key"]."_".$_FILES['upFile']['name']))
  172. {
  173. if (isset($_POST["caching"]))
  174. {
  175. updateTextNoCache($_POST["page_key"],$_POST["field"],$_POST["page_key"]."_".$_FILES['upFile']['name'].$uppar);
  176. }
  177. else
  178. {
  179. updateText($_POST["page_key"],$_POST["field"],$_POST["page_key"]."_".$_FILES['upFile']['name'].$uppar);
  180. }
  181. }
  182. else
  183. {
  184. ?>
  185. <script language="Javascript">
  186. alert("Upload ERROR!");
  187. </script>
  188. <?
  189. }
  190. }
  191. elseif ($_POST["page_fileexists"] != "")
  192. {
  193. if (isset($_POST["caching"]))
  194. {
  195. updateTextNoCache($_POST["page_key"],$_POST["field"],$_POST["page_fileexists"].$uppar);
  196. }
  197. else
  198. {
  199. updateText($_POST["page_key"],$_POST["field"],$_POST["page_fileexists"].$uppar);
  200. }
  201. }
  202. else
  203. {
  204. if ((isset($_POST["savedfile"])) && ($_POST["savedfile"] != ""))
  205. {
  206. updateText($_POST["page_key"],$_POST["field"],$_POST["savedfile"].$uppar);
  207. }
  208. }
  209. }
  210. break;
  211. }
  212. }
  213. }
  214. }
  215.  
  216. if ((isset($_GET["action"])) && (isAdmin()))
  217. {
  218. switch ($_GET["action"])
  219. {
  220. case "delaccount": deleteAccount($_GET["account_key"]);break;
  221. case "delnewsletter": deleteNewsletter($_GET["nl_key"]);break;
  222. case "copynewsletter": copyNewsletter($_GET["nl_key"]);break;
  223. case "startexport": startExport($_GET["paKey"],1,$export_stepsize);break;
  224. case "unlocknewsletter": unlockNewsletter();break;
  225. }
  226. }
  227. ?>

Documentation generated on Tue, 04 Oct 2005 11:13:35 +0200 by phpDocumentor 1.3.0RC3