index.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. $altcfg=$ubillingConfig->getAlter();
  3. if ($altcfg['NETWORKS_EXT']) {
  4. if (cfr('MULTINET')) {
  5. $extNets=new ExtNets();
  6. /*
  7. * Extnets Pool Controller
  8. */
  9. if (!wf_CheckGet(array('showipsbypoolid'))) {
  10. show_window(__('Network available for allocation pools').' ('.__('Network type').' - other)', $extNets->renderNetworks()) ;
  11. }
  12. //show available pools assigned by this network
  13. if (wf_CheckGet(array('showpoolbynetid'))) {
  14. //creating an new pool
  15. if (wf_CheckPost(array('newpool','newpoolnetid','newpoolnetmask'))) {
  16. $extNets->poolCreate($_POST['newpoolnetid'], $_POST['newpool'], $_POST['newpoolnetmask'], $_POST['newpoolvlan']);
  17. rcms_redirect("?module=extnets&showpoolbynetid=".$_POST['newpoolnetid']);
  18. }
  19. //deleting pool
  20. if (wf_CheckGet(array('deletepoolid','showpoolbynetid'))) {
  21. $extNets->poolDelete($_GET['deletepoolid']);
  22. rcms_redirect("?module=extnets&showpoolbynetid=".$_GET['showpoolbynetid']);
  23. }
  24. //editing pool
  25. if (wf_CheckPost(array('editpoolid','editpoolnetid'))) {
  26. $extNets->poolEdit($_POST['editpoolid'], $_POST['editpoolvlan'], $_POST['editpoollogin']);
  27. rcms_redirect("?module=extnets&showpoolbynetid=".$_POST['editpoolnetid']);
  28. }
  29. $poolNetCidr=$extNets->getNetworkCidr($_GET['showpoolbynetid']);
  30. show_window(__('Extended address pools in').' '.$poolNetCidr, $extNets->renderPools($_GET['showpoolbynetid']));
  31. //pool creation form
  32. show_window(__('Create new pool'), $extNets->poolCreateForm($_GET['showpoolbynetid']));
  33. }
  34. /*
  35. * Extnets IPS Controller
  36. */
  37. if (wf_CheckGet(array('showipsbypoolid'))) {
  38. //editing ip
  39. if (wf_CheckPost(array('editipid'))) {
  40. $extNets->ipsEdit($_POST['editipid'], $_POST['editipnas'], $_POST['editipiface'], $_POST['editipmac'], $_POST['editipswitchid'], $_POST['editipport']);
  41. rcms_redirect("?module=extnets&showipsbypoolid=".$_GET['showipsbypoolid']);
  42. }
  43. show_window(__('IP associated with pool'), $extNets->renderIps($_GET['showipsbypoolid']));
  44. }
  45. } else {
  46. show_error( __('Access denied'));
  47. }
  48. } else {
  49. show_error( __('This module is disabled'));
  50. }
  51. ?>