#11547 Show a different 'about' depending on whether the user is admin

This commit is contained in:
miguel angel rasteu 2023-07-19 12:50:39 +02:00
parent e645f65e8e
commit 04a45e84a8

View File

@ -950,11 +950,14 @@ if (is_ajax()) {
$dialog = ' $dialog = '
<div id="about-tabs" class="invisible overflow-hidden"> <div id="about-tabs" class="invisible overflow-hidden">
<ul> <ul>
<li><a href="#tab-general-view">'.__('Information').'</a></li> <li><a href="#tab-general-view">'.__('Information').'</a></li>';
<li><a href="#tab-database">'.__('Database').'</a></li> if ($config['is_admin']['admin'] === true) {
<li><a href="#tab-system-info">'.__('System Info').'</a></li> $dialog .= '<li><a href="#tab-database">'.__('Database').'</a></li>
<li><a href="#tab-php-system">'.__('PHP System').'</a></li> <li><a href="#tab-system-info">'.__('System Info').'</a></li>
<li class="ui-tabs-close-button" style="float:right!important;"> <li><a href="#tab-php-system">'.__('PHP System').'</a></li>';
}
$dialog .= '<li class="ui-tabs-close-button" style="float:right!important;">
<img id="about-close" style="cursor: pointer;" src="'.ui_get_full_url('/include/styles/images/dialog-titlebar-close.png', false, false, false).'" alt="'.__('Close').'" title="'.__('Close').'" width="25px"> <img id="about-close" style="cursor: pointer;" src="'.ui_get_full_url('/include/styles/images/dialog-titlebar-close.png', false, false, false).'" alt="'.__('Close').'" title="'.__('Close').'" width="25px">
</li> </li>
</ul> </ul>
@ -1028,222 +1031,224 @@ if (is_ajax()) {
</tbody> </tbody>
</table> </table>
<p class="trademark-copyright">Trademark and copyright 2004 - '.date('Y').' <a href="https://pandorafms.com/" target="_blank">Pandora FMS</a>. All rights reserved</p> <p class="trademark-copyright">Trademark and copyright 2004 - '.date('Y').' <a href="https://pandorafms.com/" target="_blank">Pandora FMS</a>. All rights reserved</p>
</div> </div>';
<div id="tab-database" class="div-scroll"> if ($config['is_admin']['admin'] === true) {
<table class="table-about"> $dialog .= '<div id="tab-database" class="div-scroll">
<tbody style="text-align: left;"> <table class="table-about">
<tr> <tbody style="text-align: left;">
<th colspan="2"> <tr>
<h2><span> - </span>'.__('Database health status').'</h2> <th colspan="2">
</th> <h2><span> - </span>'.__('Database health status').'</h2>
</tr> </th>
<tr> </tr>
<th style="width: 50%;"> <tr>
<p><span>'.$db_health->data->unknownAgents->name.'</span></p> <th style="width: 50%;">
</th> <p><span>'.$db_health->data->unknownAgents->name.'</span></p>
<th style="width: 50%;"> </th>
<p style="font-size: 10pt;">'.$db_health->data->unknownAgents->value.'</p> <th style="width: 50%;">
</th> <p style="font-size: 10pt;">'.$db_health->data->unknownAgents->value.'</p>
</tr> </th>
<tr> </tr>
<th style="width: 50%;"> <tr>
<p><span>'.$db_health->data->notInitAgents->name.'</span></p> <th style="width: 50%;">
</th> <p><span>'.$db_health->data->notInitAgents->name.'</span></p>
<th style="width: 50%;"> </th>
<p style="font-size: 10pt;">'.$db_health->data->notInitAgents->value.'</p> <th style="width: 50%;">
</th> <p style="font-size: 10pt;">'.$db_health->data->notInitAgents->value.'</p>
</tr> </th>
<tr class="about-last-tr"> </tr>
<th style="width: 50%;"> <tr class="about-last-tr">
<p class="about-last-p"><span>'.$db_health->data->pandoraDbLastRun->name.'</span></p> <th style="width: 50%;">
</th> <p class="about-last-p"><span>'.$db_health->data->pandoraDbLastRun->name.'</span></p>
<th style="width: 50%;"> </th>
<p class="about-last-p" style="font-size: 10pt;">'.$db_health->data->pandoraDbLastRun->value.'</p> <th style="width: 50%;">
</th> <p class="about-last-p" style="font-size: 10pt;">'.$db_health->data->pandoraDbLastRun->value.'</p>
</tr> </th>
</tr>
<tr> <tr>
<th colspan="2"> <th colspan="2">
<h2><span> - </span>'.__('Database status info').'</h2> <h2><span> - </span>'.__('Database status info').'</h2>
</th> </th>
</tr> </tr>
<tr> <tr>
<th style="width: 50%;"> <th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeFirstVersion->name.'</span></p> <p><span>'.$db_info->data->dbSchemeFirstVersion->name.'</span></p>
</th> </th>
<th style="width: 50%;"> <th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeFirstVersion->value.'</p> <p style="font-size: 10pt;">'.$db_info->data->dbSchemeFirstVersion->value.'</p>
</th> </th>
</tr> </tr>
<tr> <tr>
<th style="width: 50%;"> <th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeVersion->name.'</span></p> <p><span>'.$db_info->data->dbSchemeVersion->name.'</span></p>
</th> </th>
<th style="width: 50%;"> <th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeVersion->value.'</p> <p style="font-size: 10pt;">'.$db_info->data->dbSchemeVersion->value.'</p>
</th> </th>
</tr> </tr>
<tr> <tr>
<th style="width: 50%;"> <th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeBuild->name.'</span></p> <p><span>'.$db_info->data->dbSchemeBuild->name.'</span></p>
</th> </th>
<th style="width: 50%;"> <th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeBuild->value.'</p> <p style="font-size: 10pt;">'.$db_info->data->dbSchemeBuild->value.'</p>
</th> </th>
</tr> </tr>
<tr class="about-last-tr"> <tr class="about-last-tr">
<th style="width: 50%;"> <th style="width: 50%;">
<p class="about-last-p"><span>'.$db_info->data->dbSize->name.'</span></p> <p class="about-last-p"><span>'.$db_info->data->dbSize->name.'</span></p>
</th> </th>
<th style="width: 50%;"> <th style="width: 50%;">
<p class="about-last-p" style="font-size: 10pt;">'.$db_info->data->dbSize->value.'</p> <p class="about-last-p" style="font-size: 10pt;">'.$db_info->data->dbSize->value.'</p>
</th> </th>
</tr> </tr>
<tr> <tr>
<th colspan="2"> <th colspan="2">
<h2><span> - </span>'.__('Tables fragmentation in the %s database', $product_name).'</h2> <h2><span> - </span>'.__('Tables fragmentation in the %s database', $product_name).'</h2>
</th> </th>
</tr> </tr>
<tr> <tr>
<th style="width: 50%;"> <th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationMax->name.'</span></p> <p><span>'.$db_fragmentation->data->tablesFragmentationMax->name.'</span></p>
</th> </th>
<th style="width: 50%;"> <th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationMax->value.'</p> <p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationMax->value.'</p>
</th> </th>
</tr> </tr>
<tr> <tr>
<th style="width: 50%;"> <th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationValue->name.'</span></p> <p><span>'.$db_fragmentation->data->tablesFragmentationValue->name.'</span></p>
</th> </th>
<th style="width: 50%;"> <th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationValue->value.'</p> <p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationValue->value.'</p>
</th> </th>
</tr> </tr>
<tr> <tr>
<th style="width: 50%;"> <th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationStatus->name.'</span></p> <p><span>'.$db_fragmentation->data->tablesFragmentationStatus->name.'</span></p>
</th> </th>
<th style="width: 50%;"> <th style="width: 50%;">
<p>'.$fragmentation_status.'</p> <p>'.$fragmentation_status.'</p>
</th> </th>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div>
<div id="tab-system-info">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('System Info').'</h2>
</th>
</tr>
<tr>
<th style="width: 30%;">
<p><span>'.$sys_info->data->cpuInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->cpuInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->ramInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->ramInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->osInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->osInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->hostnameInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->hostnameInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->ipInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->ipInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$system_date->data->date->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$system_date->data->date->value.'</p>
</th>
</tr>
</tbody>
</table>
</div>
<div id="tab-php-system">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('PHP system').'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$php_sys->data->phpVersion->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->phpVersion->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->maxExecutionTime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->maxExecutionTime->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->maxInputTime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->maxInputTime->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->memoryLimit->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->memoryLimit->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->sessionLifetime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->sessionLifetime->value.'</p>
</th>
</tr>
</tbody>
</table>
</div>
</div> </div>
<div id="tab-system-info"> ';
<table class="table-about"> }
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('System Info').'</h2>
</th>
</tr>
<tr>
<th style="width: 30%;">
<p><span>'.$sys_info->data->cpuInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->cpuInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->ramInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->ramInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->osInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->osInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->hostnameInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->hostnameInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->ipInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->ipInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$system_date->data->date->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$system_date->data->date->value.'</p>
</th>
</tr>
</tbody>
</table>
</div>
<div id="tab-php-system">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('PHP system').'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$php_sys->data->phpVersion->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->phpVersion->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->maxExecutionTime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->maxExecutionTime->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->maxInputTime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->maxInputTime->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->memoryLimit->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->memoryLimit->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->sessionLifetime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->sessionLifetime->value.'</p>
</th>
</tr>
</tbody>
</table>
</div>
</div>
';
echo $dialog; echo $dialog;
} }