index.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. if($system->checkForRight('RULES')) {
  3. if (wf_CheckPost(array('newrulename'))) {
  4. $createrulename=trim($_POST['newrulename']);
  5. if (!empty($createrulename)) {
  6. zb_DirectionAdd($_POST['newrulenumber'], $_POST['newrulename']);
  7. zb_StargazerSIGHUP();
  8. rcms_redirect("?module=rules");
  9. } else {
  10. show_window(__('Error'), __('Required fields'));
  11. }
  12. }
  13. if (isset($_GET['delete'])) {
  14. zb_DirectionDelete($_GET['delete']);
  15. zb_StargazerSIGHUP();
  16. rcms_redirect("?module=rules");
  17. }
  18. if (isset($_GET['edit'])) {
  19. $editruleid=vf($_GET['edit'],3);
  20. if (wf_CheckPost(array('editrulename'))) {
  21. $newrulename=$_POST['editrulename'];
  22. simple_update_field('directions', 'rulename', $newrulename, "WHERE `id`='".$editruleid."'");
  23. log_register("CHANGE TrafficClass ".$editruleid." ON ".$newrulename);
  24. rcms_redirect("?module=rules");
  25. }
  26. web_DirectionsEditForm($editruleid);
  27. } else {
  28. web_DirectionsShow();
  29. web_DirectionAddForm();
  30. }
  31. }
  32. else {
  33. show_error(__('Access denied'));
  34. }
  35. ?>