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

47 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 DedeBIZ.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. if ($rank == 10) {
  16. ShowMsg('超级管理员的权限不允许更改!', 'sys_group.php');
  17. exit();
  18. }
  19. $purview = "";
  20. if (is_array($purviews)) {
  21. foreach ($purviews as $p) {
  22. $purview .= "$p ";
  23. }
  24. $purview = trim($purview);
  25. }
  26. $dsql->ExecuteNoneQuery("UPDATE `#@__admintype` SET typename='$typename',purviews='$purview' WHERE CONCAT(`rank`)='$rank'");
  27. ShowMsg('成功更改用户组的权限!', 'sys_group.php');
  28. exit();
  29. } else if ($dopost == 'del') {
  30. $dsql->ExecuteNoneQuery("DELETE FROM `#@__admintype` WHERE CONCAT(`rank`)='$rank' AND system='0';");
  31. ShowMsg("成功删除一个用户组!", "sys_group.php");
  32. exit();
  33. }
  34. $groupRanks = array();
  35. $groupSet = $dsql->GetOne("SELECT * FROM `#@__admintype` WHERE CONCAT(`rank`)='{$rank}' ");
  36. $groupRanks = explode(' ', $groupSet['purviews']);
  37. include DedeInclude('templets/sys_group_edit.htm');
  38. //检查是否已经有此权限
  39. function CRank($n)
  40. {
  41. global $groupRanks;
  42. return in_array($n, $groupRanks) ? ' checked' : '';
  43. }