📄 index.php
字号:
} // Implode for display: $out[$k] = implode('<br />',$pout); break; case 'workspace_perms': $out[$k] = implode('<br/>',explode(', ',t3lib_BEfunc::getProcessedValue('be_users','workspace_perms',$v))); break; case 'workspace_membership': $out[$k] = implode('<br/>',$this->ext_workspaceMembership()); break; case 'custom_options': // Explode and flip values: $nef = array_flip(explode(',',$v)); $pout = array(); // Initialize: $customOptions = $GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions']; if (is_array($customOptions)) { foreach($customOptions as $coKey => $coValue) { if (is_array($coValue['items'])) { // Traverse items: foreach($coValue['items'] as $itemKey => $itemCfg) { $v = $coKey.':'.$itemKey; if (isset($nef[$v])) { unset($nef[$v]); $pout[] = $GLOBALS['LANG']->sl($coValue['header']).' / '.$GLOBALS['LANG']->sl($itemCfg[0]); } } } } } // Add remaining: if (count($nef)) { $pout = array_merge($pout, array_keys($nef)); } // Implode for display: $out[$k] = implode('<br />',$pout); break; } } } return $out; } /** * Get HTML code for the pages which were mounted, but NOT readable! * * @return string HTML code. */ function ext_getReadableButNonmounted() { // List of page id mounts which ARE mounted (and should therefore not be selected) if (!$this->ext_pageIdsFromMounts) { $this->ext_pageIdsFromMounts=0; } // User and group names: $be_user_Array = t3lib_BEfunc::getUserNames(); $be_group_Array = t3lib_BEfunc::getGroupNames(); // Create query: $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'pid,uid,title,doktype,perms_user,perms_group,perms_everybody,perms_userid,perms_groupid'.(t3lib_extMgm::isLoaded('cms')?',media,layout,hidden,starttime,endtime,fe_group,extendToSubpages':''), 'pages', 'uid NOT IN ('.$this->ext_pageIdsFromMounts.') AND '.$this->getPagePermsClause(1).t3lib_BEfunc::deleteClause('pages') ); $dat = array(); while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $dat[] = array( 'row'=>$row, 'HTML'=>t3lib_iconWorks::getIconImage('pages',$row,$GLOBALS['BACK_PATH'],'align="top" title="['.$row['uid'].']"') // .htmlspecialchars($row['title']) ); } $className=t3lib_div::makeInstanceClassName('printAllPageTree_perms'); $pp = new $className($this); return $pp->printTree($dat,1); } /** * Print a set of permissions * * @param integer The permissions integer. * @return string HTML formatted. */ function ext_printPerms($int) { $str=''; $str.= (($int&1)?'*':'<font color="red">x</font>'); $str.= (($int&16)?'*':'<font color="red">x</font>'); $str.= (($int&2)?'*':'<font color="red">x</font>'); $str.= (($int&4)?'*':'<font color="red">x</font>'); $str.= (($int&8)?'*':'<font color="red">x</font>'); return '<b><font color="green">'.$str.'</font></b>'; } /** * returns the permissions for a group based of the perms_groupid of $row. If the $row[perms_groupid] equals the $firstGroup[uid] then the function returns perms_everybody OR'ed with perms_group, else just perms_everybody * * @param array Page record. * @param array First-group record. * @return integer Permissions. */ function ext_groupPerms($row,$firstGroup) { if (is_array($row)) { $out=intval($row['perms_everybody']); if ($row['perms_groupid'] && $firstGroup['uid']==$row['perms_groupid']) { $out|= intval($row['perms_group']); } return $out; } } /** * Creates uInfo array for the user. * * @param array Might contain array where keys/values indicate whether to render a certain value * @return array Array with the information of the user for each analysis topic. */ function ext_compileUserInfoForHash($filter=NULL) { $uInfo=array(); $renderAll = !is_array($filter); // Filemounts: if ($renderAll || $filter['filemounts']) { $uInfo['filemounts'] = $this->ext_uniqueAndSortList(implode(',',array_keys($this->groupData['filemounts']))); } // DBmounts: if ($renderAll || $filter['webmounts']) { $uInfo['webmounts'] = $this->ext_uniqueAndSortList($this->groupData['webmounts']); } // Sharing Upload Folder if ($renderAll || $filter['tempPath']) { $fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions'); $fileProcessor->init($this->groupData['filemounts'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']); $uInfo['tempPath'] = $fileProcessor->findTempFolder(); // The closest TEMP-path is found } // First Main Group: if ($renderAll || $filter['firstMainGroup']) { $uInfo['firstMainGroup'] = $this->firstMainGroup; } // Group List: if ($renderAll || $filter['groupList']) { $uInfo['groupList'] = $this->groupList; // This gives a list that shows in which order the groups are processed. This may result in a list of groups which is similar to that of another user regarding which group but not the order of groups. For now, I believe it's most usefull to let separate orders of groups appear as different group settings for a user. } // Page Types: if ($renderAll || $filter['pagetypes_select']) { $uInfo['pagetypes_select'] = $this->ext_uniqueAndSortList($this->groupData['pagetypes_select']); } // Tables select: if ($renderAll || $filter['tables_select']) { $uInfo['tables_select'] = $this->ext_uniqueAndSortList($this->groupData['tables_select'].','.$this->groupData['tables_modify']); } // Tables modify: if ($renderAll || $filter['tables_modify']) { $uInfo['tables_modify'] = $this->ext_uniqueAndSortList($this->groupData['tables_modify']); } // Non-exclude fields: if ($renderAll || $filter['non_exclude_fields']) { $uInfo['non_exclude_fields'] = $this->ext_uniqueAndSortList($this->groupData['non_exclude_fields']); } // Explicit Allow/Deny: if ($renderAll || $filter['explicit_allowdeny']) { $uInfo['explicit_allowdeny'] = $this->ext_uniqueAndSortList($this->groupData['explicit_allowdeny']); } // Limit to languages: if ($renderAll || $filter['allowed_languages']) { $uInfo['allowed_languages'] = $this->ext_uniqueAndSortList($this->groupData['allowed_languages']); } // Workspace permissions if ($renderAll || $filter['workspace_perms']) { $uInfo['workspace_perms'] = $this->ext_uniqueAndSortList($this->groupData['workspace_perms']); } // Workspace membership if ($renderAll || $filter['workspace_membership']) { $uInfo['workspace_membership'] = $this->ext_workspaceMembership(); } // Custom options: if ($renderAll || $filter['custom_options']) { $uInfo['custom_options'] = $this->ext_uniqueAndSortList($this->groupData['custom_options']); } // Modules: if ($renderAll || $filter['modules']) { $uInfo['modules'] = $this->ext_uniqueAndSortList($this->groupData['modules']); } // User TS: $this->ext_ksortArrayRecursive($this->userTS); if ($renderAll || $filter['userTS']) { $uInfo['userTS'] = $this->userTS; } if ($renderAll || $filter['userTS_hl']) { $uInfo['userTS_hl'] = $this->userTS_text; } return $uInfo; } /** * Sorts a commalist of values and removes duplicates. * * @param string Commalist. * @return string Sorted, unique commalist. */ function ext_uniqueAndSortList($list) { $uList=t3lib_div::trimExplode(',',$list,1); sort($uList); $uList=array_unique($uList); $uList=implode(',',$uList); return $uList; } /** * Key sort input array recursively. * * @param array Multidimensional array (value by reference!) * @return void */ function ext_ksortArrayRecursive(&$arr) { krsort($arr); reset($arr); while(list($k,$v)=each($arr)) { if (is_array($v)) $this->ext_ksortArrayRecursive($arr[$k]); } } /** * [Describe function...] * * @return [type] ... */ function ext_workspaceMembership() { // Create accessible workspace arrays: $options = array(); if ($this->checkWorkspace(array('uid' => 0))) { $options[0] = '0: [LIVE]'; } if ($this->checkWorkspace(array('uid' => -1))) { $options[-1] = '-1: [Default Draft]'; } // Add custom workspaces (selecting all, filtering by BE_USER check): $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,adminusers,members,reviewers,db_mountpoints','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title'); if (count($workspaces)) { foreach ($workspaces as $rec) { if ($this->checkWorkspace($rec)) { $options[$rec['uid']] = $rec['uid'].': '.$rec['title']; // Check if all mount points are accessible, otherwise show error: if (trim($rec['db_mountpoints'])!=='') { $mountPoints = t3lib_div::intExplode(',',$this->workspaceRec['db_mountpoints'],1); foreach($mountPoints as $mpId) { if (!$this->isInWebMount($mpId,'1=1')) { $options[$rec['uid']].= '<br> \- WARNING: Workspace Webmount page id "'.$mpId.'" not accessible!'; } } } } } } return $options; }}/** * Main script class * * @author Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_beuser */class SC_mod_tools_be_user_index { var $MCONF=array(); var $MOD_MENU=array(); var $MOD_SETTINGS=array(); var $doc; var $include_once=array(); var $content; /** * @return [type] ... */ function init() { $this->MCONF = $GLOBALS['MCONF']; $this->menuConfig(); $this->switchUser(t3lib_div::_GP('SwitchUser')); // ************************** // Initializing // ************************** $this->doc = t3lib_div::makeInstance('noDoc'); $this->doc->form='<form action="" method="POST">'; $this->doc->backPath = $GLOBALS['BACK_PATH']; // JavaScript $this->doc->JScode = $this->doc->wrapScriptTags(' script_ended = 0; function jumpToUrl(URL) { // window.location.href = URL; } ' . $this->doc->redirectUrls()); } /** * [Describe function...] * * @return [type] ... */ function menuConfig() { // MENU-ITEMS: // If array, then it's a selector box menu // If empty string it's just a variable, that'll be saved. // Values NOT in this array will not be saved in the settings-array for the module. $this->MOD_MENU = array( 'function' => array( 'compare' => 'Compare User Settings', 'whoisonline' => 'List Users Online' ) ); // CLEAN SETTINGS $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name'], 'ses'); } /** * [Describe function...] * * @return [type] ... */ function main() { $this->content=''; $this->content.=$this->doc->startPage('Backend User Administration'); $menu=t3lib_BEfunc::getFuncMenu(0,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function']); $this->content.=$this->doc->header('Backend User Administration'); $this->content.=$this->doc->spacer(5); $this->content.=$this->doc->section('',$menu).$this->doc->divider(5); switch($this->MOD_SETTINGS['function']) { case 'compare': if (t3lib_div::_GP('ads')) { $compareFlags = t3lib_div::_GP('compareFlags'); $GLOBALS['BE_USER']->pushModuleData('tools_beuser/index.php/compare',$compareFlags); } else { $compareFlags = $GLOBALS['BE_USER']->getModuleData('tools_beuser/index.php/compare','ses'); } $this->content.=$this->compareUsers($compareFlags); break; case 'whoisonline': $this->content.=$this->whoIsOnline(); break; } if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $this->content.=$this->doc->spacer(20). $this->doc->section('',$this->doc->makeShortcutIcon('be_user_uid,compareFlags','function',$this->MCONF['name'])); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -