index.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. if (cfr('ADDVLAN')) {
  3. $altcfg = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
  4. if ($altcfg['VLANGEN_SUPPORT']) {
  5. $vlanGen = new VlanGen;
  6. if (isset($_POST['AddVlan'])) {
  7. $vlanAddRequire = array('FirstVlan', 'LastVlan', 'Desc');
  8. if (wf_CheckPost($vlanAddRequire)) {
  9. $vlanGen->AddVlanPool($_POST['Desc'], $_POST['FirstVlan'], $_POST['LastVlan'], $_POST['UseQinQ'], $_POST['sVlan']);
  10. rcms_redirect(VlanGen::MODULE_URL_ADDVLAN);
  11. } else {
  12. show_window(__('Error'), __('No all of required fields is filled'));
  13. }
  14. }
  15. if (isset($_GET['DeleteVlanPool'])) {
  16. $vlanGen->DeleteVlanPool(vf($_GET['DeleteVlanPool'], 3));
  17. rcms_redirect(VlanGen::MODULE_URL_ADDVLAN);
  18. }
  19. if (!isset($_GET['EditVlanPool'])) {
  20. $vlanGen->ShowVlanPools();
  21. $vlanGen->AddVlanPoolForm();
  22. }
  23. if (isset($_GET['EditVlanPool'])) {
  24. $PoolID = vf($_GET['EditVlanPool'], 3);
  25. $vlanGen->VlanPoolEditForm($PoolID);
  26. if (isset($_POST['EditVlanPool'])) {
  27. $VlanEditRequire = array('FirstVlan', 'LastVlan', 'Desc');
  28. if (wf_CheckPost($VlanEditRequire)) {
  29. $vlanGen->EditVlanPool($_POST['FirstVlan'], $_POST['LastVlan'], $_POST['Desc'], $_POST['UseQinQ'], $_POST['sVlan'], $PoolID);
  30. rcms_redirect(VlanGen::MODULE_URL_ADDVLAN);
  31. } else {
  32. show_window(__('Error'), __('No all of required fields is filled'));
  33. }
  34. }
  35. }
  36. zb_BillingStats(true, 'vlangen');
  37. } else {
  38. show_error(__('This module is disabled'));
  39. }
  40. } else {
  41. show_error(__("You can't control this module"));
  42. }
  43. ?>