summaryrefslogtreecommitdiffstats
path: root/application/controllers/file.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-06-23 21:24:07 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-06-23 21:24:07 +0200
commit92ac1086ce5d3de253a7bb8979bdfd108e227755 (patch)
tree472c38d9c1d171161ae0e834b06a73fc7aa71e93 /application/controllers/file.php
parent19c119d185c679796bd24aa6cee32c6d34272030 (diff)
delete: return correct error if ID doesn't exist
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/file.php')
-rw-r--r--application/controllers/file.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index 12ec9fa66..9458e9f53 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -96,7 +96,9 @@ class File extends CI_Controller {
$password = $this->file_mod->get_password();
$data["title"] = "Delete";
$data["id"] = $id;
- if ($password != "NULL") {
+ if ($id && !$this->file_mod->id_exists($id)) {
+ $data["msg"] = "Unkown ID.";
+ } elseif ($password != "NULL") {
if ($this->file_mod->delete_id($id)) {
$this->load->view($this->var->view_dir.'/header', $data);
$this->load->view($this->var->view_dir.'/deleted', $data);
@@ -109,9 +111,6 @@ class File extends CI_Controller {
if ($this->var->cli_client) {
$data["msg"] = "No password supplied.";
}
- if ($id && !$this->file_mod->id_exists($id)) {
- $data["msg"] = "Unkown ID.";
- }
}
$this->load->view($this->var->view_dir.'/header', $data);
$this->load->view($this->var->view_dir.'/delete_form', $data);