From 93e69bfb4cec84a4c29f0ff0a31915d347122d48 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 18 Sep 2017 19:39:08 +0200 Subject: [PATCH] refactoring --- lam/templates/login.php | 2 +- lam/templates/ou_edit.php | 2 +- lam/templates/pdfedit/pdfmain.php | 10 +++++----- lam/templates/profedit/profilemain.php | 10 +++++----- lam/templates/profedit/profilepage.php | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lam/templates/login.php b/lam/templates/login.php index d63603d5..155d822e 100644 --- a/lam/templates/login.php +++ b/lam/templates/login.php @@ -591,7 +591,7 @@ if(!empty($_POST['checklogin'])) { $searchFilter = str_replace('%USER%', $username ,$searchFilter); $searchDN = ''; $searchPassword = ''; - if (($_SESSION['config']->getLoginSearchDN() != null) && ($_SESSION['config']->getLoginSearchDN() != '')) { + if (!empty($_SESSION['config']->getLoginSearchDN())) { $searchDN = $_SESSION['config']->getLoginSearchDN(); $searchPassword = $_SESSION['config']->getLoginSearchPassword(); } diff --git a/lam/templates/ou_edit.php b/lam/templates/ou_edit.php index 03fa0b93..f4b6de9a 100644 --- a/lam/templates/ou_edit.php +++ b/lam/templates/ou_edit.php @@ -81,7 +81,7 @@ if (isset($_POST['createOU']) || isset($_POST['deleteOU'])) { // check if ou already exists $new_dn = "ou=" . $_POST['newOU'] . "," . $_POST['parentOU']; $found = ldapGetDN($new_dn); - if ($found == null) { + if ($found === null) { // add new ou $ou = array(); $ou['objectClass'] = "organizationalunit"; diff --git a/lam/templates/pdfedit/pdfmain.php b/lam/templates/pdfedit/pdfmain.php index 5d27b88e..a5d64764 100644 --- a/lam/templates/pdfedit/pdfmain.php +++ b/lam/templates/pdfedit/pdfmain.php @@ -142,7 +142,7 @@ if (!empty($_POST['import'])) { } $errMessage = importStructures($_POST['typeId'], $options, $serverProfiles, $typeManager); } - if ($errMessage != null) { + if ($errMessage !== null) { $errMessage->colspan = 10; $container->addElement($errMessage, true); } @@ -167,7 +167,7 @@ if (!empty($_POST['export'])) { $name = $_POST['name_' . $typeId]; $errMessage = exportStructures($typeId, $name, $options, $serverProfiles, $typeManager); } - if ($errMessage != null) { + if ($errMessage !== null) { $errMessage->colspan = 10; $container->addElement($errMessage, true); } @@ -437,7 +437,7 @@ function importStructures($typeId, $options, &$serverProfiles, TypeManager &$typ $sourceTypeManager = new TypeManager($serverProfiles[$sourceConfName]); $sourceType = $sourceTypeManager->getConfiguredType($sourceTypeId); $targetType = $typeManager->getConfiguredType($typeId); - if (($sourceType != null) && ($targetType != null)) { + if (($sourceType !== null) && ($targetType !== null)) { try { \LAM\PDF\copyStructure($sourceType, $sourceName, $targetType); } @@ -461,7 +461,7 @@ function importStructures($typeId, $options, &$serverProfiles, TypeManager &$typ */ function exportStructures($typeId, $name, $options, &$serverProfiles, TypeManager &$typeManager) { $sourceType = $typeManager->getConfiguredType($typeId); - if ($sourceType == null) { + if ($sourceType === null) { return null; } foreach ($options as $option) { @@ -478,7 +478,7 @@ function exportStructures($typeId, $name, $options, &$serverProfiles, TypeManage $targetTypeId = $option['typeId']; $targetTypeManager = new TypeManager($serverProfiles[$targetConfName]); $targetType = $targetTypeManager->getConfiguredType($targetTypeId); - if ($targetType != null) { + if ($targetType !== null) { try { \LAM\PDF\copyStructure($sourceType, $name, $targetType); } diff --git a/lam/templates/profedit/profilemain.php b/lam/templates/profedit/profilemain.php index cb7d41ad..983abd12 100644 --- a/lam/templates/profedit/profilemain.php +++ b/lam/templates/profedit/profilemain.php @@ -159,7 +159,7 @@ if (!empty($_POST['import'])) { } $errMessage = importProfiles($_POST['typeId'], $options, $serverProfiles, $typeManager); } - if ($errMessage != null) { + if ($errMessage !== null) { $errMessage->colspan = 10; $container->addElement($errMessage, true); } @@ -182,7 +182,7 @@ if (!empty($_POST['export'])) { $name = $_POST['name_' . $typeId]; $errMessage = exportProfiles($typeId, $name, $options, $serverProfiles, $typeManager); } - if ($errMessage != null) { + if ($errMessage !== null) { $errMessage->colspan = 10; $container->addElement($errMessage, true); } @@ -397,7 +397,7 @@ function importProfiles($typeId, $options, &$serverProfiles, TypeManager &$typeM $sourceTypeManager = new TypeManager($serverProfiles[$sourceConfName]); $sourceType = $sourceTypeManager->getConfiguredType($sourceTypeId); $targetType = $typeManager->getConfiguredType($typeId); - if (($sourceType != null) && ($targetType != null)) { + if (($sourceType !== null) && ($targetType !== null)) { try { \LAM\PROFILES\copyAccountProfile($sourceType, $sourceName, $targetType); } @@ -421,7 +421,7 @@ function importProfiles($typeId, $options, &$serverProfiles, TypeManager &$typeM */ function exportProfiles($typeId, $name, $options, &$serverProfiles, TypeManager &$typeManager) { $sourceType = $typeManager->getConfiguredType($typeId); - if ($sourceType == null) { + if ($sourceType === null) { return null; } foreach ($options as $option) { @@ -438,7 +438,7 @@ function exportProfiles($typeId, $name, $options, &$serverProfiles, TypeManager $targetTypeId = $option['typeId']; $targetTypeManager = new TypeManager($serverProfiles[$targetConfName]); $targetType = $targetTypeManager->getConfiguredType($targetTypeId); - if ($targetType != null) { + if ($targetType !== null) { try { \LAM\PROFILES\copyAccountProfile($sourceType, $name, $targetType); } diff --git a/lam/templates/profedit/profilepage.php b/lam/templates/profedit/profilepage.php index 897223d3..98183007 100644 --- a/lam/templates/profedit/profilepage.php +++ b/lam/templates/profedit/profilepage.php @@ -229,7 +229,7 @@ for ($m = 0; $m < sizeof($modules); $m++) { if (sizeof($options[$modules[$m]]) < 1) continue; $module = new $modules[$m]($type->getScope()); $icon = $module->getIcon(); - if (($icon != null) && !(strpos($icon, 'http') === 0) && !(strpos($icon, '/') === 0)) { + if (!empty($icon) && !(strpos($icon, 'http') === 0) && !(strpos($icon, '/') === 0)) { $icon = '../../graphics/' . $icon; } $container = new htmlTable();