Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-19541

Login with DebugByUser enabled is not possible in ezp500

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Won't Fix
    • Affects Version/s: Known Issues Legacy Stack, 5.0, 5.1
    • Labels:
      None
    • Environment:

      Operating System: RHEL 6.2
      PHP Version: PHP 5.3.3
      Database and version: mysql 5.1.61
      Browser (and version): FF 13

      Description

      If i had the following settings to site.ini.apppend.php login is no longer possible

      [DebugSettings]
      DebugByUser=enabled
      

      This happens with database or file session handlers using an ezflow installation

      Steps to reproduce

      1. Activate ezpublish debug
      2. Add the mentioned settings to site.ini.append.php
      3. Clear all caches
      4. Try to login to ezflow_site

        Activity

        Hide
        Jose Ignacio Honrado added a comment - - edited

        I can confirm this problem in eZ Publish 2012.8 using PHP 5.4.6.
        The login is successful, but you don't see the changes in the UI (for example the logout link) until you disable DebugByUser.

        Show
        Jose Ignacio Honrado added a comment - - edited I can confirm this problem in eZ Publish 2012.8 using PHP 5.4.6. The login is successful, but you don't see the changes in the UI (for example the logout link) until you disable DebugByUser.
        Hide
        Eugene Svirskyy added a comment -

        Problem with DebugByUser=enabled is confirmed in eZ Pubslish 2012.12 with PHP 5.3.6 and 5.3.17.
        In the same time DebugByIP=enabled setting is working well.

        Show
        Eugene Svirskyy added a comment - Problem with DebugByUser=enabled is confirmed in eZ Pubslish 2012.12 with PHP 5.3.6 and 5.3.17. In the same time DebugByIP=enabled setting is working well.
        Hide
        Arnaud Chasseux added a comment - - edited

        I confirm this probleme with ezpublish5_community_2013.1, using php 5.4.6, with

        {legacy_mode: true}

        or just with FULL legacy virtualhost.

        In constructor of ezpkernelweb, on line 293, we can see this comment :

        /**
         * Check for activating Debug by user ID (Final checking. The first was in eZDebug::updateSettings())
         * @uses eZUser::instance() So needs to be executed after eZSession::start()|lazyStart()
         */
        eZDebug::checkDebugByUser();
        

        ( from https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/private/classes/ezpkernelweb.php#L289 )

        However, the call of $this->sessionInit() is made on line 1125 ( https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/private/classes/ezpkernelweb.php#L1125 ), in requestInit() method, and not in the constructor.

        We can see this comment on line 1124:

        // TODO: Session starting should be made only once in the constructor
        

        https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/private/classes/ezpkernelweb.php#L1124

        The consequence is that the call of eZUser::instance() ( in eZDebug::checkDebugByUser() ) force the userID to be set to the anonymousUserID, and the GLOBAL variable
        $GLOBALS["eZUserGlobalInstance_$id"] to be set to the anonymous user.

        https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/classes/datatypes/ezuser/ezuser.php#L1075

        if ( $sessionHasStarted )
        {
            $userId = $http->sessionVariable( 'eZUserLoggedInID' );
            if ( !is_numeric( $userId ) )
            {
                $userId = $anonymousUserID;
                eZSession::setUserID( $userId );
                $http->setSessionVariable( 'eZUserLoggedInID', $userId );
            }
        }
        else
        {
           $userId = $anonymousUserID;
           eZSession::setUserID( $userId );
        }
        

        In order to quickly fixe this problem, in in ezpkernelweb.php , I have moved the line 293 ( "eZDebug::checkDebugByUser()" ) to the line 303 ( after $this->requestInit(); ), and the debug by user works fine.

        Show
        Arnaud Chasseux added a comment - - edited I confirm this probleme with ezpublish5_community_2013.1, using php 5.4.6, with {legacy_mode: true} or just with FULL legacy virtualhost. In constructor of ezpkernelweb, on line 293, we can see this comment : /** * Check for activating Debug by user ID (Final checking. The first was in eZDebug::updateSettings()) * @uses eZUser::instance() So needs to be executed after eZSession::start()|lazyStart() */ eZDebug::checkDebugByUser(); ( from https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/private/classes/ezpkernelweb.php#L289 ) However, the call of $this->sessionInit() is made on line 1125 ( https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/private/classes/ezpkernelweb.php#L1125 ), in requestInit() method, and not in the constructor. We can see this comment on line 1124: // TODO: Session starting should be made only once in the constructor https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/private/classes/ezpkernelweb.php#L1124 The consequence is that the call of eZUser::instance() ( in eZDebug::checkDebugByUser() ) force the userID to be set to the anonymousUserID, and the GLOBAL variable $GLOBALS ["eZUserGlobalInstance_$id"] to be set to the anonymous user. https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/classes/datatypes/ezuser/ezuser.php#L1075 if ( $sessionHasStarted ) { $userId = $http->sessionVariable( 'eZUserLoggedInID' ); if ( !is_numeric( $userId ) ) { $userId = $anonymousUserID; eZSession::setUserID( $userId ); $http->setSessionVariable( 'eZUserLoggedInID', $userId ); } } else { $userId = $anonymousUserID; eZSession::setUserID( $userId ); } In order to quickly fixe this problem, in in ezpkernelweb.php , I have moved the line 293 ( "eZDebug::checkDebugByUser()" ) to the line 303 ( after $this->requestInit(); ), and the debug by user works fine.

          People

          • Assignee:
            Unassigned
            Reporter:
            João Pingo
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: