2007-03-24 08:27:00 +01:00
< ? php
2017-02-14 10:23:17 +01:00
/**
* Postfix Admin
*
* LICENSE
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE . TXT .
*
* Further details on the project are available at http :// postfixadmin . sf . net
*
* @ version $Id $
* @ license GNU GPL v2 or later .
*
2007-09-30 17:53:54 +02:00
* File : setup . php
* Used to help ensure a server is setup appropriately during installation / setup .
*/
2007-10-07 19:23:29 +02:00
2019-08-13 10:00:21 +02:00
require_once ( dirname ( __FILE__ ) . '/common.php' ); # make sure correct common.php is used.
2007-10-07 19:23:29 +02:00
2020-12-09 23:53:29 +01:00
$configSetupPassword = Config :: read_string ( 'setup_password' );
$errors = [];
$configSetupDone = false ;
$authenticated = false ;
2021-01-12 23:31:05 +01:00
$old_setup_password = false ;
2020-12-09 23:53:29 +01:00
2021-01-12 23:31:05 +01:00
if ( strpos ( $configSetupPassword , ':' ) > 0 ) {
$old_setup_password = true ;
} elseif ( $configSetupPassword != 'changeme' && $configSetupPassword != '' ) {
2020-12-09 23:53:29 +01:00
$configSetupDone = true ;
$pass = safepost ( 'setup_password' , 'invalid' );
if ( $pass != 'invalid' ) {
if ( password_verify ( safepost ( 'setup_password' , 'invalid' ), $configSetupPassword )) {
$authenticated = true ;
} else {
$errors [ 'setup_login_password' ] = " Password verification failed. " ;
}
}
}
2007-03-24 08:27:00 +01:00
?>
2007-10-07 19:23:29 +02:00
2020-12-09 23:53:29 +01:00
< html lang = " " >
< head >
< meta charset = " utf-8 " >
< meta http - equiv = " X-UA-Compatible " content = " IE=edge " >
< meta name = " viewport " content = " width=device-width, initial-scale=1 " >
< meta http - equiv = " Content-Type " content = " text/html; charset=UTF-8 " />
< title > Postfix Admin - Setup </ title >
< link rel = " shortcut icon " href = " images/favicon.ico " />
2021-01-07 20:23:23 +01:00
< link rel = " stylesheet " href = " css/bootstrap-3.4.1-dist/css/bootstrap.min.css " />
2020-12-09 23:53:29 +01:00
<!-- https :// www . srihash . org / -->
2021-01-07 20:18:15 +01:00
< script src = " jquery-1.12.4.min.js "
2020-12-09 23:53:29 +01:00
integrity = " sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ " crossorigin = " anonymous "
></ script >
< script src = " css/bootstrap-3.4.1-dist/js/moment-with-locales.min.js " ></ script >
< script src = " css/bootstrap-3.4.1-dist/js/bootstrap.min.js " ></ script >
< script src = " css/bootstrap-3.4.1-dist/js/bootstrap-datetimepicker.min.js " ></ script >
</ head >
< body >
< nav class = " navbar navbar-default " >
< div class = " container " >
< div class = " navbar-header " >
< a class = " navbar-brand " href = 'main.php' >
< img id = " login_header_logo " src = " images/logo-default.png "
alt = " Logo " /></ a >
</ div >
</ div >
</ nav >
2019-01-01 21:38:51 +01:00
2020-12-09 23:53:29 +01:00
< ? php
$todo = '<span class="font-weight-bold text-primary">TODO</span>' ;
$authenticatedLabel = $todo ;
2019-08-13 10:00:21 +02:00
2020-12-09 23:53:29 +01:00
$configSetupLabel = $todo ;
$tick = ' ✅ ' ;
2019-08-13 10:00:21 +02:00
2020-12-09 23:53:29 +01:00
if ( $configSetupDone ) {
$configSetupLabel = $tick ;
2007-03-24 08:27:00 +01:00
2020-12-09 23:53:29 +01:00
if ( $authenticated ) {
$authenticatedLabel = $tick ;
}
}
?>
2007-10-07 19:23:29 +02:00
2020-12-09 23:53:29 +01:00
< div class = " container " >
2019-08-13 10:00:21 +02:00
2020-12-09 23:53:29 +01:00
< div class = " row " >
< ? php
2018-12-28 20:15:38 +01:00
2020-12-09 23:53:29 +01:00
if ( ! isset ( $_SERVER [ 'HTTPS' ])) {
echo " <h2 class='h2 text-danger'>Warning: connection not secure, switch to https if possible</h2> " ;
} ?>
2007-03-24 08:27:00 +01:00
2020-12-09 23:53:29 +01:00
< div class = " col-12 " >
< h1 > Configure and Setup Postfixadmin </ h1 >
2007-12-14 01:05:54 +01:00
2020-12-09 23:53:29 +01:00
< ul >
< li >< ? = $configSetupLabel ?> You need to have a setup_password configured in a
< code > config . local . php </ code > file .
</ li >
< li >< ? = $authenticatedLabel ?> Login using your setup password.</li>
< li > Then you can run some self tests to check compatability with
Postfixadmin
</ li >
< li > Create / update your database of choice </ li >
< li > and Add a new super user account </ li >
</ ul >
2021-01-12 23:31:05 +01:00
2020-12-09 23:53:29 +01:00
</ div >
</ div >
< ? php if ( $configSetupDone && ! $authenticated ) { ?>
< div class = " row " >
< h2 class = " h2 " > Login with setup_password </ h2 >
< p > If you ' ve forgotten your super - admin password , you can generate a new one using the < em > Generate </ em >
form
and update your < code > config . local . php </ code ></ p >
< form name = " authenticate " class = " form-horizontal " method = " post " >
< div class = " form-group " >
< label for = " setup_password " class = " col-sm-4 control-label " > Setup password </ label >
< div class = " col-sm-4 " >
< input class = " form-control " type = " password " name = " setup_password " minlength = 5
id = " setup_password "
value = " " />
< ? = _error_field ( $errors , 'setup_login_password' ); ?>
</ div >
</ div >
< div class = " form-group " >
< div class = " col-sm-offset-4 col-sm-4 " >
< button class = " btn btn-primary " type = " submit " name = " submit " value = " setuppw " > Login with
setup_password .
</ button >
</ div >
</ div >
</ form >
</ div >
< ? php } ?>
< div class = " row " >
< ? php
if ( ! $configSetupDone ) {
echo <<< EOF
< p >< strong > For a new installation , you must generate a 'setup_password' to go into your config . local . php file .</ strong ></ p >
< p > You can use the form below , or run something like the following in a shell - < code > php - r 'echo password_hash("password", PASSWORD_DEFAULT);' </ code >< p >
EOF ;
}
2021-01-12 23:31:05 +01:00
if ( $old_setup_password ) {
echo '<p class="text-danger"><strong>Your setup_password is in an obsolete. As of PostfixAdmin 3.3 it needs regenerating. </strong>' ;
}
2020-12-09 23:53:29 +01:00
if ( ! $authenticated || ! $configSetupDone ) { ?>
< h2 > Generate setup_password hash </ h2 >
< ? php
$form_error = '' ;
$result = '' ;
if ( safepost ( 'form' ) === " setuppw " ) {
$errors = [];
# "setup password" form submitted
if ( safepost ( 'setup_password' , 'abc' ) != safepost ( 'setup_password2' )) {
$errors [ 'setup_password' ] = " The two passwords differ! " ;
$form_error = 'has-error' ;
2019-08-13 10:00:21 +02:00
} else {
2020-12-09 23:53:29 +01:00
$msgs = validate_password ( safepost ( 'setup_password' ));
if ( empty ( $msgs )) {
// form has been submitted; both fields filled in, so generate a new setup password.
$hash = password_hash ( safepost ( 'setup_password' ), PASSWORD_DEFAULT );
2008-06-11 00:34:25 +02:00
2020-12-09 23:53:29 +01:00
$result = '<p>If you want to use the password you entered as setup password, edit config.inc.php or config.local.php and set</p>' ;
$result .= " <pre> \$ CONF['setup_password'] = ' $hash ';</pre> " ;
} else {
$form_error = 'has-error' ;
$errors [ 'setup_password' ] = implode ( ', ' , $msgs );
2019-08-13 10:00:21 +02:00
}
}
2020-12-09 23:53:29 +01:00
}
2008-06-11 00:34:25 +02:00
2020-12-09 23:53:29 +01:00
?>
2008-06-11 00:34:25 +02:00
2020-12-09 23:53:29 +01:00
< form name = " setuppw " method = " post " class = " form-horizontal " action = " setup.php " >
< input type = " hidden " name = " form " value = " setuppw " />
2008-06-11 00:34:25 +02:00
2020-12-09 23:53:29 +01:00
< div class = " form-group <?= $form_error ?> " >
2008-06-11 00:34:25 +02:00
2020-12-09 23:53:29 +01:00
< label for = " setup_password " class = " col-sm-4 control-label " > Setup password </ label >
< div class = " col-sm-4 " >
< input class = " form-control " type = " password " name = " setup_password " minlength = 5
id = " setup_password "
autocomplete = " new-password "
value = " " />
< ? = _error_field ( $errors , 'setup_password' ); ?>
</ div >
</ div >
< div class = " form-group <?= $form_error ?> " >
< label for = " setup_password2 " class = " col-sm-4 control-label " > Setup password ( again ) </ label >
< div class = " col-sm-4 " >
< input class = " form-control " type = " password " name = " setup_password2 "
minlength = 5 id = " setup_password2 "
autocomplete = " new-password "
value = " " />
< ? = _error_field ( $errors , 'setup_password2' ); ?>
</ div >
</ div >
< div class = " form-group " >
< div class = " col-sm-offset-4 col-sm-4 " >
< button class = " btn btn-primary " type = " submit " name = " submit " value = " setuppw " > Generate setup_password
hash
</ button >
</ div >
</ div >
</ form >
< ? = $result ?>
</ div >
2020-12-23 17:24:41 +01:00
< ? php } // end if(!$authenticated)?>
2020-12-09 23:53:29 +01:00
< div class = " row " >
< h2 > Hosting Environment Check </ h2 >
< ? php
$check = do_software_environment_check ();
if ( $authenticated ) {
if ( ! empty ( $check [ 'error' ])) {
echo " <p><p>Errors were found with your environment. These will be displayed once you've configured a setup_password and confirmed it.</p> " ;
2019-08-13 10:00:21 +02:00
}
2008-06-11 00:34:25 +02:00
2020-12-09 23:53:29 +01:00
if ( ! empty ( $check [ 'info' ])) {
echo " <h3>Information</h3><ul> " ;
foreach ( $check [ 'info' ] as $msg ) {
echo " <li> { $tick } { $msg } </li> " ;
}
echo " </ul> " ;
2019-08-13 10:00:21 +02:00
}
2008-06-11 00:34:25 +02:00
2020-12-09 23:53:29 +01:00
if ( ! empty ( $check [ 'warn' ])) {
echo " <h3>Warnings</h3><ul> " ;
foreach ( $check [ 'warn' ] as $msg ) {
echo " <li class='text-warning'>⚠ { $msg } </li> " ;
}
echo " </ul> " ;
2019-08-13 10:00:21 +02:00
}
2020-12-09 23:53:29 +01:00
if ( ! empty ( $check [ 'error' ])) {
echo " <h3>Errors (MUST be fixed)</h3><ul> " ;
foreach ( $check [ 'error' ] as $msg ) {
echo " <li class='text-danger'>⛔ { $msg } </li> " ;
}
echo " </ul> " ;
}
} else {
if ( ! empty ( $check [ 'error' ])) {
echo '<h3 class="text-danger">Hosting Environment errors found. Login to see details.</h3>' ;
}
if ( ! empty ( $check [ 'warn' ])) {
echo '<h3 class="text-warning">Hosting Environment warnings found. Login to see details.</h3>' ;
}
}
2007-10-07 19:23:29 +02:00
2020-12-09 23:53:29 +01:00
?>
2007-10-07 19:23:29 +02:00
2020-12-09 23:53:29 +01:00
</ div >
2009-04-08 22:16:05 +02:00
2020-12-09 23:53:29 +01:00
< div class = " row " >
2009-04-08 22:16:05 +02:00
2020-12-09 23:53:29 +01:00
< h2 > Database Update </ h2 >
2009-04-08 22:16:05 +02:00
2020-12-09 23:53:29 +01:00
< ? php
if ( $authenticated ) {
print " <p>Everything seems fine... attempting to create/update database structure</p> \n " ;
require_once ( dirname ( __FILE__ ) . '/upgrade.php' );
} else {
echo " <h3 class='text-warning'>Please login to see perform database update.</h3> " ;
}
?>
2009-04-08 22:16:05 +02:00
2020-12-09 23:53:29 +01:00
</ div >
2011-12-20 02:06:49 +01:00
2020-12-09 23:53:29 +01:00
< ? php
if ( $authenticated ) {
?>
< div class = " row " >
< h2 > Add Superadmin Account </ h2 >
2011-12-20 02:06:49 +01:00
2009-04-08 22:16:05 +02:00
2020-12-09 23:53:29 +01:00
< form name = " create_admin " class = " form-horizontal " method = " post " >
2009-05-02 22:24:58 +02:00
2019-08-13 10:00:21 +02:00
2020-12-09 23:53:29 +01:00
< div class = " form-group " >
< label for = " setup_password " class = " col-sm-4 control-label " > Setup password </ label >
< div class = " col-sm-4 " >
2021-01-12 23:31:05 +01:00
< input class = " form-control " type = " password " required = " required " name = " setup_password "
minlength = 5
2020-12-09 23:53:29 +01:00
value = " " />
2019-08-13 10:00:21 +02:00
2020-12-09 23:53:29 +01:00
</ div >
</ div >
2019-08-13 10:00:21 +02:00
2020-12-09 23:53:29 +01:00
< div class = " form-group " >
< label for = " username " class = " col-sm-4 control-label " >< ? = $PALANG [ 'admin' ] ?> </label>
< div class = " col-sm-4 " >
< input class = " form-control " type = " text " required = " required " name = " username " minlength = 5
id = " username "
value = " " />
2019-08-13 10:19:22 +02:00
2020-12-09 23:53:29 +01:00
< ? = _error_field ( $errors , 'username' ); ?>
2019-08-13 10:19:22 +02:00
2020-12-09 23:53:29 +01:00
</ div >
2019-08-13 10:00:21 +02:00
</ div >
2020-12-09 23:53:29 +01:00
< div class = " form-group " >
< label for = " password " class = " col-sm-4 control-label " >< ? = $PALANG [ 'password' ] ?> </label>
< div class = " col-sm-4 " >
< input class = " form-control " type = " password " required = required
name = " password " minlength = 5
id = " password " autocomplete = " new-password "
value = " " />
< ? = _error_field ( $errors , 'password' ); ?>
2019-08-13 10:19:22 +02:00
</ div >
2020-12-09 23:53:29 +01:00
</ div >
2019-08-13 10:00:21 +02:00
2020-12-09 23:53:29 +01:00
< div class = " form-group " >
< label for = " password2 " class = " col-sm-4 control-label " >< ? = $PALANG [ 'password_again' ] ?> </label>
< div class = " col-sm-4 " >
< input class = " form-control " type = " password " required = required
name = " password2 " minlength = 5
id = " password2 " autocomplete = " new-password "
value = " " />
2019-08-13 10:19:22 +02:00
2020-12-09 23:53:29 +01:00
< ? = _error_field ( $errors , 'password2' ); ?>
2009-04-16 01:32:45 +02:00
2020-12-09 23:53:29 +01:00
</ div >
</ div >
2017-02-14 10:23:17 +01:00
2009-04-16 01:32:45 +02:00
2020-12-09 23:53:29 +01:00
< div class = " form-group " >
< div class = " col-sm-offset-4 col-sm-4 " >
< button class = " btn btn-primary " type = " submit " name = " submit "
value = " setuppw " >< ? = $PALANG [ 'pAdminCreate_admin_button' ] ?>
</ button >
</ div >
</ div >
2009-04-16 01:32:45 +02:00
2020-12-09 23:53:29 +01:00
</ form >
</ div >
2009-05-02 22:24:58 +02:00
2021-01-12 23:31:05 +01:00
< ? php
2020-12-23 17:24:41 +01:00
}
2009-05-02 22:24:58 +02:00
2020-12-09 23:53:29 +01:00
if ( safepost ( " form " ) === " createadmin " && $authenticated ) {
2020-12-23 17:24:41 +01:00
# "create admin" form submitted, make sure the correct setup password was specified.
2009-04-16 01:32:45 +02:00
2020-12-23 17:24:41 +01:00
// XXX need to ensure domains table includes an 'ALL' entry.
2020-12-09 23:53:29 +01:00
$table_domain = table_by_key ( 'domain' );
$rows = db_query_all ( " SELECT * FROM $table_domain WHERE domain = 'ALL' " );
if ( empty ( $rows )) {
2020-12-23 17:24:41 +01:00
// all other fields should default through the schema.
2020-12-09 23:53:29 +01:00
db_insert ( 'domain' , array ( 'domain' => 'ALL' , 'description' => '' , 'transport' => '' ));
}
2009-05-02 22:24:58 +02:00
2020-12-09 23:53:29 +01:00
$values = array (
'username' => safepost ( 'username' ),
'password' => safepost ( 'password' ),
'password2' => safepost ( 'password2' ),
'superadmin' => 1 ,
'domains' => array (),
'active' => 1 ,
);
2011-09-25 20:39:20 +02:00
2020-12-09 23:53:29 +01:00
list ( $error , $setupMessage , $errormsg ) = create_admin ( $values );
if ( $error == 1 ) {
$tUsername = htmlentities ( $values [ 'username' ]);
2009-05-02 22:24:58 +02:00
} else {
2020-12-23 17:24:41 +01:00
// all good!.
2020-12-09 23:53:29 +01:00
$setupMessage .= " <p>You are done with your basic setup. " ;
$setupMessage .= " <p><b>You can now <a href='login.php'>login to PostfixAdmin</a> using the account you just created.</b> " ;
2009-05-02 22:24:58 +02:00
}
2009-04-16 01:32:45 +02:00
}
2020-12-09 23:53:29 +01:00
?>
</ div >
</ div >
< footer class = " footer mt-5 bg-dark " >
< div class = " container text-center " >< a target = " _blank " rel = " noopener "
href = " https://github.com/postfixadmin/postfixadmin/ " > Postfix Admin </ a >
</ div >
</ footer >
</ body >
</ html >
< ? php
2020-12-23 17:24:41 +01:00
function _error_field ( $errors , $key ) {
2020-12-09 23:53:29 +01:00
if ( ! isset ( $errors [ $key ])) {
return '' ;
}
return " <span style='color: #ff0000'> { $errors [ $key ] } </span> " ;
2009-04-16 01:32:45 +02:00
}
2021-01-11 22:41:19 +01:00
2020-12-23 17:24:41 +01:00
function create_admin ( $values ) {
2020-12-09 23:53:29 +01:00
define ( 'POSTFIXADMIN_SETUP' , 1 ); # avoids instant redirect to login.php after creating the admin
2011-12-20 02:06:49 +01:00
$handler = new AdminHandler ( 1 , 'setup.php' );
$formconf = $handler -> webformConfig ();
if ( ! $handler -> init ( $values [ 'username' ])) {
return array ( 1 , " " , $handler -> errormsg );
2017-02-14 10:23:17 +01:00
}
2011-12-20 02:06:49 +01:00
if ( ! $handler -> set ( $values )) {
return array ( 1 , " " , $handler -> errormsg );
}
2020-09-25 22:29:45 +02:00
if ( ! $handler -> save ()) {
2011-12-20 02:06:49 +01:00
return array ( 1 , " " , $handler -> errormsg );
}
return array (
0 ,
2013-11-01 20:08:32 +01:00
$handler -> infomsg [ 'success' ],
2011-12-20 02:06:49 +01:00
array (),
);
}
2020-12-09 23:53:29 +01:00
/**
* @ return array [ 'info' => string [], 'warn' => string [], 'error' => string [] ]
*/
2020-12-23 17:24:41 +01:00
function do_software_environment_check () {
2020-12-09 23:53:29 +01:00
$CONF = Config :: getInstance () -> getAll ();
$warn = [];
$error = [];
$info = [];
//
2020-12-23 17:24:41 +01:00
// Check for availability functions
2020-12-09 23:53:29 +01:00
//
$f_phpversion = function_exists ( " phpversion " );
$f_apache_get_version = function_exists ( " apache_get_version " );
$m_pdo = extension_loaded ( " PDO " );
$m_pdo_mysql = extension_loaded ( " pdo_mysql " );
$m_pdo_pgsql = extension_loaded ( 'pdo_pgsql' );
$m_pdo_sqlite = extension_loaded ( " pdo_sqlite " );
$f_session_start = function_exists ( " session_start " );
$f_preg_match = function_exists ( " preg_match " );
$f_mb_encode_mimeheader = function_exists ( " mb_encode_mimeheader " );
$f_imap_open = function_exists ( " imap_open " );
$file_local_config = file_exists ( realpath ( " ./../config.local.php " ));
2020-12-23 17:24:41 +01:00
// Fall back to looking in /etc/postfixadmin for config.local.php (Debian etc)
2020-12-09 23:53:29 +01:00
if ( ! $file_local_config && is_dir ( '/etc/postfixadmin' )) {
$file_local_config = file_exists ( '/etc/postfixadmin/config.local.php' );
}
//
2020-12-23 17:24:41 +01:00
// Check for PHP version
2020-12-09 23:53:29 +01:00
//
$phpversion = 'unknown-version' ;
if ( $f_phpversion == 1 ) {
2021-01-11 22:35:54 +01:00
if ( version_compare ( PHP_VERSION , '7.0.0' , '<' )) {
$error [] = " Error: Depends on: PHP v7.0+. You must upgrade. " ;
2020-12-09 23:53:29 +01:00
} else {
$info [] = " PHP version " . phpversion ();
}
} else {
2021-01-11 22:35:54 +01:00
$error [] = " Unable to check for PHP version. (PHP_VERSION not found?) " ;
2020-12-09 23:53:29 +01:00
}
//
2020-12-23 17:24:41 +01:00
// Check for Apache version
2020-12-09 23:53:29 +01:00
//
if ( $f_apache_get_version == 1 ) {
$info [] = apache_get_version ();
}
//
2020-12-23 17:24:41 +01:00
// Check for config.local.php
2020-12-09 23:53:29 +01:00
//
if ( $file_local_config == 1 ) {
$info [] = " Depends on: presence config.local.php - Found " ;
} else {
$warn [] = " <b>Warning: config.local.php - NOT FOUND - It's Recommended to store your own settings in config.local.php instead of editing config.inc.php " ;
}
2020-12-23 17:24:41 +01:00
// Check if there is support for at least 1 database
2020-12-09 23:53:29 +01:00
if (( $m_pdo == 0 ) and ( $m_pdo_mysql == 0 ) and ( $m_pdo_sqlite == 0 ) and ( $m_pdo_pgsql == 0 )) {
$error [] = " There is no database (PDO) support in your PHP setup, you MUST install a suitable PHP PDO extension (e.g. pdo_pgsql, pdo_mysql or pdo_sqlite). " ;
}
if ( $m_pdo_mysql == 1 ) {
$info [] = " Database - PDO MySQL - Found " ;
} else {
$info [] = " Database - MySQL (pdo_mysql) extension not found " ;
}
//
2020-12-23 17:24:41 +01:00
// PostgreSQL functions
2020-12-09 23:53:29 +01:00
//
if ( $m_pdo_pgsql == 1 ) {
$info [] = " Database support : PDO PostgreSQL - Found " ;
if ( Config :: read_string ( 'database_type' ) != 'pgsql' ) {
$warn [] = " Change the database_type to 'pgsql' in config.local.php if you want to use PostgreSQL " ;
}
} else {
$warn [] = " Database - PostgreSQL (pdo_pgsql) extension not found " ;
}
if ( $m_pdo_sqlite == 1 ) {
$info [] = " Database support : PDO SQLite - Found " ;
if ( Config :: read_string ( 'database_type' ) != 'sqlite' ) {
$warn [] = " Change the database_type to 'sqlite' in config.local.php if you want to use SQLite " ;
}
} else {
$warn [] = " Database support - SQLite (pdo_sqlite) extension not found " ;
}
$link = null ;
$error_text = null ;
try {
$link = db_connect ();
} catch ( Exception $e ) {
$error_text = $e -> getMessage ();
}
if ( ! empty ( $link ) && $error_text == " " ) {
2021-01-11 22:41:19 +01:00
$info [] = " Testing database connection (using config) - Success " ;
2020-12-09 23:53:29 +01:00
} else {
$error [] = " Error: Can't connect to database - please check the \$ CONF['database_*'] parameters in config.local.php : $error_text " ;
}
//
2020-12-23 17:24:41 +01:00
// Session functions
2020-12-09 23:53:29 +01:00
//
if ( $f_session_start == 1 ) {
$info [] = " Depends on: session - OK " ;
} else {
2021-01-06 13:03:21 +01:00
$error [] = " Error: Depends on: session - NOT FOUND. (FreeBSD: portinstall php $phpversion -session ?) " ;
2020-12-09 23:53:29 +01:00
}
//
2020-12-23 17:24:41 +01:00
// PCRE functions
2020-12-09 23:53:29 +01:00
//
if ( $f_preg_match == 1 ) {
$info [] = " Depends on: pcre - Found " ;
} else {
$error [] = " Error: Depends on: pcre - NOT FOUND. (FreeBSD: portinstall php $phpversion -pcre) " ;
}
//
2020-12-23 17:24:41 +01:00
// Multibyte functions
2020-12-09 23:53:29 +01:00
//
if ( $f_mb_encode_mimeheader == 1 ) {
$info [] = " Depends on: multibyte string - Found " ;
} else {
$error [] = " Error: Depends on: multibyte string - mbstring extension missing. (FreeBSD: portinstall php $phpversion -mbstring?) " ;
}
//
2020-12-23 17:24:41 +01:00
// Imap functions
2020-12-09 23:53:29 +01:00
//
if ( $f_imap_open == 1 ) {
$info [] = " IMAP functions - Found " ;
} else {
2021-01-06 13:03:21 +01:00
$warn [] = " Warning: Optional dependency 'imap' extension missing, without this you may not be able to automcate creation of subfolders for new mailboxes " ;
2020-12-09 23:53:29 +01:00
}
return [ 'error' => $error , 'warn' => $warn , 'info' => $info ];
}
2011-12-20 02:06:49 +01:00
2009-02-15 16:02:26 +01:00
?>