venkata reddy
2011-Dec-26 09:59 UTC
Finding Username of the machine from which rails app accessed
Hi All, Can anybody tell me, is there any way that i can find the name of the computer/machine rather than ip of the machine, from where a user is accessing my rails application? I was asked to do some research on this...please help. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
sandip ransing
2011-Dec-26 10:08 UTC
Re: Finding Username of the machine from which rails app accessed
observe request parameters but i dont think its giving machine name On Mon, Dec 26, 2011 at 3:29 PM, venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Hi All, > Can anybody tell me, is there any way that i can find the name > of the computer/machine rather than ip of the machine, from where a > user is accessing my rails application? > > I was asked to do some research on this...please help. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- sαη∂ιρ Rαηѕιηg --- www.funonrails.com twitter, github @sandipransing skype sandip.ransing -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Pravin Mishra
2011-Dec-26 10:50 UTC
Re: Finding Username of the machine from which rails app accessed
i m not sound on rails, but if U take a look to this site it not able to access machine name. http://iplocationtools.com/ http://www.ipaddresslocation.org/ i think U using either this gem http://geokit.rubyforge.org/index.html or any other derived gem . form my knowledge there is not option to get machine name. On 26 December 2011 15:38, sandip ransing <sandip-cm2wsEbV6oregbzhZkK2zA@public.gmane.org> wrote:> observe request parameters but i dont think its giving machine name > > > On Mon, Dec 26, 2011 at 3:29 PM, venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: > >> Hi All, >> Can anybody tell me, is there any way that i can find the name >> of the computer/machine rather than ip of the machine, from where a >> user is accessing my rails application? >> >> I was asked to do some research on this...please help. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> > > > -- > sαη∂ιρ Rαηѕιηg > > --- > www.funonrails.com > > twitter, github @sandipransing > skype sandip.ransing > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Gautam Pai
2011-Dec-26 10:54 UTC
Re: Finding Username of the machine from which rails app accessed
request.env[''REMOTE_HOST''] should be the closest to what you want. Gautam Pai On Mon, Dec 26, 2011 at 3:38 PM, sandip ransing <sandip-cm2wsEbV6oregbzhZkK2zA@public.gmane.org>wrote:> observe request parameters but i dont think its giving machine name > > > On Mon, Dec 26, 2011 at 3:29 PM, venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: > >> Hi All, >> Can anybody tell me, is there any way that i can find the name >> of the computer/machine rather than ip of the machine, from where a >> user is accessing my rails application? >> >> I was asked to do some research on this...please help. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> > > > -- > sαη∂ιρ Rαηѕιηg > > --- > www.funonrails.com > > twitter, github @sandipransing > skype sandip.ransing > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
venkata reddy
2011-Dec-26 12:55 UTC
Re: Finding Username of the machine from which rails app accessed
The exact requirement is, the rails app will be hosted in the lan itself. And when the user/employee opens the home page of the application, an action should be triggered and it should fetch the logged in user name(here logged name means the user who is using the machine), and the same thing(saying so and so user logged in) should be noticed to the admin. One idea i am having is if it is a linux machine i have to use the ''who'' command and parse the output. but what for windows system? And what are the ways to execute the linux commands in a rails app? Anybody come across this sort of situation already? On Dec 26, 3:54 pm, Gautam Pai <gomzi....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> request.env[''REMOTE_HOST''] should be the closest to what you want. > > Gautam Pai > > On Mon, Dec 26, 2011 at 3:38 PM, sandip ransing <san...-cm2wsEbV6oregbzhZkK2zA@public.gmane.org>wrote: > > > > > > > > > observe request parameters but i dont think its giving machine name > > > On Mon, Dec 26, 2011 at 3:29 PM, venkata reddy <venkatareddy...@gmail.com>wrote: > > >> Hi All, > >> Can anybody tell me, is there any way that i can find the name > >> of the computer/machine rather than ip of the machine, from where a > >> user is accessing my rails application? > > >> I was asked to do some research on this...please help. > > >> -- > >> You received this message because you are subscribed to the Google Groups > >> "Ruby on Rails: Talk" group. > >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. > >> To unsubscribe from this group, send email to > >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >> For more options, visit this group at > >>http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > sαη∂ιρ Rαηѕιηg > > > --- > >www.funonrails.com > > > twitter, github @sandipransing > > skype sandip.ransing > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter De Berdt
2011-Dec-26 13:29 UTC
Re: Re: Finding Username of the machine from which rails app accessed
On 26 Dec 2011, at 13:55, venkata reddy wrote:> The exact requirement is, the rails app will be hosted in the lan > itself. And when the user/employee opens the home page of the > application, an action should be triggered and it should fetch the > logged in user name(here logged name means the user who is using the > machine), and the same thing(saying so and so user logged in) should > be noticed to the admin. > > One idea i am having is if it is a linux machine i have to use the > ''who'' command and parse the output. but what for windows system? And > what are the ways to execute the linux commands in a rails app?The simple fact of the matter is that Rails applications run within a browser and you can''t run any system commands from within the browser. Your idea of running "who" from within the browser won''t work and if you do it from within your Rails app, it will just return the logged in user on the server (where your Rails app is running). In fact, there is very little you can find out about the system itself from within a browser for security reasons. Imagine the fun malicious code developer would have if a browser would enable you to access that kind of information. The only way to "detect" who is using your intranet web application is by having them log in from within the browser somehow. Whether that''s through a login and password, some single sign-on scheme like OpenID or some time-limited generated key (e.g. DigiPass, …) is up to you. Best regards Peter De Berdt -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Matt Jones
2011-Dec-27 12:33 UTC
Re: Finding Username of the machine from which rails app accessed
On Dec 26, 7:55 am, venkata reddy <venkatareddy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> The exact requirement is, the rails app will be hosted in the lan > itself. And when the user/employee opens the home page of the > application, an action should be triggered and it should fetch the > logged in user name(here logged name means the user who is using the > machine), and the same thing(saying so and so user logged in) should > be noticed to the admin. > > One idea i am having is if it is a linux machine i have to use the > ''who'' command and parse the output. but what for windows system? And > what are the ways to execute the linux commands in a rails app? > > Anybody come across this sort of situation already?If your users are all on Windows, apparently it''s possible to tie into NTLM authentication: http://blog.rayapps.com/2008/12/02/ntlm-windows-domain-authentication-for-rails-application/ Never tried this, but it may work. Once you''ve got a username, you may want to use something like ActiveLDAP to grab more info from your Active Directory server. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.