minor fixes to template engine for now

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-19 20:38:29 +01:00
parent d654b18517
commit adc627ca4e
2 changed files with 4 additions and 3 deletions

View File

@@ -153,13 +153,13 @@ if ($action == '2fa_entercode') {
} }
} }
if ((hasUpdates($version) || hasDbUpdates($dbversion)) && $is_admin == false) { if ((\Froxlor\Froxlor::hasUpdates() || \Froxlor\Froxlor::hasDbUpdates()) && $is_admin == false) {
redirectTo('index.php'); redirectTo('index.php');
exit(); exit();
} }
if ($is_admin) { if ($is_admin) {
if (hasUpdates($version) || hasDbUpdates($dbversion)) { if (\Froxlor\Froxlor::hasUpdates() || \Froxlor\Froxlor::hasDbUpdates()) {
$stmt = Database::prepare("SELECT `loginname` AS `admin` FROM `" . TABLE_PANEL_ADMINS . "` $stmt = Database::prepare("SELECT `loginname` AS `admin` FROM `" . TABLE_PANEL_ADMINS . "`
WHERE `loginname`= :loginname WHERE `loginname`= :loginname
AND `change_serversettings` = '1'"); AND `change_serversettings` = '1'");
@@ -364,7 +364,7 @@ if ($action == '2fa_entercode') {
} }
$update_in_progress = ''; $update_in_progress = '';
if (hasUpdates($version) || hasDbUpdates($dbversion)) { if (\Froxlor\Froxlor::hasUpdates() || \Froxlor\Froxlor::hasDbUpdates()) {
$update_in_progress = $lng['update']['updateinprogress_onlyadmincanlogin']; $update_in_progress = $lng['update']['updateinprogress_onlyadmincanlogin'];
} }

View File

@@ -91,6 +91,7 @@ function _checkAndParseTpl($filename) {
// loop through template more than once in case we have an "if"-statement in another one // loop through template more than once in case we have an "if"-statement in another one
while (preg_match('/<if[ \t]*(.*)>(.*)(<\/if>|<else>(.*)<\/if>)/Uis', $templatefile)) { while (preg_match('/<if[ \t]*(.*)>(.*)(<\/if>|<else>(.*)<\/if>)/Uis', $templatefile)) {
$templatefile = preg_replace('/<if[ \t]*(.*)>(.*)(<\/if>|<else>(.*)<\/if>)/Uis', '".( ($1) ? ("$2") : ("$4") )."', $templatefile); $templatefile = preg_replace('/<if[ \t]*(.*)>(.*)(<\/if>|<else>(.*)<\/if>)/Uis', '".( ($1) ? ("$2") : ("$4") )."', $templatefile);
$templatefile = str_replace('\\\\', '\\', $templatefile);
} }
return $templatefile; return $templatefile;