From: Jan Schneider Date: Wed, 8 Dec 2010 18:24:33 +0000 (+0100) Subject: Update API. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b211f02f7d24a2183c2c7b25495421a10858c27d;p=horde.git Update API. --- diff --git a/vilma/lib/Api.php b/vilma/lib/Api.php new file mode 100644 index 000000000..d6907c17d --- /dev/null +++ b/vilma/lib/Api.php @@ -0,0 +1,29 @@ + + * + * See the enclosed file LICENSE for license information (BSD). If you did not + * did not receive this file, see http://cvs.horde.org/co.php/vilma/LICENSE. + * + * See the enclosed file COPYING for license information (GPL). If you + * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. + * + * @author Ben Klang + * @package Vilma + */ +class Vilma_Api extends Horde_Registry_Api +{ + public function listDomains() + { + $domains = array(); + foreach ($GLOBALS['vilma']->driver->getDomains() as $domain) { + $domains[] = $domain['domain_name']; + } + return $domains; + } +} diff --git a/vilma/lib/api.php b/vilma/lib/api.php deleted file mode 100644 index d3cc2219b..000000000 --- a/vilma/lib/api.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * See the enclosed file LICENSE for license information (BSD). If you did not - * did not receive this file, see http://cvs.horde.org/co.php/vilma/LICENSE. - * - * See the enclosed file COPYING for license information (GPL). If you - * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. - * - * @author Ben Klang - * @package Vilma - */ -@define('VILMA_BASE', dirname(__FILE__) . '/..'); - -$_services['perms'] = array( - 'args' => array(), - 'type' => '{urn:horde}stringArray'); - - -$_services['listDomains'] = array( - 'args' => array(), - 'type' => '{urn:horde}stringArray'); - -function _vilma_listDomains() -{ - require_once VILMA_BASE . '/lib/base.php'; - global $vilma_driver; - - return $vilma_driver->getDomains(); - $domains = array(); - foreach ($vilma_driver->getDomains() as $domain) { - $domains[] = $domain['domain_name']; - } - return $domains; -}