⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 Typo3, 开源里边最强大的
💻 PHP
📖 第 1 页 / 共 4 页
字号:
<?php/****************************************************************  Copyright notice**  (c) 1999-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)*  All rights reserved**  This script is part of the TYPO3 project. The TYPO3 project is*  free software; you can redistribute it and/or modify*  it under the terms of the GNU General Public License as published by*  the Free Software Foundation; either version 2 of the License, or*  (at your option) any later version.**  The GNU General Public License can be found at*  http://www.gnu.org/copyleft/gpl.html.*  A copy is found in the textfile GPL.txt and important notices to the license*  from the author is found in LICENSE.txt distributed with these scripts.***  This script is distributed in the hope that it will be useful,*  but WITHOUT ANY WARRANTY; without even the implied warranty of*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the*  GNU General Public License for more details.**  This copyright notice MUST APPEAR in all copies of the script!***************************************************************//** * Backend User Administration Module * * @author	Kasper Skaarhoj <kasperYYYY@typo3.com> *//** * [CLASS/FUNCTION INDEX of SCRIPT] * * * *  129: class localPageTree extends t3lib_browseTree *  140:     function localPageTree($BE_USER,$WEBMOUNTS='') *  154:     function ext_permsC() *  165:     function wrapTitle($str,$row) *  177:     function PM_ATagWrap($icon,$cmd,$bMark='') *  188:     function wrapIcon($icon,$row) *  201:     function initializePositionSaving() * * *  222: class printAllPageTree extends localPageTree *  231:     function ext_permsC() *  243:     function PM_ATagWrap($icon,$cmd,$bMark='') *  254:     function wrapIcon($icon,$row) * * *  279: class printAllPageTree_perms extends printAllPageTree *  288:     function printTree($treeArr='',$printPath=0) *  331:     function ext_printPerms($int) *  349:     function ext_groupPerms($row,$firstGroup) * * *  377: class localFolderTree extends t3lib_folderTree *  388:     function localFolderTree($BE_USER,$FILEMOUNTS='') *  403:     function wrapTitle($str,$row) *  415:     function PM_ATagWrap($icon,$cmd,$bMark='') *  426:     function wrapIcon($icon,$row) *  439:     function initializePositionSaving() * * *  463: class printAllFolderTree extends localFolderTree *  475:     function PM_ATagWrap($icon,$cmd,$bMark='') * * *  497: class local_beUserAuth extends t3lib_beUserAuth *  509:     function returnWebmounts($pClause='') *  533:     function ext_non_readAccessPages() *  556:     function user_where_clause() *  568:     function ext_printOverview($uInfo,$compareFlags,$printTrees=0) *  838:     function ext_getReadableButNonmounted() *  873:     function ext_printPerms($int) *  891:     function ext_groupPerms($row,$firstGroup) *  907:     function ext_compileUserInfoForHash($filter=NULL) * 1007:     function ext_uniqueAndSortList($list) * 1021:     function ext_ksortArrayRecursive(&$arr) * 1034:     function ext_workspaceMembership() * * * 1088: class SC_mod_tools_be_user_index * 1100:     function init() * 1128:     function menuConfig() * 1149:     function main() * 1185:     function printContent() * *              SECTION: OTHER FUNCTIONS: * 1207:     function compareUsers($compareFlags) * 1394:     function linkUser($str,$rec) * 1405:     function elementLinks($table,$row) * 1436:     function initUsers() * 1456:     function localPath($str) * 1468:     function switchUser($switchUser) * * TOTAL FUNCTIONS: 39 * (This index is automatically created/updated by the extension "extdeveval") * */require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');require_once (PATH_t3lib.'class.t3lib_browsetree.php');require_once (PATH_t3lib.'class.t3lib_foldertree.php');require_once (PATH_t3lib.'class.t3lib_tstemplate.php');require_once (PATH_t3lib.'class.t3lib_loadmodules.php');require_once (PATH_t3lib.'class.t3lib_tsparser_ext.php');require_once (PATH_typo3.'class.alt_menu_functions.inc');$BE_USER->modAccess($MCONF,1);/** * Base Extension class for printing a page tree (non-browsable though) * * @author	Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_beuser */ class localPageTree extends t3lib_browseTree {	var $expandFirst=0;	var $expandAll=0;	/**	 * Constructor for the local page tree.	 *	 * @param	object		Local backend user (not the GLOBALS[] backend user!!)	 * @param	array		Webmounts for the backend user.	 * @return	void	 */	function localPageTree($BE_USER,$WEBMOUNTS='')	{		$this->init();		$this->BE_USER = $BE_USER;		$this->MOUNTS = $WEBMOUNTS;		$this->clause = $this->ext_permsC();	// Notice, this clause does NOT filter out un-readable pages. This is the POINT since this class is ONLY used for the main overview where ALL is shown! Otherwise "AND '.$this->BE_USER->getPagePermsClause(1).'" should be added.		$this->orderByFields = 'sorting';	}	/**	 * Return select permissions.	 *	 * @return	string		WHERE query part.	 */	function ext_permsC()	{		return '';	}	/**	 * Wraps the title.	 *	 * @param	string		[See parent]	 * @param	array		[See parent]	 * @return	string	 */	function wrapTitle($str,$row)	{		return $str;	}	/**	 * Wraps the plus/minus icon - in this case we just return blank which means we STRIP AWAY the plus/minus icon!	 *	 * @param	string		[See parent]	 * @param	string		[See parent]	 * @param	string		[See parent]	 * @return	string	 */	function PM_ATagWrap($icon,$cmd,$bMark='')	{		return '';	}	/**	 * Wrapping the icon of the element/page. Normally a click menu is wrapped around the icon, but in this case only a title parameter is set.	 *	 * @param	string		Icon image tag.	 * @param	array		Row.	 * @return	string		Icon with title attribute added.	 */	function wrapIcon($icon,$row)	{			// Add title attribute to input icon tag		$title = '['.$row['uid'].'] '.t3lib_BEfunc::getRecordPath($row['uid'],'',15);		$theIcon = $this->addTagAttributes($icon,($this->titleAttrib ? $this->titleAttrib.'="'.htmlspecialchars($title).'"' : '').' border="0"');		return $theIcon;	}	/**	 * This will make sure that no position data is acquired from the BE_USER uc variable.	 *	 * @return	void	 */	function initializePositionSaving()	{		$this->stored=array();	}}/** * Extension class for printing a page tree: All pages of a mount point. * * @author	Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_beuser */class printAllPageTree extends localPageTree {	var $expandFirst=1;	var $expandAll=1;	/**	 * Return select permissions.	 *	 * @return	string		WHERE query part.	 */	function ext_permsC()	{		return ' AND '.$this->BE_USER->getPagePermsClause(1);	}	/**	 * Returns the plus/minus icon.	 *	 * @param	string		[See parent]	 * @param	string		[See parent]	 * @param	string		[See parent]	 * @return	string	 */	function PM_ATagWrap($icon,$cmd,$bMark='')	{		return $icon;	}	/**	 * Wrapping the icon of the element/page. Normally a click menu is wrapped around the icon, but in this case only a title parameter is set.	 *	 * @param	string		Icon image tag.	 * @param	array		Row.	 * @return	string		Icon with title attribute added.	 */	function wrapIcon($icon,$row)	{			// Add title attribute to input icon tag		$title = '['.$row['uid'].']';		$theIcon = $this->addTagAttributes($icon,($this->titleAttrib ? $this->titleAttrib.'="'.htmlspecialchars($title).'"' : '').' border="0"');		return $theIcon;	}}/** * Extension class for printing a page tree: Printing all pages, with permissions. * * @author	Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_beuser */class printAllPageTree_perms extends printAllPageTree {	/**	 * Print the tree of pages.	 *	 * @param	array		The tree items	 * @param	boolean		If set, the path of the pages in the tree is printed (only done for pages outside of mounts).	 * @return	string		HTML content.	 */	function printTree($treeArr='',$printPath=0)	{		$titleLen=intval($this->BE_USER->uc['titleLen']);		$be_user_Array = t3lib_BEfunc::getUserNames();		$be_group_Array = t3lib_BEfunc::getGroupNames();		$lines=array();		$lines[]='<tr class="bgColor5">			<td nowrap="nowrap"><strong>Page title:</strong></td>			'.($printPath?'<td nowrap="nowrap"><strong>Path:</strong></td>':'').'			<td nowrap="nowrap" colspan=2><strong>User:</strong></td>			<td nowrap="nowrap" colspan=2><strong>Group: &nbsp;</strong></td>			<td nowrap="nowrap"><strong>Everybody: &nbsp;</strong></td>			<td nowrap="nowrap"><strong>This user: &nbsp;</strong></td>			<td nowrap="nowrap"><strong>Main group:</strong></td>		</tr>';		if (!is_array($treeArr))	$treeArr=$this->tree;		reset($treeArr);		while(list($k,$v)=each($treeArr))	{			$col1 = ' bgcolor="'.t3lib_div::modifyHtmlColor($GLOBALS['SOBE']->doc->bgColor4,+10,+10,+10).'"';			$row = $v['row'];			$title = htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'],$this->BE_USER->uc['titleLen']));			$lines[]='<tr class="bgColor4">				<td nowrap="nowrap">'.$v['HTML'].$title.' &nbsp;</td>				'.($printPath?'<td nowrap="nowrap">'.htmlspecialchars(t3lib_BEfunc::getRecordPath ($row['pid'],'',15)).' &nbsp;</td>':'').'				<td nowrap="nowrap"'.$col1.'>'.$be_user_Array[$row['perms_userid']]['username'].' &nbsp;</td>				<td nowrap="nowrap"'.$col1.'>'.$this->ext_printPerms($row['perms_user']).' &nbsp;</td>				<td nowrap="nowrap">'.$be_group_Array[$row['perms_groupid']]['title'].' &nbsp;</td>				<td nowrap="nowrap">'.$this->ext_printPerms($row['perms_group']).' &nbsp;</td>				<td nowrap="nowrap" align="center" '.$col1.'>'.$this->ext_printPerms($row['perms_everybody']).' &nbsp;</td>				<td nowrap="nowrap" align="center">'.($row['editlock'] ? '<img '.t3lib_iconWorks::skinImg($this->backPath,'gfx/recordlock_warning2.gif').' title="Edit lock prevents all editing" alt="" />' : $this->ext_printPerms($this->BE_USER->calcPerms($row))).' &nbsp;</td>				<td nowrap="nowrap" align="center">'.$this->ext_printPerms($this->ext_groupPerms($row,$be_group_Array[$this->BE_USER->firstMainGroup])).' &nbsp;</td>			</tr>';		}		return '<table border="0" cellpadding="0" cellspacing="0">'.implode('',$lines).'</table>';	}	/**	 * 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;		}	}}/** * Base Extension class for printing a folder tree (non-browsable though) * * @author	Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_beuser */ class localFolderTree extends t3lib_folderTree {	var $expandFirst=0;	var $expandAll=0;	/**	 * Constructor for the local folder tree.	 *	 * @param	object		Local backend user (not the GLOBALS[] backend user!!)	 * @param	array		Filemounts for the backend user.	 * @return	void	 */	function localFolderTree($BE_USER,$FILEMOUNTS='')	{		$this->init();		$this->BE_USER = $BE_USER;		$this->MOUNTS = $FILEMOUNTS;		$this->clause = '';	// Notice, this clause does NOT filter out un-readable pages. This is the POINT since this class is ONLY used for the main overview where ALL is shown! Otherwise "AND '.$this->BE_USER->getPagePermsClause(1).'" should be added.	}	/**

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -