summaryrefslogtreecommitdiffstats
path: root/system/application/controllers
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-12-19 14:21:51 +0100
committerFlorian Pritz <bluewind@xssn.at>2010-12-19 14:21:51 +0100
commitbb64fc9350d9159ea23f415de7964b6a4b2123d4 (patch)
treea89144c943c43c8b9599800d3bc9f4245850b740 /system/application/controllers
parent0d313a32f230071fcb53c84efe0e0e7296bcee46 (diff)
add deleteion support to the webui
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'system/application/controllers')
-rw-r--r--system/application/controllers/file.php32
1 files changed, 28 insertions, 4 deletions
diff --git a/system/application/controllers/file.php b/system/application/controllers/file.php
index 40a5c9016..e42d1d3db 100644
--- a/system/application/controllers/file.php
+++ b/system/application/controllers/file.php
@@ -86,14 +86,38 @@ class File extends Controller {
// Allow users to delete IDs if their password matches the one used when uploading
function delete()
{
+ $data = array();
$id = $this->uri->segment(3);
$password = $this->input->post('password');
- if ($this->file_mod->delete_id($id, $password)) {
- echo $id." deleted\n";
+ $data["title"] = "Delete";
+ $data["id"] = $id;
+ if ($password) {
+ if ($this->file_mod->delete_id($id, $password)) {
+ if ($this->var->cli_client) {
+ echo $id." deleted\n";
+ die();
+ } else {
+ $this->load->view('file/header', $data);
+ $this->load->view('file/deleted', $data);
+ $this->load->view('file/footer', $data);
+ return;
+ }
+ } else {
+ if ($this->var->cli_client) {
+ echo 'Couldn\'t delete '.$id."\n";
+ die();
+ } else {
+ $data["msg"] = "Deletion failed. Is the password correct?";
+ }
+ }
+ }
+ if ($this->var->cli_client) {
+ die();
} else {
- echo 'Couldn\'t delete '.$id."\n";
+ $this->load->view('file/header', $data);
+ $this->load->view('file/delete_form', $data);
+ $this->load->view('file/footer', $data);
}
- die();
}
// Take the content from post instead of a file