From e7a2d4d945cd2fa56837dcb7ac93e31280e944eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be> Date: Mon, 25 Feb 2019 17:18:39 +0100 Subject: [PATCH] :ambulance: fix(code) Code style fixes by php-cs-fixer Basic fixes like identation issue #5955 --- contrib/smarty/plugins/block.render.php | 3 +- contrib/smarty/plugins/function.filePath.php | 1 - contrib/smarty/plugins/function.iconPath.php | 1 - contrib/smarty/plugins/function.msgPool.php | 1 - html/autocomplete.php | 4 -- html/geticon.php | 1 - html/main.php | 2 +- html/progress.php | 1 - html/setup.php | 2 - include/accept-to-gettext.inc | 3 +- include/class_CSRFProtection.inc | 3 +- include/class_CopyPasteHandler.inc | 3 +- include/class_IconTheme.inc | 2 - include/class_SnapshotDialogs.inc | 1 - include/class_SnapshotHandler.inc | 1 - include/class_acl.inc | 6 +-- include/class_baseSelector.inc | 1 - include/class_config.inc | 3 -- include/class_departmentSortIterator.inc | 4 +- include/class_divSelectBox.inc | 1 - include/class_filter.inc | 19 ++++----- include/class_filterLDAP.inc | 1 - include/class_ldap.inc | 10 ++--- include/class_ldapMultiplexer.inc | 6 +-- include/class_listing.inc | 13 +++--- include/class_listingSortIterator.inc | 4 +- include/class_logging.inc | 4 +- include/class_msgPool.inc | 42 +++++++++---------- include/class_msg_dialog.inc | 4 +- include/class_objects.inc | 2 - include/class_passwordRecovery.inc | 2 - include/class_pluglist.inc | 3 +- include/class_session.inc | 4 +- include/class_standAlonePage.inc | 3 +- include/class_templateHandling.inc | 10 +++-- include/class_timezone.inc | 1 - include/class_userinfo.inc | 2 +- include/class_xml.inc | 9 ++-- include/exporter/class_PDF.php | 2 - include/exporter/class_csvExporter.inc | 3 -- include/exporter/class_pdfExporter.inc | 6 +-- include/functions.inc | 21 ++++------ include/functions_debug.inc | 29 +++++++------ include/login/class_LoginPost.inc | 1 - .../class_ManagementConfigurationDialog.inc | 1 - .../management/class_managementListing.inc | 2 +- .../class_password-methods-clear.inc | 2 - .../class_password-methods-crypt.inc | 13 +++--- .../class_password-methods-empty.inc | 1 - .../class_password-methods-md5.inc | 3 +- .../class_password-methods-sasl.inc | 1 - .../class_password-methods-sha.inc | 1 - .../class_password-methods-smd5.inc | 1 - .../class_password-methods-ssha.inc | 1 - .../class_password-methods.inc | 1 - include/php_setup.inc | 4 +- include/select/class_filterLDAPBlacklist.inc | 5 +-- .../select/groupSelect/class_groupSelect.inc | 1 - .../systemSelect/class_systemSelect.inc | 1 - .../class_BaseSelectorAttribute.inc | 2 +- .../attributes/class_BooleanAttribute.inc | 1 - .../attributes/class_SetAttribute.inc | 2 +- .../attributes/class_StringAttribute.inc | 6 +-- include/simpleplugin/class_Attribute.inc | 3 +- .../simpleplugin/class_dialogAttributes.inc | 1 - .../simpleplugin/class_helpersAttribute.inc | 2 - include/simpleplugin/class_multiPlugin.inc | 2 - .../simpleplugin/class_simpleManagement.inc | 1 - include/simpleplugin/class_simplePlugin.inc | 4 +- .../class_simpleSelectManagement.inc | 1 - include/simpleplugin/class_simpleTabs.inc | 1 - include/variables.inc | 2 - include/variables_common.inc | 2 - .../dashboard/class_dashboardPasswords.inc | 1 - .../addons/dashboard/class_dashboardUsers.inc | 1 - plugins/addons/dashboard/tabs_dashBoard.inc | 2 - .../admin/aclrole/class_aclEditionDialog.inc | 1 - plugins/admin/aclrole/class_aclRole.inc | 1 - plugins/admin/departments/class_country.inc | 1 - plugins/admin/departments/class_dcObject.inc | 1 - .../admin/departments/class_department.inc | 1 - plugins/admin/departments/class_domain.inc | 1 - plugins/admin/departments/class_locality.inc | 1 - .../admin/departments/class_organization.inc | 1 - plugins/admin/departments/tabs_department.inc | 1 - plugins/admin/groups/class_ogroup.inc | 1 - plugins/admin/groups/class_roleGeneric.inc | 7 ++-- plugins/admin/groups/tabs_ogroups.inc | 1 - plugins/config/class_configInLdap.inc | 1 - plugins/config/class_dashBoardConfig.inc | 1 - plugins/config/class_mainPluginsConfig.inc | 1 - plugins/config/class_recoveryConfig.inc | 1 - plugins/config/tabs_configInLdap.inc | 1 - plugins/personal/generic/class_user.inc | 1 - setup/class_setup.inc | 1 - setup/class_setupStep.inc | 1 - setup/class_setupStepChecks.inc | 6 +-- setup/class_setupStepFinish.inc | 1 - setup/class_setupStepLdap.inc | 1 - setup/class_setupStepMigrate.inc | 3 +- setup/class_setupStepWelcome.inc | 2 - 101 files changed, 120 insertions(+), 236 deletions(-) diff --git a/contrib/smarty/plugins/block.render.php b/contrib/smarty/plugins/block.render.php index 6e9914562..04d5b3c5f 100644 --- a/contrib/smarty/plugins/block.render.php +++ b/contrib/smarty/plugins/block.render.php @@ -33,7 +33,7 @@ function smarty_block_render ($params, $text) } /* Debug output */ - if (session::is_set('DEBUGLEVEL') && session::get('DEBUGLEVEL') & DEBUG_ACL ) { + if (session::is_set('DEBUGLEVEL') && session::get('DEBUGLEVEL') & DEBUG_ACL) { echo '<div style="color:blue;">'.$acl.(isset($params['aclName']) ? ' ['.$params['aclName'].']' : '').'</div>'; } @@ -75,4 +75,3 @@ function smarty_block_render ($params, $text) return preg_replace($from, $to, $text); } -?> diff --git a/contrib/smarty/plugins/function.filePath.php b/contrib/smarty/plugins/function.filePath.php index 856c3e92d..977349e4b 100644 --- a/contrib/smarty/plugins/function.filePath.php +++ b/contrib/smarty/plugins/function.filePath.php @@ -55,4 +55,3 @@ function smarty_function_filePath ($params, Smarty_Internal_Template $smarty) } return $filename; } -?> diff --git a/contrib/smarty/plugins/function.iconPath.php b/contrib/smarty/plugins/function.iconPath.php index 3866f0eb7..d87335bea 100644 --- a/contrib/smarty/plugins/function.iconPath.php +++ b/contrib/smarty/plugins/function.iconPath.php @@ -29,4 +29,3 @@ function smarty_function_iconPath ($params) return IconTheme::findThemeIcon($theme, $params['context'], $params['icon'], $params['size']); } -?> diff --git a/contrib/smarty/plugins/function.msgPool.php b/contrib/smarty/plugins/function.msgPool.php index 2b7baaf85..cb3e4ccac 100644 --- a/contrib/smarty/plugins/function.msgPool.php +++ b/contrib/smarty/plugins/function.msgPool.php @@ -36,4 +36,3 @@ function smarty_function_msgPool ($params) trigger_error('Unknown class msgPool.'); } } -?> diff --git a/html/autocomplete.php b/html/autocomplete.php index b34dd291c..87f677838 100644 --- a/html/autocomplete.php +++ b/html/autocomplete.php @@ -68,9 +68,7 @@ if (isset($_GET['type']) && $_GET['type'] == "base") { echo "<ul>$res</ul>"; } } - } else { - $ui = session::global_get('ui'); $config = session::global_get('config'); @@ -80,5 +78,3 @@ if (isset($_GET['type']) && $_GET['type'] == "base") { $filter->processAutocomplete(); } } - -?> diff --git a/html/geticon.php b/html/geticon.php index dbd9cf101..5807d6078 100644 --- a/html/geticon.php +++ b/html/geticon.php @@ -50,4 +50,3 @@ if (isset($_GET['disabled']) && $_GET['disabled']) { } else { readfile($src); } -?> diff --git a/html/main.php b/html/main.php index 3af25bf2f..2fea060b6 100644 --- a/html/main.php +++ b/html/main.php @@ -167,7 +167,7 @@ if (!empty($old_plugin_index) && ($old_plugin_index != $plugin_index)) { $ui->getSizeLimitHandler()->update(); /* Check for memory */ -if (memory_get_usage() > (to_byte(ini_get('memory_limit')) - 2048000 )) { +if (memory_get_usage() > (to_byte(ini_get('memory_limit')) - 2048000)) { msg_dialog::display(_("Configuration error"), _("Running out of memory!"), WARNING_DIALOG); } diff --git a/html/progress.php b/html/progress.php index 7b9aa68f8..8b247b80b 100644 --- a/html/progress.php +++ b/html/progress.php @@ -55,7 +55,6 @@ if (!function_exists("imagecreate")) { echo "Please install the php5-gd library, FusionDirectory can't create images without it."; exit(); } else { - $x_matches = FALSE; $y_matches = FALSE; foreach (array(7,6,5,4,3,2,1,0) as $font) { diff --git a/html/setup.php b/html/setup.php index 8e814b094..50112ffc6 100644 --- a/html/setup.php +++ b/html/setup.php @@ -130,5 +130,3 @@ if ($error_collector != "") { $smarty->assign("version", FD_VERSION); echo $header.$smarty->fetch("$BASE_DIR/setup/setup_frame.tpl"); - -?> diff --git a/include/accept-to-gettext.inc b/include/accept-to-gettext.inc index ebd6fa580..4bfa81061 100644 --- a/include/accept-to-gettext.inc +++ b/include/accept-to-gettext.inc @@ -165,7 +165,7 @@ function al2gt ($gettextlangs) } // if lang scores are equals we compare char scores - if (($lang_score > $max_l_score) + if (($lang_score > $max_l_score) || (($lang_score == $max_l_score) && ($char_score > $max_c_score))) { $max_l_score = $lang_score; $max_c_score = $char_score; @@ -179,4 +179,3 @@ function al2gt ($gettextlangs) return $max_lang; } -?> diff --git a/include/class_CSRFProtection.inc b/include/class_CSRFProtection.inc index bcca73bbc..695f93cad 100644 --- a/include/class_CSRFProtection.inc +++ b/include/class_CSRFProtection.inc @@ -58,8 +58,7 @@ class CSRFProtection if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) { /* Only take the first value, there may be several separated by commas */ list($target) = explode(',', $_SERVER['HTTP_X_FORWARDED_HOST'], 2); - } else - if (!empty($_SERVER['HTTP_HOST'])) { + } elseif (!empty($_SERVER['HTTP_HOST'])) { $target = $_SERVER['HTTP_HOST']; } if ($target && !hash_equals($origin, $target)) { diff --git a/include/class_CopyPasteHandler.inc b/include/class_CopyPasteHandler.inc index e84e649c9..9aaf90b87 100644 --- a/include/class_CopyPasteHandler.inc +++ b/include/class_CopyPasteHandler.inc @@ -187,7 +187,7 @@ class CopyPasteHandler $cut_acl = $ui->is_cutable($entry['dn'], $entry['aclCategory'], $entry['mainTab']); /* Check permissions */ - if ( (($entry['method'] == 'copy') && !$copy_acl) + if ((($entry['method'] == 'copy') && !$copy_acl) || (($entry['method'] == 'cut') && !$cut_acl)) { $this->disallowed_objects[$key] = $entry; } else { @@ -328,4 +328,3 @@ class CopyPasteHandler return $Copy_Paste; } } -?> diff --git a/include/class_IconTheme.inc b/include/class_IconTheme.inc index 2829381d4..e44ecbb3d 100644 --- a/include/class_IconTheme.inc +++ b/include/class_IconTheme.inc @@ -401,5 +401,3 @@ class IconTheme ), ); } - -?> diff --git a/include/class_SnapshotDialogs.inc b/include/class_SnapshotDialogs.inc index 4f61316f8..4aae53235 100644 --- a/include/class_SnapshotDialogs.inc +++ b/include/class_SnapshotDialogs.inc @@ -408,4 +408,3 @@ class SnapshotRestoreDialog extends simplePlugin { } } -?> diff --git a/include/class_SnapshotHandler.inc b/include/class_SnapshotHandler.inc index 700ce6dc4..a6723a0a2 100644 --- a/include/class_SnapshotHandler.inc +++ b/include/class_SnapshotHandler.inc @@ -402,4 +402,3 @@ class SnapshotHandler } } } -?> diff --git a/include/class_acl.inc b/include/class_acl.inc index e2312aa13..d3e63aebf 100644 --- a/include/class_acl.inc +++ b/include/class_acl.inc @@ -99,11 +99,11 @@ class acl { $list = explode(':', $acl); if (count($list) == 5) { - list($index, $type,$role,$members,$filter) = $list; + list($index, $type, $role, $members, $filter) = $list; $filter = base64_decode($filter); } else { $filter = ""; - list($index, $type,$role,$members) = $list; + list($index, $type, $role, $members) = $list; } $a = array( $index => array( @@ -214,11 +214,9 @@ class acl list($field, $facl) = explode(';', $ssacl); $a[$gobject][$field] = $facl; } - } } return $a; } } -?> diff --git a/include/class_baseSelector.inc b/include/class_baseSelector.inc index 139e20792..63ceaa13e 100644 --- a/include/class_baseSelector.inc +++ b/include/class_baseSelector.inc @@ -320,4 +320,3 @@ class baseSelector return $this->pathMapping; } } -?> diff --git a/include/class_config.inc b/include/class_config.inc index 1ef33e8f7..352aa207d 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -101,7 +101,6 @@ class config session::global_set('class_location.inc:timestamp', $tmp['mtime']); if (($this->filename != '') && ((filemtime($this->filename) != $this->last_modified) || $force)) { - $this->config_found = FALSE; $this->tags = array(); $this->level = 0; @@ -447,7 +446,6 @@ class config ); } } - } /* Check that configuration is in LDAP, check that no plugin got installed since last configuration update */ @@ -1126,4 +1124,3 @@ class config ); } } -?> diff --git a/include/class_departmentSortIterator.inc b/include/class_departmentSortIterator.inc index 37c4f5dd0..feea924d0 100644 --- a/include/class_departmentSortIterator.inc +++ b/include/class_departmentSortIterator.inc @@ -27,7 +27,8 @@ /*! * \brief This class contains all the function needed to sort department */ -class departmentSortIterator extends listingSortIterator { +class departmentSortIterator extends listingSortIterator +{ /*! * \brief departmentSortIterator constructor * @@ -40,4 +41,3 @@ class departmentSortIterator extends listingSortIterator { parent::__construct($data, $direction, 'sort-attribute', 'department'); } } -?> diff --git a/include/class_divSelectBox.inc b/include/class_divSelectBox.inc index d06e4dc15..affc4718a 100644 --- a/include/class_divSelectBox.inc +++ b/include/class_divSelectBox.inc @@ -217,4 +217,3 @@ class divSelectBox return $s_return; } } -?> diff --git a/include/class_filter.inc b/include/class_filter.inc index 99e8c7fbc..cd46381be 100644 --- a/include/class_filter.inc +++ b/include/class_filter.inc @@ -163,7 +163,7 @@ class filter "new Ajax.Autocompleter('$tag', 'autocomplete$tag', 'autocomplete.php', { minChars: $characters, frequency: $frequency });". "</script>"; - $this->autocompleters[$tag] = $element['autocomplete']; + $this->autocompleters[$tag] = $element['autocomplete']; } return $result; } @@ -265,13 +265,13 @@ class filter } } - /*! - * \brief Set a converter - * - * \param string $field - * - * \param string $hook - */ + /*! + * \brief Set a converter + * + * \param string $field + * + * \param string $hook + */ function setConverter ($field, $hook) { $this->converter[$field] = $hook; @@ -520,7 +520,6 @@ class filter $this->scope = (isset($_POST['SCOPE']) ? 'sub' : 'one'); } } - } /*! @@ -626,5 +625,3 @@ function strlenSort ($a, $b) } return (strlen($a['tag']) < strlen($b['tag']) ? -1 : 1); } - -?> diff --git a/include/class_filterLDAP.inc b/include/class_filterLDAP.inc index de08a9fc7..4aeb0f484 100644 --- a/include/class_filterLDAP.inc +++ b/include/class_filterLDAP.inc @@ -172,4 +172,3 @@ class filterLDAP return $result; } } -?> diff --git a/include/class_ldap.inc b/include/class_ldap.inc index d36c4a448..431723505 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -855,7 +855,6 @@ class LDAP msg_dialog::display(_('Internal error'), sprintf(_('Cannot automatically create subtrees with RDN "%s": not supported'), $type), FATAL_ERROR_DIALOG); exit(); } - } $this->cd($cdn); $this->add($na); @@ -981,16 +980,16 @@ class LDAP { // Ensure that limit is numeric if not skip here. if (!empty($limit) && !is_numeric($limit)) { - trigger_error(sprintf("Invalid parameter for limit '%s', a numeric value is required."), $limit); - return NULL; + trigger_error(sprintf("Invalid parameter for limit '%s', a numeric value is required."), $limit); + return NULL; } $limit = (!$limit) ? '' : ' -z '.$limit; // Check scope values $scope = trim($scope); if (!empty($scope) && !in_array($scope, array('base', 'one', 'sub', 'children'))) { - trigger_error(sprintf("Invalid parameter for scope '%s', please use 'base', 'one', 'sub' or 'children'."), $scope); - return NULL; + trigger_error(sprintf("Invalid parameter for scope '%s', please use 'base', 'one', 'sub' or 'children'."), $scope); + return NULL; } $scope = (!empty($scope)) ? ' -s '.$scope : ''; @@ -1305,7 +1304,6 @@ class LDAP default: $value .= $chunk.' '; } } - } if (class_available('session')) { session::global_set('LDAP_CACHE::get_objectclasses', $objectclasses); diff --git a/include/class_ldapMultiplexer.inc b/include/class_ldapMultiplexer.inc index 633fa40bb..2b3dd8ccc 100644 --- a/include/class_ldapMultiplexer.inc +++ b/include/class_ldapMultiplexer.inc @@ -28,7 +28,8 @@ /*! * \brief This class contains all function to manage ldap multiplexer */ -class ldapMultiplexer { +class ldapMultiplexer +{ /* Internal stuff */ protected $object; @@ -76,7 +77,4 @@ class ldapMultiplexer { { return $this->object->$memberName; } - } - -?> diff --git a/include/class_listing.inc b/include/class_listing.inc index 53ec6a14d..1e4913c8b 100644 --- a/include/class_listing.inc +++ b/include/class_listing.inc @@ -424,11 +424,11 @@ class listing foreach ($entryIterator as $row => $entry) { // Apply custom class to row? if (preg_match("/<rowClass:([a-z0-9_-]*)\/>/i", $entry['_rendered'], $matches)) { - $result .= "<tr class='".$matches[1]."'>\n"; - $result .= preg_replace("/<rowClass[^>]+>/", '', $entry['_rendered']); + $result .= "<tr class='".$matches[1]."'>\n"; + $result .= preg_replace("/<rowClass[^>]+>/", '', $entry['_rendered']); } else { - $result .= "<tr>\n"; - $result .= $entry['_rendered']; + $result .= "<tr>\n"; + $result .= $entry['_rendered']; } $result .= "</tr>\n"; @@ -510,7 +510,7 @@ class listing $this->baseSelector->update(); // Check if a wrong base was supplied if (!$this->baseSelector->checkLastBaseUpdate()) { - msg_dialog::display(_("Error"), msgPool::check_base(), ERROR_DIALOG); + msg_dialog::display(_("Error"), msgPool::check_base(), ERROR_DIALOG); } } @@ -1820,7 +1820,4 @@ class listing } return NULL; } - } - -?> diff --git a/include/class_listingSortIterator.inc b/include/class_listingSortIterator.inc index 571ff2c4b..1c9a77e9d 100644 --- a/include/class_listingSortIterator.inc +++ b/include/class_listingSortIterator.inc @@ -28,7 +28,8 @@ * \brief This class contains all the function needed to sort list * go up, go down , back , next. etc... */ -class listingSortIterator implements Iterator { +class listingSortIterator implements Iterator +{ protected $data; /*! @@ -172,4 +173,3 @@ class listingSortIterator implements Iterator { return (key($this->data) !== NULL); } } -?> diff --git a/include/class_logging.inc b/include/class_logging.inc index 80f375773..6df3e766c 100644 --- a/include/class_logging.inc +++ b/include/class_logging.inc @@ -33,7 +33,8 @@ * \version 2.6 * \date 11.04.2007 */ -class logging { +class logging +{ static $validActions = array('modify','create','remove','copy','snapshot','view','security','debug'); /*! @@ -157,4 +158,3 @@ class logging { } } } -?> diff --git a/include/class_msgPool.inc b/include/class_msgPool.inc index 4f20d3cc0..6bc4a0810 100644 --- a/include/class_msgPool.inc +++ b/include/class_msgPool.inc @@ -35,8 +35,8 @@ define("LDAP_AUTH", 6); /*! * \brief This class contains all the messages for the various actions */ -class msgPool { - +class msgPool +{ public static function selectToView ($type, $o_type = "") { if ($o_type == "") { @@ -50,7 +50,6 @@ class msgPool { } elseif ($o_type == "subsearch_small") { return _("Search in subtrees"); } - } /*! @@ -225,15 +224,15 @@ class msgPool { return sprintf(_("Cannot connect to %s database!"), $name).$error; } - /*! - * \brief Display informations about database select - * - * \param string $name Name of the database - * - * \param string $error Error messsage to display - * - * \param string $dbinfo Database information - */ + /*! + * \brief Display informations about database select + * + * \param string $name Name of the database + * + * \param string $error Error messsage to display + * + * \param string $dbinfo Database information + */ public static function dbselect ($name, $error = "", $dbinfo = "") { if ($error != "") { @@ -255,15 +254,15 @@ class msgPool { return sprintf(_("No %s server defined!"), $name); } - /*! - * \brief Display informations about database query - * - * \param string $name Name of the database - * - * \param string $error Error messsage to display - * - * \param string $dbinfo Database information - */ + /*! + * \brief Display informations about database query + * + * \param string $name Name of the database + * + * \param string $error Error messsage to display + * + * \param string $dbinfo Database information + */ public static function dbquery ($name, $error = "", $dbinfo = "") { if ($error != "") { @@ -856,4 +855,3 @@ class msgPool { return _("The supplied base is not valid and has been reset to the previous value!"); } } -?> diff --git a/include/class_msg_dialog.inc b/include/class_msg_dialog.inc index 061b17cd1..fa1fc86d7 100644 --- a/include/class_msg_dialog.inc +++ b/include/class_msg_dialog.inc @@ -162,7 +162,7 @@ class msg_dialog </head><body>'; if (isset($config) && is_object($config) && $config->get_cfg_value('displayerrors') == 'TRUE') { - list($trace,) = html_trace(); + list($trace, ) = html_trace(); $display .= $trace; } $display .= @@ -180,7 +180,6 @@ class msg_dialog </table></body></html>'; return $display; } else { - $smarty = get_smarty(); $smarty->assign('s_Trace', print_a($this->a_Trace, TRUE)); $smarty->assign('i_TraceCnt', count($this->a_Trace)); @@ -240,4 +239,3 @@ class msg_dialog return $return; } } -?> diff --git a/include/class_objects.inc b/include/class_objects.inc index 1528f454c..d9586b4fc 100644 --- a/include/class_objects.inc +++ b/include/class_objects.inc @@ -488,5 +488,3 @@ class objects return $templates; } } - -?> diff --git a/include/class_passwordRecovery.inc b/include/class_passwordRecovery.inc index a76a2d32f..4feb6489a 100644 --- a/include/class_passwordRecovery.inc +++ b/include/class_passwordRecovery.inc @@ -425,5 +425,3 @@ class passwordRecovery extends standAlonePage } } } - -?> diff --git a/include/class_pluglist.inc b/include/class_pluglist.inc index aaeec46bf..806fb5f78 100644 --- a/include/class_pluglist.inc +++ b/include/class_pluglist.inc @@ -31,7 +31,8 @@ * * \see class_plugin */ -class pluglist { +class pluglist +{ var $menu = ""; var $iconmenu = ""; var $current = ""; diff --git a/include/class_session.inc b/include/class_session.inc index f18d6d995..1b7863f79 100644 --- a/include/class_session.inc +++ b/include/class_session.inc @@ -27,7 +27,8 @@ /*! * \brief This class contains all the function needed to manage sessions */ -class session { +class session +{ /*! * \brief Check if the name of the session is set * @@ -257,4 +258,3 @@ class session { @session_destroy(); } } -?> diff --git a/include/class_standAlonePage.inc b/include/class_standAlonePage.inc index 082779989..42939609d 100644 --- a/include/class_standAlonePage.inc +++ b/include/class_standAlonePage.inc @@ -20,7 +20,8 @@ */ /* base class for passwordRecovery and such classes handling requests on their own */ -class standAlonePage { +class standAlonePage +{ protected $directories; protected $directory; protected $activated; diff --git a/include/class_templateHandling.inc b/include/class_templateHandling.inc index 127767c7f..c2cf79ed9 100644 --- a/include/class_templateHandling.inc +++ b/include/class_templateHandling.inc @@ -435,7 +435,8 @@ class templateHandling if (count($args) < 3) { $args[] = 1; } - $numberGenerator = function ($mandatory, $start, $step) { + $numberGenerator = function ($mandatory, $start, $step) + { if (!$mandatory) { yield ''; } @@ -609,7 +610,7 @@ class templateHandling $depends = array(); foreach ($attrs as $key => $values) { $depends[$key] = array(); - if (!is_array($values)) { + if (!is_array($values)) { $values = array($values); } unset ($values['count']); @@ -638,7 +639,8 @@ class templateHandling /*! \brief Sort attrs depending of dependencies */ protected static function sortAttributes (array $attrs, array $flatdepends) { - uksort($attrs, function ($k1, $k2) use ($flatdepends) { + uksort($attrs, function ($k1, $k2) use ($flatdepends) + { if (in_array($k1, $flatdepends[$k2])) { return -1; } elseif (in_array($k2, $flatdepends[$k1])) { @@ -648,7 +650,7 @@ class templateHandling $c1 = count($flatdepends[$k1]); $c2 = count($flatdepends[$k2]); if ($c1 == $c2) { - return 0; + return 0; } return (($c1 < $c2) ? -1 : 1); } diff --git a/include/class_timezone.inc b/include/class_timezone.inc index 3f481bb37..495151cdc 100644 --- a/include/class_timezone.inc +++ b/include/class_timezone.inc @@ -109,4 +109,3 @@ class timezone return $utc; } } -?> diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index 2d1a469d1..549873179 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -652,7 +652,7 @@ class userinfo * * \return array Return all accessible departments */ - function get_module_departments ($module, $skip_self_acls = FALSE ) + function get_module_departments ($module, $skip_self_acls = FALSE) { global $config; /* If we are forced to skip ACLs checks for the current user diff --git a/include/class_xml.inc b/include/class_xml.inc index 3dcb117c1..8a2c8acd0 100644 --- a/include/class_xml.inc +++ b/include/class_xml.inc @@ -28,7 +28,8 @@ * \brief This class contains all the function needed to manage xml * files */ -class xml { +class xml +{ /*! * \brief Transform a xml document to an array * @@ -110,7 +111,6 @@ class xml { $repeated_tag_index[$tag.'_'.$level] = 1; $current = &$current[$tag]; - } else { //There was another element with the same tag name if (isset($current[$tag][0])) {//If there is a 0th element it is already an array @@ -128,7 +128,6 @@ class xml { $last_item_index = $repeated_tag_index[$tag.'_'.$level] - 1; $current = &$current[$tag][$last_item_index]; } - } elseif ($type == "complete") { //Tags that ends in 1 line '<tag />' //See if the key is already taken. if (!isset($current[$tag])) { //New Key @@ -143,10 +142,9 @@ class xml { $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result; if ($priority == 'tag' and $get_attributes and $attributes_data) { - $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data; + $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data; } $repeated_tag_index[$tag.'_'.$level]++; - } else { //If it is not an array... $current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value $repeated_tag_index[$tag.'_'.$level] = 1; @@ -170,5 +168,4 @@ class xml { return $xml_array; } - } diff --git a/include/exporter/class_PDF.php b/include/exporter/class_PDF.php index 9b85ed242..68945f38f 100644 --- a/include/exporter/class_PDF.php +++ b/include/exporter/class_PDF.php @@ -61,5 +61,3 @@ class PDF extends FPDF $this->Cell(0, 10, _("Page")." ".$this->PageNo().'/{nb}', 0, 0, 'C'); } } - -?> diff --git a/include/exporter/class_csvExporter.inc b/include/exporter/class_csvExporter.inc index f4a6a1191..0389bbb32 100644 --- a/include/exporter/class_csvExporter.inc +++ b/include/exporter/class_csvExporter.inc @@ -117,7 +117,4 @@ class csvExporter { return array("exportCSV" => array( "label" => _("CSV"), "image" => "geticon.php?context=mimetypes&icon=text-csv&size=16", "class" => "csvExporter", "mime" => "text/x-csv", "filename" => "export.csv" )); } - } - -?> diff --git a/include/exporter/class_pdfExporter.inc b/include/exporter/class_pdfExporter.inc index a4f418782..6fa873295 100644 --- a/include/exporter/class_pdfExporter.inc +++ b/include/exporter/class_pdfExporter.inc @@ -106,7 +106,6 @@ class pdfExporter } foreach ($columns as $order => $index) { - if (isset($row["_sort$index"])) { $this->result->Cell($width[$order], 6, utf8_decode($row["_sort$index"]), 'LR', 0, 'L', $fill); } else { @@ -222,7 +221,7 @@ class pdfExporter */ function query () { - return $this->result->Output("", "S"); + return $this->result->Output("", "S"); } static function export (managementListing $listing) @@ -310,7 +309,4 @@ class pdfExporter return NULL; } } - } - -?> diff --git a/include/functions.inc b/include/functions.inc index 061fb7033..4a1df7444 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -90,7 +90,7 @@ function __fusiondirectory_autoload ($class_name) if ($class_mapping === NULL) { if (isset($config) && is_object($config) && $config->get_cfg_value('displayerrors') == 'TRUE') { - list($trace,) = html_trace(); + list($trace, ) = html_trace(); echo $trace; echo "<br/>\n"; } @@ -109,7 +109,7 @@ function __fusiondirectory_autoload ($class_name) @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $class_name, 'Could not load'); if (isset($config) && is_object($config) && $config->get_cfg_value('displayerrors') == 'TRUE') { - list($trace,) = html_trace(); + list($trace, ) = html_trace(); echo $trace; echo "<br/>\n"; } @@ -1026,15 +1026,13 @@ function gen_locked_message (array $locks, $dn, $allow_readonly = FALSE) $remove = FALSE; /* Save variables from LOCK_VARS_TO_USE in session - for further editing */ - if ( session::is_set('LOCK_VARS_TO_USE') && count(session::get('LOCK_VARS_TO_USE'))) { - + if (session::is_set('LOCK_VARS_TO_USE') && count(session::get('LOCK_VARS_TO_USE'))) { $LOCK_VARS_USED_GET = array(); $LOCK_VARS_USED_POST = array(); $LOCK_VARS_USED_REQUEST = array(); $LOCK_VARS_TO_USE = session::get('LOCK_VARS_TO_USE'); foreach ($LOCK_VARS_TO_USE as $name) { - if (empty($name)) { continue; } @@ -1309,7 +1307,6 @@ function to_byte ($value) $value = strtolower(trim($value)); if (!is_numeric(substr($value, -1))) { - switch (substr($value, -1)) { case 'g': $mult = 1073741824; @@ -2057,13 +2054,13 @@ function set_object_info ($str = "") */ function isIpInNet ($ip, $net, $mask) { - // Move to long ints - $ip = ip2long($ip); - $net = ip2long($net); - $mask = ip2long($mask); + // Move to long ints + $ip = ip2long($ip); + $net = ip2long($net); + $mask = ip2long($mask); - // Mask given IP with mask. If it returns "net", we're in... - return (($ip & $mask) == $net); + // Mask given IP with mask. If it returns "net", we're in... + return (($ip & $mask) == $net); } /*! diff --git a/include/functions_debug.inc b/include/functions_debug.inc index 7df84694d..f88b121b3 100644 --- a/include/functions_debug.inc +++ b/include/functions_debug.inc @@ -59,7 +59,8 @@ * based on the print_a() function from * Stephan Pirson (Saibot) */ -class printAClass { +class printAClass +{ // this can be changed to FALSE if you don't like the fancy string formatting var $look_for_leading_tabs = TRUE; @@ -117,14 +118,14 @@ class printAClass { } if (!$iteration && isset($this->export_flag)) { - $this->output .= '<form id="pa_form_'.$this->export_hash.'" action="'.$this->export_dumper_path.'?mode='.$this->export_flag.'" method="post" target="_blank"><input name="array" type="hidden" value="'.htmlspecialchars( serialize( $array ) ).'"></form>'; + $this->output .= '<form id="pa_form_'.$this->export_hash.'" action="'.$this->export_dumper_path.'?mode='.$this->export_flag.'" method="post" target="_blank"><input name="array" type="hidden" value="'.htmlspecialchars(serialize($array)).'"></form>'; } // lighten up the background color for the key td's =) if ($iteration) { for ($i = 0; $i < 6; $i += 2) { - $c = substr( $key_bg_color, $i, 2 ); - $c = hexdec( $c ); + $c = substr($key_bg_color, $i, 2); + $c = hexdec($c); $c += 15; if ($c > 255) { $c = 255; @@ -132,15 +133,14 @@ class printAClass { if (!isset($tmp_key_bg_color)) { $tmp_key_bg_color = ''; } - $tmp_key_bg_color .= sprintf( "%02X", $c ); + $tmp_key_bg_color .= sprintf("%02X", $c); } $key_bg_color = $tmp_key_bg_color; } // build a single table ... may be nested - $this->output .= '<table style="border:none;" '.( !$iteration && $this->export_flag ? 'onClick="document.getElementById(\'pa_form_'.$this->export_hash.'\').submit();" )' : '' ).'>'; + $this->output .= '<table style="border:none;" '.(!$iteration && $this->export_flag ? 'onClick="document.getElementById(\'pa_form_'.$this->export_hash.'\').submit();" )' : '').'>'; foreach ($array as $key => $value) { - $value_style = 'color:black;'; $key_style = 'color:white;'; @@ -171,7 +171,7 @@ class printAClass { if ($this->look_for_leading_tabs && preg_match('/^\t/m', $value)) { $search = array('/\t/', "/\n/"); $replace = array(' ','<br />'); - $value = preg_replace( $search, $replace, htmlspecialchars($value)); + $value = preg_replace($search, $replace, htmlspecialchars($value)); $value_style = 'color:black;border:1px gray dotted;'; } else { $value_style = 'color:black;'; @@ -186,7 +186,7 @@ class printAClass { } $this->output .= '<tr>'; - $this->output .= '<td nowrap align="'.$this->keyalign.'" style="background-color:#'.$key_bg_color.';'.$key_style.';font:bold '.$this->fontsize.' '.$this->fontfamily.';" title="'.gettype( $key ).'['.$type.']">'; + $this->output .= '<td nowrap align="'.$this->keyalign.'" style="background-color:#'.$key_bg_color.';'.$key_style.';font:bold '.$this->fontsize.' '.$this->fontfamily.';" title="'.gettype($key).'['.$type.']">'; $this->output .= $key; $this->output .= '</td>'; $this->output .= '<td nowrap="nowrap" style="background-color:#'.$this->value_bg_color.';font: '.$this->fontsize.' '.$this->fontfamily.'; color:black;">'; @@ -194,13 +194,13 @@ class printAClass { // value output if ($type == 'array') { if (count($value)) { - $this->print_a( $value, TRUE, $key_bg_color ); + $this->print_a($value, TRUE, $key_bg_color); } else { $this->output .= '<div style="color:blue;">Array (empty)</div>'; } } elseif ($type == 'object') { if ($this->show_object_vars) { - $this->print_a( get_object_vars( $value ), TRUE, $key_bg_color ); + $this->print_a(get_object_vars($value), TRUE, $key_bg_color); } else { $this->output .= '<div style="'.$value_style.'">OBJECT - '.get_class($value).'</div>'; } @@ -226,7 +226,7 @@ class printAClass { * * \param boolean $export_flag false */ -function print_a ($array, $return_mode = FALSE, $show_object_vars = FALSE, $export_flag = FALSE ) +function print_a ($array, $return_mode = FALSE, $show_object_vars = FALSE, $export_flag = FALSE) { $e = error_reporting(0); if (is_array($array) || is_object($array)) { @@ -242,7 +242,7 @@ function print_a ($array, $return_mode = FALSE, $show_object_vars = FALSE, $expo $output = &$pa->output; } else { - $output = '<span style="color:red;font-size:small;">print_a( '.gettype( $array ).' )</span>'; + $output = '<span style="color:red;font-size:small;">print_a( '.gettype($array).' )</span>'; } error_reporting($e); @@ -338,10 +338,9 @@ function show_vars ($show_all_vars = FALSE, $show_object_vars = FALSE) } if ($$vars_name) { print '<div class="vars-container" style="background-color:'.$vars_data[1].';"><span class="varsname">'.$vars_data[0].'</span><br />'; - print_a($$vars_name, FALSE, $show_object_vars, FALSE ); + print_a($$vars_name, FALSE, $show_object_vars, FALSE); print '</div>'; } } print '</div>'; } -?> diff --git a/include/login/class_LoginPost.inc b/include/login/class_LoginPost.inc index 7d89777c7..cb68c5eba 100644 --- a/include/login/class_LoginPost.inc +++ b/include/login/class_LoginPost.inc @@ -39,7 +39,6 @@ class LoginPost extends LoginMethod $smarty->assign('focusfield', 'username'); if (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['login']) && isset($_POST['username']) && isset($_POST['password'])) { - static::$username = $_POST['username']; static::$password = $_POST['password']; diff --git a/include/management/class_ManagementConfigurationDialog.inc b/include/management/class_ManagementConfigurationDialog.inc index 102cdfd3c..88d627797 100644 --- a/include/management/class_ManagementConfigurationDialog.inc +++ b/include/management/class_ManagementConfigurationDialog.inc @@ -20,7 +20,6 @@ class ManagementColumnAttribute extends CompositeAttribute { - function __construct ($label, $description, $ldapName, $attributes, $acl = "") { parent::__construct($description, $ldapName, $attributes, FALSE, FALSE, $acl, $label); diff --git a/include/management/class_managementListing.inc b/include/management/class_managementListing.inc index 37e39246f..ddbecec6f 100644 --- a/include/management/class_managementListing.inc +++ b/include/management/class_managementListing.inc @@ -227,7 +227,7 @@ class managementListing // Check if a wrong base was supplied if (!$this->baseSelector->checkLastBaseUpdate()) { - msg_dialog::display(_('Error'), msgPool::check_base(), ERROR_DIALOG); + msg_dialog::display(_('Error'), msgPool::check_base(), ERROR_DIALOG); } // Save base diff --git a/include/password-methods/class_password-methods-clear.inc b/include/password-methods/class_password-methods-clear.inc index 9a877f77b..cdfecd172 100644 --- a/include/password-methods/class_password-methods-clear.inc +++ b/include/password-methods/class_password-methods-clear.inc @@ -69,6 +69,4 @@ class passwordMethodClear extends passwordMethod { return "clear"; } - } -?> diff --git a/include/password-methods/class_password-methods-crypt.inc b/include/password-methods/class_password-methods-crypt.inc index 87984b1d3..12ba6f6bd 100644 --- a/include/password-methods/class_password-methods-crypt.inc +++ b/include/password-methods/class_password-methods-crypt.inc @@ -59,21 +59,21 @@ class passwordMethodCrypt extends passwordMethod if ($this->hash == "crypt/standard-des") { $salt = ""; for ($i = 0; $i < 2; $i++) { - $salt .= get_random_char(); + $salt .= get_random_char(); } } if ($this->hash == "crypt/enhanced-des") { $salt = "_"; for ($i = 0; $i < 8; $i++) { - $salt .= get_random_char(); + $salt .= get_random_char(); } } if ($this->hash == "crypt/md5") { $salt = "\$1\$"; for ($i = 0; $i < 8; $i++) { - $salt .= get_random_char(); + $salt .= get_random_char(); } $salt .= "\$"; } @@ -81,7 +81,7 @@ class passwordMethodCrypt extends passwordMethod if ($this->hash == "crypt/blowfish") { $salt = "\$2a\$07\$"; for ($i = 0; $i < CRYPT_SALT_LENGTH; $i++) { - $salt .= get_random_char(); + $salt .= get_random_char(); } $salt .= "\$"; } @@ -89,7 +89,7 @@ class passwordMethodCrypt extends passwordMethod if ($this->hash == "crypt/sha-256") { $salt = "\$5\$"; for ($i = 0; $i < 16; $i++) { - $salt .= get_random_char(); + $salt .= get_random_char(); } $salt .= "\$"; } @@ -97,7 +97,7 @@ class passwordMethodCrypt extends passwordMethod if ($this->hash == "crypt/sha-512") { $salt = "\$6\$"; for ($i = 0; $i < 16; $i++) { - $salt .= get_random_char(); + $salt .= get_random_char(); } $salt .= "\$"; } @@ -186,4 +186,3 @@ class passwordMethodCrypt extends passwordMethod return ""; } } -?> diff --git a/include/password-methods/class_password-methods-empty.inc b/include/password-methods/class_password-methods-empty.inc index 24c5c468a..bc75c17d0 100644 --- a/include/password-methods/class_password-methods-empty.inc +++ b/include/password-methods/class_password-methods-empty.inc @@ -90,4 +90,3 @@ class passwordMethodEmpty extends passwordMethod return ''; } } -?> diff --git a/include/password-methods/class_password-methods-md5.inc b/include/password-methods/class_password-methods-md5.inc index 7637e354b..bb910db53 100644 --- a/include/password-methods/class_password-methods-md5.inc +++ b/include/password-methods/class_password-methods-md5.inc @@ -56,7 +56,7 @@ class passwordMethodMd5 extends passwordMethod */ function generate_hash ($pwd, $locked = FALSE) { - return '{MD5}'.($locked ? '!' : '').base64_encode( pack('H*', md5($pwd))); + return '{MD5}'.($locked ? '!' : '').base64_encode(pack('H*', md5($pwd))); } /*! @@ -67,4 +67,3 @@ class passwordMethodMd5 extends passwordMethod return 'md5'; } } -?> diff --git a/include/password-methods/class_password-methods-sasl.inc b/include/password-methods/class_password-methods-sasl.inc index d0a2e898c..dcae829c1 100644 --- a/include/password-methods/class_password-methods-sasl.inc +++ b/include/password-methods/class_password-methods-sasl.inc @@ -123,4 +123,3 @@ class passwordMethodsasl extends passwordMethod return ($config->get_cfg_value('forceSaslPasswordAsk', 'FALSE') == 'TRUE'); } } -?> diff --git a/include/password-methods/class_password-methods-sha.inc b/include/password-methods/class_password-methods-sha.inc index af5acbc7d..f08802694 100644 --- a/include/password-methods/class_password-methods-sha.inc +++ b/include/password-methods/class_password-methods-sha.inc @@ -75,4 +75,3 @@ class passwordMethodsha extends passwordMethod return 'sha'; } } -?> diff --git a/include/password-methods/class_password-methods-smd5.inc b/include/password-methods/class_password-methods-smd5.inc index 9f3ab5b75..f367d8a21 100644 --- a/include/password-methods/class_password-methods-smd5.inc +++ b/include/password-methods/class_password-methods-smd5.inc @@ -77,4 +77,3 @@ class passwordMethodsmd5 extends passwordMethod return 'smd5'; } } -?> diff --git a/include/password-methods/class_password-methods-ssha.inc b/include/password-methods/class_password-methods-ssha.inc index f31f53b88..0bf55370c 100644 --- a/include/password-methods/class_password-methods-ssha.inc +++ b/include/password-methods/class_password-methods-ssha.inc @@ -93,4 +93,3 @@ class passwordMethodssha extends passwordMethod return 'ssha'; } } -?> diff --git a/include/password-methods/class_password-methods.inc b/include/password-methods/class_password-methods.inc index 7a822dcae..e7b0917c0 100644 --- a/include/password-methods/class_password-methods.inc +++ b/include/password-methods/class_password-methods.inc @@ -390,4 +390,3 @@ class passwordMethod return TRUE; } } -?> diff --git a/include/php_setup.inc b/include/php_setup.inc index da665fd58..a091892ea 100644 --- a/include/php_setup.inc +++ b/include/php_setup.inc @@ -94,7 +94,8 @@ function html_trace ($errstr = "") } else { $hideArgsIndexes = array(); } - $f = function ($index, $arg) use(&$f, $hideArgsIndexes) { + $f = function ($index, $arg) use (&$f, $hideArgsIndexes) + { static $i = 0; if (($i == 0) && in_array($index, $hideArgsIndexes)) { return '***'; @@ -354,4 +355,3 @@ $ssl = ''; if (!sslOn()) { $ssl = sslUrl(); } -?> diff --git a/include/select/class_filterLDAPBlacklist.inc b/include/select/class_filterLDAPBlacklist.inc index a6a5a0368..e2dbb0b18 100644 --- a/include/select/class_filterLDAPBlacklist.inc +++ b/include/select/class_filterLDAPBlacklist.inc @@ -23,8 +23,8 @@ /*! * \brief filterLDAP backend with blacklist/whitelist handling */ -class filterLDAPBlacklist { - +class filterLDAPBlacklist +{ static function query ($parent, $base, $scope, $filter, $attributes, $category, $objectStorage = "") { $result = filterLDAP::query($parent, $base, $scope, $filter, $attributes, $category, $objectStorage); @@ -70,4 +70,3 @@ class filterLDAPBlacklist { return array_values($entries); } } -?> diff --git a/include/select/groupSelect/class_groupSelect.inc b/include/select/groupSelect/class_groupSelect.inc index 9e9784b88..fa94786eb 100644 --- a/include/select/groupSelect/class_groupSelect.inc +++ b/include/select/groupSelect/class_groupSelect.inc @@ -33,4 +33,3 @@ class groupSelect extends simpleSelectManagement parent::__construct(); } } -?> diff --git a/include/select/systemSelect/class_systemSelect.inc b/include/select/systemSelect/class_systemSelect.inc index 1ee23b44a..c8d1a7faa 100644 --- a/include/select/systemSelect/class_systemSelect.inc +++ b/include/select/systemSelect/class_systemSelect.inc @@ -28,4 +28,3 @@ class systemSelect extends simpleSelectManagement 'terminal', 'workstation', 'server' ); } -?> diff --git a/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc b/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc index c8581d3fd..ea27f0e5e 100644 --- a/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc +++ b/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc @@ -121,7 +121,7 @@ class BaseSelectorAttribute extends Attribute function checkValue ($value) { - if (!is_string($value) && (!is_object($value) || !method_exists($value, '__toString' ))) { + if (!is_string($value) && (!is_object($value) || !method_exists($value, '__toString'))) { throw new InvalidValueException(_('Base field value should always be a string')); } } diff --git a/include/simpleplugin/attributes/class_BooleanAttribute.inc b/include/simpleplugin/attributes/class_BooleanAttribute.inc index 1fd7838ee..f355a9d9b 100644 --- a/include/simpleplugin/attributes/class_BooleanAttribute.inc +++ b/include/simpleplugin/attributes/class_BooleanAttribute.inc @@ -209,4 +209,3 @@ class ObjectClassBooleanAttribute extends BooleanAttribute } } } - diff --git a/include/simpleplugin/attributes/class_SetAttribute.inc b/include/simpleplugin/attributes/class_SetAttribute.inc index 42e69c719..3459b2c89 100644 --- a/include/simpleplugin/attributes/class_SetAttribute.inc +++ b/include/simpleplugin/attributes/class_SetAttribute.inc @@ -197,7 +197,7 @@ class SetAttribute extends Attribute } $attribute = $this->attribute; return array_map( - function ($value) use($attribute) + function ($value) use ($attribute) { return $attribute->displayValue($value); }, diff --git a/include/simpleplugin/attributes/class_StringAttribute.inc b/include/simpleplugin/attributes/class_StringAttribute.inc index 81ecde381..bb8570447 100644 --- a/include/simpleplugin/attributes/class_StringAttribute.inc +++ b/include/simpleplugin/attributes/class_StringAttribute.inc @@ -77,7 +77,7 @@ class StringAttribute extends Attribute $attributes['onChange'] = 'javascript:'.htmlentities($js, ENT_COMPAT, 'UTF-8'); } if ($this->autocomplete !== NULL) { - $attributes['autocomplete'] = ($this->autocomplete ? 'on' : 'off' ); + $attributes['autocomplete'] = ($this->autocomplete ? 'on' : 'off'); } if ($this->html5pattern !== NULL) { $attributes['pattern'] = '{literal}'.htmlentities($this->html5pattern, ENT_COMPAT, 'UTF-8').'{/literal}'; @@ -98,7 +98,7 @@ class StringAttribute extends Attribute 'value' => '{literal}'.htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8').'{/literal}' ); if ($this->autocomplete !== NULL) { - $attributes['autocomplete'] = ($this->autocomplete ? 'on' : 'off' ); + $attributes['autocomplete'] = ($this->autocomplete ? 'on' : 'off'); } if ($this->isSubAttribute) { $attributes['class'] = 'subattribute'; @@ -144,7 +144,7 @@ class StringAttribute extends Attribute function checkValue ($value) { - if (!is_scalar($value) && (!is_object($value) || !method_exists($value, '__toString' ))) { + if (!is_scalar($value) && (!is_object($value) || !method_exists($value, '__toString'))) { throw new InvalidValueException(sprintf(_('StringAttribute "%s" was set to a non-compatible value'), $this->getLabel())); } } diff --git a/include/simpleplugin/class_Attribute.inc b/include/simpleplugin/class_Attribute.inc index 88c2b5bf2..6b2318fa6 100644 --- a/include/simpleplugin/class_Attribute.inc +++ b/include/simpleplugin/class_Attribute.inc @@ -700,7 +700,8 @@ class Attribute protected function changeStateJS () { return join(array_map( - function ($id) { + function ($id) + { return 'changeState('.json_encode($id).');'; }, $this->htmlIds() diff --git a/include/simpleplugin/class_dialogAttributes.inc b/include/simpleplugin/class_dialogAttributes.inc index 5b4ba7817..789b0e816 100644 --- a/include/simpleplugin/class_dialogAttributes.inc +++ b/include/simpleplugin/class_dialogAttributes.inc @@ -998,4 +998,3 @@ class GenericSimplePluginDialog extends GenericDialog return FALSE; } } -?> diff --git a/include/simpleplugin/class_helpersAttribute.inc b/include/simpleplugin/class_helpersAttribute.inc index 81b63b777..d28364299 100644 --- a/include/simpleplugin/class_helpersAttribute.inc +++ b/include/simpleplugin/class_helpersAttribute.inc @@ -284,5 +284,3 @@ class TimeAttribute extends UnitIntAttribute parent::__construct($label, $description, $ldapName, $required, $units, $min, $max, $defaultValue, $acl); } } - -?> diff --git a/include/simpleplugin/class_multiPlugin.inc b/include/simpleplugin/class_multiPlugin.inc index 2a88b02fc..b501ec98d 100644 --- a/include/simpleplugin/class_multiPlugin.inc +++ b/include/simpleplugin/class_multiPlugin.inc @@ -206,5 +206,3 @@ class multiPlugin extends simplePlugin unset($plug); } } - -?> diff --git a/include/simpleplugin/class_simpleManagement.inc b/include/simpleplugin/class_simpleManagement.inc index 1a57bda72..55e05b899 100644 --- a/include/simpleplugin/class_simpleManagement.inc +++ b/include/simpleplugin/class_simpleManagement.inc @@ -1353,4 +1353,3 @@ class simpleManagement } } } -?> diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc index 6eaf819cf..03e0cd804 100644 --- a/include/simpleplugin/class_simplePlugin.inc +++ b/include/simpleplugin/class_simplePlugin.inc @@ -789,9 +789,9 @@ class simplePlugin function show_header (string $button_text, string $text, bool $plugin_enabled, bool $button_disabled = FALSE, string $name = 'modify_state'): string { if ($button_disabled || ((!$this->acl_is_createable() && !$plugin_enabled) || (!$this->acl_is_removeable() && $plugin_enabled))) { - $state = 'disabled="disabled"'; + $state = 'disabled="disabled"'; } else { - $state = ''; + $state = ''; } $display = '<div width="100%"><p><b>'.$text.'</b><br/>'."\n"; $display .= '<input type="submit" formnovalidate="formnovalidate" value="'.$button_text.'" name="'.$name.'" '.$state.'></p></div><hr class="separator"/>'; diff --git a/include/simpleplugin/class_simpleSelectManagement.inc b/include/simpleplugin/class_simpleSelectManagement.inc index dc5159221..fb03870ed 100644 --- a/include/simpleplugin/class_simpleSelectManagement.inc +++ b/include/simpleplugin/class_simpleSelectManagement.inc @@ -86,4 +86,3 @@ class simpleSelectManagement extends simpleManagement return ''; } } -?> diff --git a/include/simpleplugin/class_simpleTabs.inc b/include/simpleplugin/class_simpleTabs.inc index 5d8bc7268..0f6692d8d 100644 --- a/include/simpleplugin/class_simpleTabs.inc +++ b/include/simpleplugin/class_simpleTabs.inc @@ -567,4 +567,3 @@ class simpleTabs_noSpecial extends simpleTabs { protected $specialTabs = FALSE; } -?> diff --git a/include/variables.inc b/include/variables.inc index 95dd6230d..0385a59e7 100644 --- a/include/variables.inc +++ b/include/variables.inc @@ -83,5 +83,3 @@ define("SUPANN_DIR", "/etc/fusiondirectory/supann/"); /* FusionDirectory supann * \brief name of the class.cache file */ define("CLASS_CACHE", "class.cache"); /* name of the class cache */ - -?> diff --git a/include/variables_common.inc b/include/variables_common.inc index 6187c6ed2..ad2547b51 100644 --- a/include/variables_common.inc +++ b/include/variables_common.inc @@ -79,5 +79,3 @@ define('PHP_MIN_VERSION', '5.6.0'); * \brief Toggle crashing on PHP error, used for test suites */ define('PHP_ERROR_FATAL', 'FALSE'); - -?> diff --git a/plugins/addons/dashboard/class_dashboardPasswords.inc b/plugins/addons/dashboard/class_dashboardPasswords.inc index bd283470a..de27439d5 100644 --- a/plugins/addons/dashboard/class_dashboardPasswords.inc +++ b/plugins/addons/dashboard/class_dashboardPasswords.inc @@ -106,4 +106,3 @@ class dashboardPassword extends simplePlugin ); } } -?> diff --git a/plugins/addons/dashboard/class_dashboardUsers.inc b/plugins/addons/dashboard/class_dashboardUsers.inc index 5ab8831f8..a6d8500a0 100644 --- a/plugins/addons/dashboard/class_dashboardUsers.inc +++ b/plugins/addons/dashboard/class_dashboardUsers.inc @@ -274,4 +274,3 @@ class dashboardUsers extends simplePlugin } } } -?> diff --git a/plugins/addons/dashboard/tabs_dashBoard.inc b/plugins/addons/dashboard/tabs_dashBoard.inc index 0d0d350b1..a0b64a2c5 100644 --- a/plugins/addons/dashboard/tabs_dashBoard.inc +++ b/plugins/addons/dashboard/tabs_dashBoard.inc @@ -33,5 +33,3 @@ class tabs_dashboard extends simpleTabs_noSpecial { } } - -?> diff --git a/plugins/admin/aclrole/class_aclEditionDialog.inc b/plugins/admin/aclrole/class_aclEditionDialog.inc index f4e4918b1..a724f1370 100644 --- a/plugins/admin/aclrole/class_aclEditionDialog.inc +++ b/plugins/admin/aclrole/class_aclEditionDialog.inc @@ -168,7 +168,6 @@ class ACLEditionDialog extends GenericDialog foreach ($infos['classes'] as $oc) { if (isset($this->aclContents[$oc]) && count($this->aclContents[$oc]) && isset($this->aclContents[$oc][0]) && $this->aclContents[$oc][0] != '') { - $summary[] = $oc; continue; } diff --git a/plugins/admin/aclrole/class_aclRole.inc b/plugins/admin/aclrole/class_aclRole.inc index 4d1070af6..995e5d6c8 100644 --- a/plugins/admin/aclrole/class_aclRole.inc +++ b/plugins/admin/aclrole/class_aclRole.inc @@ -117,4 +117,3 @@ class aclRole extends simplePlugin ); } } -?> diff --git a/plugins/admin/departments/class_country.inc b/plugins/admin/departments/class_country.inc index 9a68dd032..73dd6fd63 100644 --- a/plugins/admin/departments/class_country.inc +++ b/plugins/admin/departments/class_country.inc @@ -63,4 +63,3 @@ class country extends department return $attributesInfo; } } -?> diff --git a/plugins/admin/departments/class_dcObject.inc b/plugins/admin/departments/class_dcObject.inc index 0439d84ed..f3a3e56c9 100644 --- a/plugins/admin/departments/class_dcObject.inc +++ b/plugins/admin/departments/class_dcObject.inc @@ -54,4 +54,3 @@ class dcObject extends department return $attributesInfo; } } -?> diff --git a/plugins/admin/departments/class_department.inc b/plugins/admin/departments/class_department.inc index 1c1c9db10..146633878 100644 --- a/plugins/admin/departments/class_department.inc +++ b/plugins/admin/departments/class_department.inc @@ -197,4 +197,3 @@ class department extends simplePlugin return parent::prepare_save(); } } -?> diff --git a/plugins/admin/departments/class_domain.inc b/plugins/admin/departments/class_domain.inc index a46d0b6a3..589b41932 100644 --- a/plugins/admin/departments/class_domain.inc +++ b/plugins/admin/departments/class_domain.inc @@ -54,4 +54,3 @@ class domain extends department return $attributesInfo; } } -?> diff --git a/plugins/admin/departments/class_locality.inc b/plugins/admin/departments/class_locality.inc index e3cc9173b..5c7ffcee6 100644 --- a/plugins/admin/departments/class_locality.inc +++ b/plugins/admin/departments/class_locality.inc @@ -55,4 +55,3 @@ class locality extends department return $attributesInfo; } } -?> diff --git a/plugins/admin/departments/class_organization.inc b/plugins/admin/departments/class_organization.inc index 6babd9ded..b6fd7641a 100644 --- a/plugins/admin/departments/class_organization.inc +++ b/plugins/admin/departments/class_organization.inc @@ -52,4 +52,3 @@ class organization extends department return parent::getDepartmentAttributesInfo(_('organization')); } } -?> diff --git a/plugins/admin/departments/tabs_department.inc b/plugins/admin/departments/tabs_department.inc index 9ce8d88ff..148557902 100644 --- a/plugins/admin/departments/tabs_department.inc +++ b/plugins/admin/departments/tabs_department.inc @@ -33,4 +33,3 @@ class deptabs extends simpleTabs return $errors; } } -?> diff --git a/plugins/admin/groups/class_ogroup.inc b/plugins/admin/groups/class_ogroup.inc index 7fd5daf76..1f6de1c0f 100644 --- a/plugins/admin/groups/class_ogroup.inc +++ b/plugins/admin/groups/class_ogroup.inc @@ -393,4 +393,3 @@ class ogroup extends simplePlugin return $this->gosaGroupObjects; } } -?> diff --git a/plugins/admin/groups/class_roleGeneric.inc b/plugins/admin/groups/class_roleGeneric.inc index 95d0a2d30..1e7f835ef 100644 --- a/plugins/admin/groups/class_roleGeneric.inc +++ b/plugins/admin/groups/class_roleGeneric.inc @@ -72,9 +72,9 @@ class roleGeneric extends simplePlugin ); } - /*! - * \brief The main function : information about attributes - */ + /*! + * \brief The main function : information about attributes + */ static function getAttributesInfo (): array { return array( @@ -142,4 +142,3 @@ class roleGeneric extends simplePlugin return parent::ldap_save(); } } -?> diff --git a/plugins/admin/groups/tabs_ogroups.inc b/plugins/admin/groups/tabs_ogroups.inc index d9ff1015f..ba30d7ed5 100644 --- a/plugins/admin/groups/tabs_ogroups.inc +++ b/plugins/admin/groups/tabs_ogroups.inc @@ -195,4 +195,3 @@ class ogrouptabs extends simpleTabs_noSpecial } } } -?> diff --git a/plugins/config/class_configInLdap.inc b/plugins/config/class_configInLdap.inc index 671688a96..f5f0faa3e 100644 --- a/plugins/config/class_configInLdap.inc +++ b/plugins/config/class_configInLdap.inc @@ -616,4 +616,3 @@ class configInLdap extends simplePlugin parent::mainInc($classname, $entry_dn, $tabs, $edit_mode, $objectType); } } -?> diff --git a/plugins/config/class_dashBoardConfig.inc b/plugins/config/class_dashBoardConfig.inc index 77d90c5d3..d724bec69 100644 --- a/plugins/config/class_dashBoardConfig.inc +++ b/plugins/config/class_dashBoardConfig.inc @@ -66,4 +66,3 @@ class dashboardConfig extends simplePlugin ); } } -?> diff --git a/plugins/config/class_mainPluginsConfig.inc b/plugins/config/class_mainPluginsConfig.inc index ac7415e15..8619cb1ac 100644 --- a/plugins/config/class_mainPluginsConfig.inc +++ b/plugins/config/class_mainPluginsConfig.inc @@ -59,4 +59,3 @@ class mainPluginsConfig extends simplePlugin ); } } -?> diff --git a/plugins/config/class_recoveryConfig.inc b/plugins/config/class_recoveryConfig.inc index c32fe6eb2..c7e3bde5e 100644 --- a/plugins/config/class_recoveryConfig.inc +++ b/plugins/config/class_recoveryConfig.inc @@ -156,4 +156,3 @@ class recoveryConfig extends simplePlugin ); } } -?> diff --git a/plugins/config/tabs_configInLdap.inc b/plugins/config/tabs_configInLdap.inc index 19fdffc54..9cae38b9a 100644 --- a/plugins/config/tabs_configInLdap.inc +++ b/plugins/config/tabs_configInLdap.inc @@ -34,4 +34,3 @@ class tabs_configInLdap extends simpleTabs_noSpecial return $errors; } } -?> diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 6c5877e5d..eab0ac7d4 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -486,4 +486,3 @@ class user extends simplePlugin return FALSE; } } -?> diff --git a/setup/class_setup.inc b/setup/class_setup.inc index cbf0fe72c..69041d34f 100644 --- a/setup/class_setup.inc +++ b/setup/class_setup.inc @@ -163,7 +163,6 @@ class setup { $str = '<ul class="menu"><li><a>FusionDirectory Setup</a><ul>'; foreach ($this->o_steps as $key => $step) { - $step->update_strings(); $s_short_name = $step->get_short_name(); diff --git a/setup/class_setupStep.inc b/setup/class_setupStep.inc index 1f323af32..7f0ebea2d 100644 --- a/setup/class_setupStep.inc +++ b/setup/class_setupStep.inc @@ -112,4 +112,3 @@ class setupStep extends simplePlugin } } } -?> diff --git a/setup/class_setupStepChecks.inc b/setup/class_setupStepChecks.inc index 15ddbf3d6..84cc9cdfc 100644 --- a/setup/class_setupStepChecks.inc +++ b/setup/class_setupStepChecks.inc @@ -240,8 +240,8 @@ class setupStepChecks extends setupStep function save_object () { parent::save_object(); - /* If everything is fine, set this step to completed - * and allow switching to next setup step */ + /* If everything is fine, set this step to completed + * and allow switching to next setup step */ $failed = FALSE; foreach (array('basic_checks','config_checks') as $type) { foreach ($this->$type as $obj) { @@ -254,5 +254,3 @@ class setupStepChecks extends setupStep $this->is_completed = !$failed; } } - -?> diff --git a/setup/class_setupStepFinish.inc b/setup/class_setupStepFinish.inc index d32c5ba40..2c5ba31e8 100644 --- a/setup/class_setupStepFinish.inc +++ b/setup/class_setupStepFinish.inc @@ -128,4 +128,3 @@ class setupStepFinish extends setupStep return (bool) decbin($p & 4); } } -?> diff --git a/setup/class_setupStepLdap.inc b/setup/class_setupStepLdap.inc index 95848affb..33dd78016 100644 --- a/setup/class_setupStepLdap.inc +++ b/setup/class_setupStepLdap.inc @@ -221,4 +221,3 @@ class setupStepLdap extends setupStep } } } -?> diff --git a/setup/class_setupStepMigrate.inc b/setup/class_setupStepMigrate.inc index 91ca88627..00d479793 100644 --- a/setup/class_setupStepMigrate.inc +++ b/setup/class_setupStepMigrate.inc @@ -1127,7 +1127,7 @@ class setupStepMigrate extends setupStep /* Check if entry is not an addressbook only user * and verify that he is in a valid department */ - if ( !preg_match('/'.preg_quote('dc=addressbook,', '/').'/', $group_db_base) && + if (!preg_match('/'.preg_quote('dc=addressbook,', '/').'/', $group_db_base) && !in_array($group_db_base, $config->departments) ) { $attrs['checked'] = FALSE; @@ -1376,4 +1376,3 @@ class setupStepMigrate extends setupStep } } } -?> diff --git a/setup/class_setupStepWelcome.inc b/setup/class_setupStepWelcome.inc index ca74c4540..178309c2e 100644 --- a/setup/class_setupStepWelcome.inc +++ b/setup/class_setupStepWelcome.inc @@ -80,5 +80,3 @@ class setupStepWelcome extends setupStep } } } - -?> -- GitLab