unregistration MDL-22956 force unregistration/clean data try a last chance ws call (even though it should also fail) to unregister from the hub. This is implemented in case a site admin recieved a spam email and did "naively" the unregistration.

This commit is contained in:
jerome mouneyrac 2010-06-28 03:48:40 +00:00
parent bd40069f4d
commit 5bfbe04e24

View file

@ -100,16 +100,18 @@ if (empty($cancel) and $unregistration and $confirm and confirm_sesskey()) {
$cleanregdata = 1;
}
}
}
//course unpublish went ok, unregister the site now
if ($confirm) {
$function = 'hub_unregister_site';
$params = array();
$serverurl = $huburl . "/local/hub/webservice/webservices.php";
$xmlrpcclient = new webservice_xmlrpc_client();
try {
$result = $xmlrpcclient->call($serverurl, $hub->token, $function, $params);
} catch (Exception $e) {
//course unpublish went ok, unregister the site now
if ($confirm) {
$function = 'hub_unregister_site';
$params = array();
$serverurl = $huburl . "/local/hub/webservice/webservices.php";
$xmlrpcclient = new webservice_xmlrpc_client();
try {
$result = $xmlrpcclient->call($serverurl, $hub->token, $function, $params);
} catch (Exception $e) {
if (!$cleanregdata) {
$errormessage = $e->getMessage();
$confirm = false;
$cleanregdata = 1;