display.ctrl.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. $dos = array('display', 'del');
  9. $do = in_array($do, $dos) ? $do: 'display';
  10. $_W['page']['title'] = '用户列表 - 用户管理';
  11. $founders = explode(',', $_W['config']['setting']['founder']); $identity = uni_permission($_W['uid']); if ($identity != ACCOUNT_MANAGE_NAME_FOUNDER && $identity != ACCOUNT_MANAGE_NAME_VICE_FOUNDER) { itoast('???????', referer(), 'error');}
  12. if ($do == 'display') {
  13. $pindex = max(1, intval($_GPC['page']));
  14. $psize = 20;
  15. $users_table = table('users');
  16. $users_table->searchWithFounder(ACCOUNT_MANAGE_GROUP_VICE_FOUNDER);
  17. $username = trim($_GPC['username']);
  18. if (!empty($username)) {
  19. $users_table->searchWithName($username);
  20. }
  21. $users_table->searchWithPage($pindex, $psize);
  22. $users = $users_table->searchUsersList();
  23. $total = $users_table->getLastQueryTotal();
  24. $users = user_list_format($users);
  25. $pager = pagination($total, $pindex, $psize);
  26. template('founder/display');
  27. }
  28. if ($do == 'del') {
  29. if (!$_W['isajax'] || !$_W['ispost']) {
  30. iajax(-1, '非法操作!', url('founder/display'));
  31. }
  32. $uid = intval($_GPC['uid']);
  33. $uid_user = user_single($uid);
  34. if (in_array($uid, $founders)) {
  35. iajax(0,'访问错误, 无法操作站长.', url('founder/display'));
  36. }
  37. if (empty($uid_user)) {
  38. iajax(0,'未指定用户,无法删除.', url('founder/display'));
  39. }
  40. if ($uid_user['founder_groupid'] != ACCOUNT_MANAGE_GROUP_VICE_FOUNDER) {
  41. iajax(0,'非法操作!', url('founder/display'));
  42. }
  43. user_delete($uid);
  44. iajax(0,'删除成功!', referer());
  45. }