There are several ways to do this:

1. For the user-email field create a partial and put the logic in
there as you would with PHP code.
If you do not want to mess around with symfony code this is the way to
go.

2. A more "symfony way" would be to setup a credential
"can_see_email_addresses" and use that as a condition
in the partial (the same as above)
  if ($sf_user->hasCredential('can_see_email_addresses')):
    // show e-mail
  endif
This credential can be setup either in lib/myUser.class.php during
signin (not too good because it is checked only once during signin, if
the
user changes IP he will still have the credential) or as a filter (in
config/filters.yml)  that checks for each request this.
The storage for the list of IP addresses can be in app.yml.

    gabriel

On May 13, 11:44 am, blurmy23 <[email protected]> wrote:
> Hey folks,
>
> I've inherited a symfony 1.0 project and I'm looking for a little
> guidance.  Though I've been using php for years, I'm fairly new to
> symfony so I'm working through the 1.0 askeet tutorial 
> (http://www.symfony-project.org/askeet/1_0/en/).  A request has come down the
> line to do the following:
>
> * if a user comes from within a specified list of IP addresses,
> display the user's email in the user data table
> * otherwise hide it
>
> In regular old php, this would be as simple as an if statement, but in
> symfony it doesn't seem so clear-cut.  I think the answer I'm looking
> for is inhttp://www.symfony-project.org/book/1_0/14-Generators#Administration
> but I can't seem to wrap my head around it.  Here's what I'm
> assuming...
>
> * The user data table is rendered by code automatically generated
> * I can override it by adding a new executeShow() method to my apps/
> backend/modules/user/actions/action.class.php (?)
> * I should probably add the relevant ips to app.yml (?)
>
> Beyond here, I'm stuck.  Any suggestions?
>
> Thanks!
>
> Jacob
>
> --
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to