index.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. if (cfr('PASSWORD')) {
  3. $altCfg = $ubillingConfig->getAlter();
  4. if (isset($_GET['username'])) {
  5. $login = vf($_GET['username']);
  6. // change password if need
  7. if (wf_CheckPost(array('newpassword'))) {
  8. $password = $_POST['newpassword'];
  9. if (!$altCfg['IGNORE_PASSWORD_UNIQUE']) {
  10. if (zb_CheckPasswordUnique($password)) {
  11. $billing->setpassword($login, $password);
  12. log_register('CHANGE Password (' . $login . ') ON `' . $password . '`');
  13. rcms_redirect("?module=passwordedit&username=" . $login);
  14. } else {
  15. show_error(__('We do not recommend using the same password for different users. Try another.'));
  16. }
  17. } else {
  18. $billing->setpassword($login, $password);
  19. log_register('CHANGE Password (' . $login . ') ON `' . $password . '`');
  20. rcms_redirect("?module=passwordedit&username=" . $login);
  21. }
  22. }
  23. $current_password = zb_UserGetStargazerData($login);
  24. $current_password = $current_password['Password'];
  25. $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
  26. // Edit form construct
  27. $fieldnames = array('fieldname1' => __('Current password'), 'fieldname2' => __('New password'));
  28. $fieldkey = 'newpassword';
  29. $form = web_EditorStringDataFormPassword($fieldnames, $fieldkey, $useraddress, $current_password);
  30. // show form
  31. show_window(__('Edit password'), $form);
  32. //check non unique passwords
  33. if (!$altCfg['IGNORE_PASSWORD_UNIQUE']) {
  34. $duppasswords = zb_GetNonUniquePasswordUsers();
  35. if (!empty($duppasswords)) {
  36. show_window(__('These users have identical passwords'), web_UserArrayShower($duppasswords));
  37. }
  38. }
  39. show_window('', web_UserControls($login));
  40. }
  41. } else {
  42. show_error(__('You cant control this module'));
  43. }
  44. ?>