refactoring

This commit is contained in:
Roland Gruber 2019-10-15 16:15:12 +02:00
parent 4128f703aa
commit d2a07f697c
4 changed files with 7 additions and 7 deletions

View File

@ -2585,7 +2585,7 @@ class LAMCfgMain {
* @return boolean true if file was readable * @return boolean true if file was readable
*/ */
private function reload() { private function reload() {
if (is_file($this->conffile) == True) { if (is_file($this->conffile)) {
$file = @fopen($this->conffile, "r"); $file = @fopen($this->conffile, "r");
if (!$file) { if (!$file) {
return false; // abort if file is not readable return false; // abort if file is not readable

View File

@ -1370,7 +1370,7 @@ class sambaSamAccount extends baseModule implements passwordService {
elseif ($hr >= 24*7) { elseif ($hr >= 24*7) {
$hr = $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; $checkbox->alignment = htmlTable::ALIGN_CENTER;
$boxes[$i % 24][floor($i/24)] = $checkbox; $boxes[$i % 24][floor($i/24)] = $checkbox;
} }

View File

@ -261,7 +261,7 @@ class sambaMungedDial
} }
$ctxField=""; $ctxField="";
if($this->old_behavior==true) { if($this->old_behavior) {
$ctxField= substr(base64_decode($munge), (strlen(SAMBA_MUNGEDDIAL_FILEHEADER_OLD)) / 2); $ctxField= substr(base64_decode($munge), (strlen(SAMBA_MUNGEDDIAL_FILEHEADER_OLD)) / 2);
} else { } else {
$ctxField= substr(base64_decode($munge), (strlen(SAMBA_MUNGEDDIAL_FILEHEADER)+4) / 2); $ctxField= substr(base64_decode($munge), (strlen(SAMBA_MUNGEDDIAL_FILEHEADER)+4) / 2);
@ -445,7 +445,7 @@ class sambaMungedDial
*/ */
function getShadow () function getShadow ()
{ {
if($this->old_behavior==true) { if($this->old_behavior) {
$result= substr($this->ctx['CtxCfgFlags1'], 1, 1); $result= substr($this->ctx['CtxCfgFlags1'], 1, 1);
} else { } else {
$result= substr($this->ctx['CtxShadow'], 1, 1); $result= substr($this->ctx['CtxShadow'], 1, 1);
@ -457,7 +457,7 @@ class sambaMungedDial
function setShadow ($checked, $value) function setShadow ($checked, $value)
{ {
if ($checked) { if ($checked) {
if($this->old_behavior==true) { if($this->old_behavior) {
// We need to reset the old setting // We need to reset the old setting
$this->ctx['CtxCfgFlags1'][1]= sprintf('%1X', $value); $this->ctx['CtxCfgFlags1'][1]= sprintf('%1X', $value);
} }

View File

@ -329,7 +329,7 @@ function checkInput() {
} }
// check dependencies // check dependencies
$depends = check_module_depends($selected, getModulesDependencies($scope)); $depends = check_module_depends($selected, getModulesDependencies($scope));
if ($depends != false) { if ($depends !== false) {
for ($i = 0; $i < sizeof($depends); $i++) { for ($i = 0; $i < sizeof($depends); $i++) {
$errors[] = array('ERROR', $type->getAlias(), _("Unsolved dependency:") . ' ' . $errors[] = array('ERROR', $type->getAlias(), _("Unsolved dependency:") . ' ' .
$depends[$i][0] . " (" . $depends[$i][1] . ")"); $depends[$i][0] . " (" . $depends[$i][1] . ")");
@ -337,7 +337,7 @@ function checkInput() {
} }
// check conflicts // check conflicts
$conflicts = check_module_conflicts($selected, getModulesDependencies($scope)); $conflicts = check_module_conflicts($selected, getModulesDependencies($scope));
if ($conflicts != false) { if ($conflicts !== false) {
for ($i = 0; $i < sizeof($conflicts); $i++) { for ($i = 0; $i < sizeof($conflicts); $i++) {
$errors[] = array('ERROR', $type->getAlias(), _("Conflicting module:") . ' ' . $errors[] = array('ERROR', $type->getAlias(), _("Conflicting module:") . ' ' .
$conflicts[$i][0] . " (" . $conflicts[$i][1] . ")"); $conflicts[$i][0] . " (" . $conflicts[$i][1] . ")");