Changes

Jump to: navigation, search

Auth Module

2,293 bytes added, 18:40, 19 October 2009
no edit summary
== UmlautAuth Module ==
== Creating UmlautAuth Module and Plugin Architecture Plugins ==The UmlautAuth module extends functionality available from the [Authlogic|http://github.com/binarylogic/authlogic] (version 2.1.0) gem and configured as a plugin based on the [Authlogic OpenID add-on|http://github.com/binarylogic/authlogic_openid].
===Core Umlaut Auth PluginFiles Added or Updated ===Several core Umlaut files were updated in order to develop the UmlautAuth module.* app/controller/application.rbThe application controller was updated to filter passwords and provide two methods for accessing the current user session and the current user. The method current_user_session (aliased as has_logged_in_user) returns nil if no user session has been established. The method current_user (aliased as logged_in_user) return either nil or the current logged in user.* app/controllers/user_sessions_controller.rbThe user sessions controller manages the routing of user session requests. Three methods are available:*# new - renders the login screen or redirects to external login screen*# validate - validates the user upon login*# destroy - processes logout* app/controllers/users_controller.rbThe users controller manages the routing of user related requests. Two methods are available:*# edit (also called from show) - renders the user preferences screen.*# update - processes updates to user preferences.* app/models/user_sessionsExtends Authlogic::Session::Base* app/models/userSerializes user_attributes and adds acts_as_authentic functionality to leverage the Authlogic gem. Also sets to_param to username rather than id for prettier urls.* app/views/user_sessions/newThe default login screen* app/views/users/editThe default user preferences screen. Users can update mobile phone numbers and the like.* config/environment.rbAdded authlogic gem: <pre>#require 'authlogic'config.gem 'authlogic', :version => "= 2.1.0"</pre>* config/routes.rbAdded url routes:<pre> map.login "login", :controller => "user_sessions", :action => "new" map.logout "logout", :controller => "user_sessions", :action => "destroy" map.validate "validate", :controller => "user_sessions", :action => "validate" map.resources :user_sessions map.resources :users</pre>* db/schema.rbModified the user table to use with authlogic. Included column for mobile phone and user attributes.
58
edits

Navigation menu