mirror of
https://github.com/Froxlor/Froxlor.git
synced 2024-09-21 10:27:29 +00:00
Added manuel integritycheck for admins
Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
parent
b726a8528b
commit
e3e4dba90d
@ -264,4 +264,24 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
} else {
|
||||
ask_yesno('admin_quotas_reallyenforce', $filename, array('page' => $page));
|
||||
}
|
||||
} elseif ($page == 'integritycheck'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
$integrity = new IntegrityCheck();
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$integrity->fixAll();
|
||||
} elseif(isset($_GET['action'])
|
||||
&& $_GET['action'] == "fix") {
|
||||
ask_yesno('admin_integritycheck_reallyfix', $filename, array('page' => $page));
|
||||
}
|
||||
|
||||
$integritycheck = '';
|
||||
foreach ($integrity->available as $id => $check) {
|
||||
$displayid = $id + 1;
|
||||
$result = $integrity->$check();
|
||||
eval("\$integritycheck.=\"" . getTemplate("settings/integritycheck_row") . "\";");
|
||||
}
|
||||
eval("echo \"" . getTemplate("settings/integritycheck") . "\";");
|
||||
}
|
||||
|
@ -20,6 +20,22 @@
|
||||
|
||||
class IntegrityCheck {
|
||||
|
||||
// Store all available checks
|
||||
public $available = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Parses all available checks into $this->available
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->available = get_class_methods($this);
|
||||
unset($this->available[array_search('__construct', $this->available)]);
|
||||
unset($this->available[array_search('checkAll', $this->available)]);
|
||||
unset($this->available[array_search('fixAll', $this->available)]);
|
||||
sort($this->available);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check all occuring integrity problems at once
|
||||
*/
|
||||
|
@ -235,6 +235,11 @@ return array (
|
||||
'label' => $lng['admin']['updatecounters'],
|
||||
'required_resources' => 'change_serversettings',
|
||||
),
|
||||
array (
|
||||
'url' => 'admin_settings.php?page=integritycheck',
|
||||
'label' => $lng['admin']['integritycheck'],
|
||||
'required_resources' => 'change_serversettings',
|
||||
),
|
||||
array (
|
||||
'url' => 'admin_phpsettings.php?page=overview',
|
||||
'label' => $lng['menue']['phpsettings']['maintitle'],
|
||||
|
@ -1804,3 +1804,9 @@ $lng['tasks']['remove_ftpacc_files'] = 'Delete customer ftp-account data.';
|
||||
$lng['tasks']['regenerating_crond'] = 'Rebuilding the cron.d-file';
|
||||
$lng['serversettings']['system_crondreload']['title'] = 'Cron-daemon reload command';
|
||||
$lng['serversettings']['system_crondreload']['description'] = 'Specify the command to execute in order to reload your systems cron-daemon';
|
||||
$lng['admin']['integritycheck'] = 'Database validation';
|
||||
$lng['admin']['integrityid'] = '#';
|
||||
$lng['admin']['integrityname'] = 'Name';
|
||||
$lng['admin']['integrityresult'] = 'Result';
|
||||
$lng['admin']['integrityfix'] = 'Fix problems automatically';
|
||||
$lng['question']['admin_integritycheck_reallyfix'] = 'Do you really want to try fixing all database integrity problems automatically?';
|
@ -1530,3 +1530,9 @@ $lng['tasks']['remove_ftpacc_files'] = 'Kunden FTP-Konto Dateien löschen';
|
||||
$lng['tasks']['regenerating_crond'] = 'Neuerstellung der cron.d-Datei';
|
||||
$lng['serversettings']['system_crondreload']['title'] = 'Cron-Daemon reload Befehl';
|
||||
$lng['serversettings']['system_crondreload']['description'] = 'Geben Sie hier den Befehl zum Neuladen des Cron-Daemons an';
|
||||
$lng['admin']['integritycheck'] = 'Datenbankprüfung';
|
||||
$lng['admin']['integrityid'] = '#';
|
||||
$lng['admin']['integrityname'] = 'Name';
|
||||
$lng['admin']['integrityresult'] = 'Ergebnis';
|
||||
$lng['admin']['integrityfix'] = 'Probleme automatisch beheben';
|
||||
$lng['question']['admin_integritycheck_reallyfix'] = 'Möchten Sie wirklich versuchen sätliche Datenbank - Integritätsprobleme automatisch zu beheben?';
|
||||
|
28
templates/Sparkle/admin/settings/integritycheck.tpl
vendored
Normal file
28
templates/Sparkle/admin/settings/integritycheck.tpl
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
$header
|
||||
<article>
|
||||
<header>
|
||||
<h2>
|
||||
<img src="templates/{$theme}/assets/img/icons/res_recalculate_big.png" alt="" />
|
||||
{$lng['admin']['integritycheck']}
|
||||
</h2>
|
||||
</header>
|
||||
|
||||
<section>
|
||||
<table class="full">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{$lng['admin']['integrityid']}</th>
|
||||
<th>{$lng['admin']['integrityname']}</th>
|
||||
<th>{$lng['admin']['integrityresult']}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<td colspan="3"><a href="{$linker->getLink(array('section' => 'settings', 'page' => $page, 'action' => 'fix'))}">{$lng['admin']['integrityfix']}</a></td>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
{$integritycheck}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</article>
|
||||
$footer
|
5
templates/Sparkle/admin/settings/integritycheck_row.tpl
vendored
Normal file
5
templates/Sparkle/admin/settings/integritycheck_row.tpl
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<tr class="top">
|
||||
<td>{$displayid}</td>
|
||||
<td>{$check}</td>
|
||||
<td><if $result == '1'>OK<else>FAIL</if></td>
|
||||
</tr>
|
Loading…
Reference in New Issue
Block a user