Bug 755933

Summary: Last login,Last login IP fields empty.
Product: [Retired] CloudForms Cloud Engine Reporter: Aziza Karol <akarol>
Component: aeolus-conductorAssignee: chris alfonso <calfonso>
Status: CLOSED CURRENTRELEASE QA Contact: wes hayutin <whayutin>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0.0CC: akarol, calfonso, dajohnso, deltacloud-maint, dgao, hbrock, slinaber, ssachdev
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
user details
none
ss
none
last_login_IP
none
login ip none

Description Aziza Karol 2011-11-22 13:06:56 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.Install aeolus/aeolus-configure.
2.Navigate to Administer->users and groups.
3.click on admin user.
  
Actual results:
LAST LOGIN and LAST LOGIN IP fields is always empty.no details displayed for this fields.

see attached screenshot.


Expected results:
we should fill it in or hide these fields.


Additional info:
[root@hp-bl490cg6-01 templates]# rpm -qa | grep aeolus
rubygem-rack-mount-0.7.1-3.aeolus.el6.noarch
aeolus-conductor-doc-0.7.0-0.20111118205914git4c5036a.el6.noarch
rubygem-aeolus-cli-0.1.0-4.el6.noarch
rubygem-arel-2.0.10-0.aeolus.el6.noarch
rubygem-aeolus-image-0.1.0-6.el6.noarch
aeolus-configure-2.4.0-0.20111118150133gitde3c009.el6.noarch
aeolus-all-0.7.0-0.20111118205914git4c5036a.el6.noarch
aeolus-conductor-0.7.0-0.20111118205914git4c5036a.el6.noarch
rubygem-ZenTest-4.3.3-2.aeolus.el6.noarch
aeolus-conductor-daemons-0.7.0-0.20111118205914git4c5036a.el6.noarch

Comment 1 Aziza Karol 2011-11-22 13:07:58 UTC
Created attachment 535017 [details]
user details

Comment 2 Dave Johnson 2011-12-07 16:35:06 UTC
Created attachment 542036 [details]
ss

Looks closer but still not showing the correct IP, see the screenshot.  Also saw a value of ::1

aeolus-all-0.7.0-4.el6.noarch
aeolus-conductor-0.7.0-4.el6.noarch
aeolus-conductor-daemons-0.7.0-4.el6.noarch
aeolus-conductor-doc-0.7.0-4.el6.noarch
aeolus-configure-2.4.0-3.el6.noarch
rubygem-aeolus-cli-0.2.0-3.el6.noarch
rubygem-aeolus-image-0.2.0-1.el6.noarch

Comment 3 Dave Johnson 2011-12-07 16:36:55 UTC
Hmm, just checked the history and I really need to use today's build to verify this, disregard comment 2 at this point.

Comment 4 Dave Johnson 2011-12-07 17:28:24 UTC
Checked this mornings build and am seeing the same results of comment 2.  I am expecting the IP and/or DNS name of my workstation accessing the web ui.

aeolus-all-0.7.0-4.el6.noarch
aeolus-conductor-0.7.0-4.el6.noarch
aeolus-conductor-daemons-0.7.0-4.el6.noarch
aeolus-conductor-doc-0.7.0-4.el6.noarch
aeolus-configure-2.4.0-3.el6.noarch
rubygem-aeolus-cli-0.2.0-3.el6.noarch
rubygem-aeolus-image-0.2.0-1.el6.noarch

Comment 5 Dave Johnson 2011-12-08 14:38:48 UTC
*** Bug 761353 has been marked as a duplicate of this bug. ***

Comment 6 chris alfonso 2011-12-20 14:50:54 UTC
Is this on a RHEVM based client?

Comment 7 chris alfonso 2011-12-20 17:57:58 UTC
posted a patch to conductor for review.

[main] 0fef636b94b12d860f9ce9f354e15fa2a8e307ca - commit 1 of 2235 (0%)                                                                                                                                           
commit 0fef636b94b12d860f9ce9f354e15fa2a8e307ca                                                                                                                                                                   
Refs: master, v0.6.0_RC_1-188-g0fef636                                                                                                                                                                            
Author:     Chris Alfonso <calfonso>                                                                                                                                                                   
AuthorDate: Tue Dec 20 12:51:10 2011 -0500                                                                                                                                                                        
Commit:     Chris Alfonso <calfonso>                                                                                                                                                                   
CommitDate: Tue Dec 20 12:51:10 2011 -0500                                                                                                                                                                        
                                                                                                                                                                                                                  
    BZ#755933 Last login,Last login IP fields empty.                                                                                                                                                              
                                                                                                                                                                                                                  
    The implementation of rails' AbstractRequest.remote_ip returns the HTTP_CLIENT_IP                                                                                                                             
    if it's populated, which when there is a a proxy (apache) in front of rails, the                                                                                                                              
    client ip is 127.0.0.1.  I would think rails should check the HTTP_X_FORWARDED_FOR                                                                                                                            
    first, then fall back to the HTTP_CLIENT_IP.  For now, I've added a check for the                                                                                                                             
    HTTP_X_FORWARDED_FOR first, then fall back to the remote_ip method call.                                                                                                                                      
