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/ 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.*" 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/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'); diff --git a/install/installer.class.php b/install/installer.class.php index 73a5a30..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([ @@ -613,7 +614,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 +655,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 +860,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)) { 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]); + } }