i want to create users for my webapplication.
im using symfony. i wonder if i should do that with sfDoctrineGuardPlugin or symfony’s provided methods for this?
// Add one or more credentials
$user->addCredential('foo');
$user->addCredentials('foo', 'bar');
// Check if the user has a credential
echo $user->hasCredential('foo'); => true
// Check if the user has both credentials
echo $user->hasCredential(array('foo', 'bar')); => true
// Check if the user has one of the credentials
echo $user->hasCredential(array('foo', 'bar'), false); => true
// Remove a credential
$user->removeCredential('foo');
echo $user->hasCredential('foo'); => false
// Remove all credentials (useful in the logout process)
$user->clearCredentials();
echo $user->hasCredential('bar'); => false
or is the purpose of sfDoctrineGuardPlugin just securing the admin page and not the frontend logging system?
thanks.
I would recommend using sfDoctrineGuardPlugin. It provides forms for managing your users in the backend. It is easily extendable to add extra data base fields to add more info for your users (profiles, etc) and it handles all the SHA/MD5 password encryption when storing user passwords for you. If you are creating your login system from scratch you need to consider password storage.
It is basically a great starting point when building your secure pages. It can be used both for backend and frontend. For the frontend you just need to enable the right modules in the config file and you can use it without problem.
One thing I forgot to add is that sfDoctrineGuardPlugin also provides the “remember me” function. Which is great. Use the plugin. 🙂