Add admin backend for deleting sites

This commit is contained in:
2011-12-21 19:29:56 +00:00
parent ca1fc52be2
commit a041081f3b
2 changed files with 138 additions and 102 deletions

View File

@@ -58,6 +58,26 @@ if ($request->exists('do')) {
} break;
case 'delete-site': {
$site_id = $request->get('site', 'Sihnon_Exception_InvalidParameters');
try {
$site = StatusBoard_Site::fromId($site_id);
$site->delete();
$messages[] = array(
'severity' => 'success',
'content' => 'The Site was deleted successfully.',
);
} catch (Sihnon_Exception_ResultCountMismatch $e) {
$messages[] = array(
'severity' => 'error',
'content' => 'The Site was not deleted as the object requested could not be found.',
);
}
} break;
default: {
$messages[] = array(
'severity' => 'warning',