From 4810ee88a47fae82b7f206f04a9c5d88964dcdfb Mon Sep 17 00:00:00 2001 From: alban Date: Fri, 4 Jul 2014 23:29:10 +0200 Subject: [PATCH] [fix] diagnostic:service:ftp --- lib/Alternc/Diagnostic/Service/Ftp.php | 34 +++++++++----------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/lib/Alternc/Diagnostic/Service/Ftp.php b/lib/Alternc/Diagnostic/Service/Ftp.php index 951a1cff..4bcf6f28 100644 --- a/lib/Alternc/Diagnostic/Service/Ftp.php +++ b/lib/Alternc/Diagnostic/Service/Ftp.php @@ -11,8 +11,8 @@ class Alternc_Diagnostic_Service_Ftp public $name = "ftp"; - /** @var m_ftp */ - protected $ftp; +// /** @var m_ftp */ +// protected $ftp; /** @var array */ protected $ftpList; @@ -24,10 +24,6 @@ class Alternc_Diagnostic_Service_Ftp function run(){ -// global $ftp; -// -// $this->ftp = $ftp; - $this->ftpList = $this->get_list(); // Writes the domains list @@ -56,24 +52,18 @@ class Alternc_Diagnostic_Service_Ftp function get_list() { - global $db,$err, $bro; - $err->log("ftp","get_list"); - $r=array(); - $db->query("SELECT id, name, homedir, enabled FROM ftpusers ORDER BY name;"); - if ($db->num_rows()) { - while ($db->next_record()) { - $r[$db->f("name")]=array( - "id"=>$db->f("id"), - "login"=>$db->f("name"), - "enabled"=>$db->f("enabled"), - "dir"=>$db->f("homedir") - ); + $returnArray = array(); + $this->db->query("SELECT id, name, homedir, enabled FROM ftpusers ORDER BY name;"); + if ($this->db->num_rows()) { + while ($this->db->next_record()) { + $returnArray[$this->db->f("name")]=array( + "enabled" => $this->db->f("enabled"), + "dir" => $this->db->f("homedir") + ); } - return $r; - } else { - $err->raise("ftp",_("No FTP account found")); - return array(); } + return $returnArray; + } } \ No newline at end of file