Charlie Bowman
2006-May-22 13:40 UTC
[Rails] finding out the remote users username ENV[REMOTE_USER] ?
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060522/67fbd154/attachment.html
Chris Sendall
2006-May-22 15:27 UTC
[Rails] Re: finding out the remote users username ENV[REMOTE_USER] ?
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-- Posted via http://www.ruby-forum.com/.
Charlie Bowman
2006-May-22 16:05 UTC
[Rails] Re: finding out the remote users username ENV[REMOTE_USER] ?
thanks, I finally figured out the fcgi had to be configured to pass in the environment variables. It is turned off by default. Charlie On Mon, 2006-05-22 at 17:27 +0200, Chris Sendall wrote:> 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 > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060522/12092158/attachment.html