index.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. if (cfr('SIGREQ')) {
  3. $alterconf = $ubillingConfig->getAlter();
  4. if ($alterconf['SIGREQ_ENABLED']) {
  5. //Main sigreq management
  6. if (!wf_CheckGet(array('settings'))) {
  7. $signups = new SignupRequests();
  8. //requests management
  9. //set request as done
  10. if (isset($_GET['reqdone'])) {
  11. if (cfr('SIGREQEDIT')) {
  12. $signups->setDone($_GET['reqdone']);
  13. //update notification area
  14. $darkVoid = new DarkVoid();
  15. $darkVoid->flushCache();
  16. rcms_redirect("?module=sigreq");
  17. } else {
  18. show_error(__('Access denied'));
  19. log_register('SIGREQ CLOSE RIGHTS FAIL [' . $_GET['reqdone'] . ']');
  20. }
  21. }
  22. //set request as undone
  23. if (isset($_GET['requndone'])) {
  24. if (cfr('SIGREQEDIT')) {
  25. $signups->setUnDone($_GET['requndone']);
  26. //update notification area
  27. $darkVoid = new DarkVoid();
  28. $darkVoid->flushCache();
  29. rcms_redirect("?module=sigreq");
  30. } else {
  31. show_error(__('Access denied'));
  32. log_register('SIGREQ OPEN RIGHTS FAIL [' . $_GET['requndone'] . ']');
  33. }
  34. }
  35. //delete request
  36. if (isset($_GET['deletereq'])) {
  37. if (cfr('SIGREQDELETE')) {
  38. $signups->deleteReq($_GET['deletereq']);
  39. rcms_redirect("?module=sigreq");
  40. } else {
  41. show_error(__('Access denied'));
  42. log_register('SIGREQ DELETE RIGHTS FAIL [' . $_GET['deletereq'] . ']');
  43. }
  44. }
  45. if (wf_CheckGet(array('showreq'))) {
  46. //shows selected signup request by its ID
  47. $signups->showRequest($_GET['showreq']);
  48. } else {
  49. if (!wf_CheckGet(array('calendarview'))) {
  50. if (wf_CheckGet(array('ajlist'))) {
  51. $signups->renderAjListData();
  52. }
  53. //display signup requests list
  54. $signups->renderList();
  55. } else {
  56. //display signup requests calendar
  57. $signups->renderCalendar();
  58. }
  59. }
  60. } else {
  61. //signup requests service configuration
  62. $signupConf = new SignupConfig;
  63. //save config request
  64. if (wf_CheckPost(array('changesettings'))) {
  65. if (cfr('SIGREQCONF')) {
  66. $signupConf->save();
  67. rcms_redirect('?module=sigreq&settings=true');
  68. } else {
  69. show_error(__('Access denied'));
  70. log_register('SIGREQCONF RIGHTS FAIL');
  71. }
  72. }
  73. show_window(__('Settings'), $signupConf->renderForm());
  74. }
  75. } else {
  76. show_error(__('This module disabled'));
  77. }
  78. } else {
  79. show_error(__('You cant control this module'));
  80. }
  81. ?>