index.php 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. if (cfr('MOBILE')) {
  3. if (wf_CheckGet(array('username'))) {
  4. $altCfg = $ubillingConfig->getAlter();
  5. $login = vf($_GET['username']);
  6. // change mobile if need
  7. if (isset($_POST['newmobile'])) {
  8. $mobile = $_POST['newmobile'];
  9. zb_UserChangeMobile($login, $mobile);
  10. rcms_redirect("?module=mobileedit&username=" . $login);
  11. }
  12. $current_mobile = zb_UserGetMobile($login);
  13. $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
  14. // Edit form construct
  15. $fieldnames = array('fieldname1' => __('Current mobile'), 'fieldname2' => __('New mobile'));
  16. $fieldkey = 'newmobile';
  17. if (@$altCfg['MOBILE_FILTERS_DISABLED']) {
  18. $formFilters = '';
  19. } else {
  20. $formFilters = 'mobile';
  21. }
  22. $form = web_EditorStringDataForm($fieldnames, $fieldkey, $useraddress, $current_mobile, $formFilters);
  23. // Edit form display
  24. show_window(__('Edit mobile'), $form);
  25. // Additional mobile management
  26. if (isset($altCfg['MOBILES_EXT'])) {
  27. if ($altCfg['MOBILES_EXT']) {
  28. $extMobiles = new MobilesExt();
  29. //new additional mobile creation
  30. if (ubRouting::checkPost(array($extMobiles::PROUTE_NEW_LOGIN, $extMobiles::PROUTE_NEW_NUMBER))) {
  31. $newLogin = ubRouting::post($extMobiles::PROUTE_NEW_LOGIN);
  32. $newNumber = ubRouting::post($extMobiles::PROUTE_NEW_NUMBER);
  33. $newNotes = ubRouting::post($extMobiles::PROUTE_NEW_NOTES);
  34. $extMobiles->createUserMobile($newLogin, $newNumber, $newNotes);
  35. ubRouting::nav($extMobiles::URL_ME . '&' . $extMobiles::ROUTE_LOGIN . '=' . $login);
  36. }
  37. //existing additional mobile deletion
  38. if (ubRouting::checkGet($extMobiles::ROUTE_DELETE_ID)) {
  39. $extMobiles->deleteUserMobile(ubRouting::get($extMobiles::ROUTE_DELETE_ID));
  40. ubRouting::nav($extMobiles::URL_ME . '&' . $extMobiles::ROUTE_LOGIN . '=' . $login);
  41. }
  42. //updating existing additional mobile number
  43. if (ubRouting::checkPost(array($extMobiles::PROUTE_ED_ID, $extMobiles::PROUTE_ED_NUMBER))) {
  44. $updateExtId = ubRouting::post($extMobiles::PROUTE_ED_ID);
  45. $updateNumber = ubRouting::post($extMobiles::PROUTE_ED_NUMBER);
  46. $updateNotes = ubRouting::post($extMobiles::PROUTE_ED_NOTES);
  47. $extMobiles->updateUserMobile($updateExtId, $updateNumber, $updateNotes);
  48. ubRouting::nav($extMobiles::URL_ME . '&' . $extMobiles::ROUTE_LOGIN . '=' . $login);
  49. }
  50. $extCreateForm = $extMobiles->renderCreateForm($login);
  51. $extList = $extMobiles->renderUserMobilesList($login);
  52. show_window(__('Additional mobile phones'), $extList . $extCreateForm);
  53. //Form with last incoming numbers to attach
  54. $extMobiles->fastNumAttachForm($login);
  55. }
  56. }
  57. //User back to profile controls
  58. show_window('', web_UserControls($login));
  59. } else {
  60. show_error(__('Strange exeption') . ': EX_NO_USERNAME');
  61. }
  62. } else {
  63. show_error(__('You cant control this module'));
  64. }
  65. ?>