cms.document.php 665 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. if (core::ifPost("from") AND core::getPost("from") == "document") {
  3. if(core::getPost("id") == "add"){
  4. $add = document::add();
  5. if($add != FALSE) {
  6. session::resetTemp();
  7. $location = "/document-". $add .".html";
  8. } else {
  9. $location = "/add-document.html";
  10. }
  11. } else {
  12. document::update();
  13. $location = "/document-". core::getPost("id") .".html";
  14. }
  15. json::create("documents");
  16. json::create("documents-limited");
  17. document::cleanOrphanTags();
  18. header("Location: " . $location);
  19. exit();
  20. } else {
  21. header('HTTP/1.0 401 Unauthorized');
  22. exit();
  23. }