General developer forum

Help with access to custom file by logged in user

Picture of Gary Lynch
Help with access to custom file by logged in user


I have created some custom SQL reports/php files.

what im trying to do is create a  check against user database and give the user access to the file that meets the criteria.

here is what i have done

i have created a table (called customtable) which contains the following




link (to each custom file relating to institution)

what im try i would like to do is:

if logged in user  is in institution and description in mdl_user and customtable then access file link in customtable if not then redirect to access denied page

my database is Postgres

i know i have to use the following


Islogged in

Session handlers

So my line of thinking is

click button to php file that checks logged in user is in the institution in mdl_user against customtable institution if yes then open custom php file link if no redirect to access denied

I have basic php (but not moodle specific) and mysql skills  but this is bit beyond me.

im looking to extendmy skills.

I would be very grateful for any help

Gary smile

Average of ratings: -
Picture of Gary Lynch
Re: Help with access to custom file by logged in user


I have found a plugin that does what im seeking but unfortuantely it will not install on our moodle version 3.1.3

We cant upgrade due to staff issues at the present time



Average of ratings: -