sfOpenAuthPlugin (doctrine 1.2)
TODO: Описание
Установка
-
Установить плагин
-
Установка из Git-репозитария:
cd /my/project/dir
git clone git://github.com/maxim-oleinik/sfOpenAuthPlugin.git plugins/sfOpenAuthPlugin -
Подключить как субмодуль для Git-репозитария:
cd /my/project/dir
git submodule add git://github.com/maxim-oleinik/sfOpenAuthPlugin.git plugins/sfOpenAuthPlugin
-
-
Установить Zend
-
Положить в lib/vendor/Zend
Controller
Http
Loader
OpenId
Session
Uri
ValidateRegistry.php
Exception.php -
Настроить автозагрузку в ProjectConfiguration.class.php
set_include_path(implode(PATH_SEPARATOR, array(
dirname(FILE) . '/../lib/vendor',
get_include_path(),
)));
require_once("Zend/Loader/Autoloader.php");
Zend_Loader_Autoloader::getInstance(); -
Пропатчить v2 для гугла, см
-
-
Активировать плагин в config/ProjectConfiguration.class.php
class ProjectConfiguration extends sfProjectConfiguration { public function setup() { $this->enablePlugins(array( 'sfDoctrinePlugin', 'sfOpenAuthPlugin', '...' )); } } -
Пересобрать модели
symfony doctrine:build --all-classes -
Обновить БД
TODO: Миграции -
Опубликовать assets
./symfony plugin:publish-assets -
Очистить кеш
symfony cc
Настроить приложение
-
Подключить jQuery во view.yml
-
Активировать модуль авторизации в
settings.ymlall: .settings: enabled_modules: [default, sfOpenAuth] -
Подключить фильтр "Remember Me" в "filters.yml" перед "security" фильтром
remember_me: class: sfOpenAuthRememberMeFilter security: ~ -
Указать модуль авторизации в
settings.ymllogin_module: sfOpenAuth login_action: login -
Change the parent class in
myUser.class.phpclass myUser extends sfOpenAuthSecurityUser { } -
Optionally add the following routing rules to
routing.ymlopen_auth_login: url: /login param: { module: sfOpenAuth, action: login } open_auth_logout: url: /logout param: { module: sfOpenAuth, action: logout } open_auth_verify: url: /auth/openid/verify param: { module: sfOpenAuth, action: verify }You can customize the
urlparameter of each route.
N.B.: You must have a@homepagerouting rule (used when a user sign out)These routes are automatically registered by the plugin if the module
sfOpenAuth
is enabled unless you definedapp_open_auth_routes_registerto false
in theapp.ymlconfiguration file: -
Secure some modules or your entire application in
security.ymldefault: is_secure: true -
Дополнительные настройки в app.yml
all:
open_auth:
remember_cookie: me # remember cookie name
remember_ttl: 1296000 # sec, 15 days
redirect_signin: homepage
redirect_signout: homepage
routes_register: true