7 * @link https://www.open-emr.org
8 * @author Roberto Vasquez <robertogagliotta@gmail.com>
9 * @author Scott Wakefield <scott@npclinics.com.au>
10 * @author Ranganath Pathak <pathak@scrs1.org>
11 * @copyright Copyright (c) 2016 Roberto Vasquez <robertogagliotta@gmail.com>
12 * @copyright Copyright (c) 2016 Scott Wakefield <scott@npclinics.com.au>
13 * @copyright Copyright (c) 2019 Ranganath Pathak <pathak@scrs1.org>
14 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
16 // Set the maximum excution time and time limit to unlimited.
17 ini_set('max_execution_time', 0);
20 // Warning. If you set $allow_multisite_setup to true, this is a potential security vulnerability.
21 // Recommend setting it back to false (or removing this setup.php script entirely) after you
22 // are done with the multisite procedure.
23 $allow_multisite_setup = false;
25 // Warning. If you set $allow_cloning_setup to true, this is a potential security vulnerability.
26 // Recommend setting it back to false (or removing this setup.php script entirely) after you
27 // are done with the cloning setup procedure.
28 $allow_cloning_setup = false;
29 if (!$allow_cloning_setup && !empty($_REQUEST['clone_database'])) {
30 die("To turn on support for cloning setup, need to edit this script and change \$allow_cloning_setup to true. After you are done setting up the cloning, ensure you change \$allow_cloning_setup back to false or remove this script altogether");
33 // Checks if the server's PHP version is compatible with OpenEMR:
34 require_once(dirname(__FILE__
) . "/common/compatibility/Checker.php");
36 use OpenEMR\Common\Checker
;
38 $response = Checker
::checkPhpVersion();
39 if ($response !== true) {
43 $COMMAND_LINE = php_sapi_name() == 'cli';
44 require_once(dirname(__FILE__
) . '/library/authentication/password_hashing.php');
45 require_once dirname(__FILE__
) . '/library/classes/Installer.class.php';
47 $state = isset($_POST["state"]) ?
($_POST["state"]) : '';
48 $installer = new Installer($_REQUEST);
49 // Make this true for IPPF.
50 $ippf_specific = false;
52 $error_page_end = <<<EPE
55 </div><!--end of container div-->
60 // If this script was invoked with no site ID, then ask for one.
61 if (!$COMMAND_LINE && empty($_REQUEST['site'])) {
66 <title>OpenEMR Setup Tool</title>
67 <!--<link rel=stylesheet href="interface/themes/style_blue.css">-->
68 <link rel="stylesheet" href="public/assets/bootstrap/dist/css/bootstrap.min.css" type="text/css">
69 <link rel="stylesheet" href="public/assets/jquery-ui/jquery-ui.css" type="text/css">
70 <script type="text/javascript" src="public/assets/jquery/dist/jquery.min.js"></script>
71 <script type="text/javascript" src="public/assets/bootstrap/dist/js/bootstrap.min.js"></script>
72 <link rel="stylesheet" href="public/assets/font-awesome/css/font-awesome.min.css" type="text/css">
73 <link rel="shortcut icon" href="public/images/favicon.ico" />
74 <script type="text/javascript" src="public/assets/jquery-ui/jquery-ui.js"></script>
82 <div class = 'container'>
85 <div class="col-sm-12">
86 <div class="page-header">
87 <h2>OpenEMR Setup <a class="oe-pull-away oe-help-redirect" data-target="#myModal" data-toggle="modal" href="#" id="help-href" name="help-href" style="color:#676666" title="Click to view Help"><i class="fa fa-question-circle" aria-hidden="true"></i></a></h2>
93 <div class="col-sm-12">
95 <legend>Optional Site ID Selection</legend>
96 <p>Most OpenEMR installations support only one site. If that is
97 true for you then ignore the rest of this text and just click Continue.</p>
98 <p>Otherwise please enter a unique Site ID here.</p>
99 <p>A Site ID is a short identifier with no spaces or special
100 characters other than periods or dashes. It is case-sensitive and we
101 suggest sticking to lower case letters for ease of use.</p>
102 <p>If each site will have its own host/domain name, then use that
103 name as the Site ID (e.g. www.example.com).</p>
104 <p>The site ID is used to identify which site you will log in to.
105 If it is a hostname then it is taken from the hostname in the URL.
106 Otherwise you must append "?site=<i>siteid</i>" to the URL used for
108 <p>It is OK for one of the sites to have "default" as its ID. This
109 is the ID that will be used if it cannot otherwise be determined.</p>
112 <input type='hidden' name='state' value='0'>
113 Site ID: <input type='text' name='site' value='default'>
114 <button type='submit' value='Continue'>Continue</button>
119 </div><!--end of container div-->
121 echo $site_id . "\r\n";
122 $installer->setupHelpModal();
123 echo "</body>". "\r\n";
124 echo "</html>". "\r\n";
129 // Support "?site=siteid" in the URL, otherwise assume "default".
130 $site_id = 'default';
131 if (!$COMMAND_LINE && !empty($_REQUEST['site'])) {
132 $site_id = trim($_REQUEST['site']);
135 // Die if site ID is empty or has invalid characters.
136 if (empty($site_id) ||
preg_match('/[^A-Za-z0-9\\-.]/', $site_id)) {
137 die("Site ID '".htmlspecialchars($site_id, ENT_NOQUOTES
)."' contains invalid characters.");
140 // If multisite is turned off, then only allow default for site.
141 if (!$allow_multisite_setup && $site_id != 'default') {
142 die("To turn on support for multisite setup, need to edit this script and change \$allow_multisite_setup to true. After you are done setting up the cloning, ensure you change \$allow_multisite_setup back to false or remove this script altogether");
145 //If having problems with file and directory permission
146 // checking, then can be manually disabled here.
147 $checkPermissions = true;
149 global $OE_SITE_DIR; // The Installer sets this
151 $docsDirectory = "$OE_SITE_DIR/documents";
152 $billingDirectory = "$OE_SITE_DIR/edi";
153 $billingDirectory2 = "$OE_SITE_DIR/era";
154 $lettersDirectory = "$OE_SITE_DIR/letter_templates";
155 $gaclWritableDirectory = dirname(__FILE__
)."/gacl/admin/templates_c";
156 $requiredDirectory1 = dirname(__FILE__
)."/interface/main/calendar/modules/PostCalendar/pntemplates/compiled";
157 $requiredDirectory2 = dirname(__FILE__
)."/interface/main/calendar/modules/PostCalendar/pntemplates/cache";
159 $zendModuleConfigFile = dirname(__FILE__
)."/interface/modules/zend_modules/config/application.config.php";
161 //These are files and dir checked before install for
162 // correct permissions.
163 if (is_dir($OE_SITE_DIR)) {
164 $writableFileList = array($installer->conffile
,$zendModuleConfigFile);
165 $writableDirList = array($docsDirectory, $billingDirectory, $billingDirectory2, $lettersDirectory, $gaclWritableDirectory, $requiredDirectory1, $requiredDirectory2);
167 $writableFileList = array();
168 $writableDirList = array($OE_SITES_BASE, $gaclWritableDirectory, $requiredDirectory1, $requiredDirectory2);
171 // Include the sqlconf file if it exists yet.
173 if (file_exists($OE_SITE_DIR)) {
174 include_once($installer->conffile
);
175 } elseif ($state > 3) {
176 // State 3 should have created the site directory if it is missing.
177 die("Internal error, site directory is missing.");
182 <title
>OpenEMR Setup Tool
</title
>
183 <!--<link rel
=stylesheet href
="interface/themes/style_blue.css">-->
184 <link rel
="stylesheet" href
="public/assets/bootstrap/dist/css/bootstrap.min.css" type
="text/css">
185 <link rel
="stylesheet" href
="public/assets/jquery-ui/jquery-ui.css" type
="text/css">
186 <script type
="text/javascript" src
="public/assets/jquery/dist/jquery.min.js"></script
>
187 <script type
="text/javascript" src
="public/assets/bootstrap/dist/js/bootstrap.min.js"></script
>
188 <script type
="text/javascript" src
="public/assets/jquery-ui/jquery-ui.js"></script
>
189 <link rel
="stylesheet" href
="public/assets/font-awesome/css/font-awesome.min.css" type
="text/css">
190 <link rel
="shortcut icon" href
="public/images/favicon.ico" />
195 border
-collapse
:collapse
;
197 table
.phpset td
, table
.phpset th
{
199 border
:1px solid gray
;
202 .table
.no
-border tr td
, .table
.no
-border tr th
{
214 font
-family
:sans
-serif
;
222 .label
-div
:hover
> a
{
223 display
:inline
-block
;
228 margin
: 10px
15px
0px
15px
;
230 div
[id$
="_info"] > a
{
234 display
: inline
-block
;
237 .checkboxgroup label
{
250 font
-size
: 70%
!important
;
253 background
-color
: WHITESMOKE
;
265 fieldset
> [class*="col-"] {
267 text
-align
:left
!Important
;
271 <script language
="javascript">
272 // onclick handler for "clone database" checkbox
273 function cloneClicked() {
274 var cb
= document
.forms
[0].clone_database
;
275 $
('.noclone').css('display', cb
.checked ?
'none' : 'block');
281 <div
class = 'container'>
283 <div
class="col-sm-12">
284 <div
class="page-header">
285 <h2
>OpenEMR Setup
<a
class="oe-pull-away oe-help-redirect" data
-target
="#myModal" data
-toggle
="modal" href
="#" id
="help-href" name
="help-href" style
="color:#676666" title
="Click to view Help"><i
class="fa fa-question-circle" aria
-hidden
="true"></i
></a
></h2
>
290 <div
class="col-sm-12">
292 $error = "<span class='text-danger'><b>ERROR</b></span>";
293 $caution = "<span class='text-danger'><b>CAUTION</b></span>";
294 $ok = "<span class='text-success'><b>OK</b></span>";
295 $note = "<span class='text-primary'><b>NOTE</b></span>";
297 if (strtolower(ini_get('register_globals')) != 'off' && (bool) ini_get('register_globals')) {
298 echo "$caution: It appears that you have register_globals enabled in your php.ini\n" .
299 "configuration file. This causes unacceptable security risks. You must\n" .
300 "turn it off before continuing with installation.\n";
304 if (!extension_loaded("xml")) {
305 echo "$error: PHP XML extension missing. To continue, install PHP XML extension, then restart web server.";
309 if (!(extension_loaded("mysql") ||
extension_loaded("mysqlnd") ||
extension_loaded("mysqli"))) {
310 echo "$error: PHP MySQL extension missing. To continue, install and enable MySQL extension, then restart web server.";
314 if (!(extension_loaded("mbstring") )) {
315 echo "$error: PHP mb_string extension missing. To continue, install and enable mb_string extension, then restart web server.";
319 if (!(extension_loaded("openssl") )) {
320 echo "$error: PHP openssl extension missing. To continue, install PHP openssl extension, then restart web server.";
330 <legend
>Final step
- Success
</legend
>
331 <p
>Congratulations
! OpenEMR is now installed
.</p
>
334 <li
>Access
controls (php
-GACL
) are installed
for fine
-grained security
, and can be administered in
335 OpenEMR
's admin->acl menu.</li>
336 <li>Reviewing <?php echo $OE_SITE_DIR; ?>/config.php is a good idea. This file
337 contains some settings that you may want to change.</li>
338 <li>There's much information
and many extra tools bundled within the OpenEMR installation directory
.
339 Please refer to openemr
/Documentation
. Many forms
and other useful scripts can be found at openemr
/contrib
.</li
>
340 <li
>To ensure a consistent look
and feel throughout the application
,
341 <a href
='http://www.mozilla.org/products/firefox/'>Firefox
</a
> and <a href
="https://www.google.com/chrome/browser/desktop/index.html">Chrome
</a
> are recommended
. The OpenEMR development team exclusively tests with modern versions of these browsers
.</li
>
342 <li
>The OpenEMR project home page
, documentation
, and forums can be found at
<a href
= "https://www.open-emr.org" rel
='noopener' target
="_blank">https
://www.open-emr.org</a></li>
343 <li
>We pursue grants to help fund the future development of OpenEMR
. To apply
for these grants
, we need to estimate how many times this program is installed
and how many practices are evaluating
or using this software
. It would be awesome
if you would email us at
<a href
="mailto:president@oemr.org">president@oemr
.org
</a
> if you have installed this software
. The more details about your plans with this software
, the better
, but even just sending us an email stating you just installed it is very helpful
.</li
>
345 <p
>We recommend you
print these instructions
for future reference
.</p
>
347 if (empty($installer->clone_database
)) {
348 echo "<p><b>The initial OpenEMR user is <span class='text-primary'>'".$installer->iuser
."'</span> and the password is <span class='text-primary'>'".$installer->iuserpass
."'</span></b></p>";
349 echo "<p> The selected theme is :</p>";
350 $installer->displayNewThemeDiv();
351 $installer->setCurrentTheme();
352 echo "<p>If you edited the PHP or Apache configuration files during this installation process, then we recommend you restart your Apache server before following below OpenEMR link.</p>";
353 echo "<p>In Linux use the following command:</p>";
354 echo "<p><code>sudo apachectl -k restart</code></p>";
357 <a href
='./?site=<?php echo $site_id; ?>'>Click here to start using OpenEMR
. </a
>
364 </div><!--end of container div-->
366 echo $end_div . "\r\n";
367 $installer->setupHelpModal();
368 echo "</body>". "\r\n";
369 echo "</html>". "\r\n";
377 $inst = isset($_POST["inst"]) ?
($_POST["inst"]) : '';
379 if (($config == 1) && ($state < 4)) {
380 echo "OpenEMR has already been installed. If you wish to force re-installation, then edit $installer->conffile (change the 'config' variable to 0), and re-run this script.<br>\n";
386 <legend>Step $state - Select Database Setup</legend>
387 <p>Now I need to know whether you want me to create the database on my own or if you have already created the database for me to use. For me to create the database, you will need to supply the MySQL root password.
389 <p class='bg-danger'>$caution: clicking on <b>Proceed to Step 2</b> may delete or cause damage to existing data on your system. Before you continue <b>please backup your data</b>.
392 <input name='state' type='hidden' value='2'>
393 <input name='site' type='hidden' value='$site_id'>
395 <input checked id='inst1' name='inst' type='radio' value='1'>Have setup create the database
398 <input id='inst2' name='inst' type='radio' value='2'>I have already created the database
401 <button type='submit' value='Continue'><b>Proceed to Step 2</b></button>
409 $step2top = <<<STP2TOP
411 <legend>Step $state - Database and OpenEMR Initial User Setup Details</legend>
412 <p>Now you need to supply the MySQL server information and path information. Detailed instructions on each item can be found in the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span STYLE='text-decoration: underline;'>'INSTALL'</span></a> manual file.
414 <form method='post' id='myform'>
415 <input name='state' type='hidden' value='3'>
416 <input name='site' type='hidden' value='$site_id'>
417 <input name='inst' type='hidden' value='$inst'>
419 echo $step2top ."\r\n";
422 $step2tabletop1 = <<<STP2TBLTOP1
424 <legend name="form_legend" id="form_legend" class='oe-setup-legend'>MySQL Server Details<i id="enter-details-tooltip" class="fa fa-info-circle oe-text-black oe-superscript enter-details-tooltip" aria-hidden="true"></i></legend>
426 <div class="col-xs-12 ">
427 <div class="col-sm-4">
428 <div class="clearfix form-group">
429 <div class="label-div">
430 <label class="control-label" for="server">Server Host:</label> <a href="#server_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
433 <input name='server' id='server' type='text' class='form-control' value='localhost'>
437 <div id="server_info" class="collapse">
438 <a href="#server_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
439 <p>If you run MySQL and Apache/PHP on the same computer, then leave this as 'localhost'.
440 <p>If they are on separate computers, then enter the IP address of the computer running MySQL.
444 <div class="col-sm-4">
445 <div class="clearfix form-group">
446 <div class="label-div">
447 <label class="control-label" for="port">Server Port:</label> <a href="#port_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
450 <input name='port' id='port' type='text' class='form-control' value='3306'>
453 <div id="port_info" class="collapse">
454 <a href="#port_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
455 <p>This is the MySQL port.
456 <p>The default port for MySQL is 3306.
459 <div class="col-sm-4">
460 <div class="clearfix form-group">
461 <div class="col-sm-12 label-div">
462 <label class="control-label" for="dbname">Database Name:</label> <a href="#dbname_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
464 <div class="col-sm-12">
465 <input name='dbname' id='dbname' type='text' class='form-control' value='openemr'>
468 <div id="dbname_info" class="collapse">
469 <a href="#dbname_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
470 <p>This will be the name of the OpenEMR database in MySQL.
471 <p>'openemr' is the recommended name.
472 <p>This database will contain patient data as well as data pertaining to the OpenEMR installation.
478 <div class="col-xs-12 ">
479 <div class="col-sm-4">
480 <div class="clearfix form-group">
481 <div class="label-div">
482 <label class="control-label" for="login">Login Name:</label> <a href="#login_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
485 <input name='login' ID='login' type='text' class='form-control' value='openemr'>
489 <div id="login_info" class="collapse">
490 <a href="#login_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
491 <p>This is the name that OpenEMR will use to login to the MySQL database.
492 <p>'openemr' is the recommended name.
495 <div class="col-sm-4">
496 <div class="clearfix form-group">
497 <div class="label-div">
498 <label class="control-label" for="pass">Password:</label> <a href="#pass_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
501 <input name='pass' id='pass' class='form-control' type='password' value='' minlength='12' required>
504 <div id="pass_info" class="collapse">
505 <a href="#pass_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
506 <p>This is the Login Password that OpemEMR will use to accesses the MySQL database.
507 <p>It should be at least 12 characters long and composed of both numbers and letters.
511 echo $step2tabletop1 ."\r\n";
513 $step2tabletop2 = <<<STP2TBLTOP2
514 <div class="col-sm-4">
515 <div class="clearfix form-group">
516 <div class="col-sm-12 label-div">
517 <label class="control-label" for="root">Name for Root Account:</label> <a href="#root_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
519 <div class="col-sm-12">
520 <input name='root' id='root'type='text' class='form-control' value='root'>
523 <div id="root_info" class="collapse">
524 <a href="#root_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
525 <p>This is name for the MySQL root account.
526 <p>For localhost, it is usually ok to leave it as 'root'.
532 <div class="col-xs-12 ">
533 <div class="col-sm-4">
534 <div class="clearfix form-group">
535 <div class="label-div">
536 <label class="control-label" for="rootpass">Root Password:</label> <a href="#rootpass_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
539 <input name='rootpass' id='rootpass' type='password' class='form-control' value=''>
543 <div id="rootpass_info" class="collapse">
544 <a href="#rootpass_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
545 <p>This is your MySQL server root password.
546 <p>For localhost, it is usually ok to leave it blank.
549 <div class="col-sm-4">
550 <div class="clearfix form-group">
551 <div class="label-div">
552 <label class="control-label" for="loginhost">User Hostname:</label> <a href="#loginhost_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
555 <input name='loginhost' id='loginhost' type='text' class='form-control' value='localhost'>
558 <div id="loginhost_info" class="collapse">
559 <a href="#loginhost_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
560 <p>If you run Apache/PHP and MySQL on the same computer, then leave this as 'localhost'.
561 <p>If they are on separate computers, then enter the IP address of the computer running Apache/PHP.
564 <div class="col-sm-4">
565 <div class="clearfix form-group">
566 <div class="col-sm-12 label-div">
567 <label class="control-label" for="collate">UTF-8 Collation:</label> <a href="#collate_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
569 <div class="col-sm-12">
570 <select name='collate' id=='collate' class='form-control'>
571 <option value='utf8_bin'>
574 <option value='utf8_czech_ci'>
577 <option value='utf8_danish_ci'>
580 <option value='utf8_esperanto_ci'>
583 <option value='utf8_estonian_ci'>
586 <option selected value='utf8_general_ci'>
589 <option value='utf8_hungarian_ci'>
592 <option value='utf8_icelandic_ci'>
595 <option value='utf8_latvian_ci'>
598 <option value='utf8_lithuanian_ci'>
601 <option value='utf8_persian_ci'>
604 <option value='utf8_polish_ci'>
607 <option value='utf8_roman_ci'>
610 <option value='utf8_romanian_ci'>
613 <option value='utf8_slovak_ci'>
616 <option value='utf8_slovenian_ci'>
619 <option value='utf8_spanish2_ci'>
620 Spanish2 (Traditional)
622 <option value='utf8_spanish_ci'>
625 <option value='utf8_swedish_ci'>
628 <option value='utf8_turkish_ci'>
631 <option value='utf8_unicode_ci'>
632 Unicode (German, French, Russian, Armenian, Greek)
635 None (Do not force UTF-8)
640 <div id="collate_info" class="collapse">
641 <a href="#collate_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
642 <p>This is the collation setting for MySQL.
643 <p>Collation refers to a set of rules that determine how data is sorted and compared in a database.
644 <p>Leave as 'General' if you are not sure.
645 <p>If the language you are planning to use in OpenEMR is in the menu, then you can select it.
646 <p>Otherwise, just select 'General'.
652 echo $step2tabletop2 ."\r\n";
654 // Include a "source" site ID drop-list and a checkbox to indicate
655 // if cloning its database. When checked, do not display initial user
656 // and group stuff below.
657 $dh = opendir($OE_SITES_BASE);
659 die("Cannot read directory '$OE_SITES_BASE'.");
662 $siteslist = array();
663 while (false !== ($sfname = readdir($dh))) {
664 if (substr($sfname, 0, 1) == '.') {
668 if ($sfname == 'CVS') {
672 if ($sfname == $site_id) {
676 $sitedir = "$OE_SITES_BASE/$sfname";
677 if (!is_dir($sitedir)) {
681 if (!is_file("$sitedir/sqlconf.php")) {
685 $siteslist[$sfname] = $sfname;
689 // If this is not the first site...
690 if (!empty($siteslist)) {
692 $source_site_top = <<<SOURCESITETOP
694 <div class="col-xs-12 ">
695 <div class="col-sm-4">
696 <div class="clearfix form-group">
697 <div class="label-div">
698 <label class="control-label" for="source_site_id">Source Site:</label> <a href="#source_site_id_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
701 <select name='source_site_id'id='source_site_id' class='form-control'>
703 echo $source_site_top . "\r\n";
704 foreach ($siteslist as $sfname) {
705 echo "<option value='$sfname'";
706 if ($sfname == 'default') {
710 echo ">$sfname</option>";
712 $source_site_bot = <<<SOURCESITEBOT
717 <div id="source_site_id_info" class="collapse">
718 <a href="#source_site_id_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
719 <p>The site directory that will be a model for the new site.
722 <div class="col-sm-4">
723 <div class="clearfix form-group">
724 <div class="label-div">
725 <label class="control-label" for="clone_database">Clone Source Database:</label> <a href="#clone_database_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
728 <input type='checkbox' name='clone_database' onclick='cloneClicked()' />
731 <div id="clone_database_info" class="collapse">
732 <a href="#clone_database_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
733 <p>Clone the source site's database instead of creating a fresh one.
739 echo $source_site_bot ."\r\n";
741 $randomusername = chr(rand(65, 90)) . chr(rand(65, 90)) . chr(rand(65, 90)) . "-admin-" . rand(0, 9) . rand(0, 9);
742 $step2tablebot = <<<STP2TBLBOT
745 <fieldset class='noclone'>
746 <legend name="form_legend" id="form_legend" class='oe-setup-legend'>OpenEMR Initial User Details<i id="enter-details-tooltip" class="fa fa-info-circle oe-text-black oe-superscript enter-details-tooltip" aria-hidden="true"></i></legend>
748 <div class="col-xs-12 ">
749 <div class="col-sm-4">
750 <div class="clearfix form-group">
751 <div class="label-div">
752 <label class="control-label" for="iuser">Initial User Login Name:</label> <a href="#iuser_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
755 <input name='iuser' id='iuser' type='text' class='form-control' value='$randomusername' minlength='12'>
759 <div id="iuser_info" class="collapse">
760 <a href="#iuser_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
761 <p>This is the login name of the first user that will be created for you.
762 <p>Limit this to one word with at least 12 characters and composed of both numbers and letters.
766 <div class="col-sm-4">
767 <div class="clearfix form-group">
768 <div class="label-div">
769 <label class="control-label" for="iuserpass">Initial User Password:</label> <a href="#iuserpass_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
772 <input name='iuserpass' id='iuserpass' type='password' class='form-control' value='' minlength='12'>
775 <div id="iuserpass_info" class="collapse">
776 <a href="#iuserpass_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
777 <p>This is the password for the initial user.
780 <div class="col-sm-4">
781 <div class="clearfix form-group">
782 <div class="col-sm-12 label-div">
783 <label class="control-label" for="iufname">Initial User's First Name:</label> <a href="#iufname_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
785 <div class="col-sm-12">
786 <input name='iufname' id='iufname 'type='text' class='form-control' value='Administrator'>
789 <div id="iufname_info" class="collapse">
790 <a href="#iufname_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
791 <p>This is the First name of the 'initial user'.
797 <div class="col-xs-12 ">
798 <div class="col-sm-4">
799 <div class="clearfix form-group">
800 <div class="label-div">
801 <label class="control-label" for="iuname">Initial User's Last Name:</label> <a href="#iuname_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
804 <input name='iuname' id='iuname' type='text' class='form-control' value='Administrator'>
808 <div id="iuname_info" class="collapse">
809 <a href="#iuname_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
810 <p>This is the Last name of the 'initial user'.
813 <div class="col-sm-4">
814 <div class="clearfix form-group">
815 <div class="label-div">
816 <label class="control-label" for="igroup">Initial Group:</label> <a href="#igroup_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
819 <input name='igroup' id='igroup' class='form-control' type='text' value='Default'>
822 <div id="igroup_info" class="collapse">
823 <a href="#igroup_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
824 <p>This is the group that will be created for your users.
825 <p>This should be the name of your practice.
831 <p class='bg-warning'>Click the <b>Create DB and User</b> button to create the database and first user. $note: This process will take a few minutes.</p>
832 <!--<p class='bg-success'>Upon successful completion will automatically take you to the next step.</p>-->
833 <p class='bg-success oe-spinner' style = 'visibility:hidden;'>Upon successful completion will automatically take you to the next step.<i class='fa fa-spinner fa-pulse fa-fw'></i></p>
834 <button type='submit' id='create_db_button' value='Continue' class='wait'><b>Create DB and User</b></button>
838 echo $step2tablebot ."\r\n";
843 // (applicable if not cloning from another database)
845 $pass_step2_validation = true;
846 $error_step2_message = "$error - ";
848 if (! $installer->char_is_valid($_REQUEST['server'])) {
849 $pass_step2_validation = false;
850 $error_step2_message .= "A database server host is required <br>\n";
853 if (! $installer->char_is_valid($_REQUEST['port'])) {
854 $pass_step2_validation = false;
855 $error_step2_message .= "A database server port value is required <br>\n";
858 if (! $installer->databaseNameIsValid($_REQUEST['dbname'])) {
859 $pass_step2_validation = false;
860 $error_step2_message .= "A database name is required <br>\n";
863 if (! $installer->collateNameIsValid($_REQUEST['collate'])) {
864 $pass_step2_validation = false;
865 $error_step2_message .= "A collation name is required <br>\n";
868 if (! $installer->char_is_valid($_REQUEST['login'])) {
869 $pass_step2_validation = false;
870 $error_step2_message .= "A database login name is required <br>\n";
873 if (! $installer->char_is_valid($_REQUEST['pass'])) {
874 $pass_step2_validation = false;
875 $error_step2_message .= "A database login password is required <br>\n";
878 if (!$pass_step2_validation) {
879 $error_step2_message .= $error_page_end . "\r\n";
880 die($error_step2_message);
884 if (empty($installer->clone_database)) {
885 if (! $installer->login_is_valid()) {
886 echo "$error. Please pick a proper 'Login Name'.<br>\n";
887 echo "Click Back in browser to re-enter.<br>\n";
891 if (! $installer->iuser_is_valid()) {
892 echo "$error. The 'Initial User' field can only contain one word and no spaces.<br>\n";
893 echo "Click Back in browser to re-enter.<br>\n";
897 if (! $installer->user_password_is_valid()) {
898 echo "$error. Please pick a proper 'Initial User Password'.<br>\n";
899 echo "Click Back in browser to re-enter.<br>\n";
904 if (! $installer->password_is_valid()) {
905 echo "$error. Please pick a proper 'Password'.<br>\n";
906 echo "Click Back in browser to re-enter.<br>\n";
911 echo "<legend>Step $state - Creating Database and First User</legend>";
913 // Skip below if database shell has already been created.
915 echo "Connecting to MySQL Server...\n";
917 if (! $installer->root_database_connection()) {
918 echo "$error. Check your login credentials.\n";
919 echo $installer->error_message;
927 // Only pertinent if cloning another installation database
928 if ($allow_cloning_setup && !empty($installer->clone_database)) {
929 echo "Dumping source database...";
931 if (! $installer->create_dumpfiles()) {
932 echo $installer->error_message;
940 // Only pertinent if mirroring another installation directory
941 if (! empty($installer->source_site_id)) {
942 echo "Creating site directory...";
943 if (! $installer->create_site_directory()) {
944 echo $installer->error_message;
952 // Skip below if database shell has already been created.
954 echo "Creating database...\n";
956 if (! $installer->create_database()) {
957 echo "$error. Check your login credentials.\n";
958 echo $installer->error_message;
965 echo "Creating user with permissions for database...\n";
967 $user_mysql_error = true;
968 if (! $installer->create_database_user()) {
969 echo "$error when creating specified user.\n";
970 echo $installer->error_message;
973 $user_mysql_error = false;
975 if (! $installer->grant_privileges()) {
976 echo "$error when granting privileges to the specified user.\n";
977 echo $installer->error_message;
980 $user_mysql_error = false;
982 if (!$user_mysql_error) {
987 echo "Reconnecting as new user...\n";
989 $installer->disconnect();
991 echo "Connecting to MySQL Server...\n";
994 if (! $installer->user_database_connection()) {
995 echo "$error. Check your login credentials.\n";
996 echo $installer->error_message;
1003 // Load the database files
1004 $dump_results = $installer->load_dumpfiles();
1005 if (! $dump_results) {
1007 echo $installer->error_message;
1014 echo "Writing SQL configuration...\n";
1016 if (! $installer->write_configuration_file()) {
1018 echo $installer->error_message;
1025 // Only pertinent if not cloning another installation database
1026 if (empty($installer->clone_database)) {
1027 echo "Setting version indicators...\n";
1029 if (! $installer->add_version_info()) {
1031 echo $installer->error_message;
1039 echo "Writing global configuration defaults...\n";
1041 if (! $installer->insert_globals()) {
1043 echo $installer->error_message;
1051 echo "Adding Initial User...\n";
1053 if (! $installer->add_initial_user()) {
1055 echo $installer->error_message;
1063 if ($allow_cloning_setup && !empty($installer->clone_database)) {
1064 // Database was cloned, skip ACL setup.
1065 $btn_text = 'Proceed to Final Step';
1067 echo "<p>The database was cloned, access control list exists therefore skipping ACL setup and skipping theme setup</p>";
1068 echo "<p class='bg-warning'>Click <b>$btn_text</b> for further instructions.</p>";
1071 $btn_text = 'Proceed to Step 4';
1073 echo "<p class='bg-warning'>Click <b>$btn_text</b> to install and configure access controls (php-GACL). $note: This process will take a few minutes.</p>";
1074 echo "<p class='bg-success oe-spinner' style = 'visibility:hidden;'>Upon successful completion will automatically take you to the next step.<i class='fa fa-spinner fa-pulse fa-fw'></i></p>";
1078 $form_top = <<<FRMTOP
1079 <form method='post'>
1080 <input name='state' type='hidden' value='$next_state'>
1081 <input name='site' type='hidden' value='$site_id'>
1082 <input name='iuser' type='hidden' value='{$installer->iuser}'>
1083 <input name='iuserpass' type='hidden' value='{$installer->iuserpass}'>
1084 <input name='iuname' type='hidden' value='{$installer->iuname}'>
1085 <input name='iufname' type='hidden' value='{$installer->iufname}'>
1086 <input name='login' type='hidden' value='{$installer->login}'>
1087 <input name='pass' type='hidden' value='{$installer->pass}'>
1088 <input name='server' type='hidden' value='{$installer->server}'>
1089 <input name='port' type='hidden' value='{$installer->port}'>
1090 <input name='loginhost' type='hidden' value='{$installer->loginhost}'>
1091 <input name='dbname' type='hidden' value='{$installer->dbname}'>
1093 echo $form_top . "\r\n";
1094 if ($allow_cloning_setup) {
1095 echo "<input type='hidden' name='clone_database' value='$installer->clone_database'>";
1097 $form_bottom = <<<FRMBOT
1098 <button type='submit' id='step-4-btn' value='Continue' class='wait'><b>$btn_text</b></button>
1103 echo $form_bottom . "\r\n";
1106 $step4_top = <<<STP4TOP
1108 <legend>Step $state - Creating and Configuring Access Control List</legend>
1109 <p>Installing and Configuring Access Controls (php-GACL)...</p><br>
1111 echo $step4_top . "\r\n";
1112 if (! $installer->install_gacl()) {
1114 echo $installer->error_message;
1117 // display the status information for gacl setup
1118 echo $installer->debug_message;
1120 $btn_text = 'Proceed to Step 5';
1121 $step4_bottom = <<<STP4BOT
1122 <p>Gave the '{$installer->iuser}' user (password is '{$installer->iuserpass}') administrator access.</p>
1123 <p>Done installing and configuring access controls (php-gacl).</p>
1124 <p>The next step will configure php.</p>
1125 <p class='bg-warning'>Click <strong>$btn_text</strong> to continue.</p>
1127 <form method='post'>
1128 <input name='state' type='hidden' value='5'>
1129 <input name='site' type='hidden' value='$site_id'>
1130 <input name='iuser' type='hidden' value='{$installer->iuser}'>
1131 <input name='iuserpass' type='hidden' value='{$installer->iuserpass}'>
1132 <input name='login' type='hidden' value='{$installer->login}'>
1133 <input name='pass' type='hidden' value='{$installer->pass}'>
1134 <input name='server' type='hidden' value='{$installer->server}'>
1135 <input name='port' type='hidden' value='{$installer->port}'>
1136 <input name='loginhost' type='hidden' value='{$installer->loginhost}'>
1137 <input name='dbname' type='hidden' value='{$installer->dbname}'>
1138 <button type='submit' value='Continue'><b>$btn_text</b></button>
1142 echo $step4_bottom . "\r\n";
1146 $step5_top = <<<STP5TOP
1148 <legend>Step $state - Configure PHP</legend>
1149 <p>Configuration of PHP...</p><br>
1150 <p>We recommend making the following changes to your PHP installation, which can normally be done by editing the php.ini configuration file:</p>
1153 echo $step5_top . "\r\n";
1155 if (version_compare(PHP_VERSION, '5.2.4', '>=')) {
1156 $phpINIfile = php_ini_loaded_file();
1158 echo "<li><font color='green'>Your php.ini file can be found at ".$phpINIfile."</font></li>\n";
1163 $short_tag = ini_get('short_open_tag')?'On':'Off';
1164 $display_errors = ini_get('display_errors')?'On':'Off';
1165 $register_globals = ini_get('register_globals')?'On':'Off';
1166 $max_input_vars = ini_get('max_input_vars');
1167 $max_execution_time = ini_get('max_execution_time');
1168 $max_input_time = ini_get('max_input_time');
1169 $post_max_size = ini_get('post_max_size');
1170 $memory_limit = ini_get('memory_limit');
1172 $step5_table = <<<STP5TAB
1173 <li>To ensure proper functioning of OpenEMR you must make sure that PHP settings include:
1174 <table class='phpset'>
1177 <th>Required value</th>
1178 <th>Current value</th>
1181 <td>short_open_tag</td>
1186 <td>display_errors</td>
1188 <td>$display_errors</td>
1191 <td>register_globals</td>
1193 <td>$register_globals</td>
1196 <td>max_input_vars</td>
1197 <td>at least 3000</td>
1198 <td>$max_input_vars</td>
1201 <td>max_execution_time</td>
1202 <td>at least 60</td>
1203 <td>$max_execution_time</td>
1206 <td>max_input_time</td>
1208 <td>$max_input_time</td>
1211 <td>post_max_size</td>
1212 <td>at least 30M</td>
1213 <td>$post_max_size</td>
1216 <td>memory_limit</td>
1217 <td>at least 256M</td>
1218 <td>$memory_limit</td>
1222 <li>In order to take full advantage of the patient documents capability you must make sure that settings in php.ini file include "file_uploads = On", that "upload_max_filesize" is appropriate for your use and that "upload_tmp_dir" is set to a correct value that will work on your system.
1225 echo $step5_table . "\r\n";
1227 if (!$gotFileFlag) {
1228 echo "<li>If you are having difficulty finding your php.ini file, then refer to the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span STYLE='text-decoration: underline;'>'INSTALL'</span></a> manual for suggestions.</li>\n";
1231 $btn_text = 'Proceed to Step 6';
1232 $step5_bottom = <<<STP5BOT
1235 <p>We recommend you print these instructions for future reference.</p>
1236 <p>The next step will configure the Apache web server.</p>
1237 <p class='bg-warning'>Click <strong>$btn_text</strong> to continue.</p>
1239 <form method='post'>
1240 <input type='hidden' name='state' value='6'>
1241 <input type='hidden' name='site' value='$site_id'>
1242 <input type='hidden' name='iuser' value='{$installer->iuser}'>
1243 <input type='hidden' name='iuserpass' value='{$installer->iuserpass}'>
1244 <input name='login' type='hidden' value='{$installer->login}'>
1245 <input name='pass' type='hidden' value='{$installer->pass}'>
1246 <input name='server' type='hidden' value='{$installer->server}'>
1247 <input name='port' type='hidden' value='{$installer->port}'>
1248 <input name='loginhost' type='hidden' value='{$installer->loginhost}'>
1249 <input name='dbname' type='hidden' value='{$installer->dbname}'>
1250 <button type='submit' value='Continue'><b>$btn_text</b></button>
1254 echo $step5_bottom . "\r\n";
1259 echo "<legend>Step $state - Configure Apache Web Server</legend>";
1260 echo "<p>Configuration of Apache web server...</p><br>\n";
1261 echo "The <strong>\"".preg_replace("/${site_id}/", "*", realpath($docsDirectory))."\", \"".preg_replace("/${site_id}/", "*", realpath($billingDirectory))."\"</strong> and <strong>\"".preg_replace("/${site_id}/", "*", realpath($billingDirectory2))."\"</strong> directories contain patient information, and
1262 it is important to secure these directories. Additionally, some settings are required for the Zend Framework to work in OpenEMR. This can be done by pasting the below to end of your apache configuration file:<br><br>
1263 <Directory \"".realpath(dirname(__FILE__))."\"><br>
1264 AllowOverride FileInfo<br>
1265 </Directory><br>
1266 <Directory \"".realpath(dirname(__FILE__))."/sites\"><br>
1267 AllowOverride None<br>
1268 </Directory><br>
1269 <Directory \"".preg_replace("/${site_id}/", "*", realpath($docsDirectory))."\"><br>
1270 order deny,allow<br>
1271 Deny from all<br>
1272 </Directory><br>
1273 <Directory \"".preg_replace("/${site_id}/", "*", realpath($billingDirectory))."\"><br>
1274 order deny,allow<br>
1275 Deny from all<br>
1276 </Directory><br>
1277 <Directory \"".preg_replace("/${site_id}/", "*", realpath($billingDirectory2))."\"><br>
1278 order deny,allow<br>
1279 Deny from all<br>
1280 </Directory><br><br>";
1282 $btn_text = 'Proceed to Select a Theme';
1283 $step6_bottom = <<<STP6BOT
1284 <p>If you are having difficulty finding your apache configuration file, then refer to the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span style='text-decoration: underline;'>'INSTALL'</span></a> manual for suggestions.</p>
1285 <p>We recommend you print these instructions for future reference.</p>
1286 <p class='bg-warning'>Click <strong>'$btn_text'</strong> to select a theme.</p>
1288 <form method='post'>
1289 <input type='hidden' name='state' value='7'>
1290 <input type='hidden' name='site' value='$site_id'>
1291 <input type='hidden' name='iuser' value='{$installer->iuser}'>
1292 <input type='hidden' name='iuserpass' value='{$installer->iuserpass}'>
1293 <input name='login' type='hidden' value='{$installer->login}'>
1294 <input name='pass' type='hidden' value='{$installer->pass}'>
1295 <input name='server' type='hidden' value='{$installer->server}'>
1296 <input name='port' type='hidden' value='{$installer->port}'>
1297 <input name='loginhost' type='hidden' value='{$installer->loginhost}'>
1298 <input name='dbname' type='hidden' value='{$installer->dbname}'>
1299 <button type='submit' value='Continue'><b>$btn_text</b></button>
1303 echo $step6_bottom . "\r\n";
1308 echo "<legend>Step $state - Select a Theme</legend>";
1309 echo "<p>Select a theme for OpenEMR...</p><br>\n";
1310 $btn_text = "Proceed to Final Step";
1311 $installer->displaySelectedThemeDiv();
1312 $theme_form = <<<TMF
1314 <div class="col-sm-4 col-sm-offset-4">
1315 <form method='post'>
1316 <input type='hidden' name='state' value='8'>
1317 <input type='hidden' name='site' value='$site_id'>
1318 <input type='hidden' name='iuser' value='{$installer->iuser}'>
1319 <input type='hidden' name='iuserpass' value='{$installer->iuserpass}'>
1320 <input name='login' type='hidden' value='{$installer->login}'>
1321 <input name='pass' type='hidden' value='{$installer->pass}'>
1322 <input name='server' type='hidden' value='{$installer->server}'>
1323 <input name='port' type='hidden' value='{$installer->port}'>
1324 <input name='loginhost' type='hidden' value='{$installer->loginhost}'>
1325 <input name='dbname' type='hidden' value='{$installer->dbname}'>
1326 <input type='hidden' name='new_theme' id = 'new_theme' value='{$installer->getCurrentTheme()}'>
1327 <input name='clone_database' type='hidden' value='{$installer->clone_database}'>
1328 <h4>Select One:</h4>
1329 <div class="checkbox">
1330 <label><input type="checkbox" class="check" value="show_theme">Show More Themes</label>
1332 <div class="checkbox">
1333 <label><input type="checkbox" class="check" value="keep_current">Keep Current</label>
1335 <div class='hide_button' style="display:none;">
1336 <button type='submit' value='Continue' id='continue'>{$btn_text}</button>
1343 echo $theme_form ."\r\n";
1344 echo '<div class="row hideaway" style="display:none;">'."\r\n";
1345 echo '<div class="col-sm-12">'."\r\n";
1346 echo ' <h4>Select New Theme: <h5>(scroll down to view all)</h5></h4>'."\r\n";
1347 echo ' <br>'."\r\n";
1348 $installer->displayThemesDivs();
1355 <legend>Pre Install - Checking File and Directory Permissions</legend>
1356 <p><span class="text">Welcome to OpenEMR. This utility will step you through the installation and configuration of OpenEMR for your practice.</span></p>
1358 <li><span class="text">Before proceeding, be sure that you have a properly installed and configured MySQL server available, and a PHP configured webserver.</span></li>
1359 <li><span class="text mark">Detailed installation instructions can be found in the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span style='text-decoration: underline;'>'INSTALL'</span></a> manual file.</span></li>
1360 <li>If you are upgrading from a previous version, <strong>DO NOT</strong> use this script. Please read the <strong>'Upgrading'</strong> section found in the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span style='text-decoration: underline;'>'INSTALL'</span></a> manual file.
1365 if ($checkPermissions) {
1366 echo "<p>We will now ensure correct file and directory permissions before starting installation:</p>\n";
1367 echo "<FONT COLOR='green'>Ensuring following files are world-writable...</FONT><br>\n";
1369 foreach ($writableFileList as $tempFile) {
1370 if (is_writable($tempFile)) {
1371 echo "'".realpath($tempFile)."' file is <FONT COLOR='green'><b>ready</b></FONT>.<br>\n";
1373 echo "<p><FONT COLOR='red'>UNABLE</FONT> to open file '".realpath($tempFile)."' for writing.<br>\n";
1374 echo "(configure file permissions; see below for further instructions)</p>\n";
1379 if ($errorWritable) {
1380 $check_file = <<<CHKFILE
1381 <p style="font-color:red;">You can't proceed until all above files are ready (world-writable).</p>
1382 <p>In linux, recommend changing file permissions with the <strong>'chmod 666 filename'</strong> command.</p>
1383 <p class='bg-danger'>Fix above file permissions and then click the <strong>'Check Again'</strong> button to re-check files.</p>
1385 <form method='post'>
1386 <input type='hidden' name='site' value='$site_id'>
1387 <button type='submit' value='check again'><b>Check Again</b></button>
1390 echo $check_file . "\r\n";
1394 echo "<br><FONT COLOR='green'>Ensuring following directories have proper permissions...</FONT><br>\n";
1396 foreach ($writableDirList as $tempDir) {
1397 if (is_writable($tempDir)) {
1398 echo "'".realpath($tempDir)."' directory is <FONT COLOR='green'><b>ready</b></FONT>.<br>\r\n";
1400 echo "<p><FONT COLOR='red'>UNABLE</FONT> to open directory '".realpath($tempDir)."' for writing by web server.<br>\r\n";
1401 echo "(configure directory permissions; see below for further instructions)</p>\r\n";
1406 if ($errorWritable) {
1407 $check_directory = <<<CHKDIR
1408 <p style="font-color:red;">You can't proceed until all directories are ready.</p>
1409 <p>In linux, recommend changing owners of these directories to the web server. For example, in many linux OS's the web server user is 'apache', 'nobody', or 'www-data'. So if 'apache' were the web server user name, could use the command <strong>'chown -R apache:apache directory_name'</strong> command.</p>
1410 <p class='bg-warning'>Fix above directory permissions and then click the <strong>'Check Again'</strong> button to re-check directories.</p>
1412 <form method='post'>
1413 <input type='hidden' name='site' value='$site_id'>
1414 <button type='submit' value='check again'><b>Check Again</b></button>
1417 echo $check_directory . "\r\n";
1423 <p>All required files and directories have been verified.</p>
1424 <p class='bg-warning'>Click <b>Proceed to Step 1</b> to continue with a new installation.</p>
1425 <p class='bg-danger'>$caution: If you are upgrading from a previous version, <strong>DO NOT</strong> use this script. Please read the <strong>'Upgrading'</strong> section found in the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span style='text-decoration: underline;'>'INSTALL'</span></a> manual file.</p>
1427 <form method='post'>
1428 <input name='state' type='hidden' value='1'>
1429 <input name='site' type='hidden' value='$site_id'>
1430 <button type='submit' value='Continue'><b>Proceed to Step 1</b></button>
1435 echo "<br>Click to continue installation.<br>\n";
1447 </div><!--end of container div -->
1448 <?php $installer->setupHelpModal();?>
1451 $(document).ready(function() {
1452 $('.icon-tooltip').prop( "title", "Click to see more information").tooltip({
1458 $('.enter-details-tooltip').prop( "title", "Additional help to fill out this form is available by hovering over labels of each box and clicking on the dark blue help ? icon that is revealed. On mobile devices tap once on the label to reveal the help icon and tap on the icon to show the help section").tooltip();
1462 <script type = "text/javascript" >
1463 $(document).ready(function() {
1464 $("input[type='radio']").click(function() {
1465 var radioValue = $("input[name='stylesheet']:checked").val();
1466 var imgPath = "public/images/stylesheets/";
1467 var currStyle = $("#current_theme_title").text();
1468 var currStyleTitle = currStyle;
1469 currStyle = currStyle.replace(/\b\w/g, l => l.toLowerCase());
1470 currStyle = currStyle.split(" ");
1471 currStyle = currStyle.join("_");
1472 currStyle = "style_" + currStyle + ".png";
1474 var currThemeText = radioValue.split("_");
1475 currThemeText = currThemeText.join(" ");
1476 currThemeText = currThemeText.replace(/\b\w/g, l => l.toUpperCase());
1477 var styleSelected = confirm("You have selected style - " + currThemeText + "\n" + "Click OK to apply selection");
1478 if (styleSelected) {
1479 $("#current_theme").attr("src", imgPath + "style_" + radioValue + ".png");
1480 $("#current_theme_title").text(currThemeText);
1481 $("#new_theme").val("style_" + radioValue + ".css");
1483 $("#current_theme").attr("src", imgPath + currStyle);
1484 $("#current_theme_title").text(currStyleTitle);
1485 $(this).prop("checked", false);
1489 $('.check').click(function() {
1490 $('.check').not(this).prop('checked', false);
1491 if($('.check:checked').val() == 'show_theme'){
1492 $(".hideaway").show();
1493 } else if($('.check:checked').val() == 'keep_current'){
1494 $(".hideaway").hide();
1497 if($('.check').filter(':checked').length > 0) {
1498 $(".hide_button").show();
1500 $(".hide_button").hide();
1501 $(".hideaway").hide();
1504 $('.wait').removeClass('button-wait');
1506 $( "#create_db_button" ).hover(
1508 if ($('#pass' ).val().length > 11 && $('#iuserpass' ).val().length > 11 && $('#iuser' ).val().length > 11 ){
1510 $("button").click(function(){
1511 $(".oe-spinner").css("visibility", "visible");
1514 $('.wait').click(function(){
1515 $('.wait').addClass('button-wait');
1521 $("#step-4-btn").click(function(){
1522 $(".oe-spinner").css("visibility", "visible");
1523 $(this).addClass('button-wait');