From 3c82d3822b3e16512f1f13881a8cac3f1bfe90be Mon Sep 17 00:00:00 2001 From: sergey-mz Date: Sun, 19 Nov 2017 00:53:08 -0500 Subject: [PATCH] Check Windows ODBC DSN during install (#2798) * ODBC DSN detection * Merge remote-tracking branch 'upstream/master' * Merge remote-tracking branch 'upstream/master' --- core/install/install.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/install/install.php b/core/install/install.php index 154af7d839..e68cc6ed6c 100644 --- a/core/install/install.php +++ b/core/install/install.php @@ -170,7 +170,12 @@ } //test for windows and non sqlite if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' and strlen($db_type) > 0 and $db_type !='sqlite') { - $messages[] = "Windows requires a system DSN ODBC connection this must be configured."; + //Test for ODBC DSN in ODBC.INI. It should have section: + //[fusionpbx] + //Driver32=C:\Program Files\psqlODBC\0906\bin\psqlodbc35w.dll + if ( preg_match('/\[fusionpbx\]/mi', file_get_contents('c:/Windows/ODBC.INI')) == 0 ) { + $messages[] = "Windows requires a system DSN ODBC connection with name 'fusionpbx'."; + } } //action code