No sf guard dependency #6

wants to merge 4 commits into

3 participants


This simply remove the dependency the plugin has with sfGuardUser plugin : the dashboard and the global drop down menu won't list any items if $sf_user->isAuthenticated() does not return true.
Now setting the option is_protected to false this check is skipped and the menus work fine.

Kevin Saliou added some commits Nov 8, 2011

@CraftyShadow can you review?


This is not a dependency on sfGuardPlugin. The method isAuthenticated() is a part of sfBasicSecurityUser:

I am not sure how I feel about this change. It's basically a question of whether there is a use case when you will want to have user authentication active, and at the same time have it not matter for the sfAdminDash menu.

Is your use case like that?


ok, it is indeed part of sfBasicSecurityUser! :)
But to me the change still makes sense : why would i need to setup credentials if i do not want to! My current use case is : i want to be able to very quickly be able to manage a db through the admin generator on my local machine (or any local network) and i therefore do not want nor need any authentication system or credentials assigned.
Also i feel it does not make much sense to only protect the menu generation from un-authorized user.
Finally the change is backward compatible : if you don't set the option to "false", the plugin will work just like before.


The menu will almost always be used in layout.php
This means that it would be shown in the "login" page if it was not protected.
The dashboard action should probably be protected as well, @kbond, what do you think?


class myUser extends sfBasicSecurityUser
  public function isAuthenticated() { return true; } 

All in all, I am not against this change, but I am not really for it either. It just seems unnecessary for the 80%


Ok, i also like your work around! :)
What about adding it to the readme then?
I've reverted my changes on my machine and applied you line of code and it works fine when you add "logout: false" to your app.yml

@VanTanev VanTanev closed this Jan 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment