Peter,

That is useful if I know the next page is protected.  In this case,   
I don't know that the next page is protected.  The only way to know  
seems to be to parse the security.yml file.  I'm wondering if this  
information already exists before I land on the secured page.

To take your example, I'm looking for something like the following:

<?php

if($sf_response->isSecured('module/action') && ! $sf_user- 
 >isAuthenticated())
{
echo link_to_function('link', visual_effect('blind_down', 'login',  
array('duration' => 0.5)));
} else {
echo link_to('module/action', 'Link');
}
?>

So, if I have a page of links, some are secured, some aren't.   
Instead of having the page refresh to show the login page, I'd like  
to see if the user needs to login before seeing the next page.

I just can't figure out how to determine if the link is secured or not.

Charley

On Sep 28, 2007, at 2:51 PM, Peter Van Garderen wrote:

>
> Charley,
>
> Try this in your template:
>
>
> <?php if(!$sf_user->isAuthenticated())
>   {
>   echo '<your login div>';
>   }
> ?>
>
> --peter
>
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[EMAIL PROTECTED] On Behalf Of Charley Tiggs
>> Sent: September 28, 2007 11:52 AM
>> To: [email protected]
>> Subject: [symfony-users] Re: Checking if a page requires credentials
>>
>>
>> Jon,
>>
>> Thanks for the response but that's not really what I'm after.
>>  If the
>> user hasn't logged in yet, I want to show a hidden div with the
>> message to login and to give the user the username/password
>> fields to
>> login...without reloading the page.
>>
>> Charley
>>
>> On Sep 28, 2007, at 1:26 PM, Jon Busby wrote:
>>
>>>
>>> Charley,
>>>
>>> I believe you can set this in the settings.yml of your apps
>>> configuration directory, when user doesnt have the necessary
>>> credentials
>>> it forwards to the secure_action and secure_module.
>>>
>>> Jon
>>>
>>> Charley Tiggs wrote:
>>>> Is there an easy way to check to see if a page requires credentials
>>>> before you arrive at that page?
>>>>
>>>> What I'm trying to do is create navigation logic that
>> allows prompts
>>>> a user to login when they click on a certain link instead of being
>>>> faced with the default "Credentials Required" page.
>>>>
>>>> Charley
>>>>
>>>>>
>>>>
>>>>
>>>
>>>>
>>
>>
>>>
>>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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