Permalink
Browse files

white spaces

  • Loading branch information...
mkristian committed Jun 19, 2013
1 parent 1afe79f commit 679dd05e44dba94251d2ac435abfddd7957a1dff
@@ -1,5 +1,5 @@
class ApplicationController < ActionController::Base
-
+
respond_to :json
protected
@@ -15,7 +15,7 @@ def login_and_password
auth = params[:authentication] || params
[ auth[:login] || auth[:email], auth[:password] ]
end
-
+
end
# old stuff
# protect_from_forgery
@@ -56,7 +56,7 @@ def login_and_password
# end
# def current_user(user = nil)
-# # TODO just put user_id and user.groups names into session
+# # TODO just put user_id and user.groups names into session
# session['user'] = user if user
# session['user']
# end
@@ -67,7 +67,7 @@ def login_and_password
# def remote_permission
# perm = RemotePermission.find_by_token(x_service_token)
-# raise "ip #{request.remote_ip} wrong authentication" unless perm
+# raise "ip #{request.remote_ip} wrong authentication" unless perm
# # if the perm.id == nil then do not check IP - needed when using clusters
# raise "ip #{request.remote_ip} not allowed" if (!perm.ip.blank? && request.remote_ip != perm.ip)
# end
@@ -2,7 +2,7 @@ class ApplicationsController < LocalController
guard_filter( {} ) do |groups|
groups.select do |group|
- group.application == Application.ALL ||
+ group.application == Application.ALL ||
( application && group.application == application )
end
end
@@ -16,7 +16,7 @@ def group_url( *args )
def authorize_application
#TODO super(params[:id])
if params[:id]
- @application =
+ @application =
if updated_at
Application.optimistic_find(updated_at, params[:id])
else
@@ -56,7 +56,7 @@ def create
# authorize_app(@application)
@application.save
-
+
respond_with serializer( @application )
end
@@ -86,9 +86,9 @@ def group_create
end
def group_update
- group = application.group_update( current_user,
+ group = application.group_update( current_user,
params[ :group ][ :updated_at ],
- params[ :id ],
+ params[ :id ],
params[ :group ] )
# for audit log
@@ -13,14 +13,14 @@ def show
# PUT /configuration
def update
- @configuration = ::Configuration.optimistic_find( updated_at,
+ @configuration = ::Configuration.optimistic_find( updated_at,
::Configuration.instance.id )
params[:configuration] ||= {}
params[:configuration][:modified_by] = current_user
@configuration.update_attributes( params[:configuration] )
-
+
respond_with serializer( @configuration )
end
end
@@ -30,15 +30,15 @@ def update
@domain.attributes = params[ :domain ]
if @domain.changed?
- @domain.modified_by = current_user
+ @domain.modified_by = current_user
@domain.save
end
respond_with serializer( @domain )
end
# DELETE /domains/1
- def destroy
+ def destroy
@domain = Domain.optimistic_find( updated_at, params[:id] )
@domain.destroy
@@ -33,7 +33,7 @@ def index
# @application )
# params[:group][:modified_by] = current_user
-
+
# authorize_application_param( params[:group] )
# @group.update_attributes( params[:group] )
@@ -43,8 +43,8 @@ def index
# # DELETE /groups/1
# def destroy
- # @group = Group.filtered_optimistic_find( updated_at,
- # params[:id],
+ # @group = Group.filtered_optimistic_find( updated_at,
+ # params[:id],
# @application )
# @group.destroy
@@ -54,12 +54,12 @@ def csrf
protected
- def current_user(user = nil)
+ def current_user(user = nil)
if user
session['user'] = serializer(user).use(:session).to_hash['user']
@_current_user = user
else
- @_current_user ||=
+ @_current_user ||=
begin
data = session['user']
if data
@@ -73,7 +73,7 @@ def current_user(user = nil)
end
end
end
-
+
def current_groups
if current_user
app_ids = [Application.THIS.id, Application.ALL.id]
@@ -1,5 +1,5 @@
class ProfileController < LocalController
-
+
#TODO cache_headers :private
# GET /profile
@@ -30,15 +30,15 @@ def update
@region.attributes = params[ :region ]
if @region.changed?
- @region.modified_by = current_user
+ @region.modified_by = current_user
@region.save
end
respond_with serializer( @region )
end
# DELETE /regions/1
- def destroy
+ def destroy
@region = Region.optimistic_find( updated_at, params[:id] )
@region.destroy
@@ -18,7 +18,7 @@ def reset_password
@authentication = "login/email: #{username}"
pwd = User.reset_password( username )
-
+
if pwd
render :inline => "password sent", :content_type => :text
else
@@ -13,7 +13,7 @@ def last_changes_of_app
end
def setup
- @user = User.filtered_setup( params,
+ @user = User.filtered_setup( params,
remote_permission,
User.system_user )
respond_with serializer( @user ).use( :for_app )
@@ -24,7 +24,7 @@ def create
@session = Session.new( 'user' => user,
'idle_session_timeout' => Users::Application.config.idle_session_timeout,
'permissions' => guard.permissions( user.groups) )
-
+
respond_with serializer( @session )
else
@session = user.to_s
@@ -40,7 +40,7 @@ def destroy
# for the log
@session = current_user
- # reset session happens in the after filter which allows for
+ # reset session happens in the after filter which allows for
# audit log with username which happens in another after filter
head :ok
end
@@ -35,7 +35,7 @@ def show
# GET /users/1/at.json
def at
@user = User.filtered_find(params[:id], current_user)
-
+
respond_with serializer( @user )
end
@@ -56,8 +56,8 @@ def create
# PUT /users/1.json
def update
params[:user] ||= params
- @user = User.filtered_optimistic_find(params[:user][:updated_at],
- params[:id],
+ @user = User.filtered_optimistic_find(params[:user][:updated_at],
+ params[:id],
current_user)
params[:user][:modified_by] = current_user
@@ -1,5 +1,5 @@
applications:
- defaults: []
+ defaults: []
index:
- user-admin
- app-admin
View
@@ -1,5 +1,5 @@
ats:
- defaults: [at]
+ defaults: [at]
# index: []
# show: []
# new: []
@@ -1,5 +1,5 @@
audits:
- defaults: []
+ defaults: []
# index: []
# show: []
# new: []
@@ -1,5 +1,5 @@
configuration:
- defaults: []
+ defaults: []
# index: []
# show: []
# new: []
@@ -1,5 +1,5 @@
domains:
- defaults: []
+ defaults: []
index: ['*']
# index: []
# show: []
@@ -1,5 +1,5 @@
errors:
- defaults: []
+ defaults: []
# index: []
# show: []
# new: []
@@ -1,5 +1,5 @@
groups:
- defaults: [app-admin]
+ defaults: [app-admin]
index: [user-admin, app-admin]
# show: []
# new: []
@@ -1,5 +1,5 @@
regions:
- defaults: []
+ defaults: []
index: ['*']
# show: []
# new: []
@@ -18,7 +18,7 @@ def self.ALL
end
def self.ATS
- @ats ||=
+ @ats ||=
begin
ats = Application.new
ats.id = -1
View
@@ -16,11 +16,11 @@ def self.all_changed_after( from )
def self.all_changed_after_of_app( from, app )
set = unless from.blank?
- DomainsGroupsUser.joins( :group, :domain ).where( 'application_id = ? and domains.updated_at > ?',
- app.id,
+ DomainsGroupsUser.joins( :group, :domain ).where( 'application_id = ? and domains.updated_at > ?',
+ app.id,
from )
else
- DomainsGroupsUser.uniq.joins( :group => :application ).where( 'application_id = ?',
+ DomainsGroupsUser.uniq.joins( :group => :application ).where( 'application_id = ?',
app.id )
end
set.collect { |d| d.domain }.uniq
View
@@ -10,7 +10,7 @@ def errors
[]
end
- def id
+ def id
''
end
end
Oops, something went wrong.

0 comments on commit 679dd05

Please sign in to comment.