From ea7467a584ad344e13f0cc595f58a1bb22e1649c Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 14 Feb 2013 15:34:51 +0100 Subject: Move cli client login code to muser constructor Signed-off-by: Florian Pritz --- application/controllers/file.php | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'application/controllers') diff --git a/application/controllers/file.php b/application/controllers/file.php index e9637663b..429efbe6e 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -43,27 +43,6 @@ class File extends CI_Controller { $this->var->view_dir = "file"; } - if (is_cli_client()) { - $username = $this->input->post("username"); - $password = $this->input->post("password"); - - // prefer post parameters if either (username or password) is set - if ($username === false && $password === false) { - if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { - $username = $_SERVER['PHP_AUTH_USER']; - $password = $_SERVER['PHP_AUTH_PW']; - } - } - - if ($username !== false && $password !== false) { - if (!$this->muser->login($username, $password)) { - // TODO: better message - echo "login failed.\n"; - exit; - } - } - } - $this->data['username'] = $this->muser->get_username(); $this->data['title'] = "FileBin"; } -- cgit v1.2.3-24-g4f1b