Added more detailed messages when site is or fails to register

HFP-489
pull/38/head
thomasmars 2017-03-16 10:01:41 +01:00
parent 93e9d6e0ec
commit 675c87df68
1 changed files with 12 additions and 1 deletions

View File

@ -2463,16 +2463,27 @@ class H5PCore {
// Failed retrieving uuid // Failed retrieving uuid
if (!$registration) { if (!$registration) {
$errorMessage = $this->h5pF->t('Site could not be registered with the hub. Please contact your site administrator.');
return H5PCore::ajaxError( return H5PCore::ajaxError(
t('Site could not be registered with the hub. Please contact your site administrator.'), $errorMessage,
'SITE_REGISTRATION_FAILED' 'SITE_REGISTRATION_FAILED'
); );
$this->h5pF->setErrorMessage($errorMessage);
$this->h5pF->setErrorMessage(
$this->h5pF->t('The H5P Hub has been disabled until this problem can be resolved. You may still upload libraries through the "H5P Libraries" page.')
);
} }
// Successfully retrieved new uuid // Successfully retrieved new uuid
$json = json_decode($registration); $json = json_decode($registration);
$data['uuid'] = $json->uuid; $data['uuid'] = $json->uuid;
$this->h5pF->setOption('site_uuid', $json->uuid); $this->h5pF->setOption('site_uuid', $json->uuid);
$this->h5pF->setInfoMessage(
$this->h5pF->t('Your site was successfully registered with the H5P Hub.')
);
$this->h5pF->setInfoMessage(
$this->h5pF->t('You have been provided a unique key that identifies you with the Hub when receiving new updates. The key is available for viewing in the "H5P Settings" page.')
);
} }
$result = $this->updateContentTypeCache($data); $result = $this->updateContentTypeCache($data);