Skip to content

Commit

Permalink
Convert DEMO_INSTALLATION from integer to boolean
Browse files Browse the repository at this point in the history
There's a report that someone's getting an undefined constant error
related to DEMO_INSTALLATION, and I have a feeling it has something to
do with it being defined as 0 when it's not being defined on the demo
URL. To eliminate this possibility I'm converting it from an integer to
a boolean.
  • Loading branch information
chetcuti committed Feb 4, 2019
1 parent 3dfc09e commit 4aa4583
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions _includes/config-demo.inc.php
Expand Up @@ -22,10 +22,10 @@
<?php
if ($_SERVER['HTTP_HOST'] == 'demo.domainmod.org') {

define('DEMO_INSTALLATION', 1);
define('DEMO_INSTALLATION', true);

} else {

define('DEMO_INSTALLATION', 0);
define('DEMO_INSTALLATION', false);

}
2 changes: 1 addition & 1 deletion admin/dw/rebuild.php
Expand Up @@ -48,7 +48,7 @@
<body class="hold-transition skin-red sidebar-mini">
<?php require_once DIR_INC . '/layout/header.inc.php'; ?>
<?php
if (DEMO_INSTALLATION !== 1) {
if (DEMO_INSTALLATION === false) {

$result_message = $dw->build();

Expand Down
4 changes: 2 additions & 2 deletions admin/scheduler/run.php
Expand Up @@ -44,7 +44,7 @@

$id = $_GET['id'];

if (DEMO_INSTALLATION !== 1) {
if (DEMO_INSTALLATION === false) {

$stmt = $pdo->prepare("
SELECT `name`, slug, expression, active
Expand Down Expand Up @@ -193,7 +193,7 @@

} else {

if (DEMO_INSTALLATION === 1) {
if (DEMO_INSTALLATION === true) {

$_SESSION['s_message_danger'] .= "Tasks Disabled in Demo Mode";

Expand Down
2 changes: 1 addition & 1 deletion cron.php
Expand Up @@ -39,7 +39,7 @@

$pdo = $deeb->cnxx;

if (DEMO_INSTALLATION !== 1) {
if (DEMO_INSTALLATION === false) {

$pdo->query("UPDATE scheduler SET is_running = '0'");

Expand Down
4 changes: 2 additions & 2 deletions index.php
Expand Up @@ -139,7 +139,7 @@
<?php
echo $form->showFormTop('');

if (DEMO_INSTALLATION === 1) { ?>
if (DEMO_INSTALLATION === true) { ?>
<strong>Demo Username:</strong> demo<BR>
<strong>Demo Password:</strong> demo<BR><BR><?php
}
Expand All @@ -149,7 +149,7 @@
echo $form->showSubmitButton('Login', '', '');
echo $form->showFormBottom('');

if (DEMO_INSTALLATION !== 1) { ?>
if (DEMO_INSTALLATION === false) { ?>

<BR><a href="reset.php">Forgot your Password?</a><?php

Expand Down

0 comments on commit 4aa4583

Please sign in to comment.