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

51 lines
1.5KB

  1. <?php
  2. /**
  3. * 系统权限组编辑
  4. *
  5. * @version $Id: sys_group_edit.php 1 22:28 2010年7月20日Z tianya $
  6. * @package DedeCMS.Administrator
  7. * @copyright Copyright (c) 2020, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. CheckPurview('sys_Group');
  13. if(empty($dopost)) $dopost = "";
  14. if($dopost=='save')
  15. {
  16. if($rank==10)
  17. {
  18. ShowMsg('超级管理员的权限不允许更改!', 'sys_group.php');
  19. exit();
  20. }
  21. $purview = "";
  22. if(is_array($purviews))
  23. {
  24. foreach($purviews as $p)
  25. {
  26. $purview .= "$p ";
  27. }
  28. $purview = trim($purview);
  29. }
  30. $dsql->ExecuteNoneQuery("UPDATE `#@__admintype` SET typename='$typename',purviews='$purview' WHERE CONCAT(`rank`)='$rank'");
  31. ShowMsg('成功更改用户组的权限!', 'sys_group.php');
  32. exit();
  33. }
  34. else if($dopost=='del')
  35. {
  36. $dsql->ExecuteNoneQuery("DELETE FROM `#@__admintype` WHERE CONCAT(`rank`)='$rank' AND system='0';");
  37. ShowMsg("成功删除一个用户组!","sys_group.php");
  38. exit();
  39. }
  40. $groupRanks = Array();
  41. $groupSet = $dsql->GetOne("SELECT * FROM `#@__admintype` WHERE CONCAT(`rank`)='{$rank}' ");
  42. $groupRanks = explode(' ', $groupSet['purviews']);
  43. include DedeInclude('templets/sys_group_edit.htm');
  44. //检查是否已经有此权限
  45. function CRank($n)
  46. {
  47. global $groupRanks;
  48. return in_array($n,$groupRanks) ? ' checked' : '';
  49. }