[fix] diagnostic:service:ftp
This commit is contained in:
parent
fc01077346
commit
4810ee88a4
|
@ -11,8 +11,8 @@ class Alternc_Diagnostic_Service_Ftp
|
||||||
|
|
||||||
public $name = "ftp";
|
public $name = "ftp";
|
||||||
|
|
||||||
/** @var m_ftp */
|
// /** @var m_ftp */
|
||||||
protected $ftp;
|
// protected $ftp;
|
||||||
|
|
||||||
/** @var array */
|
/** @var array */
|
||||||
protected $ftpList;
|
protected $ftpList;
|
||||||
|
@ -24,10 +24,6 @@ class Alternc_Diagnostic_Service_Ftp
|
||||||
function run(){
|
function run(){
|
||||||
|
|
||||||
|
|
||||||
// global $ftp;
|
|
||||||
//
|
|
||||||
// $this->ftp = $ftp;
|
|
||||||
|
|
||||||
$this->ftpList = $this->get_list();
|
$this->ftpList = $this->get_list();
|
||||||
|
|
||||||
// Writes the domains list
|
// Writes the domains list
|
||||||
|
@ -56,24 +52,18 @@ class Alternc_Diagnostic_Service_Ftp
|
||||||
|
|
||||||
|
|
||||||
function get_list() {
|
function get_list() {
|
||||||
global $db,$err, $bro;
|
$returnArray = array();
|
||||||
$err->log("ftp","get_list");
|
$this->db->query("SELECT id, name, homedir, enabled FROM ftpusers ORDER BY name;");
|
||||||
$r=array();
|
if ($this->db->num_rows()) {
|
||||||
$db->query("SELECT id, name, homedir, enabled FROM ftpusers ORDER BY name;");
|
while ($this->db->next_record()) {
|
||||||
if ($db->num_rows()) {
|
$returnArray[$this->db->f("name")]=array(
|
||||||
while ($db->next_record()) {
|
"enabled" => $this->db->f("enabled"),
|
||||||
$r[$db->f("name")]=array(
|
"dir" => $this->db->f("homedir")
|
||||||
"id"=>$db->f("id"),
|
);
|
||||||
"login"=>$db->f("name"),
|
|
||||||
"enabled"=>$db->f("enabled"),
|
|
||||||
"dir"=>$db->f("homedir")
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return $r;
|
|
||||||
} else {
|
|
||||||
$err->raise("ftp",_("No FTP account found"));
|
|
||||||
return array();
|
|
||||||
}
|
}
|
||||||
|
return $returnArray;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue