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.
Today's Messages (OFF)  | Unanswered Messages (ON)

Forum: User management plugins
 Topic: Accessing sfGuard entries from fronend
Accessing sfGuard entries from fronend [message #54526] Fri, 20 June 2008 21:15
Messages: 4
Registered: February 2008
Junior Member

I need to notify various groups via email when certain frontend events are triggered. I'm having trouble figuring out how to pull this information from the backend implementation of sfGuard where the group, user and email address information is stored. Could anyone point me in the right direction?

 Topic: sfGuardUserProfile and edit.yml of sfGuardUser
sfGuardUserProfile and edit.yml of sfGuardUser [message #55634] Mon, 07 July 2008 19:12
raruiz  is currently offline raruiz
Messages: 18
Registered: September 2007
Location: Santiago de Chile
Junior Member
Hello all,
I have a form with all user info, sfGuardUser info + sfGuardUserProfile info, for users that need to edit their info. All works fine, except when I don't touch email data (that is Unique, and in edit.yml I use Unique validator), I got the unique_msg, but I need to use the same email that exists.
How could I tell to the edit.yml validator that only work when email data has been modified?, or if there are another method to solve this issue.

Thanks all.

[Updated on: Mon, 07 July 2008 19:12]

 Topic: sfGuard and SSL in backend application
sfGuard and SSL in backend application [message #55651] Mon, 07 July 2008 22:13
Messages: 1
Registered: July 2008
Junior Member
Does anyone have experience enabling SSL in a backend application? We're using sfGuard and we haven't had any problems enabling SSL when its just a frontend application. But trying to implment it in a backend app is kicking ours.

Any help would be appreciated, thanks
 Topic: sfGuard propel teams
sfGuard propel teams [message #56160] Mon, 14 July 2008 21:18
IsRobot  is currently offline IsRobot
Messages: 83
Registered: March 2008
Location: East Midlands, UK
I use the sfGuardPLugin and I need to create a team model in my system. A team will consist of a single manager and many members. Each manager will be an sfGuardUser and so will all the members. An sfGuardUser must be able to be a manager more than once and belong to more than one team. This is the model I have come up with and I'd appreciate some feedback to see if it makes sense and the implications for building and using the model with propel.

  • Attachment: Capture.JPG
    (Size: 17.77KB, Downloaded 2165 time(s))

web development
 Topic: sfguard check_password_callable not callable [solved]
sfguard check_password_callable not callable [solved] [message #56260] Tue, 15 July 2008 21:28
daum  is currently offline daum
Messages: 84
Registered: April 2007
It seems my auth function for this isn't being callable. Right now I have tried several different ways of formatting this but still no luck. In my app.yml I have:
    check_password_callable: [myLDAPauth, ldap_login]

Then for myLDAPauth.class.php I have tried a bunch:
public static function ldap_login($user, $pw) {
         return true;

And i tried to make it a class
class myLDAPauth{
public static function ldap_login($user, $pw) {
         return true;

No matter what I get the following error when it goes to call the function:

Warning: call_user_func_array() []: First argument is expected to be a valid callback, 'myLDAPauth::ldap_login' was given in

What am I missing?

Solution:Do the class declaration example above, the problem was the file had some hidden characters that was causing it to not be readable .

[Updated on: Wed, 16 July 2008 14:44]

 Topic: sfGuard admin signin
sfGuard admin signin [message #56463] Fri, 18 July 2008 14:08
kkeff  is currently offline kkeff
Messages: 1
Registered: July 2008
Junior Member
I use Symfony 1.1.0 and sfGuard 1.1

So when I'am trying to login at admin/admin happens nothing!

If I post incorrect login/password - I see an error messege, but in other hand I see nothing and no redirect happens Crying or Very Sad

$this->form->isValid() comes false
$values = $this->form->getValues() comes empty

I don't know what to do, please help
 Topic: table/class prefix an sfGuard
table/class prefix an sfGuard [message #58295] Fri, 08 August 2008 16:05
klausherzberg  is currently offline klausherzberg
Messages: 11
Registered: July 2008
Junior Member
in my current project i have to use table/class prefix using

propel.classPrefix = myPrefix

With it i come in trouble with sfGuardPlugin.

For example i have to rename some file etc.

Do you think is it possible to work with such prefix and sfGuard?

Thanks for some hints.

 Topic: Disable Generator
Disable Generator [message #59366] Sun, 24 August 2008 22:01
slide  is currently offline slide
Messages: 33
Registered: January 2006
Location: Baton Rouge, Louisiana
How do I disable the generator in sfGuard?
 Topic: sfGuard, groups & sfWidgetFormPropelSelect
sfGuard, groups & sfWidgetFormPropelSelect [message #59591] Thu, 28 August 2008 01:02
Tocpe  is currently offline Tocpe
Messages: 1
Registered: August 2008
Junior Member
I'm hoping one of the wiser and more experienced Symfony experts will be kind enough to help me with this.

Running Symfony 1.1 with the new forms.

I am able to pull up a list of users into the sfWidgetFormPropelSelect, but I'd like to be able to "filter out" certain groups.

For example, I have 4 groups: Admin, SuperUsers, Associates & Customers.
sf_Guard_User  Table (condensed)
ID | Their name/access
1    admin
2    Superuser
3    Associate
4    Customer

sf_Guard_Group  Table
ID | Description
1    admin
2    superuser
3    associate
4    customer

I have a page where a user can create a support ticket. If the person viewing this page has an access level above customer, they can select who to assign the ticket to.

- All users (including customers) are in the sf_Guard_User table.
- In the sf_Guard_Group table I have set up the 4 levels of access and the sf_Guard_User_Group table has linked these together.
sf_Guard_User_Group   Table
user_id | group_id
1         1
2         2
3         3
4         4

And both permission tables appear the same as the group tables.

I have tried the following code in the TicketForm.class.php file to control my form results when creating/editing a ticket:

In the $this->setWidgets(array(... section
'assignedto'    => new sfWidgetFormPropelSelect(array('model' => 'sfGuardUser', 'add_empty' => false)),

And just below the setWidgets secion:
$assignedtoCriteria = new Criteria;
$assignedtoCriteria->add(sfGuardUserGroupPeer::GROUP_ID, '4', Criteria::NOT_EQUAL);

$this->widgetSchema['assignedto']->setOption('criteria', $assignedtoCriteria);

I'm trying to filter out the customers from the "assigned to" pull down. While no errors are thrown, no filtering is taking place either. What am I missing?
 Topic: sfGuard Usage
sfGuard Usage [message #61092] Tue, 16 September 2008 09:27
mdf092  is currently offline mdf092
Messages: 59
Registered: May 2006

what can be permission values and how can i use them in my application?

 Topic: count query
count query [message #61529] Mon, 22 September 2008 15:51
mechandankr  is currently offline mechandankr
Messages: 22
Registered: May 2008
Location: noida
Junior Member
This query:

select p.property_name, COUNT(c.commentable_id) as count from promoter as p left join sf_comment as c on group by

how to write with Criteria.



[Updated on: Mon, 22 September 2008 15:52]

 Topic: SfGuard Question
SfGuard Question [message #61771] Wed, 24 September 2008 21:10
Russpd  is currently offline Russpd
Messages: 104
Registered: September 2008
Senior Member
Hi, I am installing sfGuard for my application and have some questions regarding it.

First, how necessary is sfGuard in a forum-like application? Our website is not geared around holding very sensitive information (beyond email addresses) For apps like this, are you sacrificing a lot by creating the login/authentication form described in the Askeet tutorial. What benefits are you getting with sfGuard: I read through the literature and it was a bit vague. My main problem is that my app allows unauthenticated users to do stuff on my site and credits their actions with the last authenticated user. I figured that sfGuard would be a airtight way of making sure that any user logged out would not be able to post under the last user's name

Finally, is sfGuard compatible with symfony 1.0. I think the new release is meant for 1.1 and does this explain why I am getting these errors?
Strict Standards: Declaration of sfGuardSecurityUser::initialize() should be compatible with that of sfBasicSecurityUser::initialize()

Thanks in advance!
 Topic: sfGuardLogin & AJAX
sfGuardLogin & AJAX [message #62575] Tue, 07 October 2008 22:12
jhartlep  is currently offline jhartlep
Messages: 32
Registered: January 2008
Location: Germany
I have the following problem:
In my navigation I have this Link:
<?php echo link_to_remote('Login', array(
    'update' => 'col1_content',
    'url'    => '@sf_guard_signin',
)) ?>

Now when I click on this link, the signin-site loades inside my div-container...
BUT: As the link_to_remote-function uses method => post, the loginpage shows the error_list "The username and/or password is invalid". When I use 'method' => 'get', nothing is displayed :S

Can anybody tell me, how to fix this? (symfony 1.1/sfGuard for 1.1.)


<form action="/frontend_dev.php/login" method="post">
  <th><label for="signin_username">Username</label></th>
  <td>  <ul class="error_list">
    <li>The username and/or password is invalid.</li>
<input type="text" name="signin[username]" id="signin_username" /></td>
  <th><label for="signin_password">Password</label></th>
  <td>  <ul class="error_list">
<input type="password" name="signin[password]" id="signin_password" /></td>
  <th><label for="signin_remember">Remember</label></th>
  <td><input type="checkbox" name="signin[remember]" id="signin_remember" /></td>
  <input type="submit" value="sign in" />
  <a href="/frontend_dev.php/request_password">Forgot your password?</a>
 Topic: 'Remember me' keys are shared between apps
'Remember me' keys are shared between apps [message #63067] Tue, 14 October 2008 15:43
joostvb  is currently offline joostvb
Messages: 3
Registered: October 2008
Junior Member
I have two apps where I'm using sfGuardPlugin to do the authentication. One is a normal website and the other one is the mobile version of the same website.
Both sites use the same user database.
I would like to be able to use the 'remember me' feature on both apps/sites. I have configured both sites to do so and all works fine except that a user can't have 'remember me' active on both sites.
This is because of the following piece of code in plugins/sfGuardPlugin/lib/user/sfGuardSecurityUser.class.php (signIn() function):

      // remove other keys from this user
      $c = new Criteria();
      $c->add(sfGuardRememberKeyPeer::USER_ID, $user->getId());

This removes all 'remember me' keys for this user.

The solution is pretty simple. I would suggest to add an extra 'site' column to the 'remember me' table that keeps track of which site a certain key belongs to.
In the signIn() function you should only remove the keys of the current user that belong to the current site.
We could take the cookie name as 'site name', but by configuring the 'site name' through app.yml, you could make two sites (apps) share the same 'remember me' keys just by configuring the same 'site name'.

I can't imagine that no one had this problem before me. Maybe I have overlooked it?
Are there other people having the some problem? If so, I will submit my changes as a patch. Or perhaps create a behavior for it.

 Topic: updateObject not working in sfGuardUserProfileForm
updateObject not working in sfGuardUserProfileForm [message #63551] Tue, 21 October 2008 06:02
jjkaye  is currently offline jjkaye
Messages: 1
Registered: June 2008
Junior Member
Hi, I'm not sure if anyone has run across this issue...

public function updateObject()

    $object = parent::updateObject();

      $object->getProfile()->setProfileImage(str_replace(sfConfig::get('sf_upload_dir').'/', '/uploads/', $objectgetProfile()->getProfileImage()));
    } else {

    return $object;

public function doSave($con = null)

    if($file = $this->getProfileImage()) 
      $filename = $this->getValue('username').$file->getExtension($file->getOriginalExtension());
    return parent::doSave($con);

public function checkForExistingFile()
    if(is_null($v = sfGuardUserProfilePeer::retrieveByPk($this->object->getPrimaryKey()))) {
      return false;
    } else {
      return $v->getProfileImage() ? $v->getProfileImage() : null;

This is the code that I'm using to upload a file using the sfGuardUserProfile. I'm using a near replica of this code to also handle a file upload for a lightweight blog that module that I wrote.

This code executes perfectly in the other module, however within the sfGuardUserProfileForm.class.php it's as if it does not exist. I have tried just putting "echo" statements in the code just to see if it's getting called. None of these functions are getting called and I'm wondering if anyone has run into a similar issue when trying to use updateObject, on a sfGuardUserProfile object in conjunction with sfGuardPlugin.



 Topic: sfGuardPlugin for sf 1.1 and extJS login
sfGuardPlugin for sf 1.1 and extJS login [message #64559] Wed, 05 November 2008 08:13
f1xxx3r  is currently offline f1xxx3r
Messages: 2
Registered: October 2008
Junior Member
Has anyone managed to customize the symfony 1.1 sfGuard login form with extJS (in the 'standard' extJS way without the extJS plugin) ?. If you did would you mind posting a code snippet ?

Thank you!
 Topic: [SOLVED] sfGuard + symfony 1.1
[SOLVED] sfGuard + symfony 1.1 [message #65110] Thu, 13 November 2008 11:07
serjshaklein  is currently offline serjshaklein
Messages: 1
Registered: November 2008
Junior Member
As i see last version of sfGuard works with symfony 1.2 (which is currently beta) only. Am i right?

So i've used 2.2.0 to install

symfony plugin:install sfGuardPlugin --release=2.2.0

But i'm getting errors like

Fatal error: Class 'BasesfGuardUserGroupPeer' not found

Yes, i tried to clear cache and read README file.

Is it some kind of versions conflict?
Is any chance to use last version of sfGuard?
Thank you.

I've solved it!
Problem was in model generating and schema.
For unknown reason i had duplicates of sfGuard tables in my general schema.yml.

[Updated on: Thu, 13 November 2008 12:42]

 Topic: xsPasswordManagerPlugin - 0.1.2
xsPasswordManagerPlugin - 0.1.2 [message #65180] Fri, 14 November 2008 11:01
xsolve  is currently offline xsolve
Messages: 1
Registered: November 2008
Location: Gliwice/Poland
Junior Member
XSolve's Password Manager Symfony Plugin

We've created a new helpfull plugin: xsPasswordManager. How many times, you've been wondering, what this password was, for another program, community portal or what so ever? Here's the solution: You don't have to bother anymore to remember all those difficult passwords, because our plugin does it for you.
Here are the main features:
* Shared passwords - assigned to a group of users
* Private passwords - visible only for the owner
* Password encryption
* Activity log
* User management done with sfGuardPlugin

You may find our plugin at: in
 Topic: use sfGuard plugin in several projects
use sfGuard plugin in several projects [message #65217] Fri, 14 November 2008 19:19
rxg127  is currently offline rxg127
Messages: 7
Registered: September 2008
Location: New York
Junior Member
Hi there,

(I am using Symfony 1.1)

Here is what I would like to do: I want to use sfGuard in all my Symfony projects without having to install the plugin in every project directory.

So I wanted to know if it is possible to install sfGuard plugin in my Symfony lib/plugins folder rather than install it in each of my projects. I have tried but I am getting some errors on the includes when I try to access my application (and the symfony commands don't work). It looks like the plugin is being loaded but symfony is still looking for files in my
folder when they are in

Anybody know how I could make this work?

Some more details:
First thing I did was put all the tables generated by sfGuard in their own database so I can access it from any project after adding an entry for this new database in databases.yml. That works fine if I install the plugin in the project directory but not when I move the plugin to my

Thanks for your help

 Topic: bad redirection after login
bad redirection after login [message #66385] Sun, 30 November 2008 14:27
frinux  is currently offline frinux
Messages: 10
Registered: October 2008
Junior Member
I'm using sf 1.2 and sfGuardPlugin (last svn version). I'm having a problem when logging in : I am well authenticated (when I manually go to http://server/frontend_dev.php/module/action I get an access), but when logging in it leads me to a 404 error message.

The URL is showing me http://server/images/icones/bullet_arrow_right_3.png, an image that is in my web/images folder. I saw that sfPluginAuth routes to @homepage, and I have this in my routing.yml :

  url:   /
  param: { module: welcome, action: index }

I don't know why the redirection is wrong, do yo usee something?
Thank you

 Topic: [solved] sfguard signin with lists instead of tables
icon3.gif  [solved] sfguard signin with lists instead of tables [message #68034] Wed, 17 December 2008 21:10
doox  is currently offline doox
Messages: 6
Registered: December 2008
Junior Member
as a new user of sfguard with symfony 1.1, it took me a couple of hours to find out how to use lists instead of tables for my signin form. so if any new user ever needs this, i am posting it here:

create a new folder under apps/frontend/modules/ (replace frontend with your app name) called sfGuardAuth, in this you create a folder called actions, and within this again a file called actions.class.php.

the file should look like this:


class sfGuardAuthActions extends BasesfGuardAuthActions
  public function executeSignin($request)

thats it! Smile

[Updated on: Wed, 17 December 2008 21:18]

 Topic: sfGuard usage questions
sfGuard usage questions [message #68495] Tue, 23 December 2008 18:22
nfuids  is currently offline nfuids
Messages: 58
Registered: April 2007
Location: Quebec

Here is my situation.. I want to use sfGuardDoctrine with sfDoctrine and symfony 1.2.x

I used sfGuard (both propel and doctrine) for a while now and here is how I think to use it.. so I'd like comment about if it's the right way to use it.. and I also got a question.

I will have a Project class. People need certain permission to perform certain tasks inside a project. Say for instances the permissions are: manager, contribuer and reader.

Each time I create a project, do I need to create those 3 permissions specific to that project? Something like project1_manager, project1_contribuer, project1_reader. So that way, a User could be manager for a project, but only a reader in another project?

If I later want to introduce a new project's permission, I will have to create it for every projects in the database, right?

Now, when I want to display a list of project on a page, but I would like to display only the project for which the user has access, how can I do that? I'm thinking using DQL, but I just don't get how to do it, any help would be greatly appreciated.

 Topic: sfGuard + sfDynamicCMS problem
sfGuard + sfDynamicCMS problem [message #68878] Tue, 30 December 2008 21:20
dignado  is currently offline dignado
Messages: 16
Registered: November 2008
Location: Germany
Junior Member
Hi all,

I want to use the sfDynamicCMS plugin, but when I try to access the plugin after the login I get this error message:

You don't have the required permission to access this page.

If I access afterwards the url "../sandbox/web/backend_dev.php/sfGuardUser" I can see that I am logged in. So I don't see what the problem is.

I am using:
Symfony 1.0.16
Php 5

Can someone help me?

Thanks in advance.
 Topic: sfGuardPlugin filters solution
sfGuardPlugin filters solution [message #69420] Wed, 07 January 2009 21:29
brentj84062  is currently offline brentj84062
Messages: 1
Registered: January 2009
Junior Member
[This post is being written for anyone having problems getting sfGuardPlugin to work no matter what they try in symfony 1.2]

I've been fighting with sfGuardPlugin for days, following the documentation, tracing logs, and getting frustrated overall with it's implementation.

I decided that, since nobody seemed to be having my problem, I probably ought to make a from-scratch project and be particularly meticulous about everything I was doing, copy pasting straight from the documentation and everything. Amazingly enough, it worked in my testbed environment. Some log comparisons revealed that both my project and my testbed were performing identically, BUT the applications filters were out of order. A quick tweak to my apps filters and it started working perfectly.

So, the moral of the story for anyone frustrated with sfGuardPlugin not working even though everything looks right: filter order matters. Specifically, this worked for me:

  class:  sfGuardBasicSecurityFilter
rendering: ~

# insert your own filters here

cache:     ~
common:    ~
execution: ~

Hope this helps somebody.
 Topic: Problem with sfGuardUserProfile
Problem with sfGuardUserProfile [message #69498] Thu, 08 January 2009 20:57
superpaul82  is currently offline superpaul82
Messages: 43
Registered: November 2008
Location: Tarcento
Hi everyone! I've a problem with the sfGuard plugin in symfony 1.2.1
I've installed it at the 3.1.3 version. The installation is ok.
I've extend it with the sf_guard_user_profile

    user_id:        { type: integer, foreignTable: sf_guard_user, foreignReference: id, onDelete: cascade, required: true }
    anagrafica_id:  { type: integer, foreignTable: anagrafica, foreignReference: id, onDelete: cascade }
    nominativo:     varchar(20)
    compleanno:     date
    mail:           varchar(255)
    foto:           varchar(255)
    impostazioni:   longvarchar #campo composto es.: campo1:valore1|campo2:valore2|...
      user_id:      [user_id]

    nome:            { type: varchar(50),required: true }
    cognome:         { type: varchar(50),required: true }
    codice_fiscale:  { type: varchar(16),required: true }
    data_nascita:    { type: date, required: true }
    luogo_nascita:   { type: varchar(50), required: true }
    deleted_at:      timestamp
      cf:            [codice_fiscale]

in my app.yml

    profile_class:      sfGuardUserProfile
    profile_field_name: user_id

in my layout.php
<?php if ($sf_user->isAuthenticated()): ?>
<div id="loggedin">
<a href="#" id="username">#<?php echo $sf_user->getProfile()->getNominativo(); ?></a>
<?php echo link_to("Logout","@sf_guard_signout",array("id"=>"logout")) ?>
<?php endif; ?>

If I execute the app, I've obtain this error:
500 | Internal Server Error | sfException
The user profile class "sfGuardUserProfile" does not exist.

but in my lib/model the SfGuardUserProfile exist and this is the content
class SfGuardUserProfile extends BaseSfGuardUserProfile

What can I do? There is mine error?

Thanks in advantage

[Updated on: Thu, 08 January 2009 20:58]

 Topic: [sfGuard] Missing mandatory parameters ?
[sfGuard] Missing mandatory parameters ? [message #69548] Fri, 09 January 2009 12:14
grenoult  is currently offline grenoult
Messages: 52
Registered: September 2008
Location: France

Today i've installed the sfGuardPlugin, which seems working properly.

I have followed the instructions given in the "readme" of the plugin.

But in the sfGuardUser (the interface to manage accounts), I can't modify an account, nor filter users etc... I can access to the main page. The error is :

The "/sf_guard_user/:id.:sf_format" route has some missing mandatory parameters (:id).

Where's the problem ? How can i solve it ?

 Topic: How would I translate the sfGuardUser module?
How would I translate the sfGuardUser module? [message #70135] Sat, 17 January 2009 20:53
o_bridge  is currently offline o_bridge
Messages: 12
Registered: November 2008
Location: Montreal, Québec, Canada
Junior Member

I'm building a site for French people. I've been able to translate the login form by changing the template files in /plugins/sfGuardPlugin/modules/sfGuardAuth/templates

However, I want to translate the admin module sfGuardUser. How would I do that? Do translations already exist?

Note: This is my first symfony project.

 Topic: admin generated sfguardpages accessables from everywhere
admin generated sfguardpages accessables from everywhere [message #70483] Thu, 22 January 2009 11:37
doox  is currently offline doox
Messages: 6
Registered: December 2008
Junior Member
seems like i've did something wrong with the admin generator! Sad

i can access the admin generated pages on every app (got frontend and backend). for example, i can access "http://localhost/sfGuardUser" even when not signed in to the website itself.

the frontend is running without security but the backend is. so, its working like it should be, but the whole adminstuff messed up!
it shouldn't be in the frontend!

i am new to symfony and sfguard. so is the adminstuff saved in the plugin or in the app? can't find it. can't even find any generator.yml, except the ones in "plugin/sfguard/modules/.../config/...".

is there a way to remove it from the frontend or even completely?
 Topic: Modify sfGuardPermission
Modify sfGuardPermission [message #70638] Sat, 24 January 2009 13:55
masterix  is currently offline masterix
Messages: 41
Registered: September 2008

I have a table called clients( which are not users in the system ). I'd like to build permissions' name dynamically so admin can choose client from list and user ( from system ) and connect them into one permission. The result of above connection should be "clientID_userID" name of permission. How to obtain that?

 Topic: Backend modules in the frontend
Backend modules in the frontend [message #70949] Wed, 28 January 2009 15:56
buzi  is currently offline buzi
Messages: 62
Registered: January 2008

I want my application to show the managing feature (AKA backend) from within the frontend, according to the permission the user has.

So I enabled the managing modules (sfGuardUser, etc...) in the frontend and it works great.

BUT, any user can reach these pages and do whatever he wants.
I've tried writing:
  credentials: adminPermission

in security.yml in the config dir of the frontend application (and of course I added that permission to the super admin I created), but it doesn't affect anything for some reason.
I tried writing sf_guard_user instead of sfGuardUser but it didn't helped as well.

What can I do ?

Thank you,
 Topic: Edit profile with sfForm
icon2.gif  Edit profile with sfForm [message #71000] Thu, 29 January 2009 10:54
mirage  is currently offline mirage
Messages: 8
Registered: July 2008
Junior Member

I have a problem with sfGuard and profile editing with sfForm : the form isn't saved in database!

Before saving, I have the user's id but after saving, he is null and the list of columns modified is null too

Have you an idea?

public function executeEdit($request)
    $this->form = new sfGuardEditForm(sfGuardUserPeer::retrieveByPK($this->getUser()->getGuardUser()->getId()));

    if ($request->isMethod('post'))
      $params_register = array_merge($request->getParameter('user'),
                                       'last_information_update' => time()
      $this->form->bind($request->getParameter('user'), $request->getFiles('user'));

      if ($this->form->isValid())

        $this->getUser()->setFlash('message', 'Vos données personnelles ont bien été modifiées !');

class sfGuardEditForm extends sfGuardUserAdminForm
  protected $pkName = null;

  public function configure()



    $this->widgetSchema['avatar'] = new sfWidgetFormInputFileEditable(
        'file_src' => 'uploads' . DIRECTORY_SEPARATOR . sfConfig::get('app_user_upload_path') . DIRECTORY_SEPARATOR . $this->getObject()->getAvatar(),
        'edit_mode' => $this->getObject()->getAvatar(),
        'is_image' => true

    $years = range(date('Y') - 100, date('Y'));
    $this->widgetSchema['birthday'] = new sfWidgetFormDate(
        'format' => '%day% %month% %year%',
        'years' => array_combine($years, $years)

      'password' => 'Nouveau mot de passe',
      'password_again' => 'Répétez le nouveau mot de passe',
      'email' => 'Adresse email',
      'birthday' => 'Date de naissance'

    $this->validatorSchema['password'] = new sfValidatorString(
      array('min_length' => 4, 'max_length' => 128, 'required' => false),
        'min_length' => 'Vous devez saisir un mot de passe de %min_length% caractères minimum.',
        'max_length' => 'Vous devez saisir un mot de passe de %min_length% caractères maximum.',
        'required' => 'Vous devez saisir un mot de passe.'

    $this->validatorSchema['email'] = new sfValidatorEmail(
        'required' => 'Vous devez saisir une adresse email.',
        'invalid' => 'Vous devez saisir une adresse email valide.'

    $this->validatorSchema['avatar'] = new sfValidatorFile(
        'required'   => false,
        'path'       => sfConfig::get('sf_upload_dir') . DIRECTORY_SEPARATOR . sfConfig::get('app_user_upload_path'),
        'mime_types' => 'web_images'
 Topic: Pulling userdata on a user not logged in
Pulling userdata on a user not logged in [message #71473] Wed, 04 February 2009 20:06
devcod  is currently offline devcod
Messages: 3
Registered: December 2008
Junior Member
Hello everyone.
I am building a pseudo-forum and I need to show a list of posts, which is going fine.

Then I want to show the poster of that posts, with a link to his profile and some quick data about him, but I ran into trouble.

will for example only be able to pull data out on the user currently logged in.
How do I get access to the other user's data and embed that into my webpage?

Thank you in advance, Devcod.

[Updated on: Sat, 07 February 2009 17:32]

 Topic: error to get username of sfGuardUser from backend using generator
error to get username of sfGuardUser from backend using generator [message #72170] Thu, 12 February 2009 02:09
sumon  is currently offline sumon
Messages: 8
Registered: January 2009
Location: World, Universe, Black Ho...
Junior Member
what i am trying to display sfGuardUser username at a module in backend. here is partial of config

      actions: ~
      fields:  ~
        title:  Stories by Programmer
        display: [project_id, programmer_id, title]
        layout: stacked
        params: |
           %%project%% - %%sfGuardUser%% - %%title%%

portion of my schema file
    Timestampable: ~
      type: integer
      notnull: true
      type: integer
      notnull: true
      type: string(255)
      notnull:  true
      type: string(4000)
      notnull:  true
      local:  project_id
      foreign:  id
      foreignAlias: story_project
      local: programmer_id
      foreign: id
      type: many
      foreignAlias: story_username

furthermore, i already add a function at lib/model/.../sfGuardUser.class.php
  public function __toString()
    return ucfirst($this->getUsername());

when i browse http://localhost:8086/backend_dev.php/mymodule it shows me the following error:
<pre> Doctrine_Collection data : Array( 0 : Object(sfGuardUser) ) </pre>

any idea or help highly appreciated.

[Updated on: Thu, 12 February 2009 02:12]

 Topic: sfGuardUserProfile - the password is not saved
sfGuardUserProfile - the password is not saved [message #72285] Thu, 12 February 2009 20:27
loulouraph  is currently offline loulouraph
Messages: 5
Registered: December 2008
Location: Belgium
Junior Member
hi everyone,

I try to use sfGuardUser and sfGuardUserProfile.

My problem occurs when there is a new user and there is an error in the profile.

The form appears with notification of errors but the password fields are empty. It is then possible to register the user, but the password is not saved in the database.

Someone has an idea to solve my problem?

Thank you in advance ...

 Topic: Advice on sfGuardUserAdminForm and Admin Generator
Advice on sfGuardUserAdminForm and Admin Generator [message #72952] Thu, 19 February 2009 18:14  is currently offline
Messages: 2
Registered: February 2009
Location: United Kingdom
Junior Member
Hi All, apologies up front if there is a similar post available that may address my issue already. I've looked in the forums, googled, beat my head against a desk (no really... i did!!! Sad ) and no luck... so hopefully someone can help me.

I'm currently re-developing a company website and using symfony 1.2 with sfGuard 3.1.3. So far things have been great until I noticed the following:

I was trying to modify the sf_guard_user_group_list field to make it an admin_double_list but was unable to do so. After a little more tinkering I also noticed that I cannot change the display name for any of the fields either?!? Tried changing is_super_admin as an example and it refuses to acknowledge anything I add to my admin generator file.

I did notice that the generator included with the plugin (which i copied and modified to create my own - and then cleared the content of the original file) uses the class sfGuardUserAdminForm

Has anyone else had a similar issue? If so, what was the solution if one has been found? If not... does anyone have any advice on I can do? Here are some ideas that I have:

  1. Hack the sfGuardUserAdminForm class and make the necessary changes
  2. Extend the sfGuardUserAdminForm and create my own

Am I correct in assuming that the first option would be somewhat retarded when it comes to future upgrades to the form? Would it be over-ridden if I upgrade in the future?

Thanks in advance and apologies for the lengthly post.

Jason Lamb
 Topic: sfGuardPlugin problems
icon5.gif  sfGuardPlugin problems [message #73272] Tue, 24 February 2009 07:34
assassinann  is currently offline assassinann
Messages: 28
Registered: February 2009
Location: china
Junior Member

Hi```all ```
I'm a newcomer for symfony``
and recently I use sfGuardPlugin to manage the users,
and the problem is there isn't a register page for users to register on my website,how can I do this with sfGuardPlugin? Or should I write a new register page(include action/template)?
There is still any solution for me,so plz help me,sorry for my English Very Happy
Any help will be appreciate! Thans and best regards!!! Smile

[Updated on: Tue, 24 February 2009 07:51]

 Topic: sfDoctrineGuard: How to disable/remove "remember me" functionality?
sfDoctrineGuard: How to disable/remove "remember me" functionality? [message #75549] Wed, 25 March 2009 00:20
blakenzoe  is currently offline blakenzoe
Messages: 6
Registered: March 2009
Junior Member

My site doesn't use any "Remember Me" functionality. How do I disable that functionality in the sfDoctrineGuard plugin?

 Topic: sfGuardDoctrine: unit:test fails // SQLSTATE[42S22]:
icon1.gif  sfGuardDoctrine: unit:test fails // SQLSTATE[42S22]: [message #75715] Fri, 27 March 2009 10:41
greg2  is currently offline greg2
Messages: 1
Registered: March 2009
Junior Member
Hi all,

I wrote some simple unit tests for sfGuardDoctrinePlugin to test the Database Connection and so far they all worked properly.

If I try to request any table from the sfGuard tables in this way:

$q = Doctrine::getTable('UserAsset')->createQuery()->fetchOne();

it works fine. But if I'm trying to do the same with the sfGuardUser table:

$q = Doctrine::getTable('sfGuardUser')->createQuery()->fetchOne();

it fails and puts me an error message:

SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'field list'

There is no column named 'name' in sfGuardUser table (only 'username). I searched hours in the configuration and classes, but i cannot understand why Doctrine builds a request including the table column 'name'. Is there a way to debug or see where it comes from?

I would appreciate every hint to get rid of this!
thanks and best regards

btw: clear cache, build-all-reload etc. makes no difference
 Topic: sfGuardAuth and User Session
sfGuardAuth and User Session [message #75783] Sat, 28 March 2009 10:54
dannyy  is currently offline dannyy
Messages: 3
Registered: March 2009
Junior Member
Symfony 1.2.4

Is there any chance to store Session attribute after user Singin?

My code:

file: apps\frontend\modules\sfGuardAuth\BasesfGuardAuthActions.class

public function executeSignin($request)
if ($this->form->isValid())
        $values = $this->form->getValues();
        $this->getUser()->signin($values['user'], array_key_exists('remember', $values) ? $values['remember'] : false);

        @$date = date();

        $this->getUser()->setAttribute('date', $date);
        return $this->redirect('main/new');

Then in layout:
file: apps\frontend\templates\layout.php

<?php echo $sf_user->getAttribute('date') ?>

And it isnt working. Need help xp.
 Topic: How to display permissions in sfGuard user list view
How to display permissions in sfGuard user list view [message #76021] Wed, 01 April 2009 01:58
o.petro  is currently offline o.petro
Messages: 3
Registered: March 2009
Junior Member
Hello list,

I must admit I'm quiet new to symfony, so maybe this is an easy one:
I installed the sfDoctrineGuardPlugin and generated a backend application to manage users.
Now I'd like to add the list of permissions for a given user in the user list view by using the generator.yml file (just like the select element in the default filter view). Following obviously doesn't work:
    display: [=username, is_active, permissions_list]

I'm using symfony 1.2.5 and sfDoctrineGuardPlugin 3.0.0

Thank you,
Pages (3): [1  2  3  >  »]

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