inc_password.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. if (!defined('IN_MYMPS')) {
  3. exit('Forbidden');
  4. }
  5. if (submit_check('password_submit')) {
  6. if (empty($curuserpwd)) {
  7. write_msg('', '?m=password&error=48');
  8. }
  9. if (md5($curuserpwd) != $row['userpwd']) {
  10. write_msg('', '?m=password&error=47');
  11. }
  12. if (!empty($userpwd) && $userpwd != $reuserpwd) {
  13. write_msg('', '?m=password&error=20');
  14. }
  15. if (PASSPORT_TYPE == 'phpwind') {
  16. require MYMPS_ROOT . '/pw_client/uc_client.php';
  17. $pw_user = uc_user_get($s_uid);
  18. $result = uc_user_edit($pw_user['uid'], $pw_user['username'], '', md5($userpwd), '');
  19. if ($result == 1) {
  20. }
  21. else if ($result == -3) {
  22. write_msg('', '?m=password&error=21');
  23. }
  24. else if ($result == -4) {
  25. write_msg('', '?m=password&error=23');
  26. }
  27. else if ($result == -2) {
  28. write_msg('', '?m=password&error=24');
  29. }
  30. else if ($result == -1) {
  31. write_msg('', '?m=password&error=24');
  32. }
  33. else {
  34. write_msg('', '?m=password&error=26');
  35. }
  36. }
  37. else if (PASSPORT_TYPE == 'ucenter') {
  38. require MYMPS_ROOT . '/uc_client/client.php';
  39. $result = uc_user_edit($s_uid, $userpwd, $userpwd, $email, 1);
  40. if ($result == 1) {
  41. }
  42. else if ($result == -4) {
  43. write_msg('', '?m=password&error=21');
  44. }
  45. else if ($result == -5) {
  46. write_msg('', '?m=password&error=22');
  47. }
  48. else if ($result == -6) {
  49. write_msg('', '?m=password&error=23');
  50. }
  51. else if ($result == -8) {
  52. write_msg('', '?m=password&error=24');
  53. }
  54. else if ($result == -1) {
  55. write_msg('', '?m=password&error=25');
  56. }
  57. else {
  58. write_msg('', '?m=password&error=26');
  59. }
  60. }
  61. if (!empty($userpwd)) {
  62. $sql = 'UPDATE `' . $db_mymps . 'member` SET userpwd=\'' . md5($userpwd) . ('\' WHERE userid = \'' . $s_uid . '\'');
  63. }
  64. else {
  65. write_msg('', '?m=password&error=13');
  66. }
  67. $db->query($sql);
  68. write_msg('', '?m=password&success=8');
  69. }
  70. else {
  71. $location = location();
  72. include mymps_tpl('password');
  73. }
  74. ?>