--
You received this message because you are subscribed to the Google Groups "sonata-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sonata-users/-/-_yohMyrp40J.
To post to this group, send email to sonata...@googlegroups.com.
To unsubscribe from this group, send email to sonata-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sonata-users?hl=en.
If the value is hidden then it is certainly useless. You can do some logic inside the Admin class or you can extends the CrudController to define some default values.
and admin is a standard service, so you can inject the logger through the DIC definition, please review the symfony documentation to learn how to do it.
On Tue, Jul 10, 2012 at 7:09 PM, Jose Grieco <jdgr...@gmail.com> wrote:
I recently configure SonataUserBundle, and I need hidden some EntityAdmin fields based on which user is logged1.) How I get logged user inside admin class?2.) How to set a value to hidden filed (in my case a associated entity)?
--
You received this message because you are subscribed to the Google Groups "sonata-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sonata-users/-/-_yohMyrp40J.
To post to this group, send email to sonata...@googlegroups.com.
To unsubscribe from this group, send email to sonata-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sonata-users?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/sonata-users/-/OGSblGMGrgUJ.
To unsubscribe from this group, send email to sonata-users...@googlegroups.com.
Hi Nelson,I have a similar problem with Yours. Have You managed to solve that issue ? I am still digging but without success.
W dniu wtorek, 7 sierpnia 2012 05:29:43 UTC+2 użytkownik Nelson Suniaga napisał:
I'm have to confess that I'm confused. What is the purpose of the CSRF Token in a Symfony form...? Is not exactly for avoid security risks by changing HTML values? I think I understand the use of the logger user information in the controller or just before saving the data form... but, again, I'm kind of confused...
On Mon, Aug 6, 2012 at 5:55 PM, Thomas Rabaix <tho...@rabaix.net> wrote:
It is useless to render a hidden field managed by the user session. your solution introduce a security risk as an user can still change the hidden value.
So just assign the logger user to the edited data object when the request is bound ...
On Mon, Aug 6, 2012 at 7:58 PM, Nelson Suniaga <nelson....@gmail.com> wrote:
I don't think is that useless to hide a value in a form.
I'm in the same situation (and that's a guess) than Jose: I need to register the system_user_id value in almost every single table in the database, getting it from the user logged. If I don't hide that field, any user could choose any user listed in the droplist "System User" and obviously that's not the idea.
I can disable that field in the form and capture the ID value in the repository class and save it (I think that's the way I used to do it back in Symfony 1.4).
Right now I'm not sure how to manage to get that done. I'll take your advice and read the symfony documentation.
On Wednesday, July 11, 2012 6:05:39 PM UTC-4:30, Thomas Rabaix wrote:
If the value is hidden then it is certainly useless. You can do some logic inside the Admin class or you can extends the CrudController to define some default values.
and admin is a standard service, so you can inject the logger through the DIC definition, please review the symfony documentation to learn how to do it.
On Tue, Jul 10, 2012 at 7:09 PM, Jose Grieco <jdgr...@gmail.com> wrote:
I recently configure SonataUserBundle, and I need hidden some EntityAdmin fields based on which user is logged1.) How I get logged user inside admin class?2.) How to set a value to hidden filed (in my case a associated entity)?
--
You received this message because you are subscribed to the Google Groups "sonata-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sonata-users/-/-_yohMyrp40J.
To post to this group, send email to sonata...@googlegroups.com.
To unsubscribe from this group, send email to sonata-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sonata-users?hl=en.
--
Thomas Rabaix
http://rabaix.net | http://sonata-project.org
To view this discussion on the web visit https://groups.google.com/d/msg/sonata-users/-/OGSblGMGrgUJ.--
You received this message because you are subscribed to the Google Groups "sonata-users" group.
To unsubscribe from this group, send email to sonata-users...@googlegroups.com.
--
Thomas Rabaix
http://rabaix.net | http://sonata-project.org
--
You received this message because you are subscribed to the Google Groups "sonata-users" group.
To post to this group, send email to sonata...@googlegroups.com.
To unsubscribe from this group, send email to sonata-users...@googlegroups.com.
Anyone with a solution ?
I've injected security context in my admin class
calls:
- [ setTranslationDomain, [QMAdminBundle]]
- [ setSecurityContext, [@security.context]]
then I wrote my setSecurityContext
public function setSecurityContext($securityContext) {
$this->securityContext = $securityContext;
}
public function getSecurityContext() {
return $this->securityContext;
}
public function prePersist($article) {
$user = $this->getSecurityContext()->getToken()->getUser();
$appunto->setOperatore($user->getUsername());
}
Unfortunately it doesn't write the user... maybe this happens because I've got a parent document (where I don't need to write the user) and some embedded documents (where I want to write the user)?
Do you have any suggestions to solve this issue?
Thanks a lot