From ecac40b93ed32783e072d27e05f7799a8fe3c6e7 Mon Sep 17 00:00:00 2001 From: Carsten Schmitz Date: Wed, 19 Jul 2017 11:23:15 +0200 Subject: [PATCH] Dev Proper error message when trying to dump the database and demo mode is activated --- application/controllers/admin/dumpdb.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/controllers/admin/dumpdb.php b/application/controllers/admin/dumpdb.php index 4672d3b6dd5..3e3099a4f81 100644 --- a/application/controllers/admin/dumpdb.php +++ b/application/controllers/admin/dumpdb.php @@ -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")); + } + } /**