1 class OauthClientsController < ApplicationController
4 before_filter :authorize_web
5 before_filter :set_locale
6 before_filter :require_user
9 @client_applications = @user.client_applications
10 @tokens = @user.oauth_tokens.find :all, :conditions => 'oauth_tokens.invalidated_at is null and oauth_tokens.authorized_at is not null'
14 @client_application = ClientApplication.new
18 @client_application = @user.client_applications.build(params[:client_application])
19 if @client_application.save
20 flash[:notice] = t'oauth_clients.create.flash'
21 redirect_to :action => "show", :id => @client_application.id
23 render :action => "new"
28 @client_application = @user.client_applications.find(params[:id])
29 rescue ActiveRecord::RecordNotFound
30 @type = "client application"
31 render :action => "not_found", :status => :not_found
35 @client_application = @user.client_applications.find(params[:id])
39 @client_application = @user.client_applications.find(params[:id])
40 if @client_application.update_attributes(params[:client_application])
41 flash[:notice] = t'oauth_clients.update.flash'
42 redirect_to :action => "show", :id => @client_application.id
44 render :action => "edit"
49 @client_application = @user.client_applications.find(params[:id])
50 @client_application.destroy
51 flash[:notice] = t'oauth_clients.destroy.flash'
52 redirect_to :action => "index"