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

93 lines
2.6KB

  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(preg_match("/3/",$safe_gdopen)){
  19. if(strtolower($vdcode)!=$svali || $svali=='')
  20. {
  21. ResetVdValue();
  22. ShowMsg('验证码错误!', '-1');
  23. exit();
  24. }
  25. }
  26. if($typeid==0)
  27. {
  28. ShowMsg('请指定文档隶属的栏目!','-1');
  29. exit();
  30. }
  31. $query = "SELECT tp.ispart,tp.channeltype,tp.issend,ch.issend as cissend,ch.sendrank,ch.arcsta,ch.addtable,ch.fieldset,ch.usertype
  32. FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id='$typeid' ";
  33. $cInfos = $dsql->GetOne($query);
  34. $addtable = $cInfos['addtable'];
  35. //检测栏目是否有投稿权限
  36. if($cInfos['issend']!=1 || $cInfos['ispart']!=0|| $cInfos['channeltype']!=$channelid || $cInfos['cissend']!=1)
  37. {
  38. ShowMsg("你所选择的栏目不支持投稿!","-1");
  39. exit();
  40. }
  41. //文档的默认状态
  42. if($cInfos['arcsta']==0)
  43. {
  44. $ismake = 0;
  45. $arcrank = 0;
  46. }
  47. else if($cInfos['arcsta']==1)
  48. {
  49. $ismake = -1;
  50. $arcrank = 0;
  51. }
  52. else
  53. {
  54. $ismake = 0;
  55. $arcrank = -1;
  56. }
  57. //对保存的内容进行处理
  58. $title = cn_substrR(HtmlReplace($title,1),$cfg_title_maxlen);
  59. $writer = cn_substrR(HtmlReplace($writer,1),20);
  60. if(empty($description)) $description = '';
  61. $description = cn_substrR(HtmlReplace($description,1),250);
  62. $keywords = cn_substrR(HtmlReplace($tags,1),30);
  63. $mid = $cfg_ml->M_ID;
  64. $midQuery = "SELECT mid FROM `#@__arctiny` WHERE id='$aid'";
  65. $midRow = $dsql->GetOne($midQuery);
  66. if($midRow['mid'] != $mid)
  67. {
  68. ShowMsg('您暂无权限在这里进行修改文档!','javascript:;');
  69. exit;
  70. }
  71. $isadmin = ($cfg_ml->fields['matt']==10 ? true : false);
  72. if (empty($oldlitpic))
  73. {
  74. $oldlitpic = '';
  75. }
  76. //处理上传的缩略图
  77. if($litpic != '')
  78. {
  79. $litpic = MemberUploads('litpic', $oldlitpic, $mid, 'image', '', $cfg_ddimg_width, $cfg_ddimg_height, false, $isadmin);
  80. SaveUploadInfo($title, $litpic, 1);
  81. }
  82. else
  83. {
  84. $litpic =$oldlitpic; if (strpos( $litpic, '..') !== false || strpos( $litpic, $cfg_user_dir."/{$userid}/" ) === false) exit('not allowed path!');
  85. }