Sha256: 2e750525c3a56deccd0a86fd941fc0491d99b1fa8dd40642a2e92c16fbe2d74f

Contents?: true

Size: 1.01 KB

Versions: 199

Compression:

Stored size: 1.01 KB

Contents

class ApiController < ApplicationController
  
  before_filter :authenticate_user!, :only => [:create_key, :users]#, :activity_atom_feed]
  
  def create_key
    current_user.reset_authentication_token!
    if params[:api_settings].present?
      redirect_to settings_path(:api_settings => true)
      return
    end
    redirect_to :controller => :users, :action => :show, :id => current_user.to_param, :auth_token => params[:auth_token]
  end
  
  def users
    if !params[:id]
      params[:id]=current_user.to_param
    end
    
    if !params[:format]
      params[:format]='xml'
    end
        
    redirect_to :controller => :users, :action => :show, :format => params[:format], :id => params[:id], :auth_token => params[:auth_token]
  end
  
  def activity_atom_feed
    @subject = Actor.find_by_slug!(params[:id])
    # FIXME: why? check with Victor
    @subject ||= current_user

    @activities = @subject.wall(:home).page(params[:page]).per(10)
     
    respond_to do |format|
      format.atom
    end
  end
  
end

Version data entries

199 entries across 199 versions & 4 rubygems

Version Path
social_stream-0.28.4 base/app/controllers/api_controller.rb
social_stream-base-0.22.4 app/controllers/api_controller.rb
social_stream-0.28.1 base/app/controllers/api_controller.rb
social_stream-base-0.22.1 app/controllers/api_controller.rb
social_stream-0.28.0 base/app/controllers/api_controller.rb
social_stream-base-0.22.0 app/controllers/api_controller.rb
social_stream-0.27.3 base/app/controllers/api_controller.rb
social_stream-0.27.2 base/app/controllers/api_controller.rb
social_stream-base-0.21.2 app/controllers/api_controller.rb
social_stream-0.27.1 base/app/controllers/api_controller.rb
social_stream-base-0.21.1 app/controllers/api_controller.rb
social_stream-0.27.0 base/app/controllers/api_controller.rb
social_stream-base-0.21.0 app/controllers/api_controller.rb
social_stream-0.26.2 base/app/controllers/api_controller.rb
social_stream-base-0.20.2 app/controllers/api_controller.rb
social_stream-0.26.1 base/app/controllers/api_controller.rb
social_stream-base-0.20.1 app/controllers/api_controller.rb
social_stream-0.26.0 base/app/controllers/api_controller.rb
social_stream-base-0.20.0 app/controllers/api_controller.rb
social_stream-0.25.2 base/app/controllers/api_controller.rb