3 * OpenSMTPD Admin Refactor
4 * by Jeroen Janssen <jeroen at laylo dot io>
5 * Copyright (c) 2022-2023 LAYLO
8 // Check whether the configuration file exists - bail if that is the case
9 if (file_exists(realpath("./conf.php"))) {
10 print 'It seems that conf.php is already configured. Please delete setup.php to continue.';
13 // Define the app specifics
14 DEFINE('APP_NAME', 'OpenSMTPD Admin Setup Checker');
15 DEFINE('VERSION', '1.2');
17 // Start generating the HTML output
20 $html .= '<title></title>';
23 $html .= '<img id="login_header_logo" src="images/postbox.png" />';
24 $html .= '<img id="login_header_logo" height="30px" src="images/opensmtpdadmin.png" />';
25 $html .= '<h1>' . APP_NAME . ' v' . VERSION . '</h1>';
26 $html .= '<p>It seems that you are running this version of OpenSMTPD Admin for the first time.</p>';
29 $html .= '<td><strong>PHP version:</strong></td>';
30 $html .= (version_compare(PHP_VERSION, '7.4.0') >= 0) ? '<td><span style="color:green;">' . phpversion() . '</td>' : '<td><span style="color:red;">' . phpversion() . '</span></td>';
32 $html .= '<td><strong>SQL support:</strong></td>';
33 $html .= (extension_loaded('PDO')) ? '<td><span style="color:green;">PDO - MySQL/MariaDB</span>' : '<td><span style="color:red;">PDO - MySQL/MariaDB</span>';
35 $html .= '<td><strong>Functions:</strong></td>';
36 $html .= (extension_loaded('pcre')) ? '<td><span style="color:green;">pcre</span>' : '<td><span style="color:red;">pcre</span>';
37 $html .= (function_exists('session_start')) ? ' - <span style="color:green;">session_start</span></td>' : ' - <span style="color:red;">session_start</span></td>';
40 $html .= '<p>cp or mv conf.php-sample to conf.php and change it to reflect your setup.</p>';