This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » sfGuardDoctrinePlugin and sfGuardUserProfile : I can't add a new user
sfGuardDoctrinePlugin and sfGuardUserProfile : I can't add a new user [message #103397] Mon, 02 August 2010 10:13 Go to next message
Weeky  is currently offline Weeky
Messages: 17
Registered: April 2010
Location: France
Junior Member
Hi all!

I have to add more fields to my User profile and I chosen to add a sfGuardUserProfileTable.

So, this is my sfGuardUser schema:

sfGuardUser:
  actAs: [Timestampable]
  columns:
    id:
      type: integer(4)
      primary: true
      autoincrement: true
    username:
      type: string(128)
      notnull: true
      unique: true
    algorithm:
      type: string(128)
      default: sha1
      notnull: true
    salt: string(128)
    password: string(128)
    is_active:
      type: boolean
      default: 1
    is_super_admin:
      type: boolean
      default: false
    last_login:
      type: timestamp
  indexes:
    is_active_idx:
      fields: [is_active]
  relations:
    groups:
      class: sfGuardGroup
      local: user_id
      foreign: group_id
      refClass: sfGuardUserGroup
      foreignAlias: Users
    permissions:
      class: sfGuardPermission
      local: user_id
      foreign: permission_id
      refClass: sfGuardUserPermission
      foreignAlias: Users


This is my sfGuardUserProfile schema :

sfGuardUserProfile:
  actAs:
    Timestampable: ~
  columns:
    sf_guard_user_id:
      type: integer(4)
    lastname:
      type: string(64)
      notnull: true
    firstname:
      type: string(64)
      notnull: true
    email:
      type: string(128)
      notnull: true
    corporate:
      type: string(64)
      notnull: true
  relations:
    sfGuardUser:
      class: sfGuardUser
      foreignType: one
      onDelete: CASCADE


I add this into generator.yml

"Général": [username, password, password_again, sfGuardUserProfile]


I add this code into app.yml :

  sf_guard_plugin:
    profile_class: sfGuardUserProfile
    profile_field_name: sf_guard_user_id
    success_signin_url: homepage
    remember_key_expiration_age: 2592000
    remember_cookie_name: appRememberMe


The I build all and I clean the cache of my project.

So, when I try to add a new user (all fields are completed), an error occured :

View Layer

Template: autoSfGuardUser … newSuccess.php 

Parameters:
$configuration (sfGuardUserGeneratorConfiguration)
$helper (sfGuardUserGeneratorHelper)
$form (sfGuardUserAdminForm) 
$form['id'] (sfWidgetFormInputHidden)
$form['username'] (sfWidgetFormInputText)
$form['password'] (sfWidgetFormInputPassword)
$form['password_again'] (sfWidgetFormInputPassword)
$form['is_active'] (sfWidgetFormInputCheckbox)
$form['is_super_admin'] (sfWidgetFormInputCheckbox)
$form['groups_list'] (sfWidgetFormDoctrineChoice)
$form['permissions_list'] (sfWidgetFormDoctrineChoice)
$form['sfGuardUserProfile']['lastname'] (sfWidgetFormInputText)
$form['sfGuardUserProfile']['firstname'] (sfWidgetFormInputText)
$form['sfGuardUserProfile']['email'] (sfWidgetFormInputText)
$form['sfGuardUserProfile']['corporate'] (sfWidgetFormInputText)
$form['lastname'] (sfWidgetFormInputText)
Required.
$form['firstname'] (sfWidgetFormInputText)
Required.
$form['email'] (sfWidgetFormInputText)
Required.
$form['corporate'] (sfWidgetFormInputText)
Required.
$form['_csrf_token'] (sfWidgetFormInputHidden)


Thanks for your help !

[Updated on: Mon, 02 August 2010 10:17]

Re: sfGuardDoctrinePlugin and sfGuardUserProfile : I can't add a new user [message #103403 is a reply to message #103397 ] Mon, 02 August 2010 11:14 Go to previous messageGo to next message
fizyk  is currently offline fizyk
Messages: 64
Registered: December 2009
Location: Western Slavic Republic
Member
Do you use any plugin for profile or is it your definition?
Re: sfGuardDoctrinePlugin and sfGuardUserProfile : I can't add a new user [message #103404 is a reply to message #103403 ] Mon, 02 August 2010 11:25 Go to previous messageGo to next message
Weeky  is currently offline Weeky
Messages: 17
Registered: April 2010
Location: France
Junior Member
I'm using sfDoctrineGuardPlugin to manage users.
Re: sfGuardDoctrinePlugin and sfGuardUserProfile : I can't add a new user [message #103431 is a reply to message #103404 ] Mon, 02 August 2010 18:34 Go to previous message
fizyk  is currently offline fizyk
Messages: 64
Registered: December 2009
Location: Western Slavic Republic
Member
So, you're not using any DoctrineApply plugin.
Do you fill in 'sfGuardUserProfile' fields?
Previous Topic:Custom interactions only on selected rows
Next Topic:how to use two doctrine behaviours in 1.4
Goto Forum:
  

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