From dd9a825210ccd1eae6f6c10803771f5fa96a73d9 Mon Sep 17 00:00:00 2001 From: Thibault Dockx <dockx.thibault@gmail.com> Date: Mon, 18 Jul 2022 20:02:12 +0100 Subject: [PATCH] :sparkles: feat(1.3.1) - Return without space Return without space after declaration --- html/class_passwordRecovery.inc | 2 +- include/class_Combinations.inc | 2 +- include/class_IconTheme.inc | 2 +- include/class_acl.inc | 2 +- include/class_ldap.inc | 20 +++++++++---------- include/class_tests.inc | 6 +++--- include/class_userinfo.inc | 4 ++-- include/functions.inc | 2 +- .../class_password-methods-sasl.inc | 2 +- .../class_password-methods-smd5.inc | 2 +- .../class_password-methods-ssha.inc | 2 +- .../class_password-methods.inc | 4 ++-- .../attributes/class_BooleanAttribute.inc | 4 ++-- include/simpleplugin/class_Attribute.inc | 8 ++++---- include/simpleplugin/class_simplePlugin.inc | 2 +- plugins/addons/dashboard/class_dashBoard.inc | 2 +- 16 files changed, 33 insertions(+), 33 deletions(-) diff --git a/html/class_passwordRecovery.inc b/html/class_passwordRecovery.inc index b2e54a425..243279ab3 100644 --- a/html/class_passwordRecovery.inc +++ b/html/class_passwordRecovery.inc @@ -387,7 +387,7 @@ class passwordRecovery extends standAlonePage { $this->loginAttribute = $config->get_cfg_value('passwordRecoveryLoginAttribute', 'uid'); @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $config->get_cfg_value ('passwordRecoveryActivated'), "passwordRecoveryActivated"); - return($config->get_cfg_value('passwordRecoveryActivated') == "TRUE"); + return ($config->get_cfg_value('passwordRecoveryActivated') == "TRUE"); } function storeToken ($temp_password) diff --git a/include/class_Combinations.inc b/include/class_Combinations.inc index 73baca00e..65027c70e 100644 --- a/include/class_Combinations.inc +++ b/include/class_Combinations.inc @@ -67,7 +67,7 @@ class Combinations implements Iterator function valid () { - return($this->pos >= 0); + return ($this->pos >= 0); } protected function _next () diff --git a/include/class_IconTheme.inc b/include/class_IconTheme.inc index 7c5d56bb9..38f856e8d 100644 --- a/include/class_IconTheme.inc +++ b/include/class_IconTheme.inc @@ -70,7 +70,7 @@ class IconThemeDir { switch ($this->Type) { case 'Fixed': - return($this->Size == $size); + return ($this->Size == $size); default: case 'Threshold': case 'Scalable': diff --git a/include/class_acl.inc b/include/class_acl.inc index e327d51af..abe740340 100644 --- a/include/class_acl.inc +++ b/include/class_acl.inc @@ -63,7 +63,7 @@ class acl if ($pa == $pb) { return 0; } - return($pa < $pb ? -1 : 1); + return ($pa < $pb ? -1 : 1); } ); diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 4c90b6f7c..460013b8c 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -544,7 +544,7 @@ class LDAP } $r = @ldap_delete($this->cid, $deletedn); $this->error = @ldap_error($this->cid); - return($r ? $r : 0); + return ($r ? $r : 0); } else { $this->error = "Could not connect to LDAP server"; return ""; @@ -640,7 +640,7 @@ class LDAP } } $this->error = @ldap_error($this->cid); - return($r ? $r : 0); + return ($r ? $r : 0); } else { $this->error = "Could not connect to LDAP server"; return ""; @@ -693,7 +693,7 @@ class LDAP if (!$this->success()) { $this->error .= $this->makeReadableErrors($this->error, $attrs); } - return($r ? $r : 0); + return ($r ? $r : 0); } else { $this->error = "Could not connect to LDAP server"; return ""; @@ -716,7 +716,7 @@ class LDAP if (!$this->success()) { $this->error .= $this->makeReadableErrors($this->error, $attrs); } - return($r ? $r : 0); + return ($r ? $r : 0); } else { $this->error = "Could not connect to LDAP server"; return ""; @@ -924,7 +924,7 @@ class LDAP function hitSizeLimit () { /* LDAP_SIZELIMIT_EXCEEDED 0x04 */ - return($this->get_errno() == 0x04); + return ($this->get_errno() == 0x04); } function get_credentials ($url, $referrals = NULL) @@ -1067,7 +1067,7 @@ class LDAP /* Ignore version number */ } else { /* Line has ended */ - list($key, $value) = explode(':', $line, 2); + list ($key, $value) = explode(':', $line, 2); $value = trim($value); if (preg_match('/^:/', $value)) { $value = base64_decode(trim(substr($value, 1))); @@ -1235,7 +1235,7 @@ class LDAP /* Get list of objectclasses and fill array */ $nb = $attr[0]['subschemasubentry'][0]; $objectclasses = []; - $sr = ldap_read($this->cid, $nb, 'objectClass=*', ['objectclasses']); + $sr = ldap_read ($this->cid, $nb, 'objectClass=*', ['objectclasses']); $attrs = ldap_get_entries($this->cid, $sr); if (!isset($attrs[0])) { return []; @@ -1359,15 +1359,15 @@ class LDAP function get_naming_contexts ($server, $admin = '', $password = '') { /* Build LDAP connection */ - $ds = ldap_connect($server); + $ds = ldap_connect ($server); if (!$ds) { die ('Can\'t bind to LDAP. No check possible!'); } ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); - ldap_bind($ds, $admin, $password); + ldap_bind ($ds, $admin, $password); /* Get base to look for naming contexts */ - $sr = @ldap_read($ds, '', 'objectClass=*', ['namingContexts']); + $sr = @ldap_read ($ds, '', 'objectClass=*', ['namingContexts']); $attr = @ldap_get_entries($ds, $sr); return $attr[0]['namingcontexts']; diff --git a/include/class_tests.inc b/include/class_tests.inc index cd68bac8d..a943c9325 100644 --- a/include/class_tests.inc +++ b/include/class_tests.inc @@ -325,7 +325,7 @@ class tests $ar2 = explode(".", $ip2); $var2 = $ar2[0] * (16777216) + $ar2[1] * (65536) + $ar2[2] * (256) + $ar2[3]; - return($var1 < $var2); + return ($var1 < $var2); } } @@ -356,7 +356,7 @@ class tests $curr = $ad[0] * (16777216) + $ad[1] * (65536) + $ad[2] * (256) + $ad[3]; $last = $la[0] * (16777216) + $la[1] * (65536) + $la[2] * (256) + $la[3]; - return($first < $curr && $last > $curr); + return ($first < $curr && $last > $curr); } /* \brief Check if the specified IP address $address is inside the given network */ @@ -371,7 +371,7 @@ class tests $to = $to[0] * (16777216) + $to[1] * (65536) + $to[2] * (256) + $to[3]; $ad = $ad[0] * (16777216) + $ad[1] * (65536) + $ad[2] * (256) + $ad[3]; - return($ad >= $from && $ad <= $to); + return ($ad >= $from && $ad <= $to); } } diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index 51206f8b0..e7581b17f 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -332,7 +332,7 @@ class userinfo { $remove = (strpos($this->get_permissions($dn, $object.'/'.$class), 'd') !== FALSE); $read = (strpos($this->get_complete_category_acls($dn, $object), 'r') !== FALSE); - return($remove && $read); + return ($remove && $read); } @@ -994,7 +994,7 @@ class userinfo if (empty($this->ACLperPath)) { $this->loadACL(); } - return($this->get_permissions($config->current['BASE'], 'user/user') == 'rwcdm'); + return ($this->get_permissions($config->current['BASE'], 'user/user') == 'rwcdm'); } /* \brief Test if a plugin is blacklisted for this user (does not show up in the menu) diff --git a/include/functions.inc b/include/functions.inc index cffa023ff..d9741c86a 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -1017,7 +1017,7 @@ function strict_uid_mode () global $config; if (isset($config)) { - return($config->get_cfg_value('strictNamingRules') == 'TRUE'); + return ($config->get_cfg_value('strictNamingRules') == 'TRUE'); } return TRUE; } diff --git a/include/password-methods/class_password-methods-sasl.inc b/include/password-methods/class_password-methods-sasl.inc index a6255054b..2a618a64b 100644 --- a/include/password-methods/class_password-methods-sasl.inc +++ b/include/password-methods/class_password-methods-sasl.inc @@ -120,7 +120,7 @@ class passwordMethodsasl extends passwordMethod function need_password () { global $config; - return($config->get_cfg_value('forceSaslPasswordAsk', 'FALSE') == 'TRUE'); + return ($config->get_cfg_value('forceSaslPasswordAsk', 'FALSE') == 'TRUE'); } } ?> diff --git a/include/password-methods/class_password-methods-smd5.inc b/include/password-methods/class_password-methods-smd5.inc index c52a7b5b2..d5b0a8cef 100644 --- a/include/password-methods/class_password-methods-smd5.inc +++ b/include/password-methods/class_password-methods-smd5.inc @@ -67,7 +67,7 @@ class passwordMethodsmd5 extends passwordMethod $salt = substr($hash, 16); $hash = substr($hash, 0, 16); $nhash = pack('H*', md5($pwd . $salt)); - return($nhash == $hash); + return ($nhash == $hash); } /*! diff --git a/include/password-methods/class_password-methods-ssha.inc b/include/password-methods/class_password-methods-ssha.inc index 78e38d4dc..820efd749 100644 --- a/include/password-methods/class_password-methods-ssha.inc +++ b/include/password-methods/class_password-methods-ssha.inc @@ -83,7 +83,7 @@ class passwordMethodssha extends passwordMethod msg_dialog::display(_('Configuration error'), msgPool::missingext('mhash'), ERROR_DIALOG); return FALSE; } - return($nhash == $hash); + return ($nhash == $hash); } /*! diff --git a/include/password-methods/class_password-methods.inc b/include/password-methods/class_password-methods.inc index b789d5f7c..6a0929ff9 100644 --- a/include/password-methods/class_password-methods.inc +++ b/include/password-methods/class_password-methods.inc @@ -261,7 +261,7 @@ class passwordMethod */ function checkPassword ($pwd, $hash) { - return($hash == $this->generate_hash($pwd)); + return ($hash == $this->generate_hash($pwd)); } @@ -380,7 +380,7 @@ class passwordMethod global $config; if ($config->get_cfg_value("strictPasswordRules") == "TRUE") { // Do we have UTF8 characters in the password? - return($password == utf8_decode($password)); + return ($password == utf8_decode($password)); } return TRUE; diff --git a/include/simpleplugin/attributes/class_BooleanAttribute.inc b/include/simpleplugin/attributes/class_BooleanAttribute.inc index 0ab90d99c..8795e6696 100644 --- a/include/simpleplugin/attributes/class_BooleanAttribute.inc +++ b/include/simpleplugin/attributes/class_BooleanAttribute.inc @@ -61,7 +61,7 @@ class BooleanAttribute extends Attribute if ($this->isTemplate() && $this->isTemplatable() && ($value === '%askme%')) { return $value; } - return($value == $this->trueValue); + return ($value == $this->trueValue); } function loadPostValue () @@ -86,7 +86,7 @@ class BooleanAttribute extends Attribute if ($this->isTemplate() && $this->isTemplatable() && ($this->value === '%askme%')) { return $this->value; } else { - return($this->value ? $this->trueValue : $this->falseValue); + return ($this->value ? $this->trueValue : $this->falseValue); } } diff --git a/include/simpleplugin/class_Attribute.inc b/include/simpleplugin/class_Attribute.inc index 37da6f591..fa4561e83 100644 --- a/include/simpleplugin/class_Attribute.inc +++ b/include/simpleplugin/class_Attribute.inc @@ -321,7 +321,7 @@ class Attribute function hasChanged () { - return($this->getValue() !== $this->initialValue); + return ($this->getValue() !== $this->initialValue); } function displayValue ($value) @@ -363,7 +363,7 @@ class Attribute if (isset($this->managedAttributesMultipleValues[$mavalue])) { return in_array($myvalue, $this->managedAttributesMultipleValues[$mavalue]); } else { - return($myvalue == $mavalue); + return ($myvalue == $mavalue); } } @@ -520,7 +520,7 @@ class Attribute ), function ($ou) { - return($ou !== FALSE); + return ($ou !== FALSE); } ); while ($attrs = $ldap->fetch()) { @@ -725,7 +725,7 @@ class Attribute function foreignKeyCheck ($value, $source) { - return($this->getValue() == $value); + return ($this->getValue() == $value); } protected function renderInputField ($type, $name, $attributes = []) diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc index f3c7e9c8d..3ebc773b1 100644 --- a/include/simpleplugin/class_simplePlugin.inc +++ b/include/simpleplugin/class_simplePlugin.inc @@ -902,7 +902,7 @@ class simplePlugin protected function acl_skip_write () { - return($this->needEditMode && !session::is_set('edit')); + return ($this->needEditMode && !session::is_set('edit')); } /*! \brief Can we write the attribute */ diff --git a/plugins/addons/dashboard/class_dashBoard.inc b/plugins/addons/dashboard/class_dashBoard.inc index 076c9ab93..57cd0f47d 100644 --- a/plugins/addons/dashboard/class_dashBoard.inc +++ b/plugins/addons/dashboard/class_dashBoard.inc @@ -109,7 +109,7 @@ class dashboard extends simplePlugin usort($stats, function ($a, $b) { - return($b['priority'] < $a['priority']); + return ($b['priority'] < $a['priority']); } ); -- GitLab