人人商城

founderedit.ctrl.php 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. load()->model('user');
  8. load()->func('file');
  9. $dos = array('edit_base', 'edit_modules_tpl', 'edit_account');
  10. $do = in_array($do, $dos) ? $do: 'edit_base';
  11. uni_user_permission_check('system_founder_group_post');
  12. $_W['page']['title'] = '编辑用户 - 用户管理';
  13. $uid = intval($_GPC['uid']);
  14. $user = user_single($uid);
  15. if (empty($user)) {
  16. itoast('访问错误, 未找到该操作员.', url('user/display'), 'error');
  17. } else {
  18. if ($user['status'] == 1) itoast('访问错误,该用户未审核通过,请先审核通过再修改!', url('user/display/check_display'), 'error');
  19. if ($user['status'] == 3) itoast('访问错误,该用户已被禁用,请先启用再修改!', url('user/display/recycle_display'), 'error');
  20. }
  21. $founders = explode(',', $_W['config']['setting']['founder']);
  22. $profile = pdo_get('users_profile', array('uid' => $uid));
  23. if (!empty($profile)) $profile['avatar'] = tomedia($profile['avatar']);
  24. if ($do == 'edit_base') {
  25. $user['last_visit'] = date('Y-m-d H:i:s', $user['lastvisit']);
  26. $user['end'] = $user['endtime'] == 0 ? '永久' : date('Y-m-d', $user['endtime']);
  27. $user['endtype'] = $user['endtime'] == 0 ? 1 : 2;
  28. $user['url'] = user_invite_register_url($uid);
  29. if (!empty($profile)) {
  30. $profile['reside'] = array(
  31. 'province' => $profile['resideprovince'],
  32. 'city' => $profile['residecity'],
  33. 'district' => $profile['residedist']
  34. );
  35. $profile['birth'] = array(
  36. 'year' => $profile['birthyear'],
  37. 'month' => $profile['birthmonth'],
  38. 'day' => $profile['birthday'],
  39. );
  40. $profile['resides'] = $profile['resideprovince'] . $profile['residecity'] . $profile['residedist'] ;
  41. $profile['births'] =($profile['birthyear'] ? $profile['birthyear'] : '--') . '年' . ($profile['birthmonth'] ? $profile['birthmonth'] : '--') . '月' . ($profile['birthday'] ? $profile['birthday'] : '--') .'日';
  42. }
  43. template('user/edit-base');
  44. }
  45. if ($do == 'edit_modules_tpl') {
  46. if ($_W['isajax'] && $_W['ispost']) {
  47. if (intval($_GPC['groupid']) == $user['groupid']){
  48. iajax(2, '未做更改!');
  49. }
  50. if (!empty($_GPC['type']) && !empty($_GPC['groupid'])) {
  51. $data['uid'] = $uid;
  52. $data[$_GPC['type']] = intval($_GPC['groupid']);
  53. if (user_update($data)) {
  54. $group_info = user_founder_group_detail_info($_GPC['groupid']);
  55. iajax(0, $group_info, '');
  56. } else {
  57. iajax(1, '更改失败!', '');
  58. }
  59. } else {
  60. iajax(-1, '参数错误!', '');
  61. }
  62. }
  63. $groups = user_founder_group();
  64. $group_info = user_founder_group_detail_info($user['groupid']);
  65. template('founder/edit-modules-tpl');
  66. }
  67. if ($do == 'edit_account') {
  68. $account_detail = user_account_detail_info($uid);
  69. template('user/edit-account');
  70. }