include_once CMIS_ATOM_LIB_FOLDER . 'KT_cmis_atom_server.inc.php'; include_once CMIS_ATOM_LIB_FOLDER . 'KT_cmis_atom_response.inc.php'; //Containing the response feed class allowing easy atom feed generation include_once CMIS_ATOM_LIB_FOLDER . 'KT_cmis_atom_responseFeed.inc.php'; //Containing the response feed class allowing easy atom feed generation include_once CMIS_ATOM_LIB_FOLDER . 'KT_cmis_atom_serviceDoc.inc.php'; //Containing the servicedoc class allowing easy ServiceDocument generation include_once CMIS_ATOM_LIB_FOLDER . 'KT_cmis_atom_service.inc.php'; //Containing the servicedoc class allowing easy ServiceDocument generation include_once 'KT_cmis_atom_server.services.inc.php'; /** * Check Realm Authentication */ require_once KT_ATOM_LIB_FOLDER . 'KT_atom_HTTPauth.inc.php'; if (!KT_atom_HTTPauth::isLoggedIn()) { KT_atom_HTTPauth::login('KnowledgeTree DMS', 'You must authenticate to enter this realm'); } //Start the AtomPubProtocol Routing Engine $APP = new KT_cmis_atom_server(); $queryArray = split('/', trim($_SERVER['QUERY_STRING'], '/')); $workspace = strtolower(trim($queryArray[0])); if ($workspace == 'servicedocument') { // CMIS service document setup $APP->initServiceDocument(); // User defined title tag $APP->addWorkspaceTag('dms', 'atom:title', $APP->repositoryInfo['repositoryName']); } /** * Register Services * * Registered services are classes extended from KT_atom_service
include_once KT_ATOM_LIB_FOLDER . 'KT_atom_baseDoc.inc.php'; //Containing the parent class allowing easy XML manipulation include_once KT_ATOM_LIB_FOLDER . 'KT_atom_serviceDoc.inc.php'; //Containing the servicedoc class allowing easy ServiceDocument generation include_once KT_ATOM_LIB_FOLDER . 'KT_atom_response.inc.php'; //Containing the response feed class allowing easy atom feed generation include_once KT_ATOM_LIB_FOLDER . 'KT_atom_responseFeed.inc.php'; //Containing the response feed class allowing easy atom feed generation include_once KT_ATOM_LIB_FOLDER . 'KT_atom_service.inc.php'; include_once 'demodms/KT_atom_server.default_dms_services.inc.php'; /** * Check Realm Authentication */ require_once KT_ATOM_LIB_FOLDER . 'KT_atom_HTTPauth.inc.php'; if (!KT_atom_HTTPauth::isLoggedIn()) { KT_atom_HTTPauth::login('KnowledgeTree AtomPub', 'You are not authorized to enter this realm'); } //Start the AtomPubProtocol Routing Engine $APP = new KT_atom_server(); /** * Register Services * * Registered services are classes extended from KT_atom_service * The registration process takes the following parameters * Workspace :The workspace within which the service collection will be grouped * ServiceName :This is the name by which the service/collection is exposed * ServiceClass :This is the class name of the class to be instantiated when this service is accessed * Title :This is the title given to the service/collection in the servicedocument */ $APP->addWorkspaceTag('dms', 'atom:title', 'Standard DMS'); $APP->registerService('DMS', 'fulltree', 'KT_atom_service_fulltree', 'Full Document Tree');
/** * Get the KT singleton instance * * @return object */ public static function getKt() { if (!isset(self::$ktapi)) { self::$ktapi = new KTAPI(); $active = self::$ktapi->get_active_session(session_id()); if (PEAR::isError($active)) { // invoke auth code, session must be restarted if (!KT_atom_HTTPauth::isLoggedIn()) { KT_atom_HTTPauth::login('KnowledgeTree DMS', 'You must authenticate to enter this realm'); } } } return self::$ktapi; }
public function GET_action() { //$this->setStatus(self::STATUS_OK); KT_atom_HTTPauth::logout(); ob_end_clean(); KT_atom_HTTPauth::login('KnowledgeTree AtomPub', 'You are not allowed on this realm'); exit; }