check from custom front php page if its executed by cms admin or cms admin is logged in


I'm creating a simple custom plugin by putting a custom "print" link in the section records row to preview and/or print the custom page with all the fields of each record.

In this custom frontend php page I want to put a security check to see if the page is opened by the cms admin.

I'm using separated cms user table and members tables with the membership plugin.

Any help would be appreciated,

By daniel - January 4, 2022

Hi Karls,

Admin users have a flag set when they log in which can be checked like this:

if (!empty($CURRENT_USER['isAdmin'])) {
  // execute admin-only code here

Let me know if that works for you, or if you have any other questions!


Technical Lead