block non-standard vhost modification
This commit is contained in:
parent
48168c534e
commit
5bf121ae05
|
@ -48,7 +48,17 @@ if (!array_key_exists('auth', $_SESSION) || $_SESSION['auth']!=1) {
|
||||||
|
|
||||||
include_once EVOADMIN_BASE . '../inc/webadmin.php';
|
include_once EVOADMIN_BASE . '../inc/webadmin.php';
|
||||||
|
|
||||||
} elseif (preg_match('#^/webadmin/servername/(.*)/?$#', $uri, $params)) {
|
} elseif (preg_match('#^/webadmin?#', $uri)) {
|
||||||
|
|
||||||
|
// Redirect to /webadmin in order to set $_SESSION['non_stanard']
|
||||||
|
if (!isset($_SESSION['non_standard']))
|
||||||
|
http_redirect('/webadmin');
|
||||||
|
|
||||||
|
// block the non-standard vhost modification
|
||||||
|
if (in_array(htmlspecialchars(basename($_SERVER['REDIRECT_URL'])), $_SESSION['non_standard']))
|
||||||
|
http_redirect('/webadmin');
|
||||||
|
|
||||||
|
if (preg_match('#^/webadmin/servername/(.*)/?$#', $uri, $params)) {
|
||||||
|
|
||||||
include_once EVOADMIN_BASE . '../inc/webadmin-servername.php';
|
include_once EVOADMIN_BASE . '../inc/webadmin-servername.php';
|
||||||
|
|
||||||
|
@ -64,7 +74,7 @@ if (!array_key_exists('auth', $_SESSION) || $_SESSION['auth']!=1) {
|
||||||
|
|
||||||
include_once EVOADMIN_BASE . '../inc/webadmin-edit.php';
|
include_once EVOADMIN_BASE . '../inc/webadmin-edit.php';
|
||||||
|
|
||||||
} elseif (preg_match('#^/webadmin/(.*)/delete/$#', $uri, $params)) {
|
} elseif (preg_match('#^/webadmin/delete/(.*)/?$#', $uri, $params)) {
|
||||||
|
|
||||||
include_once EVOADMIN_BASE . '../inc/webadmin-delete.php';
|
include_once EVOADMIN_BASE . '../inc/webadmin-delete.php';
|
||||||
|
|
||||||
|
@ -72,6 +82,7 @@ if (!array_key_exists('auth', $_SESSION) || $_SESSION['auth']!=1) {
|
||||||
|
|
||||||
include_once EVOADMIN_BASE . '../inc/webadmin-suppr.php';
|
include_once EVOADMIN_BASE . '../inc/webadmin-suppr.php';
|
||||||
|
|
||||||
|
}
|
||||||
} elseif (is_superadmin() && preg_match('#^/accounts/?#', $uri, $params)) {
|
} elseif (is_superadmin() && preg_match('#^/accounts/?#', $uri, $params)) {
|
||||||
|
|
||||||
include_once EVOADMIN_BASE . '../inc/accounts.php';
|
include_once EVOADMIN_BASE . '../inc/accounts.php';
|
||||||
|
|
|
@ -30,6 +30,12 @@ if (!$conf['cluster']) {
|
||||||
|
|
||||||
/* Récupération de cette liste dans le tableau $vhost_list */
|
/* Récupération de cette liste dans le tableau $vhost_list */
|
||||||
$vhost_list = array();
|
$vhost_list = array();
|
||||||
|
|
||||||
|
if (!isset($_SESSION['non_standard'])) {
|
||||||
|
$_SESSION['non_standard'] = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach($data_output as $data_line) {
|
foreach($data_output as $data_line) {
|
||||||
$data_split = explode(':', $data_line);
|
$data_split = explode(':', $data_line);
|
||||||
|
|
||||||
|
@ -72,6 +78,11 @@ if (!$conf['cluster']) {
|
||||||
$occupation = "";
|
$occupation = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// current vhost isn't standard and thus not manageable by evoadmin-web
|
||||||
|
if (!$data_split[9]) {
|
||||||
|
array_push($_SESSION['non_standard'], $data_split[0]);
|
||||||
|
}
|
||||||
|
|
||||||
array_push($vhost_list, array(
|
array_push($vhost_list, array(
|
||||||
'owner' => $data_split[0],
|
'owner' => $data_split[0],
|
||||||
'configid' => $data_split[1],
|
'configid' => $data_split[1],
|
||||||
|
|
|
@ -876,9 +876,17 @@ op_listvhost() {
|
||||||
else
|
else
|
||||||
is_enabled=0
|
is_enabled=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
count_virtualhosts="$(grep "<VirtualHost" "$configfile" | wc -l)"
|
||||||
|
if [ "$count_virtualhosts" -eq 1 ]; then
|
||||||
|
is_standard=1
|
||||||
|
else
|
||||||
|
is_standard=0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$servername" ] && [ "$userid" ]; then
|
if [ "$servername" ] && [ "$userid" ]; then
|
||||||
configid=$(basename "$configfile")
|
configid=$(basename "$configfile")
|
||||||
echo "$userid:$configid:$servername:$serveraliases:$size:$quota_soft:$quota_hard:$phpversion:$is_enabled"
|
echo "$userid:$configid:$servername:$serveraliases:$size:$quota_soft:$quota_hard:$phpversion:$is_enabled:$is_standard"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -102,6 +102,7 @@
|
||||||
|
|
||||||
if (is_superadmin()) {
|
if (is_superadmin()) {
|
||||||
printf('<td>');
|
printf('<td>');
|
||||||
|
if (!in_array($vhost_info['owner'], $_SESSION['non_standard'])) {
|
||||||
printf('<a href="/webadmin/edit/%s">Alias</a> - ', $vhost_info['owner']);
|
printf('<a href="/webadmin/edit/%s">Alias</a> - ', $vhost_info['owner']);
|
||||||
printf('<a href="/webadmin/servername/%s">Servername</a> - ', $vhost_info['owner']);
|
printf('<a href="/webadmin/servername/%s">Servername</a> - ', $vhost_info['owner']);
|
||||||
if(is_multiphp()) {
|
if(is_multiphp()) {
|
||||||
|
@ -109,7 +110,10 @@
|
||||||
} else {
|
} else {
|
||||||
printf('<a href="/webadmin/itk/%s">ITK</a> - ', $vhost_info['owner']);
|
printf('<a href="/webadmin/itk/%s">ITK</a> - ', $vhost_info['owner']);
|
||||||
}
|
}
|
||||||
printf('<a href="/webadmin/%s/delete/">Supprimer</a>', $vhost_info['owner']);
|
printf('<a href="/webadmin/delete/%s">Supprimer</a>', $vhost_info['owner']);
|
||||||
|
} else {
|
||||||
|
print '<span class="form-mandatory-ok">VirtualHost non standard</span>';
|
||||||
|
}
|
||||||
printf('</td>');
|
printf('</td>');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue