index.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. $altCfg = $ubillingConfig->getAlter();
  3. if ($altCfg['VLAN_MANAGEMENT_ENABLED']) {
  4. if (cfr('VLANMANAGEMENT')) {
  5. $vlan = new VlanManagement();
  6. $realms = new Realms();
  7. if ($realms->routing->checkGet('realms')) {
  8. switch ($realms->routing->get('action')) {
  9. case 'add':
  10. $realms->add();
  11. break;
  12. case 'edit':
  13. $realms->edit();
  14. break;
  15. case 'delete':
  16. $realms->delete();
  17. break;
  18. case 'ajax':
  19. $realms->ajaxData();
  20. break;
  21. case 'ajaxedit':
  22. die($realms->ajaxEdit($realms->routing->post('realm_encode')));
  23. break;
  24. }
  25. $realms->links();
  26. $realms->showAll();
  27. } elseif ($vlan->routing->checkGet('svlan')) {
  28. switch ($vlan->routing->get('action')) {
  29. case 'add':
  30. $vlan->addSvlan();
  31. break;
  32. case 'edit':
  33. $vlan->editSvlan();
  34. break;
  35. case 'delete':
  36. $vlan->deleteSvlan();
  37. break;
  38. case 'ajax':
  39. $vlan->ajaxSvlanData();
  40. break;
  41. case 'ajaxedit':
  42. die($vlan->ajaxEditSvlan($vlan->routing->post('svlan_encode')));
  43. break;
  44. }
  45. $vlan->linksSvlan();
  46. $vlan->showSvlanAll();
  47. } else {
  48. if ($vlan->routing->get('action')) {
  49. switch ($vlan->routing->get('action')) {
  50. case 'realm_id_select':
  51. die($vlan->svlanSelector($vlan->routing->get('ajrealmid')));
  52. case 'ajax':
  53. die($vlan->ajaxChooseForm());
  54. case 'ajaxcustomer':
  55. die($vlan->ajaxCustomer());
  56. case 'ajaxswitch':
  57. die($vlan->ajaxSwitch());
  58. case 'ajaxoltzte':
  59. die($vlan->ajaxOltZte());
  60. case 'ajaxoltnonzte':
  61. die($vlan->ajaxOltNonZte());
  62. case 'chooseoltnonzteport':
  63. die($vlan->portSelector());
  64. case 'chooseoltztecard':
  65. die($vlan->cardSelector());
  66. case 'chooseoltztecardport':
  67. die($vlan->portCardSelector());
  68. case 'choosetype':
  69. die($vlan->types());
  70. case 'add':
  71. $vlan->addNewBinding();
  72. break;
  73. case 'deleteswitchbinding':
  74. $vlan->deleteSwitchBinding();
  75. break;
  76. case 'deleteoltztebinding':
  77. $vlan->deleteOltZteBinding();
  78. break;
  79. case 'deleteoltnonztebinding':
  80. $vlan->deleteOltNonZteBinding();
  81. break;
  82. }
  83. } else {
  84. if (!$vlan->routing->get('realm_id', 'int') and!$vlan->routing->get('svlan_id')) {
  85. rcms_redirect($vlan::MODULE . '&realm_id=' . $vlan->defaultRealm . '&svlan_id=' . $vlan->defaultSvlan);
  86. }
  87. }
  88. $vlan->linksMain();
  89. $vlan->realmAndSvlanSelectors();
  90. $vlan->cvlanMatrix();
  91. }
  92. } else {
  93. show_error(__('Permission denied'));
  94. }
  95. } else {
  96. show_error(__('This module is disabled'));
  97. }