From 5bfbe04e24449fc808d947244c01f14d6e91e827 Mon Sep 17 00:00:00 2001 From: jerome mouneyrac Date: Mon, 28 Jun 2010 03:48:40 +0000 Subject: [PATCH] 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. --- admin/registration/index.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/admin/registration/index.php b/admin/registration/index.php index 4cb3956387c..ae3d6068741 100644 --- a/admin/registration/index.php +++ b/admin/registration/index.php @@ -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;