Class: Caboose::LoginLogsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/caboose/login_logs_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#add_ga_event, #admin_add, #admin_bulk_add, #admin_bulk_delete, #admin_bulk_update, #admin_delete, #admin_update, #before_before_action, #hashify_query_string, #init_cart, #logged_in?, #logged_in_user, #login_user, #logout_user, #parse_url_params, #reject_param, #under_construction_or_forwarding_domain?, #user_is_allowed, #user_is_allowed_to, #validate_cookie, #validate_token, #var, #verify_logged_in

Instance Method Details

#admin_editObject


62
63
64
65
66
# File 'app/controllers/caboose/login_logs_controller.rb', line 62

def admin_edit
  return if !user_is_allowed_to 'edit', 'loginlogs'
  @login_log = LoginLog.find(params[:id])
 render :layout => 'caboose/admin'
end

#admin_indexObject


19
20
21
22
23
# File 'app/controllers/caboose/login_logs_controller.rb', line 19

def admin_index
  return if !user_is_allowed_to 'view', 'loginlogs'
  @pager = self.
  render :layout => 'caboose/admin'    
end

#admin_index_for_userObject


11
12
13
14
15
16
# File 'app/controllers/caboose/login_logs_controller.rb', line 11

def admin_index_for_user
  return if !user_is_allowed_to 'view', 'loginlogs'
  @pager = self.
  @edituser = Caboose::User.find(params[:userid]) if !params[:userid].blank?
  render :layout => 'caboose/admin'    
end

#admin_jsonObject


26
27
28
29
30
31
32
33
# File 'app/controllers/caboose/login_logs_controller.rb', line 26

def admin_json
  return if !user_is_allowed_to 'view', 'loginlogs'
  pager = self.        
  render :json => {
    :pager => pager,
    :models => pager.items
  }      
end

#admin_json_singleObject


55
56
57
58
59
# File 'app/controllers/caboose/login_logs_controller.rb', line 55

def admin_json_single
  return if !user_is_allowed_to 'view', 'loginlogs'
   = LoginLog.find(params[:id])      
  render :json => 
end

#before_actionObject


6
7
8
# File 'app/controllers/caboose/login_logs_controller.rb', line 6

def before_action
  @page = Page.page_with_uri(request.host_with_port, '/admin')
end

#login_logs_pagerObject


35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'app/controllers/caboose/login_logs_controller.rb', line 35

def 
  return Caboose::Pager.new(params, {
      'site_id'            => @site.id,
      'username_like'      => '',
      'user_id'            => '',
      'date_attempted_lte' => '',
      'date_attempted_gte' => '',
      'ip_like'            => '',        
      'success'            => ''              
		},{
		  'model'          => 'Caboose::LoginLog',
	    'sort'			     => 'date_attempted',
		  'desc'			     => false,
		  'items_per_page' => 100,
		  'base_url'		   => '/admin/login-logs',
		  'use_url_params' => false
	})    	
end