用户UID
$haozidashuju = $_G['cache']['plugin']['haozi_xgdata']; $uids = explode("\r\n", trim($haozidashuju['uids'])); if (!in_array($_G['uid'], $uids)) { showmessage('请登录之后再继续操作!', '', array(), array('login' => true)); } include template('haozi_xgdata:xiguadata/index', 0, '/source/plugin/haozi_xgdata/template');
用户组
$yonghuzu = empty($haozidashuju['yonghuzu']) ? array() : unserialize($haozidashuju['yonghuzu']); if (!in_array($_G['group']['groupid'], $yonghuzu)) { showmessage('请登录之后再继续操作!', '', array(), array('login' => true)); } include template('haozi_xgdata:xiguadata/index', 0, '/source/plugin/haozi_xgdata/template');
用户组和用户同时限制写法:
$haoziuids = explode(",", trim($haozidashuju['haoziuids'])); $yonghuzu = empty($haozidashuju['yonghuzu']) ? array() : unserialize($haozidashuju['yonghuzu']); if (!in_array($_G['uid'], $haoziuids) && $haoziuids != 0 && !in_array($_G['group']['groupid'], $yonghuzu)) { showmessage($haozidashuju['xianzhitishi'], '', array(), array('login' => true)); }
还没有评论,来说两句吧...