国内流行的内容管理系统(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.

79 lines
2.8KB

  1. <?php
  2. /**
  3. * 文档验证
  4. *
  5. * @version $Id: archives_check.php 1 13:52 2010年7月9日Z tianya $
  6. * @package DedeBIZ.User
  7. * @copyright Copyright (c) 2022, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. if (!defined('DEDEMEMBER')) exit('dedebiz');
  12. include_once(DEDEINC.'/image.func.php');
  13. include_once(DEDEINC.'/libraries/oxwindow.class.php');
  14. // 游客需要校验验证码
  15. if ($cfg_ml->M_ID === 0) {
  16. $svali = GetCkVdValue();
  17. if (strtolower($vdcode) != $svali || $svali == '') {
  18. ResetVdValue();
  19. ShowMsg('验证码错误', '-1');
  20. exit();
  21. }
  22. }
  23. //校验CSRF
  24. CheckCSRF();
  25. $flag = '';
  26. $autokey = $remote = $dellink = $autolitpic = 0;
  27. $userip = GetIP();
  28. if ($typeid == 0) {
  29. ShowMsg('请指定文档隶属的栏目', '-1');
  30. exit();
  31. }
  32. $query = "Select tp.ispart,tp.channeltype,tp.issend,ch.issend as cissend,ch.sendrank,ch.arcsta,ch.addtable,ch.fieldset,ch.usertype
  33. From `#@__arctype` tp left join `#@__channeltype` ch on ch.id=tp.channeltype where tp.id='$typeid' ";
  34. $cInfos = $dsql->GetOne($query);
  35. //检测栏目是否有投稿权限
  36. if ($cInfos['issend'] != 1 || $cInfos['ispart'] != 0 || $cInfos['channeltype'] != $channelid || $cInfos['cissend'] != 1) {
  37. ShowMsg("您所选择的栏目不支持投稿", "-1");
  38. exit();
  39. }
  40. //检查频道设定的投稿许可权限
  41. if ($cInfos['sendrank'] > $cfg_ml->M_Rank) {
  42. $row = $dsql->GetOne("Select membername From #@__arcrank where `rank`='".$cInfos['sendrank']."' ");
  43. ShowMsg("对不起,需要[".$row['membername']."]才能在这个频道发布文档", "-1", "0", 5000);
  44. exit();
  45. }
  46. if ($cInfos['usertype'] != '' && $cInfos['usertype'] != $cfg_ml->M_MbType) {
  47. ShowMsg("对不起,需要[".$cInfos['usertype']."]才能在这个频道发布文档", "-1", "0", 5000);
  48. exit();
  49. }
  50. //文档的默认状态
  51. if ($cInfos['arcsta'] == 0) {
  52. $ismake = 0;
  53. $arcrank = 0;
  54. } else if ($cInfos['arcsta'] == 1) {
  55. $ismake = -1;
  56. $arcrank = 0;
  57. } else {
  58. $ismake = 0;
  59. $arcrank = -1;
  60. }
  61. //对保存的内容进行处理
  62. $money = 0;
  63. $flag = $shorttitle = $color = $source = '';
  64. $sortrank = $senddate = $pubdate = time();
  65. $title = cn_substrR(HtmlReplace($title, 1), $cfg_title_maxlen);
  66. $writer = cn_substrR(HtmlReplace($writer, 1), 20);
  67. if (empty($description)) $description = '';
  68. $description = cn_substrR(HtmlReplace($description, 1), 250);
  69. $keywords = cn_substrR(HtmlReplace($tags, 1), 30);
  70. $mid = $cfg_ml->M_ID;
  71. //检测文档是否重复
  72. if ($cfg_mb_cktitle == 'Y') {
  73. $row = $dsql->GetOne("SELECT * FROM `#@__archives` WHERE title LIKE '$title' ");
  74. if (is_array($row)) {
  75. ShowMsg("对不起,请不要发布重复文档", "-1", "0", 5000);
  76. exit();
  77. }
  78. }