index.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. if (cfr('PLIPCHANGE')) {
  3. $ipChange = new IpChange();
  4. //rendering ajax IP selector container data
  5. if (wf_CheckGet(array('ajserviceid'))) {
  6. die($ipChange->ajIpSelector($_GET['ajserviceid']));
  7. }
  8. if (wf_CheckGet(array('username'))) {
  9. //user is here
  10. $userLogin = $_GET['username'];
  11. $ipChange->setLogin($userLogin);
  12. $ipChange->initUserParams();
  13. //change IP if required
  14. if (wf_CheckPost(array('ipselector', 'serviceselector'))) {
  15. $changeResult = $ipChange->changeUserIp($_POST['serviceselector'], $_POST['ipselector']);
  16. if (empty($changeResult)) {
  17. rcms_redirect($ipChange::URL_ME . '&username=' . $userLogin);
  18. } else {
  19. show_error($changeResult);
  20. }
  21. }
  22. //rendering interface
  23. show_window('', $ipChange->renderCurrentIp());
  24. show_window(__('Change user IP'), $ipChange->renderMainForm());
  25. if ((!cfr('BRANCHES')) OR ( cfr('ROOT'))) {
  26. show_window(__('IP usage stats'), $ipChange->renderFreeIpStats());
  27. }
  28. show_window('', web_UserControls($userLogin));
  29. } else {
  30. show_error(__('Something went wrong'));
  31. }
  32. } else {
  33. show_error(__('You cant control this module'));
  34. }
  35. ?>