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

59 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
  24. FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id='$typeid' ";
  25. $cInfos = $dsql->GetOne($query);
  26. $addtable = $cInfos['addtable'];
  27. //检测栏目是否有投稿权限
  28. if ($cInfos['issend'] != 1 || $cInfos['ispart'] != 0 || $cInfos['channeltype'] != $channelid || $cInfos['cissend'] != 1) {
  29. ShowMsg("您所选择的栏目不支持投稿", "-1");
  30. exit();
  31. }
  32. //文档的默认状态
  33. if ($cInfos['arcsta'] == 0) {
  34. $ismake = 0;
  35. $arcrank = 0;
  36. } else if ($cInfos['arcsta'] == 1) {
  37. $ismake = -1;
  38. $arcrank = 0;
  39. } else {
  40. $ismake = 0;
  41. $arcrank = -1;
  42. }
  43. //对保存的内容进行处理
  44. $title = cn_substrR(HtmlReplace($title, 1), $cfg_title_maxlen);
  45. $writer = cn_substrR(HtmlReplace($writer, 1), 20);
  46. if (empty($description)) $description = '';
  47. $description = cn_substrR(HtmlReplace($description, 1), 250);
  48. $keywords = cn_substrR(HtmlReplace($tags, 1), 30);
  49. $mid = $cfg_ml->M_ID;
  50. $midQuery = "SELECT mid FROM `#@__arctiny` WHERE id='$aid'";
  51. $midRow = $dsql->GetOne($midQuery);
  52. if ($midRow['mid'] != $mid) {
  53. ShowMsg('您暂无权限在这里进行修改文档', 'javascript:;');
  54. exit;
  55. }
  56. $isadmin = ($cfg_ml->fields['matt'] == 10 ? true : false);
  57. if (empty($oldlitpic)) {
  58. $oldlitpic = '';
  59. }