[fix] diagnostic:mysql
This commit is contained in:
parent
dedbc14b73
commit
442f8c79f5
|
@ -43,12 +43,12 @@ class Alternc_Diagnostic_Service_Mysql
|
||||||
$this->db->query("SELECT login,pass,db, bck_mode, bck_dir FROM db ORDER BY db;");
|
$this->db->query("SELECT login,pass,db, bck_mode, bck_dir FROM db ORDER BY db;");
|
||||||
if ($this->db->num_rows()) {
|
if ($this->db->num_rows()) {
|
||||||
while ($this->db->next_record()) {
|
while ($this->db->next_record()) {
|
||||||
list($dbu,$dbn) = split_mysql_database_name($this->db->f("db"));
|
$db = $this->db->f("db");
|
||||||
$returnArray[] = array(
|
list($dbu,$dbn) = split_mysql_database_name($db);
|
||||||
"db" => $this->db->f("db"),
|
$returnArray[$db] = array(
|
||||||
"name" => $this->db->f('db'),
|
"user" => $dbu,
|
||||||
"bck" => $this->db->f("bck_mode"),
|
"bck_mode" => $this->db->f("bck_mode"),
|
||||||
"dir" => $this->db->f("bck_dir"),
|
"bck_dir" => $this->db->f("bck_dir"),
|
||||||
"login" => $this->db->f("login"),
|
"login" => $this->db->f("login"),
|
||||||
"pass" => $this->db->f("pass")
|
"pass" => $this->db->f("pass")
|
||||||
);
|
);
|
||||||
|
@ -59,29 +59,30 @@ class Alternc_Diagnostic_Service_Mysql
|
||||||
|
|
||||||
function getUsersList() {
|
function getUsersList() {
|
||||||
$returnArray = array();
|
$returnArray = array();
|
||||||
// $this->db->query("SELECT id, name, homedir, enabled FROM ftpusers ORDER BY name;");
|
$this->db->query("SELECT name, password, enable FROM dbusers ORDER BY name;");
|
||||||
// if ($this->db->num_rows()) {
|
if ($this->db->num_rows()) {
|
||||||
// while ($this->db->next_record()) {
|
while ($this->db->next_record()) {
|
||||||
// $returnArray[$this->db->f("name")] = array(
|
$returnArray[$this->db->f("name")] = array(
|
||||||
// "enabled" => $this->db->f("enabled"),
|
"enable" => $this->db->f("enable"),
|
||||||
// "dir" => $this->db->f("homedir")
|
"password" => $this->db->f("password")
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
return $returnArray;
|
return $returnArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getServersList() {
|
function getServersList() {
|
||||||
$returnArray = array();
|
$returnArray = array();
|
||||||
// $this->db->query("SELECT id, name, homedir, enabled FROM ftpusers ORDER BY name;");
|
$this->db->query("SELECT name, host, login, password FROM db_servers ORDER BY host;");
|
||||||
// if ($this->db->num_rows()) {
|
if ($this->db->num_rows()) {
|
||||||
// while ($this->db->next_record()) {
|
while ($this->db->next_record()) {
|
||||||
// $returnArray[$this->db->f("name")] = array(
|
$returnArray[$this->db->f("name")] = array(
|
||||||
// "enabled" => $this->db->f("enabled"),
|
"host" => $this->db->f("host"),
|
||||||
// "dir" => $this->db->f("homedir")
|
"login" => $this->db->f("login"),
|
||||||
// );
|
"password" => $this->db->f("password")
|
||||||
// }
|
);
|
||||||
// }
|
}
|
||||||
|
}
|
||||||
return $returnArray;
|
return $returnArray;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue