From d2a07f697c27ba1845ed5cfd5f6e4dc4f9a2ac47 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 15 Oct 2019 16:15:12 +0200 Subject: [PATCH] refactoring --- lam/lib/config.inc | 2 +- lam/lib/modules/sambaSamAccount.inc | 2 +- lam/lib/modules/sambaSamAccount/sambaMungedDial.inc | 6 +++--- lam/templates/config/confmodules.php | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lam/lib/config.inc b/lam/lib/config.inc index 9d4c3109..c6e999aa 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -2585,7 +2585,7 @@ class LAMCfgMain { * @return boolean true if file was readable */ private function reload() { - if (is_file($this->conffile) == True) { + if (is_file($this->conffile)) { $file = @fopen($this->conffile, "r"); if (!$file) { return false; // abort if file is not readable diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index 93acf298..49b25d3b 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -1370,7 +1370,7 @@ class sambaSamAccount extends baseModule implements passwordService { elseif ($hr >= 24*7) { $hr = $hr - 24*7; } - $checkbox = new htmlInputCheckbox('lh_' . $hr, $hour[$hr] ? true : false); + $checkbox = new htmlInputCheckbox('lh_' . $hr, $hour[$hr]); $checkbox->alignment = htmlTable::ALIGN_CENTER; $boxes[$i % 24][floor($i/24)] = $checkbox; } diff --git a/lam/lib/modules/sambaSamAccount/sambaMungedDial.inc b/lam/lib/modules/sambaSamAccount/sambaMungedDial.inc index cdc2ba9f..f618b06f 100644 --- a/lam/lib/modules/sambaSamAccount/sambaMungedDial.inc +++ b/lam/lib/modules/sambaSamAccount/sambaMungedDial.inc @@ -261,7 +261,7 @@ class sambaMungedDial } $ctxField=""; - if($this->old_behavior==true) { + if($this->old_behavior) { $ctxField= substr(base64_decode($munge), (strlen(SAMBA_MUNGEDDIAL_FILEHEADER_OLD)) / 2); } else { $ctxField= substr(base64_decode($munge), (strlen(SAMBA_MUNGEDDIAL_FILEHEADER)+4) / 2); @@ -445,7 +445,7 @@ class sambaMungedDial */ function getShadow () { - if($this->old_behavior==true) { + if($this->old_behavior) { $result= substr($this->ctx['CtxCfgFlags1'], 1, 1); } else { $result= substr($this->ctx['CtxShadow'], 1, 1); @@ -457,7 +457,7 @@ class sambaMungedDial function setShadow ($checked, $value) { if ($checked) { - if($this->old_behavior==true) { + if($this->old_behavior) { // We need to reset the old setting $this->ctx['CtxCfgFlags1'][1]= sprintf('%1X', $value); } diff --git a/lam/templates/config/confmodules.php b/lam/templates/config/confmodules.php index 4e615ce4..36533657 100644 --- a/lam/templates/config/confmodules.php +++ b/lam/templates/config/confmodules.php @@ -329,7 +329,7 @@ function checkInput() { } // check dependencies $depends = check_module_depends($selected, getModulesDependencies($scope)); - if ($depends != false) { + if ($depends !== false) { for ($i = 0; $i < sizeof($depends); $i++) { $errors[] = array('ERROR', $type->getAlias(), _("Unsolved dependency:") . ' ' . $depends[$i][0] . " (" . $depends[$i][1] . ")"); @@ -337,7 +337,7 @@ function checkInput() { } // check conflicts $conflicts = check_module_conflicts($selected, getModulesDependencies($scope)); - if ($conflicts != false) { + if ($conflicts !== false) { for ($i = 0; $i < sizeof($conflicts); $i++) { $errors[] = array('ERROR', $type->getAlias(), _("Conflicting module:") . ' ' . $conflicts[$i][0] . " (" . $conflicts[$i][1] . ")");