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

98 lines
3.1KB

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