sfForkedDoctrineApplyPlugin
1.0.1stable
for sf 1.4sf 1.3 and Doctrine
MIT
This plugin is Forked version of sfDotrineApplyPlugin created by punkave guys.
This Fork got stripped stripped of all dependencies from Zend Framework, introduced Profile model inheritance, small structural changes and few usability changes as well.
Includes following language versions: English, Polish, Italian, French, Russian, Spanish and German.
The plugin's repository can be foun on github.
More news on fizyk's website, under sfForkedDoctrineApply tag.
Developers
License
--------------------------------------------------------------------------------
sfForkedDoctrineApplyPlugin
--------------------------------------------------------------------------------
Copyright (c) 2010 stephenrs and Grzegorz Śliwiński
--------------------------------------------------------------------------------
sfDoctrineApplyPlugin
--------------------------------------------------------------------------------
Copyright (c) 2008, 2009 Boutell.Com, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
sfForkedDoctrineApply plugin
Forked from sfDoctrineApply plugin (version 1.1.1).
It's stripped of Zend Mail dependencies as proposed by stephenrs on symfony forums,
here
Thanks to punkave guys for the original plugin, and Big thanks to stephen for
the modifications.
Requirements
- symfony 1.4
- sfDoctrineGuardPlugin - installed and configured
Requirements should be similar as the original plugin, although I can only be
sure of symfony 1.4.
When sfDoctrineGuardPlugin will introduce email in official package, our current
plugin should be modified to use sfGuardUser's email field, not it's own.
Changes to sfDoctrineApplyPlugin
- removed all Zend Mail dependency
- created a general library with all sfApplyActions functions
- introduced inheritance to Profile model.
Installation
Installation should be simple as:
symfony plugin:install sfForkedDoctrineApplyPlugin
However it is also possible to install it through archive:
symfony plugin:install sfForkedDoctrineApplyPlugin-1.0.0.tgz
just place downloaded package in your project's root first.
You can also install it manually, unpacking archive, placing it's content in your
project's plugin/ directory, and enabling it in your ProjectConfiguration.class.php file:
config/ProjectConfiguration.class.php
class ProjectConfiguration extends sfProjectConfiguration
{
//....//
public function setup()
{
//....//
$this->enablePlugins('sfDoctrineGuardPlugin');
$this->enablePlugins('sfForkedDoctrineApplyPlugin');
//....//
}
}
After installing this plugin, add this declaration into your schema.yml file:
config/doctrine/schema.yml
sfGuardUserProfile:
inheritance:
type: simple
extends: sfGuardUserProfileBasis
# Don't forget this!
relations:
User:
class: sfGuardUser
foreign: id
local: user_id
type: one
onDelete: cascade
foreignType: one
foreignAlias: Profile
You can add your own columns, if needed, it just won't be possible to set these
as not null in database. Build your model after those steps.
All you need to do is to enable sfApply module in your settings.yml file:
apps/APPLICATION/config/settings.yml
all:
.settings:
#...#
enabled_modules: [default, ... , sfGuardAuth, sfApply]
and set up routes for your app:
apps/APPLICATION/config/routing.yml
apply:
url: /user/new
param: { module: sfApply, action: apply }
reset:
url: /user/password-reset
param: { module: sfApply, action: reset }
resetRequest:
url: /user/reset-request
param: { module: sfApply, action: resetRequest }
resetCancel:
url: /user/reset-cancel
param: { module: sfApply, action: resetCancel }
validate:
url: /user/confirm/:validate
param: { module: sfApply, action: confirm }
settings:
url: /user/settings
param: { module: sfApply, action: settings }
And you can enjoy user registration on your website.
Configuration
To configure this plugin to actually send registration emails,
You need to set up email settings according to
day 16 of Jobeet tutorial,
and set up your from credentials in app.yml
apps/APPLICATION/config/app.yml
sfApplyPlugin:
from:
email: "your@emailaddress.com"
fullname: "the staff at yoursite.com"
You should also turn on i18n engine, as this plugin, like the project it rooted
from is fully internationalised:
apps/APPLICATION/config/settings.yml
all:
.settings:
i18n: on
Displaying Login and Logout Prompts
(fragment of sfDoctrineApplyPlugin's README)
You probably have pages on which logging in is optional. It's nice to
display a login prompt directly on these pages. If you want to do that,
try including my login/logout prompt component from your
apps/frontend/templates/layout.php file:
<?php include_component('sfApply', 'login') ?>
Note that you can suppress the login prompt on pages that do include
this partial by setting the sf_apply_login slot:
<?php slot('sf_apply_login') ?>
<?php end_slot() ?>
Credits
sfDoctrineApplyPlugin was written by Tom Boutell. He can be contacted
at tom@punkave.com. See also www.punkave.com and
www.boutell.com for further information about his work.
Changes resulting in forking the original plugin were written by stephenrs.
sfForkedDoctrineApplyPlugin was created by Grzegorz Śliwiński as a result of those changes with some additions.
You can contact him at fizyk@fizyk.net.pl or through
jabber/xmpp at fizyk@jabbim.pl.
Changelog
Version 1.0.0
- fizyk: fixed issue when logged user trying to reset his password was presented with 404 web site (reported by tnaseem).
- fizyk: removed all PHP's heredoc's <<
Version 0.9
- Removed all Zend_Mail references and got back to SwiftMailer
- Introduced simple inheritance for profile model.
- Logged user won't get confirmation email when accidentally requesting password change.
- Visitor can't get access to reset password page if not logged in, or haven't came through confirmation page.
- Doubled the original confirmation string.
- Moved action library class into appropriate folder
- Added i18n pl strings
For previous Changes see sfDoctrineApply Plugin's page.
TODO
- task to clean old validate codes
- setting that would allow disable email verification during registration
- add captcha!
- more i18n!
- possibility to edit emails