Bug #17161 » checkaccess.diff
typo3_src-4.1.new/t3lib/class.t3lib_tcemain.php 2007-03-27 14:20:41.000000000 +0200 | ||
---|---|---|
// If record found, check page as well:
|
||
if (is_array($output)) {
|
||
// Looking up the page for record:
|
||
$mres = $this->doesRecordExist_pageLookUp($output['pid'], $perms);
|
||
$pageRec = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($mres);
|
||
// Return true if either a page was found OR if the PID is zero AND the user is ADMIN (in which case the record is at root-level):
|
||
if (is_array($pageRec) || (!$output['pid'] && $this->admin)) {
|
||
$pageRow = t3lib_BEfunc::getRecord('pages',$output['pid']);
|
||
// Return true if either a page was found OR if the PID is zero AND the user is ADMIN (in which case the record is at root-level):
|
||
if ($GLOBALS['BE_USER']->doesUserHaveAccess($pageRow,$perms) || (!$output['pid'] && $this->admin)) {
|
||
return TRUE;
|
||
}
|
||
}
|
||
return FALSE;
|
||
} else {
|
||
$mres = $this->doesRecordExist_pageLookUp($id, $perms);
|
||
return $GLOBALS['TYPO3_DB']->sql_num_rows($mres);
|
||
$pageRow = t3lib_BEfunc::getRecord('pages',$id);
|
||
return $GLOBALS['BE_USER']->doesUserHaveAccess($pageRow,$perms);
|
||
}
|
||
}
|
||
}
|