国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1KB

  1. <?php
  2. /**
  3. * @version $Id: edit_email.php 2020/12/18 tianya $
  4. * @package DedeBIZ.Member
  5. * @copyright Copyright (c) 2020, DedeBIZ.COM
  6. * @license https://www.dedebiz.com/license
  7. * @link https://www.dedebiz.com
  8. */
  9. require_once(dirname(__FILE__) . "/config.php");
  10. $dopost = isset($dopost) ? $dopost : "";
  11. if (!isset($backurl)) {
  12. $backurl = 'edit_email.php';
  13. }
  14. if ($dopost == 'save') {
  15. if (!empty($cfg_ml->fields['email']) || $cfg_ml->fields['checkmail'] != -1) {
  16. ShowMsg('Email已经设置,无需重复提交!', '-1');
  17. exit();
  18. }
  19. // 校验CSRF
  20. CheckCSRF();
  21. if (!CheckEmail($email)) {
  22. ShowMsg('Email格式不正确!', '-1');
  23. exit();
  24. }
  25. $email = HtmlReplace($email, -1);
  26. $query = "UPDATE `#@__member` SET `email` = '$email' WHERE mid='{$cfg_ml->M_ID}' ";
  27. $dsql->ExecuteNoneQuery($query);
  28. // 清除缓存
  29. $cfg_ml->DelCache($cfg_ml->M_ID);
  30. ShowMsg('成功更新邮箱信息!', $backurl);
  31. exit();
  32. }
  33. $email = $cfg_ml->fields['email'];
  34. include(DEDEMEMBER . "/templets/edit_email.htm");
  35. exit();