人人商城

foundercreate.ctrl.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. uni_user_permission_check('system_founder_group_post');
  9. $_W['page']['title'] = '添加创始人 - 创始人管理';
  10. $state = uni_permission($_W['uid']);
  11. if ($state != ACCOUNT_MANAGE_NAME_FOUNDER && $state != ACCOUNT_MANAGE_NAME_VICE_FOUNDER) {
  12. itoast('没有操作权限!', referer(), 'error');
  13. }
  14. if (checksubmit()) {
  15. $user_founder = array(
  16. 'username' => trim($_GPC['username']),
  17. 'password' => trim($_GPC['password']),
  18. 'repassword' => trim($_GPC['repassword']),
  19. 'remark' => $_GPC['remark'],
  20. 'groupid' => intval($_GPC['groupid']),
  21. 'starttime' => TIMESTAMP,
  22. 'endtime' => intval($_GPC['timelimit']),
  23. 'founder_groupid' => ACCOUNT_MANAGE_GROUP_VICE_FOUNDER
  24. );
  25. $user_add = user_info_save($user_founder, true);
  26. if (is_error($user_add)) {
  27. itoast($user_add['message'], '', '');
  28. }
  29. itoast($user_add['message'], url('founder/founderedit', array('uid' => $user_add['uid'])), 'success');
  30. }
  31. $groups = user_founder_group();
  32. template('founder/founder-create');