Thanks, that helped. It was actually a session problem.

Thank you very much!

Pierre

Am 10.03.2008 um 09:17 schrieb wissl:

>
> First of all: I don't use sfGuard, but I read the code some while ago
> and tested the plugin.
>
> As far as I can guess your problem could be caused by a session
> problem. Either you don't have cookies enabled for your test domain,
> then a new session will be created on every page load and the user
> data will be lost, or the session handling itself does not work as it
> should be. Look at your browser preferences and control the existance
> of a cookie for your domain named as defined in your settings,
> normally "symfony", I believe.
>
> On 9 Mrz., 11:35, Pierre <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I already posted a problem several days ago. I'm still not able to
>> solve it.
>>
>> I installed sfGuard as described inhttp://trac.symfony-project.com/
>> wiki/sfGuardPluginFor10
>>
>> I enabled sfGuardAuth in my app/config/settings.yml.
>> I changed sfBasicSecurityUser to sfGuardSecurityUser in
>> myUser.class.php.
>> I set is_secure to on for my app.
>> I verified that there are the right tables with proper an admin
>> account created in my database.
>> Cleared the cache.
>>
>> So far, it seems to work. When I try to access a module I get
>> redirected to sfGuard/signin.
>> I put in admin/admin, submit, get redirected to the requested module.
>>
>> I try to output the username like this in my layout.php:
>> <?php if ($sf_user->getGuardUser() != null) : ?>
>>    <?php print_r($sf_user->getUsername()) ?>
>> <?php endif ?>
>>
>> It doesn't work. No username is put out, but I have access to the
>> secured module.
>>
>> When I add a credential (credentials:  admin) to app/config/
>> settings.yml I get an output of username directly when I first login.
>>
>> But then, when I simply reload the page, or click on a link to go to
>> another module of my app I get the secured-message, telling me that I
>> don't have the proper permissions to access this module. And the
>> username is no more output, which means, that the $sf_user-
>>> getGuardUser returns no user object. Which explains that I see the
>> secured-message, since the credentials are stored in the GuardUser
>> object as far as I can tell.
>>
>> Has anybody any idea where this behaviour comes from? Do I have to
>> customize anything?
>>
>> I have problems understanding how sfGuardAuth actually works. When I
>> request a page for example, at which moment is the sfGuard populating
>> the user object? Is it done automatically or do I have to put some
>> code somewhere?
>> At what moment get's the signIn() method from sfGuardSecurityUser
>> called? Is this done somehow automatically or do I have to add my own
>> validation or filter classes? Right now I don't use either filters
>> nor validation. I'm still new to symfony.
>> I only found calls to the signIn() method in:
>> lib/sfGuardBasicSecurityFilter.class.php:               $this- 
>> >getContext
>> ()->getUser()->signIn($rk->getSfGuardUser());
>>         -> which applies only for the remember me-functionality?
>> lib/validator/sfGuardUserValidator.class.php:   $this->getContext()-
>>> getUser()->signIn($user, $remember);
>>         -> which is for login I guess?
>> But I would expect that there has to be a call to it for every page
>> load?! Where should this happen?
>>
>> I'm going nuts with this.
>>
>> I'm using symfony 1.0.7 on apache localhost on my iBook running OS X
>> 10.4.11
>>
>> Pierre
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
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