index.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. if (cfr('PLDHCP')) {
  3. $alter_conf = $ubillingConfig->getAlter();
  4. if ($alter_conf['DHCP_ENABLED']) {
  5. if (ubRouting::checkGet('username')) {
  6. $userLogin = ubRouting::get('username');
  7. $userMac = '';
  8. $userIp = '';
  9. if (ubRouting::checkGet(array('userip', 'usermac'))) {
  10. $userIp = ubRouting::get('userip');
  11. $userMac = ubRouting::get('usermac');
  12. } else {
  13. $userData = zb_UserGetStargazerData($userLogin);
  14. if (!empty($userData)) {
  15. $userIp = $userData['IP'];
  16. $userMac = zb_MultinetGetMAC($userIp);
  17. }
  18. }
  19. $plDhcp = new DHCPPL($userLogin, $userIp, $userMac);
  20. //rendering current user mac info
  21. show_window('', $plDhcp->getMacLabel());
  22. //rendering user dhcp log data
  23. $winControl = '';
  24. if ($userLogin AND $userIp AND $userMac) {
  25. if (ubRouting::get('zen')) {
  26. $winControl = wf_Link($plDhcp::URL_ME . '&username=' . $userLogin, wf_img('skins/log_icon_small.png', __('Normal')));
  27. } else {
  28. $zenUrl = $plDhcp::URL_ME . '&username=' . $userLogin . '&userip=' . $userIp . '&usermac=' . $userMac . '&zen=true';
  29. $winControl = wf_Link($zenUrl, wf_img('skins/zen.png', __('Zen')));
  30. }
  31. }
  32. if (ubRouting::checkGet('zen')) {
  33. $zenFlow = new ZenFlow($plDhcp->getFlowId(), $plDhcp->render(), $plDhcp->getTimeout());
  34. show_window($winControl . ' ' . __('User DHCP log') . ', ' . __('Zen'), $zenFlow->render());
  35. } else {
  36. show_window($winControl . ' ' . __('User DHCP log'), $plDhcp->render());
  37. }
  38. show_window('', web_UserControls($userLogin));
  39. } else {
  40. show_error(__('Strange exception') . ': ' . __('Empty login'));
  41. show_window('', wf_tag('center') . wf_img('skins/unicornwrong.png') . wf_tag('center', true));
  42. }
  43. } else {
  44. show_error(__('This module is disabled'));
  45. }
  46. } else {
  47. show_error(__('You cant control this module'));
  48. }