Issue Bug Closed

#16561Typolink doesn't check if a page in rootline has some access and include subpages is set...

Volker Graubaum 09/13/06, 15:52 updated 09/01/23, 09:33

Description

Typolink doesn’t check the parent sides for enableFields together with include subpages

Example: try to search for a subsite in the indexSearch or link this side directly.
The link is working but you are sent to the first parent side, which is accessable…

typolink checks with calling $GLOBALS[‘TSFE’]->sys_page->getPage

There is no check for parent sides.

(issue imported from #M4213)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 1

History 9

  1. Volker Graubaum commented 09/13/06, 15:56

    To files has to be changed

    1) class.tslib_content.php

    change line 5193 $page = $GLOBALS[‘TSFE’]->sys_page->getPage($link_param,$disableGroupAccessCheck);

    to

    $page = $GLOBALS[‘TSFE’]->sys_page->getPage($link_param,$disableGroupAccessCheck,TRUE);

    (a third parameter is added for getPage)

    2) class.t3lib_page.php

    Line 184ff
    Change the function get Page and add the function checkPage

    /**
     * Returns the $row for the page with uid = $uid (observing ->where_hid_del)
     * Any pages_language_overlay will be applied before the result is returned.
     * If no page is found an empty array is returned.
     *
     * param    integer        The page id to look up.
     * param    boolean        If set, the check for group access is disabled. VERY rarely used
     * param     boolean        If set, the check will include the rootline
     * return    array        The page row with overlayed localized fields. Empty it no page.
     * @see getPage_noCheck()
    /
    function getPage($uid, $disableGroupAccessCheck=FALSE,$userRootlineCheck=FALSE) {
    $res = $GLOBALS[‘TYPO3_DB’]->exec_SELECTquery(’
    ’, ‘pages’, ‘uid=’.intval($uid).$this->where_hid_del.($disableGroupAccessCheck ? ‘’ : $this->where_groupAccess));
    $row = $GLOBALS[‘TYPO3_DB’]->sql_fetch_assoc($res);
    $check = ($userRootlineCheck ? $this->checkPage($uid) : 1 );
    if ($row && $check){
    $this->versionOL(‘pages’,$row);
    if (is_array($row)) return $this->getPageOverlay($row);
    }
    return Array();
    }
    /**
     * Checks the current rootline for defined sections.
     *
     * param    integer        The page id to look up.
     * return    boolean        
    */
    function checkPage($uid)    {
    $MP = t3lib_div::_GP(‘MP’);
    $rootLine = $this->getRootLine($uid,$MP);
    $c=count($rootLine);
    while(list($k,$page) = each($rootLine)){
    if($page[‘title’]==‘Seminare’){
    if ($page[‘extendToSubpages’] && !$GLOBALS[‘TSFE’]->checkEnableFields($page)) {
    return false;
    }
    }
    }
    return true;
    }
  2. Christian Kuhn commented 06/27/09, 01:08

    confirmed for 4.3, please take a look at the duplicate issues for a “how to reproduce”

  3. Christian Kuhn changed category removed the assignee target version 08/08/11, 10:37

  4. Riccardo De Contardi changed category Is Regression 0 11/01/15, 12:09

  5. Dima Nozdrin changed Related to #87025 11/30/18, 16:10

  6. Susanne Moog changed Complexity hard Sprint Focus On Location Sprint 08/05/22, 13:20

  7. Oliver Hader changed Sprint Focus On Location Sprint 11/03/22, 09:04

  8. Benni Mack changed Sprint Focus Stabilization Sprint 06/06/23, 13:04

  9. Christian Kuhn commented and changed status Accepted Closed 09/01/23, 09:33

    I hope it’s ok to close here since so much happened over the years that we should start with a fresh issue if there are still problems.