Yii Framework Forum: Check if direct access to action - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Check if direct access to action

#1 User is offline   dgtal 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 09-April 14

Posted 16 May 2017 - 04:25 AM

Hello.

How can i determine whether a controller action is accessed directly from the browser?

I have an action used to serve files and images, and i need to add a permissions check when the user is directly accessing the url.
The same action can be called from some other actions / models / views, to display images etc., and in that case there's no need to check for permissions.

How do i check if the action is called directly from an url or is called for example by an image src? (i don't need to know what calls it, just if it's called directly from the user or not)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users