function loadHandler($handler)
 {
     $sf = new SiteFunction();
     $sf->noForeign();
     $sf->clauseSafe('handler', $handler);
     if ($sf->id()) {
         $ret = $sf->getHandler();
     } else {
         if (class_exists(str_replace('Application', 'Setup', constant('APPLICATION')))) {
             $class_name = str_replace('Application', 'Setup', constant('APPLICATION'));
             $ret = new $class_name();
         } else {
             $ret = Application::loadHandler($handler);
         }
     }
     return $ret;
 }
 function authorise($handler)
 {
     $sf = new SiteFunction();
     $sf->clauseSafe('handler', $handler);
     $sf->noForeign();
     if ($sf->get('access_id') == 2) {
         $ret = true;
     } else {
         if ($sf->id()) {
             $ret = false;
         } else {
             if ($handler == str_replace('Application', 'Setup', constant('APPLICATION'))) {
                 $ret = true;
             } else {
                 $ret = $this->authorise(str_replace('Application', 'Setup', constant('APPLICATION')));
             }
         }
     }
     return $ret;
 }