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

77 lines
2.3KB

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