<commit_before><?php

// Have this run absolutely last, so all other plugins have already initiated.
register_elgg_event_handler('init','system','pf_safety_init',20000);
 
function pf_safety_init() {
  // Have the members page be protected with a gatekeeper() call
  elgg_unregister_page_handler('members');
  elgg_register_page_handler('members', 'pf_safety_members_page_handler');
}

function pf_safety_members_page_handler($page) {
  gatekeeper();
  return call_user_func('members_page_handler', $page);
}    

?><commit_msg>* pf_safety/start.ph: In addition to having a gatekeeper() call in the   page handler, remove the menu item for this plugin from the site   menu bar if the visitor isn't logged in.<commit_after><?php

// Have this run absolutely last, so all other plugins have already initiated.
register_elgg_event_handler('init','system','pf_safety_init',20000);
 
function pf_safety_init() {
  // Have the members page be protected with a gatekeeper() call
  elgg_unregister_page_handler('members');
  if (!elgg_is_logged_in()) 
    elgg_unregister_menu_item('site', 'members');
  elgg_register_page_handler('members', 'pf_safety_members_page_handler');
}

function pf_safety_members_page_handler($page) {
  gatekeeper();
  return call_user_func('members_page_handler', $page);
}    

?>
{'fraction_non_alphanumeric': 0.10752688172043011, 'fraction_numerical': 0.007680491551459293, 'mean_word_length': 6.279329608938547, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1027257', 'n_tokens_mistral': 423, 'n_tokens_neox': 408, 'n_words': 104}