hooks.php
author Dan
Tue, 20 Jan 2009 22:08:07 -0500
changeset 51 508400fc5282
parent 8 0acb8d9a3194
permissions -rw-r--r--
Major change to permissions backend - performs whois check (only supported blitzed and freenode right now) and advanced permissions supported.

<?php

global $eb_hooks;
$eb_hooks = array();

function eb_hook($hook_name, $code)
{
  global $eb_hooks;
  if ( !isset($eb_hooks[$hook_name]) )
    $eb_hooks[$hook_name] = array();
  
  $eb_hooks[$hook_name][] = $code;
}

function eb_fetch_hook($hook_name)
{
  global $eb_hooks;
  return ( isset($eb_hooks[$hook_name]) ) ? implode("\n", $eb_hooks[$hook_name]) : 'eb_void();';
}

// null function for filling empty hooks
function eb_void()
{
}