Plugin info

Total downloads: 963
Active installs: 0
Total reviews: 0
Average rating: 0
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 1
Last updated: 1/15/2015 (4053 days ago)
Added to WordPress: 1/15/2015 (11 years old)
Minimum WordPress version: 4.0.0
Tested up to WordPress version: 4.1.0
Minimum PHP version: f

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 4053 days ago

20/100

Is Rails Login abandoned?

Possibly abandoned (last update 4053 days ago).

Compatibility

Requires WordPress: 4.0.0
Tested up to: 4.1.0
Requires PHP: f

Languages

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Rails Theme
Rating 0.0/5 (0 reviews)Active installs 10

Description

If you have set up a WordPress installation as a subfolder of a Rails App, this plugin will make your users login with your Rails app. That is, there is no WordPress login; your users will be logged in if they are logged in to Rails, and they are not logged in if not.

The WordPress installation needs to be on the same domain as the Rails app because it needs to access the same cookie.

Installation

  1. Be sure that the Rails side is set up and working. See FAQ for more details.
  2. Unzip this plugin folder and copy the rails-login subfolder to your WordPress’s plugin directory.
  3. Activate the plugin through the ‘Plugins’ menu in WordPress.
  4. Configure the settings in the ‘Settings/Rails Login’ page.

Frequently Asked Questions

How should the Rails app be set up?

You must first configure your Rails app and WordPress installation to work together. For instructions on how to do that, and a possible way to share a theme between WordPress and Rails is here: Rails Theme

In your routes.rb file:

get ‘/authentication/user’ => “authentication#user”

after logging in and logging out, insert this statement:

write_user_cookie()

Add this to authentication_controller.rb:

#GET /authentication/user.json def user     user = read_user_cookie(params[:id])     obj = { user: user }     puts obj.to_json()     respond_to do |format|         format.json { render :json => { user: user } }     end end  private  def get_crypt     key = ActiveSupport::KeyGenerator.new(Rails.application.secrets.secret_key_base).generate_key("read-current-user")     crypt = ActiveSupport::MessageEncryptor.new(key)     return crypt end  def write_user_cookie     crypt = get_crypt()     cookie_name = Rails.application.config.session_options[:key] + '2'     id = current_user.present? ? current_user.id : 0     cookies[cookie_name] = crypt.encrypt_and_sign(id) end  def read_user_cookie(cookie)     crypt = get_crypt()     id = crypt.decrypt_and_verify(cookie)      user = User.where(id: id).first     if user.present? && !user.disabled         name = user.first_name + ' ' + user.last_name         return { email: user.email,                  first_name: user.first_name,                  last_name: user.last_name,                  url: '', description: '',                  username: user.email,                  login: user.email,                  nickname: name,                  display_name: name         }     else         return ''     end end 

Review feed

No reviews available

Screenshots

  1. Settings page for administrators.

    Settings page for administrators.

Changelog

1.0.0

  • Initial release.