通达OA官方提供的30源代码,感觉很实在
源代码在线查看: check_priv.php
$PRIV_NO_FLAG="1";
$MANAGE_FLAG="1";
$MODULE_ID=9;
include_once("inc/my_priv.php");
//---------第一次加载页面,要根据管理范围列出人员,而不是显示本部门----------
if($DEPT_PRIV=="0")
{
$WHERE_STR.=" and b.DEPT_ID='$LOGIN_DEPT_ID'";
}
else if($DEPT_PRIV=="2")
{
$WHERE_STR.=" and find_in_set(b.DEPT_ID, '$DEPT_ID_STR')";
}
else if($DEPT_PRIV=="3")
$WHERE_STR.=" and find_in_set(b.USER_ID, '$USER_ID_STR')";
if($ROLE_PRIV == "0")
$WHERE_STR.=" and g.PRIV_NO>'$MY_PRIV_NO'";
else if($ROLE_PRIV == "1")
$WHERE_STR.=" and g.PRIV_NO>='$MY_PRIV_NO'";
else if($ROLE_PRIV == "3")
$WHERE_STR.=" and find_in_set(g.PRIV_NO,'$PRIV_ID_STR')";
?>