} else { header('HTTP/1.0 501 Not Implemented'); exit; } } else { $serverType = 'soap'; } if ($serverType == 'soap' && (!isset($_SERVER['REQUEST_METHOD']) || $_SERVER['REQUEST_METHOD'] != 'POST')) { if (isset($_GET['wsdl'])) { $params = 'wsdl'; } else { $params = 'disco'; } } /* Load the RPC backend based on $serverType. */ $server =& Horde_RPC::singleton($serverType); /* Let the backend check authentication. By default, we look for HTTP * basic authentication against Horde, but backends can override this * as needed. */ $server->authorize(); /* Get the server's response. We call $server->getInput() to allow * backends to handle input processing differently. */ if ($input === null) { $input = $server->getInput(); } $out = $server->getResponse($input, $params); /* Return the response to the client. */ header('Content-Type: ' . $server->getResponseContentType()); header('Content-length: ' . strlen($out)); header('Accept-Charset: UTF-8'); echo $out;
function announce() { $module = $this->options['module']; if (!isset($this->notes)) { print "NOT announcing release, RELEASE_NOTES missing.\n"; return; } if (!empty($this->options['noannounce'])) { print "NOT announcing release on freshmeat.net\n"; } else { print "Announcing release on freshmeat.net\n"; $fm = Horde_RPC::request('xmlrpc', 'http://freshmeat.net/xmlrpc/', 'login', array('username' => $this->options['fm']['user'], 'password' => $this->options['fm']['password'])); if ($this->_fmVerify($fm)) { $fm = Horde_RPC::request('xmlrpc', 'http://freshmeat.net/xmlrpc/', 'publish_release', array('SID' => $fm['SID'], 'project_name' => $this->notes['fm']['project'], 'branch_name' => $this->notes['fm']['branch'], 'version' => $this->sourceVersionString, 'changes' => $this->notes['fm']['changes'], 'release_focus' => (int) $this->notes['fm']['focus'], 'url_changelog' => $this->oldVersion ? "http://cvs.horde.org/diff.php/{$module}/docs/CHANGES?r1={$this->oldChangelogVersion}&r2={$this->changelogVersion}&ty=h" : '', 'url_tgz' => "ftp://ftp.horde.org/pub/{$module}/{$this->tarballName}")); $this->_fmVerify($fm); } } $ml = $module; if ($ml == 'accounts' || $ml == 'forwards' || $ml == 'passwd' || $ml == 'vacation') { $ml = 'sork'; } $to = "announce@lists.horde.org, {$ml}@lists.horde.org"; if (!$this->latest) { $to .= ', i18n@lists.horde.org'; } if (!empty($this->options['noannounce'])) { print "NOT announcing release on {$to}\n"; return; } print "Announcing release to {$to}\n"; // Building headers $subject = $this->notes['name'] . ' ' . $this->sourceVersionString; if ($this->latest) { $subject .= ' (final)'; } $headers = array('From' => $this->options['ml']['from'], 'To' => $to, 'Subject' => $subject); // Building message text $body = $this->notes['ml']['changes']; if ($this->oldVersion) { $body .= "\n\n" . sprintf('The full list of changes (from version %s) can be viewed here:', $this->oldSourceVersionString) . "\n\n" . sprintf('http://cvs.horde.org/diff.php/%s/docs/CHANGES?r1=%s&r2=%s&ty=h', $module, $this->oldChangelogVersion, $this->changelogVersion); } $body .= "\n\n" . sprintf('The %s %s distribution is available from the following locations:', $this->notes['name'], $this->sourceVersionString) . "\n\n" . sprintf(' ftp://ftp.horde.org/pub/%s/%s', $module, $this->tarballName) . "\n" . sprintf(' http://ftp.horde.org/pub/%s/%s', $module, $this->tarballName); if ($this->makeDiff) { $body .= "\n\n" . sprintf('Patches against version %s are available at:', $this->oldSourceVersionString) . "\n\n" . sprintf(' ftp://ftp.horde.org/pub/%s/patches/%s.gz', $module, $this->patchName) . "\n" . sprintf(' http://ftp.horde.org/pub/%s/patches/%s.gz', $module, $this->patchName); } $body .= "\n\n" . 'Or, for quicker access, download from your nearest mirror:' . "\n\n" . ' http://www.horde.org/mirrors.php' . "\n\n" . 'MD5 sums for the packages are as follows:' . "\n\n" . ' ' . $this->tarballMD5[0] . "\n" . ' ' . $this->patchMD5[0] . "\n\n" . 'Have fun!' . "\n\n" . 'The Horde Team.'; // Building and sending message $message =& new MIME_Message('lists.horde.org'); $part =& new MIME_Part('text/plain', $body, 'iso-8859-1'); $message->addPart($part); $headers = $message->encode($headers, 'iso-8859-1'); $msg = $message->toString(); if (substr($msg, -1) != "\n") { $msg .= "\n"; } require_once 'Mail.php'; $mailer =& Mail::factory($this->options['mailer']['type'], $this->options['mailer']['params']); $result = $mailer->send(MIME::encodeAddress($to), $headers, $msg); if (is_a($result, 'PEAR_Error')) { print $result->getMessage() . "\n"; } }
/** * Get domain records */ function _getRecords($domain) { if (empty($GLOBALS['rpc'])) { $result = $GLOBALS['beatnik_driver']->getRecords($domain); } else { try { $result = Horde_RPC::request('xmlrpc', $GLOBALS['rpc'], 'dns.getRecords', $GLOBALS['http'], array($domain)); } catch (Exception $e) { $GLOBALS['cli']->fatal($e); } } return $result; }