events.php 378 B

12345678910111213141516171819
  1. <?php
  2. namespace AU\AnonymousComments;
  3. /**
  4. * page setup - protect anon user owned pages
  5. */
  6. function pagesetup() {
  7. $user = get_anon_user();
  8. $page_owner = elgg_get_page_owner_entity();
  9. if ($user->guid == $page_owner->guid) {
  10. // admin could log in as the anon user to set some things
  11. if ($user->guid != elgg_get_logged_in_user_guid()) {
  12. admin_gatekeeper();
  13. }
  14. }
  15. }