spacecp_domain.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: spacecp_domain.php 24601 2011-09-27 12:26:41Z zhengqingpeng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. $domainlength = checkperm('domainlength');
  12. if($_G['setting']['allowspacedomain'] && !empty($_G['setting']['domain']['root']['home']) && $domainlength) {
  13. checklowerlimit('modifydomain');
  14. } else {
  15. showmessage('no_privilege_spacedomain');
  16. }
  17. if(submitcheck('domainsubmit')) {
  18. $setarr = array();
  19. $_POST['domain'] = strtolower(trim($_POST['domain']));
  20. if($_POST['domain'] != $space['domain']) {
  21. if(empty($domainlength) || empty($_POST['domain'])) {
  22. $setarr['domain'] = '';
  23. } else {
  24. require_once libfile('function/domain');
  25. if(domaincheck($_POST['domain'], $_G['setting']['domain']['root']['home'], $domainlength)) {
  26. $setarr['domain'] = $_POST['domain'];
  27. }
  28. }
  29. }
  30. if($setarr) {
  31. updatecreditbyaction('modifydomain');
  32. C::t('common_member_field_home')->update($_G['uid'], $setarr);
  33. require_once libfile('function/delete');
  34. deletedomain($_G['uid'], 'home');
  35. if(!empty($setarr['domain'])) {
  36. C::t('common_domain')->insert(array('domain' => $setarr['domain'], 'domainroot' => $_G['setting']['domain']['root']['home'], 'id' => $_G['uid'], 'idtype' => 'home'));
  37. }
  38. }
  39. showmessage('domain_succeed', 'home.php?mod=spacecp&ac=domain');
  40. }
  41. $defaultop = '';
  42. $profilegroup = C::t('common_setting')->fetch('profilegroup', true);
  43. $actives = array('profile' =>' class="a"');
  44. $opactives = array('domain' =>' class="a"');
  45. include_once template("home/spacecp_domain");
  46. ?>