function uc_repeater_import in Ubercart 5
1 string reference to 'uc_repeater_import'
- uc_repeater_menu in uc_repeater/
uc_repeater.module - @file Allows a multisite setup to share changes to the catalog.
File
- uc_repeater/
uc_repeater.module, line 158 - Allows a multisite setup to share changes to the catalog.
Code
function uc_repeater_import($site_hash = null, $xml_hash = null) {
$valid_site = false;
foreach (variable_get('uc_repeater_masters', array()) as $site) {
if (md5($site) == $site_hash) {
$valid_site = true;
}
}
if ($valid_site) {
$xml = file_get_contents('php://input');
}
else {
die("Yeah, that's not a good way to get me to do things.");
}
if (!$xml) {
die('Needs must have POST data. And as a hint, it should be XML.');
}
else {
if (md5($xml) != $xml_hash) {
die("You really don't know how this site works, do you?");
}
}
/* $dom = new DOMDocument();
$dom->loadXML($xml);
if (!$dom->schemaValidate('http://www.ubercart.org/files/store.xsd')) {
die("Did not validate against the schema.<br /><pre>". htmlentities($xml) .'</pre>');
} */
uc_importer_import($xml);
die("Maybe a successful import. :P");
}