diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb deleted file mode 100644 index eea50af..0000000 --- a/app/controllers/sessions_controller.rb +++ /dev/null @@ -1,44 +0,0 @@ -class SessionsController < ApplicationController - skip_before_filter :verify_authenticity_token - - def new - response.headers['WWW-Authenticate'] = Rack::OpenID.build_header( - :identifier => "https://www.google.com/accounts/o8/id", - :required => ["http://axschema.org/contact/email", - "http://axschema.org/namePerson/first", - "http://axschema.org/namePerson/last"], - :return_to => session_url, - :method => 'POST') - head 401 - end - - def create - if openid = request.env[Rack::OpenID::RESPONSE] - case openid.status - when :success - ax = OpenID::AX::FetchResponse.from_success_response(openid) - user = User.where(:openid_url => openid.display_identifier).first - user ||= User.create!(:openid_url => openid.display_identifier, - :email => ax.get_single('http://axschema.org/contact/email'), - :name => ax.get_single('http://axschema.org/namePerson/first')) - # we should have a last name ... grrr - #:last_name => ax.get_single('http://axschema.org/namePerson/last')) - session[:user_id] = user.id - if user.name.blank? - redirect_to(user_additional_info_path(user)) - else - redirect_to(session[:redirect_to] || root_path) - end - when :failure - render :action => 'problem' - end - else - redirect_to new_session_path - end - end - - def destroy - session[:user_id] = nil - redirect_to root_path - end -end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a4c0bd6..e16380e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -10,7 +10,7 @@ def index end respond_to do |format| - format.html # index.html.erb + format.html format.js format.xml { render :xml => @users } end @@ -20,7 +20,7 @@ def show @user = current_user respond_to do |format| - format.html # show.html.erb + format.html format.xml { render :xml => @user } end end @@ -30,19 +30,16 @@ def new 3.times { @user.missions.build } respond_to do |format| - format.html # new.html.erb + format.html format.xml { render :xml => @user } end end - # GET /users/1/edit def edit @user = current_user (3-@user.missions.size).times { @user.missions.build } end - # POST /users - # POST /users.xml def create @user = User.new(params[:user]) @@ -75,8 +72,6 @@ def create end end - # PUT /users/1 - # PUT /users/1.xml def update respond_to do |format| if current_user.update_attributes(params[:user]) @@ -89,15 +84,4 @@ def update end end - # # DELETE /users/1 - # # DELETE /users/1.xml - # def destroy - # @user = User.find(params[:id]) - # @user.destroy - # - # respond_to do |format| - # format.html { redirect_to(users_url) } - # format.xml { head :ok } - # end - # end end diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP deleted file mode 100644 index fe41f5c..0000000 --- a/doc/README_FOR_APP +++ /dev/null @@ -1,2 +0,0 @@ -Use this README file to introduce your application and point to useful places in the API for learning more. -Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.