Add new features:
- Unix quota management - Apache ServerAlias management - support for multiple versions of PHP - MySQL databases management (new page dbadmin)web-add-support-nginx-and-apache
parent
ee8b8a6437
commit
483482ab59
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Databases Management Page
|
||||
*
|
||||
* Copyright (c) 2009 Evolix - Tous droits reserves
|
||||
*
|
||||
* vim: expandtab softtabstop=4 tabstop=4 shiftwidth=4 showtabline=2
|
||||
*
|
||||
* @author Gregory Colpart <reg@evolix.fr>
|
||||
* @author Thomas Martin <tmartin@evolix.fr>
|
||||
* @author Sebastien Palma <spalma@evolix.fr>
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
global $conf;
|
||||
|
||||
if (!$conf['dbadmin'])
|
||||
http_redirect('/');
|
||||
|
||||
$cmd = 'dbadmin.sh list';
|
||||
|
||||
if(!is_superadmin()) {
|
||||
$cmd .= ' ' . $_SESSION['user'];
|
||||
}
|
||||
sudoexec($cmd, $data_output, $exec_return);
|
||||
|
||||
/*
|
||||
* Put command output to db_list array.
|
||||
*/
|
||||
|
||||
$db_list = array();
|
||||
foreach ($data_output as $data_line) {
|
||||
$data_split = explode(':', $data_line);
|
||||
array_push($db_list, array(
|
||||
'owner' => $data_split[0],
|
||||
'database' => $data_split[1])
|
||||
);
|
||||
}
|
||||
|
||||
include_once EVOADMIN_BASE . '../tpl/header.tpl.php';
|
||||
include_once EVOADMIN_BASE . '../tpl/menu.tpl.php';
|
||||
include_once EVOADMIN_BASE . '../tpl/dbadmin.tpl.php';
|
||||
include_once EVOADMIN_BASE . '../tpl/footer.tpl.php';
|
||||
?>
|
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Databases management page template
|
||||
*
|
||||
* Copyright (c) 2009 Evolix - Tous droits reserves
|
||||
*
|
||||
* vim: expandtab softtabstop=4 tabstop=4 shiftwidth=4 showtabline=2
|
||||
*
|
||||
* @author Gregory Colpart <reg@evolix.fr>
|
||||
* @author Thomas Martin <tmartin@evolix.fr>
|
||||
* @author Sebastien Palma <spalma@evolix.fr>
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
?>
|
||||
<div class="container">
|
||||
<h2>Bases de données</h2><hr>
|
||||
|
||||
<?php if(count($db_list) > 0) { ?>
|
||||
<table id="tab-list" class="table table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Propriétaire</th>
|
||||
<th>Bases de données</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($db_list as $db_info) {
|
||||
print '<tr>';
|
||||
printf('<td align="left"> %s</td>', preg_replace("/'/", "", $db_info['owner']));
|
||||
printf('<td align="left"> %s</td>', $db_info['database']);
|
||||
print '</tr>';
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
} else {
|
||||
print '<div class="alert alert-info" role="alert">Aucune base existante !</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
Loading…
Reference in New Issue