symfony
symfony forum
Home » plugins » General plug-ins » [Solved] Issues when installing sfGuard
[Solved] Issues when installing sfGuard [message #21751] Thu, 15 February 2007 19:16 Go to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
Hi,

I'm trying to install the sfGuard.

Do I have to do the "Optionally add the following routing rules to routing.yml"? because "these routes are automatically registered by the plugin if the module sfGuardAuth is enabled", so that "if you try to access a secure page, you will be redirected to the login page. "

I didn't add them. All I got is the following instead of login page:

Credentials Required
This page is in a restricted area.

You do not have the proper credentials to access this page
    Even though you are already logged in, this page requires special credentials that you currently don't have. 
How to access this page
    You must ask a site administrator to grant you some special credentials.
What's next

        * Back to previous page


I do have the module sfGuardAuth enabled:

$ tail -14 apps/backend/config/settings.yml

all:
  .actions:
    login_module:           sfGuardAuth
    login_action:           signin

    secure_module:          sfGuardAuth
    secure_action:          secure

all:
  .settings:
    # Activated modules from plugins or from the symfony core
    enabled_modules: [default, sfGuardGroup, sfGuardUser, sfGuardPermission, sfGuardAuth]


*Edit*:

Adding those routing rules won't redirect me to the login page either.

How to make the auto redirect work for me?

I access my sf project as

http://localhost/sfpear/web/backend_dev.php

please help.

thanks

*Edit*:

Problem solved! Solution at

http://www.symfony-project.com/forum/index.php?t=msg&&am p;th=5071&goto=21848#msg_21848

[Updated on: Fri, 16 February 2007 21:43]


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: Issues when installing sfGuard [message #21804 is a reply to message #21751 ] Fri, 16 February 2007 11:28 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
Try to put the routing rules for sfGuard before the default rules in the routing.yml file

# default rules

sf_guard_signin:
url: /login
param: { module: sfGuardAuth, action: signin }

sf_guard_signout:
url: /logout
param: { module: sfGuardAuth, action: signout }

sf_guard_password:
url: /request_password
param: { module: sfGuardAuth, action: password }
homepage:
url: /
param: { module: default, action: index }

default_symfony:
url: /symfony/:action/*
param: { module: default }

default_index:
url: /:module
param: { action: index }

default:
url: /:module/:action/*



and Yes, the routing roule for homepage is good enough

/Michael
Re: Issues when installing sfGuard [message #21834 is a reply to message #21804 ] Fri, 16 February 2007 18:56 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
marke wrote on Fri, 16 February 2007 05:28

Try to put the routing rules for sfGuard before the default rules in the routing.yml file


thanks for the input, done that, but no help. still get that

Credentials Required
This page is in a restricted area.

page.

OK, I think I've at least found out why:

When "is_secure: off" in my apps/backend/config/security.yml, I can access the login page, http://localhost/sfpear/web/backend_dev.php/sfGuardAuth/sign in

However, if I turn it on, ie.,

$ cat apps/backend/config/security.yml
default:
  is_secure: on


Then even accessing the sfGuardAuth/signin page is blocked by "Credentials Required
This page is in a restricted area."

So, how should I fix that?

thx

[Updated on: Fri, 16 February 2007 19:04]


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: Issues when installing sfGuard [message #21836 is a reply to message #21751 ] Fri, 16 February 2007 19:04 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
Did you edit the myUser.class.php?

It is supposed to loke like:
<?php

class myUser extends sfGuardSecurityUser
{
}


/Michael
Re: Issues when installing sfGuard [message #21837 is a reply to message #21836 ] Fri, 16 February 2007 19:09 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
marke wrote on Fri, 16 February 2007 13:04

Did you edit the myUser.class.php?


yep:

$ cat apps/backend/lib/myUser.class.php
<?php

class myUser extends sfGuardSecurityUser
{
}


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: Issues when installing sfGuard [message #21838 is a reply to message #21751 ] Fri, 16 February 2007 19:22 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
You should use /backend_dev.php/login and not signin according to the routing rule.

/Michael
Re: Issues when installing sfGuard [message #21840 is a reply to message #21838 ] Fri, 16 February 2007 19:40 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
thanks!

Somehow, even after I've turn on the security

$ cat ./apps/backend/config/security.yml
default:
is_secure: on

None of my previously protected pages are protected any more.

I haven't changed much, and I believe I've restored everything, except the new ./config/schema.yml file that I'm working on. Does it matter?

Anyway, it may take a while for me to get back to you.

thanks






http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: Issues when installing sfGuard [message #21841 is a reply to message #21838 ] Fri, 16 February 2007 20:31 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
marke wrote on Fri, 16 February 2007 13:22

You should use /backend_dev.php/login and not signin according to the routing rule.


Ok, page protection is restored.

Yes, I should use /backend_dev.php/login, and yes it is accessible when "is_secure: off",

But no, the /backend_dev.php/login is blocked by "Credentials Required
This page is in a restricted area." if I turn the security on.

so...?

[Updated on: Fri, 16 February 2007 20:32]


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: Issues when installing sfGuard [message #21844 is a reply to message #21751 ] Fri, 16 February 2007 21:01 Go to previous messageGo to next message
flat stanley  is currently offline flat stanley
Messages: 46
Registered: November 2006
Location: London
Member
have you tried deleting your session cookies??


Antique Silver, Hester Bateman Silver, Collecting Silver
Re: Issues when installing sfGuard [message #21845 is a reply to message #21841 ] Fri, 16 February 2007 21:05 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
FYI, I'm amending the sfGuardPlugin wiki
http://www.symfony-project.com/trac/wiki/sfGuardPlugin
while I'm doing the installation, just trying to make it a bit easier for the next person to install it.

So far I've committed several updates. If it is a concern to any of you, please check the diffs.

thx


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: Issues when installing sfGuard [message #21847 is a reply to message #21844 ] Fri, 16 February 2007 21:12 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
flat stanley wrote on Fri, 16 February 2007 15:01

have you tried deleting your session cookies??


I don't think that matters because right after I turn the security on, I get blocked (to everywhere), and right after I turn the security off, I can access them again.

That being said, I did tried to remove my session cookies. but no, it didn't help.

thanks for the heads up though.


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: Issues when installing sfGuard [message #21848 is a reply to message #21751 ] Fri, 16 February 2007 21:20 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
I've got a problem with this too and just found something that helped me.

In the sfGuardAuth module edit the security.yml file:
change:

loginSuccess:
is_secure: off

to:

signin:
is_secure: off

/Michael

[Updated on: Fri, 16 February 2007 21:22]

Re: Issues when installing sfGuard [message #21849 is a reply to message #21847 ] Fri, 16 February 2007 21:23 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
Hmm..., it is getting more difficult than I thought now. Ok, time to report all my tweaked file contents (according to the wiki):

Sorry for the long post...

$ cat apps/backend/config/settings.yml
prod:
  .settings:
    no_script_name:           off

dev:
  .settings:
    # E_ALL | E_STRICT = 4095
    error_reporting:        4095
    web_debug:              on
    cache:                  off
    no_script_name:         off
    etag:                   off

test:
  .settings:
    # E_ALL | E_STRICT & ~E_NOTICE = 2047
    error_reporting:        2047
    cache:                  off
    web_debug:              off
    no_script_name:         off
    etag:                   off

#all:
#  .actions:
# [....]
all:
  .actions:
    login_module:           sfGuardAuth
    login_action:           signin

    secure_module:          sfGuardAuth
    secure_action:          secure

all:
  .settings:
    # Activated modules from plugins or from the symfony core
    enabled_modules: [default, sfGuardGroup, sfGuardUser, sfGuardPermission, sfGuardAuth]

$ cat apps/backend/lib/myUser.class.php
<?php

class myUser extends sfGuardSecurityUser
{
}

$ cat apps/backend/config/routing.yml
# default rules

sf_guard_signin:
  url:   /login
  param: { module: sfGuardAuth, action: signin }

sf_guard_signout:
  url:   /logout
  param: { module: sfGuardAuth, action: signout }

sf_guard_password:
  url:   /request_password
  param: { module: sfGuardAuth, action: password }

homepage:
  url:   /
  param: { module: default, action: index }

default_symfony:
  url:   /symfony/:action/*
  param: { module: default }

default_index:
  url:   /:module
  param: { action: index }

default:
  url:   /:module/:action/*

$ cat apps/backend/config/security.yml
default:
  is_secure: on


I think my sfGuard is installed ok, because the following urls can be accessed ok if the security is turned off:

http://localhost/sfpear/backend_dev.php/sfGuardUser
http://localhost/sfpear/backend_dev.php/login
http://localhost/sfpear/backend_dev.php/sfGuardAuth/signin

what could be the problem?


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: Issues when installing sfGuard [message #21852 is a reply to message #21849 ] Fri, 16 February 2007 21:32 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
Here is log, if it helps.

#  	type  	message
1	Info Routing	connect "/login"
2	Info Routing	connect "/logout"
3	Info Routing	connect "/request_password"
4	Info Context	initialization
5	Info Controller	initialization
6	Info Routing	match route [sf_guard_signin] "/login"
7	Info Request	request parameters array ( 'module' => 'sfGuardAuth', 'action' => 'signin',)
8	Info Controller	dispatch request
9	Info Filter	executing filter "sfRenderingFilter"
10	Info Filter	executing filter "sfWebDebugFilter"
11	Info Filter	executing filter "sfBasicSecurityFilter"
12	Info Filter	executing filter "sfRenderingFilter"
13	Info Filter	executing filter "sfWebDebugFilter"
14	Info Filter	executing filter "sfBasicSecurityFilter"
15	Info Filter	executing filter "sfCommonFilter"
16	Info Filter	executing filter "sfFlashFilter"
17	Info Filter	executing filter "sfExecutionFilter"
18	Info Action	call "defaultActions->executeLogin()"
19	Info View	initialize view for "default/login"
20	Info View	render "sf_symfony_data_dir/modules/default/templates/loginSuccess.php"
21	Info View	decorate content with "sf_symfony_data_dir/modules/default/templates/defaultLayout.php"
22	Info View	render "sf_symfony_data_dir/modules/default/templates/defaultLayout.php"


Step 19 & 20 looks interesting. "initialize view for "default/login"", then jump directly to "render loginSuccess.php"
!? Is that correct?


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: Issues when installing sfGuard [message #21853 is a reply to message #21849 ] Fri, 16 February 2007 21:38 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
I think you are on the track now, there are no such template.
This means that if you have is_secure: on the login action will be secured.

So if you do the change in settings.yml i think you got it.

I don't have any accont to create a ticket about this so if anyone could......

/Michael

[Updated on: Fri, 16 February 2007 21:40]

Re: Issues when installing sfGuard [message #21854 is a reply to message #21848 ] Fri, 16 February 2007 21:39 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
marke wrote on Fri, 16 February 2007 15:20

I've got a problem with this too and just found something that helped me.



Thanks a lot Michael, problem solved!

It took a while for your post to show up, otherwise, there won't be those long posts. Smile


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: Issues when installing sfGuard [message #21855 is a reply to message #21849 ] Fri, 16 February 2007 21:48 Go to previous messageGo to next message
flat stanley  is currently offline flat stanley
Messages: 46
Registered: November 2006
Location: London
Member
yes, "render loginSuccess.php" is correct. This is the template used for the user to login, which is what you want.

try removing the second all: in your config yml

all:
  .actions:
    login_module:           sfGuardAuth
    login_action:           signin

    secure_module:          sfGuardAuth
    secure_action:          secure

  .settings:
    # Activated modules from plugins or from the symfony core
    enabled_modules: [default, sfGuardGroup, sfGuardUser, sfGuardPermission, sfGuardAuth]





Antique Silver, Hester Bateman Silver, Collecting Silver
Re: [Solved] Issues when installing sfGuard [message #21859 is a reply to message #21751 ] Fri, 16 February 2007 22:53 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
Stanley, there is no template called loginSuccess.php in the sfGuardAuth module. Furthermore in the security.yml file you only set security levels for either the comlete module or for explicit actions. In this case I suppose it is the signing action that calls the signinSuccess.php template.

Please correct me if i'm wrong because i'm new to this.

sfxpt, if i'm right could you fix a ticket about this. If you are updating the wiki i also wonder if this could be of interest.
[edit] it was already done, sorry.

I had som troble with the profile issue but stumbled ove somthing interesting in the blog plugin. the reference to the id field in the sfGuardUser class from the sfGuardProfile Class is defined there like this:
user_id: { type: integer, foreignTable: sf_guard_user, foreignReference: id }

If i use this I am able to define a fixtures.yml like this:

sfGuardUser:
admin:
username: admin
password: admin
is_super_admin: true

sfGuardUserProfile:
admin:
user_id: admin
firstname: ad
lastname: min

/Michael

[Updated on: Fri, 16 February 2007 23:00]

Re: [Solved] Issues when installing sfGuard [message #21861 is a reply to message #21751 ] Fri, 16 February 2007 23:19 Go to previous messageGo to next message
flat stanley  is currently offline flat stanley
Messages: 46
Registered: November 2006
Location: London
Member
Well, I'm not sure what problem you guys had but just a few days ago I installed the latest sfGuard with the latest symfony and it worked just fine. Are you working with a fresh install?? Have you added any filters??


Antique Silver, Hester Bateman Silver, Collecting Silver
Re: [Solved] Issues when installing sfGuard [message #21862 is a reply to message #21751 ] Fri, 16 February 2007 23:30 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
Hello Stanley!
No filters added.

try what happends if you set is_secure: on in security.yml at the module level, that is secure the module.

By the way as I am digging in to this i discovered that there is a loginSuccess.php template. but in the security.yml you are supposed to secure actions not templates atleast if you read the Book Smile.

/Michael

[Updated on: Fri, 16 February 2007 23:31]

Re: [Solved] Issues when installing sfGuard [message #21864 is a reply to message #21862 ] Fri, 16 February 2007 23:49 Go to previous messageGo to next message
flat stanley  is currently offline flat stanley
Messages: 46
Registered: November 2006
Location: London
Member
right. You can secure the app in apps/app_name/config/security.yml with ...

    
default:
  is_secure: on


and you can secure a module or action, in modules/module_name/config/security.yml with ...

#secure entire module
all:
  is_secure:  on 

#secure list action of this module
list:
  is_secure:  on


I have successfully secured an entire app and selected actions but I haven't tried securing an entire module.

Is your problem with securing an entire module? did you remember to use 'all' instead of 'default'??

If this is the problem, I will check tomorrow on my development machine to see if I have the same problem.

Thanks


Antique Silver, Hester Bateman Silver, Collecting Silver
Re: [Solved] Issues when installing sfGuard [message #21872 is a reply to message #21751 ] Sat, 17 February 2007 08:07 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
You're right Stanley, when I wrote module I realy ment app, but it was fairy late on friday night Embarassed . It's when I set is_secure: on in the apps/app_name/config/security.yml and use the default label that I get problem.



I also discovered that if you secure the app the default module is not available. I created a config catalog inside the default module with a security.yml setting

all:
is_secure: off

[/edit]

/Michael

[Updated on: Sat, 17 February 2007 08:53]

Re: [Solved] Issues when installing sfGuard [message #21879 is a reply to message #21872 ] Sat, 17 February 2007 11:22 Go to previous messageGo to next message
flat stanley  is currently offline flat stanley
Messages: 46
Registered: November 2006
Location: London
Member
OK, but when I secure the app, everything works as expected.

What version of symfony and sfGuard are you using??




Antique Silver, Hester Bateman Silver, Collecting Silver
Re: [Solved] Issues when installing sfGuard [message #21880 is a reply to message #21751 ] Sat, 17 February 2007 11:50 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
symfony 1.0.0.rc2
sfGuardPlugin 1.1.6-stable

settings in apps/backend/config/settings.yml
all:
.actions:
login_module: sfGuardAuth
login_action: signin

secure_module: sfGuardAuth
secure_action: secure

.settings:
available: on
rich_text_js_dir: js/tiny_mce
enabled_modules: [default, sfGuardAuth, sfGuardGroup, sfGuardUser, sfGuardPermission]

apps/backend/config/secyrity.yml
default:
is_secure: on

apps/backend/modules/mymodule/config/security.yml
all:
is_secure: on

index:
is_secure: off

page1:
credentials: [admin]

plugins/sfGuardplugin/modules/sfGuardAuth/config/security.ym l
signin: * note works set to loginSuccess does not work
is_secure: off

/Michael
Re: [Solved] Issues when installing sfGuard [message #21881 is a reply to message #21751 ] Sat, 17 February 2007 12:02 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
Odd!! when I set loginSuccess now i works?

Let me do some more tests and come back, for now I do have som other duties Rolling Eyes .

/Michael
Re: [Solved] Issues when installing sfGuard [message #21887 is a reply to message #21751 ] Sat, 17 February 2007 16:03 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
I don't know if I'm going to be glad or mad but, now I've tested both forth and back and everyting works just like a charm with what I think is the default installation of this plugin.
What i did was to get rid of all that was'nt needed in the settings files ( comment's and stuff ). That is the olnly thing yhat I can see that was the difference. What's odd though is that it doesn't matter if it say's loginSuccess or signin in the security.yml in the module sfGuardAuth, it doesn't matter either if I'm calling the default or the plugin secure action. But it WORK'S

/Michael

PS why do the space's disappear when you submit a post?
DS
Re: [Solved] Issues when installing sfGuard [message #21894 is a reply to message #21887 ] Sat, 17 February 2007 17:25 Go to previous messageGo to next message
flat stanley  is currently offline flat stanley
Messages: 46
Registered: November 2006
Location: London
Member
Well, that's good news!

If you don't want the spaces to disappear, put that part in a code block.

Regards


Antique Silver, Hester Bateman Silver, Collecting Silver
Re: [Solved] Issues when installing sfGuard [message #22105 is a reply to message #21887 ] Tue, 20 February 2007 20:53 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
marke wrote on Sat, 17 February 2007 10:03

why do the space's disappear when you submit a post?



Michael, could you repost or edit a version with space on, just for the archive please? I'm still having problem with the sfGuard plugin.

thx


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: [Solved] Issues when installing sfGuard [message #22107 is a reply to message #21887 ] Tue, 20 February 2007 21:08 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
marke wrote on Sat, 17 February 2007 10:03

I don't know if I'm going to be glad or mad but, now I've tested both forth and back and everyting works just like a charm with what I think is the default installation of this plugin.
What i did was to get rid of all that was'nt needed in the settings files ( comment's and stuff ). That is the olnly thing yhat I can see that was the difference.


Michael, you've saved my day again!!!

I followed your advice and everything works now!

The default apps/backend/config/settings.yml is just sooooo misleading...

oh, well, glad I'm over it.

PS. I was trying to update the sfGuard wiki so that the next person who follow it can avoid all the troubles that I bumpped into, but my symptom/solution part was deleted.

I've stopped amending the wiki since, because the comment was that my effort would be wiped off anyway, when there is new release for the sfGuard plugin...


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: [Solved] Issues when installing sfGuard [message #22109 is a reply to message #22107 ] Tue, 20 February 2007 21:14 Go to previous messageGo to next message
davedash  is currently offline davedash
Messages: 147
Registered: December 2005
Senior Member
What was your comment, I can take a stab and integrating it into the README.


http://reviewsby.us/ - Rate what you just ate.
http://spindrop.us/ - Open Source web consultant
Re: [Solved] Issues when installing sfGuard [message #22110 is a reply to message #22109 ] Tue, 20 February 2007 21:22 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
thx for the offer,

please check the recent diffs of the sfGuard wiki,

Also, while you are there, please include the following sample for
apps/app_name/config/settings.yml (please include the full file spec as well).

all:
  .actions:
    login_module:           sfGuardAuth
    login_action:           signin

    secure_module:          sfGuardAuth
    secure_action:          secure

  .settings:
    # Activated modules from plugins or from the symfony core
    enabled_modules: [default, sfGuardGroup, sfGuardUser, sfGuardPermission, sfGuardAuth]

# rest of old content.
prod:
  .settings: [...]



thx


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: [Solved] Issues when installing sfGuard [message #22112 is a reply to message #22110 ] Tue, 20 February 2007 21:42 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
Oh, don't forget to fix the file
plugins/sfGuardPlugin/modules/sfGuardAuth/config/security.ym l

which was reason for the first part of the thread:

#Login:
signin:
  is_secure: off

# request_password -- method is not yet implemented.
#password:
#  is_secure: off


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: [Solved] Issues when installing sfGuard [message #22122 is a reply to message #21859 ] Tue, 20 February 2007 22:48 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
marke wrote on Fri, 16 February 2007 16:53

I am able to define a fixtures.yml like this:

sfGuardUser:
admin:
username: admin
password: admin
is_super_admin: true

sfGuardUserProfile:
admin:
user_id: admin
firstname: ad
lastname: min




Glad it works for you that way, Michael.

I wasn't able to do that -- I have to use numbers for user_id for the sfGuardUserProfile table. I made it when I use numbers, but got the following error when changed them to ids.

maybe because I've explicitly add several records to the sfGuardUserProfile table, I don't know...

Fatal error: Class 'BasesfGuardAuthActions' not found in /var/www/sfpear/apps/backend/modules/sfGuardAuth/actions/actions.class.php on line 11


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: [Solved] Issues when installing sfGuard [message #22324 is a reply to message #22105 ] Thu, 22 February 2007 20:53 Go to previous messageGo to next message
marke  is currently offline marke
Messages: 23
Registered: January 2007
Location: Sweden
Junior Member
Here is how some of my file looks like:

proj/config/schema.yml
propel:
  sf_guard_user_profile:
    _attributes: { phpName: sfGuardUserProfile }
    id:         
    user_id:             { type: integer, foreignTable: sf_guard_user, foreignReference: id }
    first_name:          varchar(50)
    last_name:           varchar(50)
    email:               varchar(255)

...


Defining user_id this way i think is the key for having proj/data/fixtures/fixture.yml to work looking like this:

sfGuardUser:
  admin:
    username:       admin
    password:       admin
    is_super_admin: true

sfGuardUserProfile:
  admin:
    user_id:        admin
    firstname:      ad
    lastname:       min
    email:          admin@something.com

....


proj/apps/frontend/config/security.yml:
default:
  is_secure: on


This means that i have to set is_secure: off for actions that is public.


proj/apps/frontend/config/settings.yml:
all:
  .actions:

    login_module:           sfGuardAuth
    login_action:           signin

    secure_module:          sfGuardAuth
    secure_action:          secure

  .settings:
    available:              on

    escaping_strategy:      both
    escaping_method:        ESC_ENTITIES
    enabled_modules:      [default, sfGuardAuth]   

In my backend app there are more modules enabled.

With setup like this it does'nt matter what the settings are in plugins/sfGuardplugin/modules/sfGuardAuth/config/security.ym l

loginSuccess: 
  is_secure: off


I hope this is all You need sfxpt

/Michael
Re: [Solved] Issues when installing sfGuard [message #22398 is a reply to message #22324 ] Fri, 23 February 2007 16:18 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
thanks a lot Michael!


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: [Solved] Issues when installing sfGuard [message #51082 is a reply to message #22107 ] Tue, 29 April 2008 18:29 Go to previous message
tickbw  is currently offline tickbw
Messages: 1
Registered: April 2008
Junior Member
This worked for me as well!!!!!!
Thanks so much
Previous Topic:sfLucene: sort is slooow
Next Topic:Help! Cant install any plugins
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software