authorized = false; $entitlements = explode(';', $_SERVER['entitlement']); foreach($entitlements as $entitlement) { if(in_array($entitlement, $required_entitlements)) { $this->authorized = true; } } $this->fragments = get_fragments("./html/$language/fragments.html"); $this->ldap = new Ldap(); } public function respond() { if(!$this->authorized) { die("Unauthorized."); } return $this->render(); } abstract public function render(); final protected function escape_tags($tags) { foreach($tags as $key => $tag) { $tags[$key] = $this->escape_string(strtolower($tag)); } return $tags; } final protected function unescape_tags($tags) { foreach($tags as $key => $tag) { $tags[$key] = $this->unescape_string(strtolower($tag)); } return $tags; } final protected function escape_string($string) { return str_replace(array("'", '"'), array(''', '"'), $string); } final protected function unescape_string($string) { return str_replace(array(''', '"'), array("'", '"'), $string); } } ?>