Description:
fig bugs in login report
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r859:d7fa5bf1aeba - - 2 files changed: 7 inserted, 6 deleted

@@ -72,8 +72,6
72 value = SecureRandom.uuid
72 value = SecureRandom.uuid
73 cookies.encrypted[:uuid] = { value: value, expires: 20.year }
73 cookies.encrypted[:uuid] = { value: value, expires: 20.year }
74 end
74 end
75 - puts "encrypt " + cookies.encrypted[:uuid]
76 - puts cookies[:uuid]
77 end
75 end
78
76
79 protected
77 protected
@@ -119,8 +119,9
119 md = params[:since_datetime].match(/(\d+)-(\d+)-(\d+) (\d+):(\d+)/)
119 md = params[:since_datetime].match(/(\d+)-(\d+)-(\d+) (\d+):(\d+)/)
120 @since_time = Time.zone.local(md[1].to_i,md[2].to_i,md[3].to_i,md[4].to_i,md[5].to_i)
120 @since_time = Time.zone.local(md[1].to_i,md[2].to_i,md[3].to_i,md[4].to_i,md[5].to_i)
121 rescue
121 rescue
122 - @since_time = DateTime.new(1000,1,1)
122 + @since_time = Time.zone.now
123 end
123 end
124 + puts @since_time
124 begin
125 begin
125 md = params[:until_datetime].match(/(\d+)-(\d+)-(\d+) (\d+):(\d+)/)
126 md = params[:until_datetime].match(/(\d+)-(\d+)-(\d+) (\d+):(\d+)/)
126 @until_time = Time.zone.local(md[1].to_i,md[2].to_i,md[3].to_i,md[4].to_i,md[5].to_i)
127 @until_time = Time.zone.local(md[1].to_i,md[2].to_i,md[3].to_i,md[4].to_i,md[5].to_i)
@@ -143,12 +144,14
143 x = Login.where("user_id = ? AND created_at >= ? AND created_at <= ?",
144 x = Login.where("user_id = ? AND created_at >= ? AND created_at <= ?",
144 user[0],@since_time,@until_time)
145 user[0],@since_time,@until_time)
145 .pluck(:ip_address).uniq
146 .pluck(:ip_address).uniq
147 + puts user[4]
148 + puts user[5]
146 @users << { id: user[0],
149 @users << { id: user[0],
147 login: user[1],
150 login: user[1],
148 full_name: user[2],
151 full_name: user[2],
149 count: user[3],
152 count: user[3],
150 - min: user[4],
153 + min: user[4].in_time_zone,
151 - max: user[5],
154 + max: user[5].in_time_zone,
152 ip: x
155 ip: x
153 }
156 }
154 end
157 end
@@ -162,7 +165,7
162 md = params[:since_datetime].match(/(\d+)-(\d+)-(\d+) (\d+):(\d+)/)
165 md = params[:since_datetime].match(/(\d+)-(\d+)-(\d+) (\d+):(\d+)/)
163 @since_time = Time.zone.local(md[1].to_i,md[2].to_i,md[3].to_i,md[4].to_i,md[5].to_i)
166 @since_time = Time.zone.local(md[1].to_i,md[2].to_i,md[3].to_i,md[4].to_i,md[5].to_i)
164 rescue
167 rescue
165 - @since_time = DateTime.new(1000,1,1)
168 + @since_time = Time.zone.now
166 end
169 end
167 begin
170 begin
168 md = params[:until_datetime].match(/(\d+)-(\d+)-(\d+) (\d+):(\d+)/)
171 md = params[:until_datetime].match(/(\d+)-(\d+)-(\d+) (\d+):(\d+)/)
You need to be logged in to leave comments. Login now