source: companies/serpro/admin/inc/class.boconfig.inc.php @ 903

Revision 903, 2.5 KB checked in by niltonneto, 15 years ago (diff)

Importacao inicial do Expresso do Serpro

Line 
1<?php
2        /**************************************************************************\
3        * eGroupWare - configuration administration                                *
4        * http://www.egroupware.org                                                *
5        * Copyright (C) 2001 Loic Dachary                                          *
6        * --------------------------------------------                             *
7        *  This program is free software; you can redistribute it and/or modify it *
8        *  under the terms of the GNU General Public License as published by the   *
9        *  Free Software Foundation; either version 2 of the License, or (at your  *
10        *  option) any later version.                                              *
11        \**************************************************************************/
12
13
14        class boconfig
15        {
16                var $public_functions = array();
17
18                var $xml_functions = array();
19
20                var $soap_functions = array(
21                        'rpc_values' => array(
22                                'in'  => array('struct', 'struct'),
23                                'out' => array()
24                        )
25                );
26
27                function list_methods($_type='xmlrpc')
28                {
29                        /*
30                          This handles introspection or discovery by the logged in client,
31                          in which case the input might be an array.  The server always calls
32                          this function to fill the server dispatch map using a string.
33                        */
34                        if (is_array($_type))
35                        {
36                                $_type = $_type['type'] ? $_type['type'] : $_type[0];
37                        }
38                        switch($_type)
39                        {
40                                case 'xmlrpc':
41                                        $xml_functions = array(
42                                                'rpc_values' => array(
43                                                        'function'  => 'rpc_values',
44                                                        'signature' => array(array(xmlrpcStruct,xmlrpcStruct)),
45                                                        'docstring' => lang('Set preference values.')
46                                                ),
47                                                'list_methods' => array(
48                                                        'function'  => 'list_methods',
49                                                        'signature' => array(array(xmlrpcStruct,xmlrpcString)),
50                                                        'docstring' => lang('Read this list of methods.')
51                                                )
52                                        );
53                                        return $xml_functions;
54                                        break;
55                                case 'soap':
56                                        return $this->soap_functions;
57                                        break;
58                                default:
59                                        return array();
60                                        break;
61                        }
62                }
63
64                // xmlrpc functions
65
66                function rpc_values($data)
67                {
68                        exit;
69
70                        $newsettings = $data['newsettings'];
71                        if (!$data['appname'])
72                        {
73                                $errors[] = "Missing appname";
74                        }
75                        if (!is_array($newsettings))
76                        {
77                                $errors[] = "Missing newsettings or not an array";
78                        }
79
80                        if (is_array($errors))
81                        {
82                                return $errors;
83                        }
84
85                        $conf = CreateObject('phpgwapi.config', $data['appname']);
86
87                        $conf->read_repository();
88                        reset($newsettings);
89                        while(list($key,$val) = each($newsettings))
90                        {
91                                $conf->value($key, $val);
92                        }
93                        $conf->save_repository();
94                        return True;
95                }
96        }
97?>
Note: See TracBrowser for help on using the repository browser.