人人商城

bind-domain.ctrl.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536
  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. $dos = array('bind_domain', 'delete');
  8. $do = in_array($do, $dos) ? $do : 'bind_domain';
  9. $_W['page']['title'] = '域名绑定';
  10. if ($do == 'bind_domain') {
  11. if (checksubmit('submit')) {
  12. $bind_domain = trim($_GPC['bind_domain']);
  13. if (!starts_with($bind_domain, 'http')) {
  14. iajax(-1, '要绑定的域名请以http://或以https://开头');
  15. }
  16. $special_domain = array('.com.cn', '.net.cn', '.gov.cn', '.org.cn', '.com.hk', '.com.tw');
  17. $bind_domain = str_replace($bind_domain, '.com', $bind_domain);
  18. $domain_array = explode('.', $bind_domain);
  19. if (count($domain_array) > 3 || count($domain_array) <2) {
  20. iajax(-1, '只支持一级域名和二级域名!');
  21. }
  22. $data = array('domain' => trim($_GPC['bind_domain']));
  23. uni_setting_save('bind_domain', iserializer($data));
  24. iajax(0, '更新成功!', referer());
  25. }
  26. template('profile/bind-domain');
  27. }
  28. if ($do == 'delete') {
  29. uni_setting_save('bind_domain', array());
  30. itoast('删除成功!', referer(), 'success');
  31. }