From 8629b5d8672ee464ac6fd00ce10c51c2d0f06e7b Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 24 Oct 2017 20:43:28 +0200 Subject: [PATCH] refactoring --- lam/templates/delete.php | 4 ++-- lam/templates/schema/schema.php | 20 ++++++++++---------- lam/templates/upload/massBuildAccounts.php | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lam/templates/delete.php b/lam/templates/delete.php index ba8a99bd..9c478f10 100644 --- a/lam/templates/delete.php +++ b/lam/templates/delete.php @@ -70,7 +70,7 @@ if (!empty($_POST)) { $typeManager = new \LAM\TYPES\TypeManager(); -if (isset($_POST['type']) && ($typeManager->getConfiguredType($_POST['type']) == null)) { +if (isset($_POST['type']) && ($typeManager->getConfiguredType($_POST['type']) === null)) { logNewMessage(LOG_ERR, 'Invalid type: ' . $_POST['type']); die(); } @@ -78,7 +78,7 @@ if (isset($_POST['type']) && ($typeManager->getConfiguredType($_POST['type']) == if (isset($_GET['type']) && isset($_SESSION['delete_dn'])) { $typeId = $_GET['type']; $type = $typeManager->getConfiguredType($typeId); - if ($type == null) { + if ($type === null) { logNewMessage(LOG_ERR, 'Invalid type: ' . $type->getId()); die(); } diff --git a/lam/templates/schema/schema.php b/lam/templates/schema/schema.php index 6083823c..4fd1b2f1 100644 --- a/lam/templates/schema/schema.php +++ b/lam/templates/schema/schema.php @@ -142,7 +142,7 @@ if( $view == 'syntaxes' ) { echo "\n"; echo ""._('Description')."\n"; - echo "" . ( $attr->getDescription() == null ? '('._('No description').')' : $attr->getDescription() ). "\n"; + echo "" . ( $attr->getDescription() === null ? '('._('No description').')' : $attr->getDescription() ). "\n"; echo "\n\n"; echo "\n"; echo ""._('OID')."\n"; @@ -157,7 +157,7 @@ if( $view == 'syntaxes' ) { echo "\n"; echo ""._('Inherits from')."\n"; echo ""; - if( $attr->getSupAttribute()==null ) + if( $attr->getSupAttribute() === null ) echo '('._('none').')'; else echo "getSupAttribute() ) . "\">" . $attr->getSupAttribute() . "\n"; @@ -165,23 +165,23 @@ if( $view == 'syntaxes' ) { echo "\n"; echo ""._('Equality')."\n"; - echo "" . ( $attr->getEquality() == null ? '('._('not specified').')' : "getEquality()."\">".$attr->getEquality()."" ) . "\n"; + echo "" . ( $attr->getEquality() === null ? '('._('not specified').')' : "getEquality()."\">".$attr->getEquality()."" ) . "\n"; echo "\n\n"; echo "\n"; echo ""._('Ordering')."\n"; - echo "" . ( $attr->getOrdering()==null? '('._('not specified').')' : $attr->getOrdering() ) . "\n"; + echo "" . ( $attr->getOrdering() === null? '('._('not specified').')' : $attr->getOrdering() ) . "\n"; echo "\n\n"; echo "\n"; echo ""._('Substring Rule')."\n"; - echo "" . ( $attr->getSubstr()==null? '('._('not specified').')' : $attr->getSubstr() ) . "\n"; + echo "" . ( $attr->getSubstr() === null? '('._('not specified').')' : $attr->getSubstr() ) . "\n"; echo "\n\n"; echo "\n"; echo ""._('Syntax')."\n"; echo ""; - if( null != $attr->getType() ) { + if( null !== $attr->getType() ) { echo "getSyntaxOID() . "#" . $attr->getSyntaxOID(); echo "\">" . $attr->getType() . " (" . $attr->getSyntaxOID() . ")"; @@ -275,10 +275,10 @@ if( $view == 'syntaxes' ) { $counter++; $oid = htmlspecialchars( $rule->getOID() ); $desc = htmlspecialchars( $rule->getName() ); - if ( $viewvalue==null || $viewvalue==($rule->getName() )) { + if ( $viewvalue === null || $viewvalue==($rule->getName() )) { if( ! is_null( $viewvalue ) ) $viewed = true; - if( null != $rule->getDescription() ) + if( null !== $rule->getDescription() ) $desc .= ' (' . $rule->getDescription() . ')'; if( true === $rule->getIsObsolete() ) $desc .= ' ' . _('Obsolete') . ''; @@ -336,7 +336,7 @@ if( $view == 'syntaxes' ) {
$oclass ) { - if ( $viewvalue==null || 0 == strcasecmp( $viewvalue, $oclass->getName() ) ){ + if ( $viewvalue === null || 0 == strcasecmp( $viewvalue, $oclass->getName() ) ){ if( ! is_null( $viewvalue ) ) $viewed = true; ?> @@ -347,7 +347,7 @@ if( $view == 'syntaxes' ) {

: getDescription(); ?>

: getType(); ?>

- getIsObsolete() == true ) { ?> + getIsObsolete() === true ) { ?>

diff --git a/lam/templates/upload/massBuildAccounts.php b/lam/templates/upload/massBuildAccounts.php index f6bbe9f2..f2fa14d9 100644 --- a/lam/templates/upload/massBuildAccounts.php +++ b/lam/templates/upload/massBuildAccounts.php @@ -169,7 +169,7 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) { // check if values in unique columns are correct for ($i = 0; $i < sizeof($columns); $i++) { - if (isset($columns[$i]['unique']) && ($columns[$i]['unique'] == true) && isset($ids[$columns[$i]['name']])) { + if (isset($columns[$i]['unique']) && ($columns[$i]['unique'] === true) && isset($ids[$columns[$i]['name']])) { $colNumber = $ids[$columns[$i]['name']]; $values_given = array(); foreach ($data as $dataRow) {