123
@mjoel,
Since you've included ./mainfile.php you should be able to just add:
(($xoopsUser instanceof XoopsUser) && ($xoopsUser->isAdmin(0))) || exit(_NOPERM);
after:
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
although I would change the include("../../mainfile.php") to
require_once dirname(dirname(dirname(__DIR__))) . "/mainfile.php";
- but that's not required to make it work. You can do something similar (although a little more complex) for other groups...