manage.ctrl.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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('xzapp');
  8. $account_info = permission_user_account_num();
  9. $do = safe_gpc_belong($do, array('create'), 'list');
  10. if($do == 'create') {
  11. if (!user_is_founder($_W['uid']) && $account_info['xzapp_limit'] < 0) {
  12. itoast('创建熊掌号个数已满', url('account/display', array('type' => XZAPP_TYPE_SIGN)));
  13. }
  14. if(checksubmit()) {
  15. $data = array(
  16. 'name' => safe_gpc_string($_GPC['name']),
  17. 'description' => safe_gpc_string($_GPC['description'])
  18. );
  19. $account_table = table('account');
  20. $account_table->searchWithTitle($data['name']);
  21. $account_table->searchWithType(ACCOUNT_TYPE_XZAPP_NORMAL);
  22. $exists = $account_table->searchAccountList();
  23. if (!empty($exists)) {
  24. itoast('该熊掌号名称已经存在!', url('account/display', array('type' => XZAPP_TYPE_SIGN)), 'error');
  25. }
  26. $uniacid = xzapp_create($data, $_W['uid']);
  27. if ($uniacid) {
  28. itoast('创建成功', url('account/display', array('type' => XZAPP_TYPE_SIGN)));
  29. } else {
  30. itoast('创建失败', '', 'error');
  31. }
  32. }
  33. template('xzapp/create');
  34. }