[fix] diagnostic:service:ftp

This commit is contained in:
alban 2014-07-04 23:29:10 +02:00
parent fc01077346
commit 4810ee88a4
1 changed files with 12 additions and 22 deletions

View File

@ -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;
}
}