2001-08-09 17:51:38 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare - XML-RPC Test App *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2001-12-18 03:25:55 +01:00
|
|
|
$phpgw_info = array();
|
|
|
|
$GLOBALS['phpgw_info']['flags'] = array(
|
2001-08-09 17:51:38 +02:00
|
|
|
'noheader' => True,
|
|
|
|
'nonavbar' => True,
|
|
|
|
'currentapp' => 'home',
|
|
|
|
'noapi' => True
|
|
|
|
);
|
2001-08-09 17:54:52 +02:00
|
|
|
include('./inc/functions.inc.php');
|
|
|
|
include('./inc/xml_functions.inc.php');
|
2001-08-09 17:51:38 +02:00
|
|
|
|
2002-01-08 15:48:35 +01:00
|
|
|
/* Check header and authentication */
|
2001-12-18 03:20:31 +01:00
|
|
|
if (!$phpgw_setup->auth('Config'))
|
|
|
|
{
|
|
|
|
Header('Location: index.php');
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
// Does not return unless user is authorized
|
|
|
|
|
2001-08-09 17:51:38 +02:00
|
|
|
$tpl_root = $phpgw_setup->setup_tpl_dir('setup');
|
|
|
|
$setup_tpl = CreateObject('phpgwapi.Template',$tpl_root);
|
2001-12-04 14:46:04 +01:00
|
|
|
$setup_tpl->set_file(array(
|
|
|
|
'T_head' => 'head.tpl',
|
|
|
|
'T_footer' => 'footer.tpl'
|
|
|
|
));
|
2001-08-09 17:51:38 +02:00
|
|
|
$setup_tpl->set_block('T_footer','footer','footer');
|
|
|
|
|
2001-12-04 14:46:04 +01:00
|
|
|
$host = 'us3.phpgroupware.org';
|
|
|
|
$path = '/cvsdemo/xmlrpc.php';
|
|
|
|
|
|
|
|
$phpgw_setup->show_header(lang('Application List'),True);
|
|
|
|
|
|
|
|
/* Login as demo */
|
|
|
|
$login = CreateObject(
|
|
|
|
'phpgwapi.xmlrpcmsg',
|
|
|
|
'system.login',
|
|
|
|
array(
|
|
|
|
CreateObject(
|
|
|
|
'phpgwapi.xmlrpcval',
|
|
|
|
array(
|
|
|
|
'domain' => CreateObject('phpgwapi.xmlrpcval','default','string'),
|
|
|
|
'username' => CreateObject('phpgwapi.xmlrpcval','demo','string'),
|
|
|
|
'password' => CreateObject('phpgwapi.xmlrpcval','guest','string')
|
|
|
|
),
|
|
|
|
'struct'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
echo '<pre>' . htmlentities($login->serialize()) . "</pre>\n";
|
|
|
|
|
|
|
|
$c = CreateObject('phpgwapi.xmlrpc_client',$path,$host,80);
|
|
|
|
$c->setDebug(1);
|
|
|
|
$r = $c->send($login);
|
|
|
|
$v = $r->value();
|
|
|
|
$result = xmlrpc_decode($v);
|
|
|
|
|
|
|
|
/* Get applist */
|
|
|
|
$f = CreateObject('phpgwapi.xmlrpcmsg','system.listApps','');
|
|
|
|
echo '<pre>' . htmlentities($f->serialize()) . "</pre>\n";
|
|
|
|
|
|
|
|
$c = CreateObject('phpgwapi.xmlrpc_client',$path,$host,80);
|
2001-08-09 17:51:38 +02:00
|
|
|
$c->setDebug(1);
|
2001-12-04 14:46:04 +01:00
|
|
|
$c->username = $result['sessionid'];
|
|
|
|
$c->password = $result['kp3'];
|
2001-08-09 17:51:38 +02:00
|
|
|
$r = $c->send($f);
|
2001-12-04 14:46:04 +01:00
|
|
|
|
|
|
|
/* Logout */
|
|
|
|
$logout = CreateObject(
|
|
|
|
'phpgwapi.xmlrpcmsg',
|
|
|
|
'system.logout',
|
|
|
|
array(
|
|
|
|
CreateObject(
|
|
|
|
'phpgwapi.xmlrpcval',
|
|
|
|
array(
|
|
|
|
'sessionid' => CreateObject('phpgwapi.xmlrpcval',$result['sessionid'],'string'),
|
|
|
|
'kp3' => CreateObject('phpgwapi.xmlrpcval',$result['kp3'],'string')
|
|
|
|
),
|
|
|
|
'struct'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
echo '<pre>' . htmlentities($logout->serialize()) . "</pre>\n";
|
|
|
|
|
|
|
|
$c = CreateObject('phpgwapi.xmlrpc_client',$path,$host,80);
|
|
|
|
$c->setDebug(1);
|
|
|
|
$r = $c->send($logout);
|
2001-08-09 17:51:38 +02:00
|
|
|
$v = $r->value();
|
|
|
|
|
|
|
|
$phpgw_setup->show_footer();
|
|
|
|
?>
|