From 09af2f0478e635f9af163a8108da3ff5767aff0a Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Tue, 10 Apr 2018 15:52:07 +0200 Subject: [PATCH 1/5] fix(config): check the web app URL ends with a slash Signed-off-by: Thierry Bugier --- inc/config.class.php | 3 +++ install/installer.class.php | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/inc/config.class.php b/inc/config.class.php index 7f77062..9975b86 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -150,6 +150,9 @@ public static function configUpdate($input) { $config->resetDemoNotificationSignature(); $config->disableDemoAccountService(); } else { + if (strrpos($input['webapp_url'], '/') != strlen($input['webapp_url']) - 1) { + $input['webapp_url'] .= '/'; + } $config->setDemoNotificationSignature(); $config->enableDemoAccountService(); } diff --git a/install/installer.class.php b/install/installer.class.php index 73a5a30..a7ed64f 100644 --- a/install/installer.class.php +++ b/install/installer.class.php @@ -613,7 +613,7 @@ protected function getNotificationTargetRegistrationEvents() { ), PluginFlyvemdmdemoNotificationTargetAccountvalidation::EVENT_TRIAL_BEGIN => array( 'itemtype' => PluginFlyvemdmdemoAccountvalidation::class, - 'name' => __('Account activated', "flyvemdmdemo"), + 'name' => __('Account activated', 'flyvemdmdemo'), 'subject' => __('Get started with Flyve MDM', 'flyvemdmdemo'), 'content_text' => __('Hi there, @@ -654,7 +654,7 @@ protected function getNotificationTargetRegistrationEvents() { ), PluginFlyvemdmdemoNotificationTargetAccountvalidation::EVENT_TRIAL_EXPIRATION_REMIND_1 => array( 'itemtype' => PluginFlyvemdmdemoAccountvalidation::class, - 'name' => __('First trial reminder', "flyvemdmdemo"), + 'name' => __('First trial reminder', 'flyvemdmdemo'), 'subject' => __('Your Flyve MDM trial will end soon! - Only ##flyvemdmdemo.days_remaining## left!', 'flyvemdmdemo'), 'content_text' => __('Hi there, @@ -859,7 +859,7 @@ protected function createSocialMediaIcons() { $document = new Document(); $input['entities_id'] = '0'; $input['is_recursive'] = '1'; - $input['name'] = __('Flyve MDM Facebook icon', 'flyvemdmdemo'); + $input['name'] = __('Flyve MDM Facebook icon', 'flyvemdmdemo'); $input['_filename'] = array('flyve-facebook.jpg'); $input['_only_if_upload_succeed'] = true; if ($document->add($input)) { From fd47e71b1b113e4ed33179eefdfd52efbdbc21e5 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Tue, 10 Apr 2018 15:53:07 +0200 Subject: [PATCH 2/5] fix(validation): update the URL to match the new dashboard Signed-off-by: Thierry Bugier --- inc/notificationtargetaccountvalidation.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/notificationtargetaccountvalidation.class.php b/inc/notificationtargetaccountvalidation.class.php index 45d17fc..eb16811 100644 --- a/inc/notificationtargetaccountvalidation.class.php +++ b/inc/notificationtargetaccountvalidation.class.php @@ -108,7 +108,7 @@ public function addDataForTemplate($event, $options = array()) { $accountValidation = $this->obj; $accountValidationId = $accountValidation->getID(); $validationToken = $accountValidation->getField('validation_pass'); - $validationUrl = $config['webapp_url'] . "#!/account/$accountValidationId/validation/$validationToken"; + $validationUrl = $config['webapp_url'] . "validateAccount/$accountValidationId/validation/$validationToken"; $activationDelay = new DateInterval('P' . $accountValidation->getActivationDelay() . 'D'); $activationDelay = $activationDelay->format('%d'); From 7d4ecffe5572e558168318b9670ca465272e3aa9 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Wed, 11 Apr 2018 18:26:22 +0200 Subject: [PATCH 3/5] fix(rights): add knowledge base rights for help center Signed-off-by: Thierry Bugier --- install/installer.class.php | 1 + .../RegisteredUserProfileIntegrationTest.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/install/installer.class.php b/install/installer.class.php index a7ed64f..e68edbc 100644 --- a/install/installer.class.php +++ b/install/installer.class.php @@ -215,6 +215,7 @@ protected function createRegisteredProfileAccess() { Software::$rightname => READ, NetworkPort::$rightname => READ, CommonDropdown::$rightname => READ, + KnowbaseItem::$rightname => READ | KnowbaseItem::READFAQ | KnowbaseItem::COMMENTS, )); $profile = new Profile(); $profile->update([ diff --git a/tests/0010_Integration/RegisteredUserProfileIntegrationTest.php b/tests/0010_Integration/RegisteredUserProfileIntegrationTest.php index 4c27302..444d389 100644 --- a/tests/0010_Integration/RegisteredUserProfileIntegrationTest.php +++ b/tests/0010_Integration/RegisteredUserProfileIntegrationTest.php @@ -222,4 +222,11 @@ public function testRegisteredUserProfileConfigRight($rights) { $this->assertEquals(READ, $rights[Config::$rightname]); } + /** + * @depends testGetRights + * @param array $rights + */ + public function testRegisteredUserProfileKnowbaseItemRight($rights) { + $this->assertEquals(READ | KnowbaseItem::READFAQ | KnowbaseItem::COMMENTS, $rights[Config::$rightname]); + } } From 5a134ba104349c633ae58d1b9aec109c75f7ecc6 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Fri, 13 Apr 2018 17:51:25 +0200 Subject: [PATCH 4/5] ci: update path to installer for GLPI Signed-off-by: Thierry Bugier --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c62439..20558d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,12 @@ language: php env: global: - - GLPI_SOURCE="https://github.com/glpi-project/glpi -b 9.2/bugfixes" - - FUSION_SOURCE="https://github.com/fusioninventory/fusioninventory-for-glpi -b master" + - GLPI_SOURCE="https://github.com/glpi-project/glpi -b 9.2/bugfixes" + - FUSION_SOURCE="https://github.com/fusioninventory/fusioninventory-for-glpi -b master" - FLYVEMDM_SOURCE="https://github.com/flyve-mdm/flyve-mdm-glpi-plugin -b develop" - secure: riqurLkD5HXiKdkjSZXipb4+2VhXIjV6yjex7z89eHYqVhK049k/qIuxX2nCCCB7BxVuA+2fjDXXgjH4XihYvIcwxepplbDEjzgTYp/dDmN/8w3v9GvNBrD5fiV68a98Wpdy9zfbGk5hcoabKGJdyYCAFzCqLYmMGo5JU52lV2v6FcjkmkogFEpcKkg6+eZvDdCuCMgKziXwXKG7mDENAZA3PlPMaTmQ+sNaCWyYPKYC08+TGRIP9sS+lTY78SW/gY06CgWeJ1cF/MSRf8g0payEl9B4BuVFt8eAk+QIhDxvfkUmjIMEciT9c3stwsLnZQW1P4AAsmAqpmdajoGPg8XY+ZmFNdvAkh9hbGzdIy50v+cKlNyi2w/ZC5iQg43fmC0YwoGLd225FI1gJQFMkQiMYj2mi1Ir0/QFfVM5G5VWALRGQs5CyGOl9MOy01QISkkuURHYGLw+7jCCZyYmfww5gFO4RFcjPDBpoQt8Ra3Lbq1IaWt/gd4eQWjoXqiUjkYQ5L0tHd2Na4DR9q7X72mPoswUucxRAusF1M883uxIVWJRGFVs3Sup6U8qnZxXrpWIN8fpAtO7NuTQoCF48AhIC32+i41Ab002AUQLij8r8GGVehprhgyTbqDtd7zXWuC04rWBwVmXLsYvvqcszY2INUz4/jPswvHuvpZraxI= - DB=glpitest - + cache: directories: - $HOME/.composer/cache @@ -19,7 +19,7 @@ before_script: - tests/config-composer.sh - git clone --depth=1 $GLPI_SOURCE ../glpi && cd ../glpi - composer install --no-dev - - php tools/cliinstall.php --db=$DB --user=travis --tests + - php scripts/cliinstall.php --db=$DB --user=travis --tests - cp tests/config_db.php config/config_db.php - mkdir plugins/fusioninventory && git clone --depth=1 $FUSION_SOURCE plugins/fusioninventory - mkdir plugins/flyvemdm && git clone --depth=1 $FLYVEMDM_SOURCE plugins/flyvemdm @@ -42,6 +42,6 @@ matrix: - php: nightly allow_failures: - php: nightly - + notifications: webhooks: https://hooks.aethonan.pro/travisci/-1001061475099/ From b4bc4e9a38338ad47ae43064035ac0835b51c623 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Wed, 18 Apr 2018 22:19:04 +0200 Subject: [PATCH 5/5] test: use last revision of helper package before atoum Signed-off-by: Thierry Bugier --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6552a75..82de71c 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "glpi-project/coding-standard" : "0.5", "glpi-project/tools": "0.1.3", "phpunit/phpunit" : "^4.8 || ^5.4 || ^6.0", - "flyve-mdm/test" : "^1.0", + "flyve-mdm/test" : "dev-master#175b4d4be344381cb0829e7cdc6e5af91f72a017", "consolidation/robo" : "^1.0", "evert/phpdoc-md": "^0.2.0", "phpdocumentor/phpdocumentor": "2.*"