index.php 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. if (cfr('SWITCHESEDIT')) {
  3. $altCfg = $ubillingConfig->getAlter();
  4. if ($altCfg['SWITCHES_AUTH_ENABLED']) {
  5. if (ubRouting::checkGet(SwitchAuth::ROUTE_DEVID)) {
  6. $editSwitchId = ubRouting::get(SwitchAuth::ROUTE_DEVID, 'int');
  7. $switchAuth = new SwitchAuth($editSwitchId);
  8. //editing form data received
  9. if (ubRouting::checkPost($switchAuth::PROUTE_DEVID)) {
  10. $switchAuth->setAuthData(
  11. $editSwitchId,
  12. ubRouting::post($switchAuth::PROUTE_LOGIN),
  13. ubRouting::post($switchAuth::PROUTE_PASSWORD),
  14. ubRouting::post($switchAuth::PROUTE_ENABLE)
  15. );
  16. ubRouting::nav($switchAuth::URL_ME . '&' . $switchAuth::ROUTE_DEVID . '=' . $editSwitchId);
  17. }
  18. show_window(__('Device authorization data'), $switchAuth->renderEditForm());
  19. show_window('', wf_BackLink($switchAuth::URL_SWPROFILE . $editSwitchId));
  20. } else {
  21. show_error(__('Something went wrong') . ': EX_NO_SWITCHID');
  22. }
  23. } else {
  24. show_error(__('This module is disabled'));
  25. }
  26. } else {
  27. show_error(__('Access denied'));
  28. }