How to completely hide the membership system, making every user an admin?

This scenario is useful mainly if you are the only user of the generated AppGini app, and don't want to have to sign in every now and then, and want to remove the 'visual clutter' of the admin link, sign out link, .. etc.

Warning The following code basically makes every user a super admin. So, NEVER use this in a public-facing or multi-user app!

  • In hooks/__global.php, add this code after the first line to set user as admin without login:
  • In hooks/footer-extras.php, add this code to hide the admin/membership related elements:
      $j(() => {
             .signed-in-as, a[href="membership_profile.php"],
       #admin-tools-menu-button{ visibility: hidden; }

The code above was tested on AppGini 22.13. If it doesn't work on a different version, it might need to be modified.