---                                                                                                                                                                                                               
 src/config/initializers/warden.rb |    3 ++-                                                                                                                                                                     
 1 files changed, 2 insertions(+), 1 deletions(-)                                                                                                                                                                 
                                                                                                                                                                                                                  
diff --git a/src/config/initializers/warden.rb b/src/config/initializers/warden.rb
index de391a5..2298b97 100644                                                                                                                                                                                     
--- a/src/config/initializers/warden.rb                                                                                                                                                                           
+++ b/src/config/initializers/warden.rb                                                                                                                                                                           
@@ -63,7 +63,8 @@ Warden::Strategies.add(:database) do                                                                                                                                                            
     login, password = get_credentials                                                                                                                                                                            
     return unless login && password                                                                                                                                                                              
     Rails.logger.debug("Warden is authenticating #{login} against database")                                                                                                                                     
-    u = User.authenticate(login, password, request.remote_ip)                                                                                                                                                    
+    ipaddress = request.env[ 'HTTP_X_FORWARDED_FOR' ] ? request.env[ 'HTTP_X_FORWARDED_FOR' ] : request.remote_ip                                                                                                
+    u = User.authenticate(login, password, ipaddress)                                                                                                                                                            
     u ? success!(u) : fail!("Username or password is not correct - could not log in")                                                                                                                            
   end                                                                                                                                                                                                            
 end

Comment 8 chris alfonso 2012-01-03 15:39:10 UTC
pushed to conductor repository: 
commit a627c7457caafb8c46f2dec9f108edb7fa1cfb58

Comment 9 Shveta 2012-01-10 08:49:45 UTC
Created attachment 551794 [details]
last_login_IP

Comment 10 Shveta 2012-01-10 08:50:55 UTC
rpm -qa|grep aeolus
aeolus-configure-2.6.0-0.20120105171403gitf0043e8.el6.noarch
aeolus-conductor-doc-0.9.0-0.20120105223209git5e068fe.el6.noarch
rubygem-arel-2.0.10-0.aeolus.el6.noarch
rubygem-rack-mount-0.7.1-3.aeolus.el6.noarch
rubygem-ZenTest-4.3.3-2.aeolus.el6.noarch
rubygem-aeolus-image-0.4.0-0.20120105171419git8108b42.el6.noarch
aeolus-conductor-0.9.0-0.20120105223209git5e068fe.el6.noarch
aeolus-all-0.9.0-0.20120105223209git5e068fe.el6.noarch
rubygem-aeolus-cli-0.4.0-0.20120105171410git2c6b457.el6.noarch
aeolus-conductor-daemons-0.9.0-0.20120105223209git5e068fe.el6.noarch

Comment 11 Steve Linabery 2012-01-10 17:33:41 UTC
a627c7457caafb8c46f2dec9f108edb7fa1cfb58 in aeolus-conductor-0.8.0-2.el6.src.rpm

Comment 12 Aziza Karol 2012-01-12 06:34:44 UTC
Values displayed in Last login,Last login IP fields.

see attached screenshot.

verified in:
[root@dell-pe1950-02 ~]# rpm -qa | grep  aeolus
aeolus-configure-2.5.0-4.el6.noarch
rubygem-aeolus-cli-0.3.0-3.el6.noarch
aeolus-conductor-doc-0.8.0-5.el6.noarch
aeolus-all-0.8.0-5.el6.noarch
aeolus-conductor-daemons-0.8.0-5.el6.noarch
rubygem-aeolus-image-0.3.0-2.el6.noarch
aeolus-conductor-0.8.0-5.el6.noarch

Comment 13 Aziza Karol 2012-01-12 06:37:09 UTC
Created attachment 552310 [details]
login ip

Comment 14 wes hayutin 2012-01-12 16:18:04 UTC
bugs in verified or on_qa moving off tracker