From 92ac1086ce5d3de253a7bb8979bdfd108e227755 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 23 Jun 2011 21:24:07 +0200 Subject: delete: return correct error if ID doesn't exist Signed-off-by: Florian Pritz --- application/controllers/file.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'application/controllers') 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); -- cgit v1.2.3-24-g4f1b