# Finding out the remote users username ENV\[REMOTE\_USER\]?

**URL:** <https://www.ruby-forum.com/t/finding-out-the-remote-users-username-env-remote-user/61261>\
**Category:** Rails\
**Created:** [May 22, 2006, 3:42pm UTC](https://www.ruby-forum.com/t/finding-out-the-remote-users-username-env-remote-user/61261 "2006-05-22T15:42:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [May 22, 2006, 3:42pm UTC](https://www.ruby-forum.com/t/finding-out-the-remote-users-username-env-remote-user/61261/1 "2006-05-22T15:42:00Z")

</div>

I’m trying to set the modified\_by in my user table from the remote user  
name. I have htaccess set up for the rails directory but I can’t seem  
to get it to read the remote users name. is ENV[REMOTE\_USER] the  
correct syntax? I searched but I can’t seem to find a definitive  
answer. Thank you for any help!

Charlie B.  
[http://www.recentrambles.com](http://www.recentrambles.com)

---

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [May 22, 2006, 6:06pm UTC](https://www.ruby-forum.com/t/finding-out-the-remote-users-username-env-remote-user/61261/2 "2006-05-22T18:06:18Z")

</div>

thanks, I finally figured out the fcgi had to be configured to pass in  
the environment variables. It is turned off by default.

Charlie

---

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [May 22, 2006, 5:27pm UTC](https://www.ruby-forum.com/t/finding-out-the-remote-users-username-env-remote-user/61261/3 "2006-05-22T17:27:08Z")

</div>

Charlie

class ApplicationController \< ActionController::Base

def authorize  
unless request.env[‘REMOTE\_USER’] == ‘cjs2’ then  
flash[:notice] = ‘You are not authorized to access this part of  
the database’  
redirect\_to(:controller =\> ‘hubfiles’, :action =\> ‘list’)  
end  
end

However this relies on an apache plugin and a University wide  
authentication service.

Chris

Charlie B. wrote:

> I’m trying to set the modified\_by in my user table from the remote user  
> name. I have htaccess set up for the rails directory but I can’t seem  
> to get it to read the remote users name. is ENV[REMOTE\_USER] the  
> correct syntax? I searched but I can’t seem to find a definitive  
> answer. Thank you for any help!
> 
> Charlie B.  
> [http://www.recentrambles.com](http://www.recentrambles.com)
