1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- /**
- * [WeEngine System] Copyright (c) 2014 WE7.CC
- * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
- */
- defined('IN_IA') or exit('Access Denied');
-
- load()->model('user');
- load()->func('file');
-
- $dos = array('edit_base', 'edit_modules_tpl', 'edit_account');
- $do = in_array($do, $dos) ? $do: 'edit_base';
- uni_user_permission_check('system_founder_group_post');
-
- $_W['page']['title'] = '编辑用户 - 用户管理';
-
- $uid = intval($_GPC['uid']);
- $user = user_single($uid);
- if (empty($user)) {
- itoast('访问错误, 未找到该操作员.', url('user/display'), 'error');
- } else {
- if ($user['status'] == 1) itoast('访问错误,该用户未审核通过,请先审核通过再修改!', url('user/display/check_display'), 'error');
- if ($user['status'] == 3) itoast('访问错误,该用户已被禁用,请先启用再修改!', url('user/display/recycle_display'), 'error');
- }
- $founders = explode(',', $_W['config']['setting']['founder']);
- $profile = pdo_get('users_profile', array('uid' => $uid));
- if (!empty($profile)) $profile['avatar'] = tomedia($profile['avatar']);
-
- if ($do == 'edit_base') {
- $user['last_visit'] = date('Y-m-d H:i:s', $user['lastvisit']);
- $user['end'] = $user['endtime'] == 0 ? '永久' : date('Y-m-d', $user['endtime']);
- $user['endtype'] = $user['endtime'] == 0 ? 1 : 2;
- $user['url'] = user_invite_register_url($uid);
-
- if (!empty($profile)) {
- $profile['reside'] = array(
- 'province' => $profile['resideprovince'],
- 'city' => $profile['residecity'],
- 'district' => $profile['residedist']
- );
- $profile['birth'] = array(
- 'year' => $profile['birthyear'],
- 'month' => $profile['birthmonth'],
- 'day' => $profile['birthday'],
- );
- $profile['resides'] = $profile['resideprovince'] . $profile['residecity'] . $profile['residedist'] ;
- $profile['births'] =($profile['birthyear'] ? $profile['birthyear'] : '--') . '年' . ($profile['birthmonth'] ? $profile['birthmonth'] : '--') . '月' . ($profile['birthday'] ? $profile['birthday'] : '--') .'日';
- }
- template('user/edit-base');
- }
- if ($do == 'edit_modules_tpl') {
- if ($_W['isajax'] && $_W['ispost']) {
- if (intval($_GPC['groupid']) == $user['groupid']){
- iajax(2, '未做更改!');
- }
- if (!empty($_GPC['type']) && !empty($_GPC['groupid'])) {
- $data['uid'] = $uid;
- $data[$_GPC['type']] = intval($_GPC['groupid']);
- if (user_update($data)) {
- $group_info = user_founder_group_detail_info($_GPC['groupid']);
- iajax(0, $group_info, '');
- } else {
- iajax(1, '更改失败!', '');
- }
- } else {
- iajax(-1, '参数错误!', '');
- }
- }
- $groups = user_founder_group();
- $group_info = user_founder_group_detail_info($user['groupid']);
- template('founder/edit-modules-tpl');
- }
-
- if ($do == 'edit_account') {
- $account_detail = user_account_detail_info($uid);
- template('user/edit-account');
- }
|