Ruby on Rails Monday, December 26, 2011

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@googlegroups.com.
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.

No comments:

Post a Comment