* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/../includes/core-minimal.inc.php'; require_once dirname(__FILE__) . '/../includes/webservices.inc.php'; function parse_premium_sign_XML($xml_) { if (!$xml_ || strlen($xml_) == 0) { return false; } $dom = new DomDocument('1.0', 'utf-8'); $buf = @$dom->loadXML($xml_); if (!$buf) { return false; } if (!$dom->hasChildNodes()) { return false; } $node = $dom->getElementsByTagname('message')->item(0); if (is_null($node)) { return false; } return $node->textContent; } if (class_exists("PremiumManager")) { $message = parse_premium_sign_XML(@file_get_contents('php://input')); if (!$message) { Logger::error('main', '(webservices/premium/sign) Server does not send a valid XML (error_code: 1)'); webservices_return_error(1, 'Server does not send a valid XML'); } PremiumManager::sign($message); }
/** * Copyright (C) 2013 Ulteo SAS * http://www.ulteo.com * Author David PHAM-VAN <*****@*****.**> 2013 * * 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; version 2 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/../includes/core.inc.php'; if (class_exists("PremiumManager")) { if (!array_key_exists('message', $_REQUEST)) { Logger::error('main', '(client/sign) - no message given'); echo PremiumManager::return_error(1, 'No message given'); die; } PremiumManager::sign($_REQUEST['message']); } $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0'; header("{$protocol} 501 Not Implemented"); exit(0);