Add admin backend to edit Service/Sites

This commit is contained in:
2011-12-21 01:11:56 +00:00
parent 7e029c3ad5
commit 59dd99cca2
5 changed files with 85 additions and 4 deletions

View File

@@ -21,10 +21,45 @@ try {
throw new StatusBoard_Exception_FileNotFound();
}
if ($request->exists('do')) {
$activity = $request->get('do');
switch ($activity) {
case 'edit': {
$name = StatusBoard_Main::issetelse($_POST['name'], 'Sihnon_Exception_InvalidParameters');
$description = StatusBoard_Main::issetelse($_POST['description'], 'Sihnon_Exception_InvalidParameters');
if ($name) {
$site->name = $name;
}
if ($description) {
$site->description = $description;
}
if ($name || $description) {
$site->save();
$messages[] = array(
'severity' => 'success',
'content' => 'The site was updated succesfully.',
);
} else {
$messages[] = 'No changes were necessary.';
}
} break;
default: {
}
}
}
$open_incidents = $site->openIncidents();
$this->smarty->assign('service', $service);
$this->smarty->assign('site', $site);
$this->smarty->assign('open_incidents', $open_incidents);
$this->smarty->assign('messages', $messages);
?>