sfLoginzaPropelPlugin - 1.0.2

This is Propel plugin for Symfony 1.4 for authorization through the social networks (facebook, vk, odnoklassniki, twitter etc.) by Loginza JavaScript-widget.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

This is Propel plugin for Symfony 1.4 for authorization through the social networks (facebook, vk, odnoklassniki, twitter etc.) by Loginza JavaScript-widget.

Installation

  • Install the plugin

    • From PEAR package

      $ symfony plugin:install sfLoginzaPropelPlugin

    • From SVN-repository

      $ svn co http://svn.symfony-project.com/plugins/sfLoginzaPropelPlugin/ plugins/sfLoginzaPropelPlugin

  • if you have installed this plugin from Subversion, then edit config/ProjectConfiguration.class.php

    [php] class ProjectConfiguration extends sfProjectConfiguration { public function setup() { // ... $this->enablePlugins('sfLoginzaPropelPlugin'); } }

  • Rebuild your model

    $ symfony propel:build-model
    $ symfony propel:build-sql
    $ symfony propel:build-forms
    $ symfony propel:build-filters
    
  • Update your database tables by starting from scratch (it will delete all the existing tables, then re-create them):

    $ symfony propel:insert-sql
    
  • Enable one or more modules in your settings.yml (optional)

    • For your frontend application

      all:
        .settings:
          enabled_modules: [..., lzauth, lzchat, lzprofile]
        .actions:
          login_module:    lzauth
          login_action:    login
  • Set my_host in plugins/sfLoginzaPropelPlugin/config/app.yml

    all:
      LoginzaPlugin:
        my_host: http://[your_host]/[frontend.php]
        #or
        #my_host: http://[your_host]
    
  • Clear you cache

    $ symfony cc
    
  • A plugin's assets must be accessible in the project's web/ directory to be viewable from a browser. The plugin:publish-assets addresses this by creating symlinks under Unix system and by copying the files on the Windows platform:

    $ symfony plugin:publish-assets
    

Secure your application

To secure a symfony application:

  • Change 'security.yml' file

    default:
      is_secure: true
  • Change the parent class in myUser.class.php

    class myUser extends sfBasicSecurityUser
    {
    }

Configuring plugin

For configuring sfLoginzaPropelPlugin you can change file 'app.yml' in plugins/sfLoginzaPropelPlugin/config

all:
  LoginzaPlugin:
    my_host: http://[your_host]
    loginza_url: http://loginza.ru/api/widget?overlay=loginza&providers_set=
    providers:
    loginza_auth_info: http://loginza.ru/api/authinfo
    chat_time_step_msec: 5000
    expires_after_sec: 10
  • my_host - your host's name, for example: www.mysocnet.com
  • loginza_url - URL for authentication through Loginza, don't change it
  • providers - list of providers, that you want display. Set this parameter empty, if you want display all providers, OR put providers names, if you want display several providers. For example:

    [yml] providers: vkontakte,twitter,facebook

    Note: between the names do not have the spaces!

  • loginza_auth_info: URL for getting authentication information, don't change it

  • chat_time_step_msec - refreshing interval for the chat in the lzchat (in milliseconds)
  • expires_after_sec - time after which the user's online status set to off (in seconds)

Plugin's routing

See plugins/sfLoginzaPropelPlugin/config/routing.yml Here you can see logout-path

lzlogout:
  url:   /lzauth/logout
  param: { module: lzauth, action: logout }

W-A-R-N-I-N-G !!!!!!!!!!

Directory plugins/sfLoginzaPropelPlugin/web/js contains jQuery and jQuery UI javascripts. If you want to use your jQuery scripts in your web/js directory, then change view.yml file in plugins/sfLoginzaPropelPlugin/modules/lzchat/config and plugins/sfLoginzaPropelPlugin/modules/lzprofile/config directories!

If you include jQuery in your project, then remove jQuery paths for js and css in view.yml in plugins/sfLoginzaPropelPlugin/modules/lzchat/config and plugins/sfLoginzaPropelPlugin/modules/lzprofile/config directories!