fetch_all_by_like_username($_GET['username'])); $uids = $uids ? $uids : array(0); $mpurl .= '&username='.dhtmlspecialchars($_GET['username']); } if($_GET['inherited']) { $inherited = ' checked'; $mpurl .= '&inherited=1'; } $ordersc = array($_GET['ordersc']=>' selected'); $perpage = in_array($_GET['perpage'], array(10,20,50,100)) ? $_GET['perpage'] : 20; $start = ($page-1)*$perpage; $perpages = array($perpage => ' selected'); $searchlang = array(); $keys = array('search', 'resultsort', 'orderdesc', 'orderasc', 'perpage_10', 'perpage_20', 'perpage_50', 'perpage_100', 'likesupport', 'uid', 'username', 'portalpermission_no_inherited'); foreach ($keys as $key) { $searchlang[$key] = cplang($key); } echo <<
$searchlang[uid] $searchlang[username]* *$searchlang[likesupport]
$searchlang[resultsort]
SEARCH; showformheader('portalpermission&operation='.$operation); showtableheader('portalpermission'); if($operation == 'article') { showsubtitle(array('username', 'portalcategory', 'portalcategory_perm_publish', 'portalcategory_perm_manage', 'block_perm_inherited')); showtagheader('tbody', '', true); loadcache('portalcategory'); $wherearr = array(); if(($where = $_GET['uid'] ? 'uid='.$_GET['uid'] : ($uids ? 'uid IN('.dimplode($uids).')' : ''))) { $wherearr[] = $where; } if($inherited) { $wherearr[] = 'inheritedcatid = \'\''; } $wheresql = $wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''; $uids = $_GET['uid'] ? array($_GET['uid']) : $uids; $count = C::t('portal_category_permission')->count_by_uids($uids, !$inherited); if($count) { $permissions = C::t('portal_category_permission')->fetch_all_by_uid($uids, !$inherited, $_GET['ordersc'], $start, $perpage); foreach($permissions as $value) { $uids[$value['uid']] = $value['uid']; } if(empty($members)) $members = C::t('common_member')->fetch_all($uids); $multipage = multi($count, $perpage, $page, $mpurl.'&perpage='.$perpage); foreach($permissions as $value){ showtablerow('', '', array( $members[$value['uid']]['username'], ''.$_G['cache']['portalcategory'][$value['catid']]['catname'].'', $value['allowpublish'] ? $right : $line, $value['allowmanage'] ? $right : $line, $value['inheritedcatid'] ? ''.$_G['cache']['portalcategory'][$value['inheritedcatid']]['catname'].'' : $line, )); } echo ''.$multipage.''; } showtagfooter('tbody'); } elseif ($operation == 'template') { showsubtitle(array('username', 'diytemplate_name', 'block_perm_manage', 'block_perm_recommend', 'block_perm_needverify', 'block_perm_inherited')); showtagheader('tbody', '', true); loadcache('diytemplatename'); $uids = $_GET['uid'] ? array($_GET['uid']) : $uids; $count = C::t('common_template_permission')->count_by_uids($uids, !$inherited); if($count) { $permissions = C::t('common_template_permission')->fetch_all_by_uid($uids, !$inherited, $_GET['ordersc'], $start, $perpage); foreach($permissions as $value) { $uids[$value['uid']] = $value['uid']; } if(empty($members)) $members = C::t('common_member')->fetch_all($uids); $multipage = multi($count, $perpage, $page, $mpurl.'&perpage='.$perpage); foreach($permissions as $value){ $targettplname = $_G['cache']['diytemplatename'][$value['targettplname']]; showtablerow('', '', array( $members[$value['uid']]['username'], ''.$targettplname.'', $value['allowmanage'] ? $right : $line, $value['allowrecommend'] ? $right : $line, $value['needverify'] ? $right : $line, $value['inheritedtplname'] ? ''.$_G['cache']['diytemplatename'][$value['inheritedtplname']].'' : $line, )); } echo ''.$multipage.''; } showtagfooter('tbody'); } elseif ($operation == 'block') { showsubtitle(array('username', 'block_name', 'block_perm_manage', 'block_perm_recommend', 'block_perm_needverify', 'block_perm_inherited')); showtagheader('tbody', '', true); loadcache('diytemplatename'); $uids = $_GET['uid'] ? array($_GET['uid']) : $uids; if(($count = C::t('common_block_permission')->count_by_uids($uids, !$inherited))) { $blocks = $bids = array(); $permissions = C::t('common_block_permission')->fetch_all_by_uid($uids, !$inherited, $_GET['ordersc'], $start, $perpage); foreach($permissions as $value) { $uids[$value['uid']] = $value['uid']; $bids[$value['bid']] = $value['bid']; } if($bids) $blocks = C::t('common_block')->fetch_all($bids); if(empty($members)) $members = C::t('common_member')->fetch_all($uids); $multipage = multi($count, $perpage, $page, $mpurl.'&perpage='.$perpage); foreach($permissions as $value){ $blockname = $blocks[$value['bid']]['name'] ? $blocks[$value['bid']]['name'] : $value['bid']; showtablerow('', '', array( $members[$value['uid']]['username'], ''.$blockname.'', $value['allowmanage'] ? $right : $line, $value['allowrecommend'] ? $right : $line, $value['needverify'] ? $right : $line, $value['inheritedtplname'] ? ''.$_G['cache']['diytemplatename'][$value['inheritedtplname']].'' : $line, )); } echo ''.$multipage.''; } showtagfooter('tbody'); } showtablefooter(); showformfooter(); ?>