# Authlogic Page View Authentication Help

**URL:** <https://www.ruby-forum.com/t/authlogic-page-view-authentication-help/178084>\
**Category:** Rails\
**Created:** [October 28, 2009, 11:03pm UTC](https://www.ruby-forum.com/t/authlogic-page-view-authentication-help/178084 "2009-10-28T23:03:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![about2flip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@about2flip](https://www.ruby-forum.com/u/about2flip)\
**Post date:** [October 28, 2009, 11:03pm UTC](https://www.ruby-forum.com/t/authlogic-page-view-authentication-help/178084/1 "2009-10-28T23:03:17Z")

</div>

Hi:

I am a newbie at ROR, and I am grasping my head around Authlogic. I am  
having hard time trying to figure out how can I do the following:

in my application controller I have the following helpers:

filter\_parameter\_logging :password, :password confirmattion

helper\_method :all

```
private
  def current_user_session
    return @current_user_session if defined?

```

(@current\_user\_session)  
@current\_user\_session = UserSession.find  
end

```
  def current_user
    return @current_user if defined?(@current_user)
    @current_user = current_user_session &&

```

current\_user\_session.user  
end

```
  def require_user

```

unless current\_user  
store\_location  
flash[:notice] = “You must be logged in to access this page”  
redirect\_to new\_user\_session\_url  
return false  
end

end

Now I want only users to be logged in to upload photos. So if the hit  
the upload link it takes them to a page, and the page tells them they  
have to logged in to upload. Once they register or login it takes them  
to another view that has the link for them to upload their picture.

Can someone tell me how I do this. I really appreciate your help.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![about2flip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@about2flip](https://www.ruby-forum.com/u/about2flip)\
**Post date:** [October 29, 2009, 3:30am UTC](https://www.ruby-forum.com/t/authlogic-page-view-authentication-help/178084/2 "2009-10-29T03:30:46Z")

</div>

figured it out.
