Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_secure is not checked before generating cached files #27

Open
tdmedia opened this issue May 31, 2012 · 0 comments
Open

is_secure is not checked before generating cached files #27

tdmedia opened this issue May 31, 2012 · 0 comments

Comments

@tdmedia
Copy link

tdmedia commented May 31, 2012

Scenario:

  1. Form class makes reference to sfGuardUser like so:

$user = sfContext::getInstance()->getUser();
...
if ($schoolId = $user->getGuardUser()->getProfile()->getSchoolId())

  1. The security.yml file for the module is set as follows:

all:
is_secure: true

  1. Clear the symfony cache.
  2. User is logged out and tries to go the module.

Expected result: User is redirected to a login page.

Actual result: 500 error

Fatal error: Call to a member function getProfile() on a non-object in /web/edits_net/editsapp/lib/form/doctrine/sfGuardUserProfileForm.class.php on line 29

If the module is visited once by an authenticated user after the cache is cleared, then subsequent visits by unauthenticated users don't have the problem. Adding a check for isAuthenticated() in the form class prevents the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants