index.php
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Index page for CMIS AtomPub services
*/
include_once('lib/cmis/KTCMISAPPServiceDoc.inc.php');
include_once('lib/cmis/KTCMISAPPFeed.inc.php');
define ('CMIS_BASE_URI', KT_APP_BASE_URI . 'cmis/');
// hack for links not yet working in KT, use Alfresco to move things forward
//define ('CMIS_BASE_URI_ALF', 'http://127.0.0.1:8080/alfresco/service/api/');
//define ('CMIS_BASE_URI', 'http://10.33.4.34:8080/alfresco/service/api/');
// fetch username and password for auth; note that this apparently only works when PHP is run as an apache module
// TODO method to fetch username and password when running PHP as CGI
$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
// NOTE this is just for demonstration purposes and attempting to auth with clients which send the username/password differently
// TODO disable once we have Drupal compatible login working
if (($username == '') && ($password == ''))
{
$username = $password = 'admin';
}
$arg = (isset($query[1]) ? $query[1] : '');
switch($arg)
{
case 'checkedout':
include('services/cmis/checkedout.inc.php');
break;
case 'document':
include('services/cmis/document.inc.php');
break;
case 'folder':
include('services/cmis/folder.inc.php');
break;
case 'type':
case 'types':
include('services/cmis/types.inc.php');
break;
case 'repository':
default:
include('services/cmis/servicedocument.inc.php');
break;
}
?>