Forum: Ruby on Rails finding out the remote users username ENV[REMOTE_USER] ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
89d967359903c639d31e4cad4569f537?d=identicon&s=25 Charlie Bowman (Guest)
on 2006-05-22 15:42
(Received via mailing list)
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 Bowman
http://www.recentrambles.com
78426f365f660355d52992c272a770ee?d=identicon&s=25 Chris Sendall (Guest)
on 2006-05-22 17:27
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 Bowman 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 Bowman
> http://www.recentrambles.com
89d967359903c639d31e4cad4569f537?d=identicon&s=25 Charlie Bowman (Guest)
on 2006-05-22 18:06
(Received via mailing list)
thanks, I finally figured out the fcgi had to be configured to pass in
the environment variables.  It is turned off by default.

Charlie
This topic is locked and can not be replied to.