display.ctrl.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. $founders = explode(',', $_W['config']['setting']['founder']);
  11. if ($do == 'display') {
  12. $founder_groups = user_founder_group();
  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. $search = safe_gpc_string($_GPC['search']);
  18. if (!empty($search)) {
  19. $users_table->searchWithNameOrMobile($search);
  20. }
  21. $group_id = intval($_GPC['groupid']);
  22. if (!empty($group_id)) {
  23. $users_table->searchWithGroupId($group_id);
  24. }
  25. $users_table->searchWithPage($pindex, $psize);
  26. $users_table->searchWithViceFounder();
  27. $users = $users_table->getUsersList();
  28. $total = $users_table->getLastQueryTotal();
  29. $users = user_list_format($users);
  30. $pager = pagination($total, $pindex, $psize);
  31. template('founder/display');
  32. }
  33. if ($do == 'del') {
  34. if (!$_W['isajax'] || !$_W['ispost'] || !in_array($_W['uid'], $founders)) {
  35. iajax(-1, '非法操作!', url('founder/display'));
  36. }
  37. $uid = intval($_GPC['uid']);
  38. $uid_user = user_single($uid);
  39. if (in_array($uid, $founders)) {
  40. iajax(0,'访问错误, 无法操作站长.', url('founder/display'));
  41. }
  42. if (empty($uid_user)) {
  43. iajax(0,'未指定用户,无法删除.', url('founder/display'));
  44. }
  45. if ($uid_user['founder_groupid'] != ACCOUNT_MANAGE_GROUP_VICE_FOUNDER) {
  46. iajax(0,'非法操作!', url('founder/display'));
  47. }
  48. user_delete($uid);
  49. iajax(0,'删除成功!', referer());
  50. }