- update self diagnostic
This commit is contained in:
parent
a47ca25f28
commit
535d03e7fc
|
@ -210,8 +210,9 @@ class dbinterface {
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Replace by SccpTables !!!!
|
* My be Replace by SccpTables ??!
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function dump_sccp_tables($data_path, $database, $user, $pass ) {
|
public function dump_sccp_tables($data_path, $database, $user, $pass ) {
|
||||||
|
@ -220,4 +221,43 @@ class dbinterface {
|
||||||
return $filename;
|
return $filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check Table structure
|
||||||
|
*/
|
||||||
|
public function validate() {
|
||||||
|
global $db;
|
||||||
|
$check_fields = array('430' => array('_hwlang' => "varchar(12)"), '431' => array('private'=> "enum('on','off')"), '433' => array('directed_pickup'=>'') );
|
||||||
|
$sql = "DESCRIBE `sccpdevice`;";
|
||||||
|
$raw_result = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
|
||||||
|
$result = 0;
|
||||||
|
foreach ($raw_result as $value) {
|
||||||
|
$id_result[$value['Field']] = $value['Type'];
|
||||||
|
}
|
||||||
|
foreach ($check_fields as $key => $value) {
|
||||||
|
$sub_result = true;
|
||||||
|
foreach($value as $skey => $svalue) {
|
||||||
|
if (!empty($svalue) ) {
|
||||||
|
if (empty($id_result[$skey])) {
|
||||||
|
$sub_result = false;
|
||||||
|
} else {
|
||||||
|
if (strtolower($id_result[$skey]) != strtolower($svalue)) {
|
||||||
|
$sub_result = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!empty($id_result[$skey])) {
|
||||||
|
$sub_result = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($sub_result) {
|
||||||
|
$result = $key;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,8 @@ $info = array();
|
||||||
$info['srvinterface'] = $this->srvinterface->info();
|
$info['srvinterface'] = $this->srvinterface->info();
|
||||||
$info['extconfigs'] = $this->extconfigs->info();
|
$info['extconfigs'] = $this->extconfigs->info();
|
||||||
$info['dbinterface'] = $this->dbinterface->info();
|
$info['dbinterface'] = $this->dbinterface->info();
|
||||||
|
$db_Schema = $this->dbinterface->validate();
|
||||||
|
|
||||||
$info['XML'] = $this->xmlinterface->info();
|
$info['XML'] = $this->xmlinterface->info();
|
||||||
$info['sccp_class'] = $driver['sccp'];
|
$info['sccp_class'] = $driver['sccp'];
|
||||||
$info['Core_sccp'] = array('Version' => $core['Version'], 'about'=> 'Sccp ver.'. $core['Version'].' r'.$core['vCode']. ' Revision :'. $core['RevisionNum']. ' Hash :'. $core['RevisionHash']);
|
$info['Core_sccp'] = array('Version' => $core['Version'], 'about'=> 'Sccp ver.'. $core['Version'].' r'.$core['vCode']. ' Revision :'. $core['RevisionNum']. ' Hash :'. $core['RevisionHash']);
|
||||||
|
@ -47,6 +49,12 @@ if (!empty($this->sccpvalues['SccpDBmodel'])) {
|
||||||
$info['Сompatible']['about'] = '<div class="alert signature alert-danger"> Reinstall SCCP manager required</div>';
|
$info['Сompatible']['about'] = '<div class="alert signature alert-danger"> Reinstall SCCP manager required</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($db_Schema == 0) {
|
||||||
|
$info['DB_Schema'] = array('Version' => 'Error', 'about'=> '<div class="alert signature alert-danger"> ERROR DB Version </div>');
|
||||||
|
} else {
|
||||||
|
$info['DB_Schema'] = array('Version' => $db_Schema, 'about'=> (($this->srvinterface->get_compatible_sccp() == $db_Schema ) ? 'Ok' : 'Incompatable Version'));
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($ast_realtime)) {
|
if (empty($ast_realtime)) {
|
||||||
$info['RealTime'] = array('Version' => 'Error', 'about'=> '<div class="alert signature alert-danger"> No found Real Time connections</div>');
|
$info['RealTime'] = array('Version' => 'Error', 'about'=> '<div class="alert signature alert-danger"> No found Real Time connections</div>');
|
||||||
} else {
|
} else {
|
||||||
|
@ -86,25 +94,25 @@ if (empty($conf_realtime)) {
|
||||||
print_r("<br> Request:<br><pre>");
|
print_r("<br> Request:<br><pre>");
|
||||||
$json = '';
|
$json = '';
|
||||||
print_r("<br>");
|
print_r("<br>");
|
||||||
print_r($conf_realtime);
|
// print_r($conf_realtime);
|
||||||
print_r("<br>");
|
print_r("<br>");
|
||||||
print_r("<br>");
|
print_r("<br>");
|
||||||
print_r($ast_realtime);
|
print_r($this->dbinterface->validate());
|
||||||
// print_r("DIRECT START");
|
// print_r("DIRECT START");
|
||||||
print_r($this->sccpvalues['ccm_address']);
|
// print_r($this->sccpvalues['ccm_address']);
|
||||||
print_r("<br>");
|
print_r("<br>");
|
||||||
// print_r($this->getIP_information2());
|
// print_r($this->getIP_information2());
|
||||||
// print_r($this->srvinterface->getеtestChanSCCP_GlablsInfo());
|
// print_r($this->srvinterface->getеtestChanSCCP_GlablsInfo());
|
||||||
// print_r($this->sccp_metainfo);
|
// print_r($this->sccp_metainfo);
|
||||||
print("</pre>");
|
print("</pre>");
|
||||||
*/
|
|
||||||
// $lang_arr = $this->extconfigs->getextConfig('sccp_lang','sk_SK');
|
// $lang_arr = $this->extconfigs->getextConfig('sccp_lang','sk_SK');
|
||||||
// print_r('<br>');
|
// print_r('<br>');
|
||||||
// print_r(timezone_identifiers_list());
|
// print_r(timezone_identifiers_list());
|
||||||
// print_r('<br>');
|
// print_r('<br>');
|
||||||
|
|
||||||
//print_r($this->dbinterface->info());
|
//print_r($this->dbinterface->info());
|
||||||
|
*/
|
||||||
if (!empty($this->class_error)) {
|
if (!empty($this->class_error)) {
|
||||||
?>
|
?>
|
||||||
<div class="fpbx-container container-fluid">
|
<div class="fpbx-container container-fluid">
|
||||||
|
|
Loading…
Reference in a new issue