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

58 lines
2.0KB

  1. <?php
  2. /**
  3. * 文档编辑验证
  4. *
  5. * @version $Id: archives_check_edit.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. require_once(DEDEINC."/image.func.php");
  13. require_once(DEDEINC."/libraries/oxwindow.class.php");
  14. $flag = '';
  15. $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0;
  16. $userip = GetIP();
  17. if ($typeid == 0) {
  18. ShowMsg('请指定文档所属栏目', '-1');
  19. exit();
  20. }
  21. //校验CSRF
  22. CheckCSRF();
  23. $query = "SELECT tp.ispart,tp.channeltype,tp.issend,ch.issend as cissend,ch.sendrank,ch.arcsta,ch.addtable,ch.fieldset,ch.usertype FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id='$typeid' ";
  24. $cInfos = $dsql->GetOne($query);
  25. $addtable = $cInfos['addtable'];
  26. //检测栏目是否有投稿权限
  27. if ($cInfos['issend'] != 1 || $cInfos['ispart'] != 0 || $cInfos['channeltype'] != $channelid || $cInfos['cissend'] != 1) {
  28. ShowMsg("您所选择的栏目不支持投稿", "-1");
  29. exit();
  30. }
  31. //文档的默认状态
  32. if ($cInfos['arcsta'] == 0) {
  33. $ismake = 0;
  34. $arcrank = 0;
  35. } else if ($cInfos['arcsta'] == 1) {
  36. $ismake = -1;
  37. $arcrank = 0;
  38. } else {
  39. $ismake = 0;
  40. $arcrank = -1;
  41. }
  42. //对保存的内容进行处理
  43. $title = cn_substrR(HtmlReplace($title, 1), $cfg_title_maxlen);
  44. $writer = cn_substrR(HtmlReplace($writer, 1), 20);
  45. if (empty($description)) $description = '';
  46. $description = cn_substrR(HtmlReplace($description, 1), 250);
  47. $keywords = cn_substrR(HtmlReplace($tags, 1), 30);
  48. $mid = $cfg_ml->M_ID;
  49. $midQuery = "SELECT mid FROM `#@__arctiny` WHERE id='$aid'";
  50. $midRow = $dsql->GetOne($midQuery);
  51. if ($midRow['mid'] != $mid) {
  52. ShowMsg('您暂无权限在这里进行修改文档', 'javascript:;');
  53. exit;
  54. }
  55. $isadmin = ($cfg_ml->fields['matt'] == 10 ? true : false);
  56. if (empty($oldlitpic)) {
  57. $oldlitpic = '';
  58. }