[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/setup/ -> applist.php (source)

   1  <?php
   2  /**************************************************************************\
   3  * eGroupWare - XML-RPC Test App                                            *
   4  * http://www.egroupware.org                                                *
   5  * --------------------------------------------                             *
   6  *  This program is free software; you can redistribute it and/or modify it *
   7  *  under the terms of the GNU General Public License as published by the   *
   8  *  Free Software Foundation; either version 2 of the License, or (at your  *
   9  *  option) any later version.                                              *
  10  \**************************************************************************/
  11  
  12  /* $Id: applist.php 13538 2004-01-27 20:49:25Z reinerj $ */
  13  
  14      $phpgw_info = array();
  15      $GLOBALS['phpgw_info']['flags'] = array(
  16          'noheader' => True,
  17          'nonavbar' => True,
  18          'currentapp' => 'home',
  19          'noapi' => True
  20      );
  21      include ('./inc/functions.inc.php');
  22      include (PHPGW_SERVER_ROOT . 'phpgwapi/inc/xml_functions.inc.php');
  23  
  24      /* Check header and authentication */
  25      if (!$GLOBALS['phpgw_setup']->auth('Config'))
  26      {
  27          Header('Location: index.php');
  28          exit;
  29      }
  30      // Does not return unless user is authorized
  31  
  32      $tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
  33      $setup_tpl = CreateObject('setup.Template',$tpl_root);
  34      $setup_tpl->set_file(array(
  35          'T_head'   => 'head.tpl',
  36          'T_footer' => 'footer.tpl'
  37      ));
  38      $setup_tpl->set_block('T_footer','footer','footer');
  39  
  40      $host = 'us.egroupware.org';
  41      $path = '/cvsdemo/xmlrpc.php';
  42  
  43      $GLOBALS['phpgw_setup']->html->show_header(lang('Application List'),True);
  44  
  45      /* Login as demo */
  46      $login = CreateObject(
  47          'phpgwapi.xmlrpcmsg',
  48          'system.login',
  49          array(
  50              CreateObject(
  51                  'phpgwapi.xmlrpcval',
  52                  array(
  53                      'domain'   => CreateObject('phpgwapi.xmlrpcval','default','string'),
  54                      'username' => CreateObject('phpgwapi.xmlrpcval','demo','string'),
  55                      'password' => CreateObject('phpgwapi.xmlrpcval','guest','string')
  56                  ),
  57                  'struct'
  58              )
  59          )
  60      );
  61      echo '<pre>' . htmlentities($login->serialize()) . "</pre>\n";
  62  
  63      $c = CreateObject('phpgwapi.xmlrpc_client',$path,$host,80);
  64      $c->setDebug(1);
  65      $r = $c->send($login);
  66      $v = $r->value();
  67      $result = xmlrpc_decode($v);
  68  
  69      /* Get applist */
  70      $f = CreateObject('phpgwapi.xmlrpcmsg','system.listApps','');
  71      echo '<pre>' . htmlentities($f->serialize()) . "</pre>\n";
  72  
  73      $c = CreateObject('phpgwapi.xmlrpc_client',$path,$host,80);
  74      $c->setDebug(1);
  75      $c->username = $result['sessionid'];
  76      $c->password = $result['kp3'];
  77      $r = $c->send($f);
  78  
  79      /* Logout */
  80      $logout = CreateObject(
  81          'phpgwapi.xmlrpcmsg',
  82          'system.logout',
  83          array(
  84              CreateObject(
  85                  'phpgwapi.xmlrpcval',
  86                  array(
  87                      'sessionid' => CreateObject('phpgwapi.xmlrpcval',$result['sessionid'],'string'),
  88                      'kp3'       => CreateObject('phpgwapi.xmlrpcval',$result['kp3'],'string')
  89                  ),
  90                  'struct'
  91              )
  92          )
  93      );
  94      echo '<pre>' . htmlentities($logout->serialize()) . "</pre>\n";
  95  
  96      $c = CreateObject('phpgwapi.xmlrpc_client',$path,$host,80);
  97      $c->setDebug(1);
  98      $r = $c->send($logout);
  99      $v = $r->value();
 100  
 101      $GLOBALS['phpgw_setup']->html->show_footer();
 102  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7