Skip to content

Commit

Permalink
Wip (#1316)
Browse files Browse the repository at this point in the history
* Release version 5.1.4.

* Bumping to v5.1.5 for development.

* Update .htaccess
allow .py files to be downloaded

* Update locales

* Update CHANGELOG

* Add remark about migration

* Release version 5.1.5.

* Bumping to v5.1.6 for development.

* Hide the empty blank "Group 0" machine group (#1130)

* Hide the empty blank "Group 0" machine group

* Changed hiding Group 0 to Unassigned

* Updated phpdotenv to version 4.x

* Updated phpdotenv to version 4.x

* Bump minor version

* Enable multiple widgets
Override widget name by specifying widget: name in the widget variables

* Catch missing LDAP

* Saml fix (#1315)

* Replace commas with _ in SAML groups

* Pass group array by reference

* Update CHANGELOG

Co-authored-by: tuxudo <[email protected]>
  • Loading branch information
bochoven and tuxudo authored Feb 13, 2020
1 parent 8106cf6 commit 5ccfb95
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 6 deletions.
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
### [5.1.5](https://github.com/munkireport/munkireport-php/compare/v5.1.4...HEAD) (Unreleased)
### [5.2.0](https://github.com/munkireport/munkireport-php/compare/v5.1.5...HEAD) (Unreleased)

Some module updates and fixes. Inventory now has single app widget support: see https://github.com/munkireport/inventory/blob/master/README.md#single-app-widget
There's a fix for SAML groups that have comma's in the name.

FEATURES
- Hide the empty blank "Group 0" machine group (#1130)

MODULE UPDATES
- munkireport/inventory (v3.0 => v3.1)
- munkireport/crashplan (V1.5 => V1.6)
- munkireport/findmymac (v1.2 => v1.3)
- munkireport/mdm_status (v1.9 => v1.11)
- munkireport/power (v1.0 => v1.1)

DEPENDENCY UPDATES
- symfony/translation-contracts (v1.1.7 => v2.0.1)
- symfony/polyfill-mbstring (v1.13.1 => v1.14.0)
- nesbot/carbon (2.29.1 => 2.30.0)
- symfony/polyfill-php73 (v1.13.1 => v1.14.0)
- symfony/service-contracts (v1.1.8 => v2.0.1)
- league/flysystem (1.0.63 => 1.0.64)
- doctrine/dbal (v2.9.3 => v2.10.1)
- symfony/polyfill-ctype (v1.13.1 => v1.14.0)
- vlucas/phpdotenv (v3.6.0 => v4.1.0)
- symfony/var-dumper (v4.4.4 => v5.0.4)
- tightenco/collect (v6.13.0 => v6.15.0)


### [5.1.5](https://github.com/munkireport/munkireport-php/compare/v5.1.4...v5.1.5) (February 02, 2020)

Mostly module updates, and a small fix for apache servers.
Security module now reports on Secure Boot and External Boot thanks to @poundbangbash Note that this change needs a database migration.
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ public function get_machine_groups()
foreach ($_SESSION['machine_groups'] as $group) {
if ($mg_data = $mg->all($group)) {
$out[] = $mg->all($group);
} else // Not in Machine_group table
} else if ($group != 0 && count($_SESSION['machine_groups']) != 0) // Not in Machine_group table
{
$out[] = array(
'name' => 'Group '.$group,
'groupid' => $group);
} else {
$out[] = array(
'name' => 'Unassigned',
'groupid' => $group);
}
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/config_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function initDotEnv()
{
try {
$envfile = defined('MUNKIREPORT_SETTINGS') ? MUNKIREPORT_SETTINGS : '.env';
$dotenv = Dotenv::create(APP_ROOT, $envfile);
$dotenv = Dotenv::createMutable(APP_ROOT, $envfile);
$dotenv->load();
} catch (InvalidPathException $e) {
// .env is missing, but not really an issue since configuration is specified here anyway.
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/site_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use munkireport\models\Machine_group, munkireport\lib\Modules, munkireport\lib\Dashboard;

// Munkireport version (last number is number of commits)
$GLOBALS['version'] = '5.1.5.3921';
$GLOBALS['version'] = '5.2.0.3922';

// Return version without commit count
function get_version()
Expand Down
5 changes: 5 additions & 0 deletions app/lib/munkireport/AuthAD.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public function login($login, $password)
{
$this->login = $login;
if ($login && $password) {

if( ! defined('LDAP_OPT_PROTOCOL_VERSION')){
error('LDAP authentication failed: PHP is missing the LDAP extension');
return false;
}

if (conf('debug'))
{
Expand Down
11 changes: 11 additions & 0 deletions app/lib/munkireport/AuthSaml.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ private function mapSamlAttrs($attrs)
}
}

// Make group names compliant
$this->_dirify($out['groups']);

// Check if we have a user
if( $this->debug() && ! $out['user'] )
{
Expand All @@ -259,6 +262,14 @@ private function mapSamlAttrs($attrs)
return $out;
}

// Replace comma with _
private function _dirify(Array &$array)
{
array_walk($array, function(&$value, $key){
$value = str_replace(',', '_', $value);
});
}

private function debug()
{
return isset($this->config['debug']) && $this->config['debug'] == true;
Expand Down
10 changes: 9 additions & 1 deletion app/views/dashboard/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@

<?php foreach($row as $item => $data):?>

<?php $widget->view($this, $item, $data); ?>
<?php if(array_key_exists('widget', $data)):?>

<?php $widget->view($this, $data['widget'], $data); ?>

<?php else:?>

<?php $widget->view($this, $item, $data); ?>

<?php endif?>

<?php endforeach?>

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"rodneyrehm/plist": "^2.0",
"doctrine/dbal": "~2.5",
"defuse/php-encryption": "^2.1",
"vlucas/phpdotenv": "^3.1",
"vlucas/phpdotenv": "^4.0",
"wikimedia/composer-merge-plugin": "^1.4",
"munkireport/ard": "^2.0",
"munkireport/reportdata": "^2.0",
Expand Down

0 comments on commit 5ccfb95

Please sign in to comment.