index.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. if ($ubillingConfig->getAlterParam('MULTIGEN_ENABLED')) {
  3. if (cfr('MULTIGEN')) {
  4. $customNas = new MultigenECN();
  5. //new NAS creation
  6. if (ubRouting::checkPost(array($customNas::PROUTE_NEWIP, $customNas::PROUTE_NEWNAME, $customNas::PROUTE_NEWSECRET))) {
  7. $newIp = ubRouting::post($customNas::PROUTE_NEWIP);
  8. $newName = ubRouting::post($customNas::PROUTE_NEWNAME);
  9. $newSecret = ubRouting::post($customNas::PROUTE_NEWSECRET);
  10. $creationResult = $customNas->create($newIp, $newName, $newSecret);
  11. if (empty($creationResult)) {
  12. ubRouting::nav($customNas::URL_ME);
  13. } else {
  14. show_error($creationResult);
  15. }
  16. }
  17. //existing NAS editing
  18. if (ubRouting::checkPost(array($customNas::PROUTE_EDID, $customNas::PROUTE_EDNAME, $customNas::PROUTE_EDSECRET))) {
  19. $editNasId = ubRouting::post($customNas::PROUTE_EDID);
  20. $editNasName = ubRouting::post($customNas::PROUTE_EDNAME);
  21. $editNasSecret = ubRouting::post($customNas::PROUTE_EDSECRET);
  22. $savingResult = $customNas->save($editNasId, $editNasName, $editNasSecret);
  23. if (empty($savingResult)) {
  24. ubRouting::nav($customNas::URL_ME);
  25. } else {
  26. show_error($savingResult);
  27. }
  28. }
  29. //existing NAS deletion
  30. if (ubRouting::checkGet($customNas::ROUTE_DELETE)) {
  31. $nasIdToDelete = ubRouting::get($customNas::ROUTE_DELETE);
  32. $deletionResult = $customNas->delete($nasIdToDelete);
  33. if (empty($deletionResult)) {
  34. ubRouting::nav($customNas::URL_ME);
  35. } else {
  36. show_error($deletionResult);
  37. }
  38. }
  39. show_window('', wf_BackLink('?module=nas'));
  40. show_window(__('Extra chromosome NASes'), $customNas->renderList());
  41. show_window(__('Add new'), $customNas->renderCreateForm());
  42. } else {
  43. show_error(__('Access denied'));
  44. }
  45. } else {
  46. show_error(__('This module is disabled'));
  47. }