Development

#2926: sfController.patch

You must first sign up to be able to contribute.

Ticket #2926: sfController.patch

File sfController.patch, 1.0 kB (added by gnat, 7 months ago)

fixes exception handling in getPresentationFor

  • sfController.class.php

    old new  
    543543      // put render mode back 
    544544      $this->setRenderMode($renderMode); 
    545545 
     546      // remove the action entry 
     547      $nb = $actionStack->getSize() - $index; 
     548      while ($nb-- > 0) 
     549      { 
     550        $actionEntry = $actionStack->popEntry(); 
     551 
     552        if ($actionEntry->getModuleName() == sfConfig::get('sf_login_module') && $actionEntry->getActionName() == sfConfig::get('sf_login_action')) 
     553        { 
     554          $error = 'Your action is secured but the user is not authenticated.'; 
     555 
     556          throw new sfException($error); 
     557        } 
     558        else if ($actionEntry->getModuleName() == sfConfig::get('sf_secure_module') && $actionEntry->getActionName() == sfConfig::get('sf_secure_action')) 
     559        { 
     560          $error = 'Your action is secured but the user does not have access.'; 
     561 
     562          throw new sfException($error); 
     563        } 
     564      } 
     565 
    546566      // remove viewName 
    547567      if ($viewName) 
    548568      {