iframe get to know if role is admin

52 views
Skip to first unread message

Fernando Alarcón

unread,
Mar 18, 2014, 5:19:09 PM3/18/14
to xata...@googlegroups.com
Can an embedded iframe know or determine the role of the logged user?
I have a custom php file that gets included as an iframe in the block_result_list, but I wan't it to change according to the role of the logged in user. Specifically if the user is admin or not.

Steve Hannah

unread,
Mar 18, 2014, 5:48:48 PM3/18/14
to Fernando Alarcón, xata...@googlegroups.com
Xataface stores its session data in a different directory that the rest of the PHP scripts on your system so to avoid gc collisions.  If you want to access the Xataface session data from a separate script and you're on the same server, you can either set your PHP script to use the same directory as Xataface to store its sessions, or you can create a shared file that both Xataface and your script have access to.  There are many alternative approaches also... limited only by your creativity.

Steve


On Tue, Mar 18, 2014 at 2:19 PM, Fernando Alarcón <sush...@gmail.com> wrote:
Can an embedded iframe know or determine the role of the logged user?
I have a custom php file that gets included as an iframe in the block_result_list, but I wan't it to change according to the role of the logged in user. Specifically if the user is admin or not.



--
Steve Hannah
Web Lite Solutions Corp.

Fernando Alarcón

unread,
Mar 19, 2014, 1:49:37 PM3/19/14
to xata...@googlegroups.com, Fernando Alarcón
The php script is on the same server, so yes, accessing the same directory sounds like a good idea. And how would I do that? What directory does Xataface use?

Steve Hannah

unread,
Mar 20, 2014, 12:25:41 PM3/20/14
to Fernando Alarcón, xata...@googlegroups.com
Xataface places it in a subdirectory of the main PHP sessions directory.  It generates a hashed directory name by default (based on the path to the app), but you can override this using the "subdir" directive in the _auth section of the conf.ini file.

e.g.
[_auth]
    ;.... other parameters
    subdir=myappsessions

Then in your PHP script you can set your session save dir to this directory.   You can see the Xataface code that sets this directory here:

Steve
Reply all
Reply to author
Forward
0 new messages