Skip to content

Commit

Permalink
Dev Proper error message when trying to dump the database and demo mo…
Browse files Browse the repository at this point in the history
…de is activated
  • Loading branch information
c-schmitz committed Jul 19, 2017
1 parent 43c6833 commit ecac40b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion application/controllers/admin/dumpdb.php
Expand Up @@ -29,10 +29,16 @@ function __construct($controller, $id)
die();
}

if (!in_array(Yii::app()->db->getDriverName(), array('mysql', 'mysqli')) || Yii::app()->getConfig('demoMode') == true)
if (!in_array(Yii::app()->db->getDriverName(), array('mysql', 'mysqli')))
{
die(sprintf(gT('This feature is only available for MySQL databases. Your database type is %s.'),Yii::app()->db->getDriverName()));
}
if (Yii::app()->getConfig('demoMode'))
{
Yii::app()->setFlashMessage(gT('This function cannot be executed because demo mode is active.'),'error');
$this->getController()->redirect(Yii::app()->getController()->createUrl("/admin/homepagesettings"));
}

}

/**
Expand Down

0 comments on commit ecac40b

Please sign in to comment.