Bernd Wurst
Bestandsschutz für eigentlich nicht mehr angebotene PHP-Versionen
Bernd Wurst commited 3a072b8 at 2018-07-18 15:03:13
<?php
/*
This file belongs to the Webinterface of schokokeks.org Hosting
Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst <bernd@schokokeks.org>
Hanno Böck <hanno@schokokeks.org>
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
http://creativecommons.org/publicdomain/zero/1.0/
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
*/
require_once("inc/base.php");
require_once("inc/error.php");
require_once("inc/security.php");
require_once('class/domain.php');
require_once("certs.php");
function valid_php_versions() {
$tags = explode(',', config('php_versions'));
$ret = array();
foreach ($tags as $t) {
$key = str_replace('*', '', $t);
$ret[$key] = array('major' => null, 'minor' => null, 'status' => 'regular');
/* Wir nehmen an, dass unsere Tags immer an zweitletzter Stelle die Major-Version und
an letzter Stelle die Minor-Version enthalten */
$ret[$key]['major'] = substr(str_replace('*', '', $t), -2, 1);
$ret[$key]['minor'] = substr(str_replace('*', '', $t), -1, 1);
if (substr($t, -1) === '*') {
$ret[$key]['status'] = 'deprecated';
}
}
/* Bis hier: aus der Datenbank ausgelesen */
DEBUG($ret);
/* Sonderfall: Wenn ein User noch Vhosts einer anderen Version hat, dann bleibt diese erlaubt */
$list = list_vhosts();
foreach ($list as $vhost) {
if ($vhost['php'] && !array_key_exists($vhost['php'], $ret)) {
$key = $vhost['php'];
$ret = array($key => array('major' => null, 'minor' => null, 'status' => 'regular')) + $ret;
/* Wir nehmen an, dass unsere Tags immer an zweitletzter Stelle die Major-Version und
an letzter Stelle die Minor-Version enthalten */
$ret[$key]['major'] = substr($key, -2, 1);
$ret[$key]['minor'] = substr($key, -1, 1);
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX