diff --git a/Auth/LdapAuth.php b/Auth/LdapAuth.php
index 0dc9bf0d..ebb97256 100644
--- a/Auth/LdapAuth.php
+++ b/Auth/LdapAuth.php
@@ -43,9 +43,10 @@
* There is no LDAP concept of a authentication token, and connecting to the LDAP
* server for every token auth authentication would be very wasteful.
*
- * So instead, when a user is synchronized, a token auth is generated using part of
- * the password hash stored in LDAP. We don't want to store the whole password hash
- * so attackers cannot get the true hash if they gain access to the MySQL DB.
+ * So instead, when a user is synchronized, Matomo stores a random placeholder in the
+ * password column and token auth authentication continues to use Matomo's normal token
+ * auth flow. The placeholder is intentionally unrelated to LDAP password attributes so
+ * database-only authentication cannot bypass LDAP-side checks.
*
* Once the token auth is generated, authenticating with it is done in the same way
* as with {@link Piwik\Plugins\Login\Auth}. In fact, this class will create an
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ad9115bf..a036564c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
# LoginLdap Changelog
+#### LoginLdap 5.2.4 - 2026-08-10
+- Added code to change the logic for random password generation
+
#### LoginLdap 5.2.3 - 2026-08-03
* Enabled password confirmation by default on the LoginLdap settings page
* Added code to synchronize LDAP users using the resolved Matomo login instead of the supplied identifier
diff --git a/LdapInterop/UserMapper.php b/LdapInterop/UserMapper.php
index 93ccfe4d..1758c10c 100644
--- a/LdapInterop/UserMapper.php
+++ b/LdapInterop/UserMapper.php
@@ -125,19 +125,29 @@ public function getExpectedLdapUsername($login)
}
/**
- * The password we store for a mapped user isn't used to authenticate, it's just
- * data used to generate a user's token auth.
+ * Returns the value to store in the Matomo user's password column.
+ *
+ * When LoginLdap is configured to always authenticate against LDAP, this value must never be
+ * derived from LDAP password data. Otherwise fallback database authentication would let users
+ * bypass LDAP-side checks such as ldap_user_filter, required_member_of and directory account
+ * state.
+ *
+ * When LDAP is only used for synchronization, the stored database password remains part of the
+ * supported authentication flow, so the legacy behavior is preserved.
*/
private function getPiwikPasswordForLdapUser($ldapUser, $user)
{
+ $useLdapForAuthentication = Config::getUseLdapForAuthentication();
$ldapPassword = $this->getLdapUserField($ldapUser, $this->ldapUserPasswordField);
- if (!empty($user['password']) && !Config::getShouldSynchronizeUsersAfterLogin()) {
- // do not generate new passwords for users that are already synchronized
- return $user['password'];
- } elseif (!empty($ldapPassword)) {
- return $this->hashLdapPassword($ldapPassword);
- } else {
+ if (!$useLdapForAuthentication) {
+ if (!empty($user['password']) && !Config::getShouldSynchronizeUsersAfterLogin()) {
+ // do not generate new passwords for users that are already synchronized
+ return $user['password'];
+ } elseif (!empty($ldapPassword)) {
+ return $this->hashLdapPassword($ldapPassword);
+ }
+
$this->logger->debug(
"UserMapper::{func}: Could not find LDAP password for user '{user}', generating random one.",
array(
@@ -148,6 +158,16 @@ private function getPiwikPasswordForLdapUser($ldapUser, $user)
return $this->generateRandomPassword();
}
+
+ $this->logger->debug(
+ "UserMapper::{func}: generating random placeholder password for user '{user}'.",
+ array(
+ 'func' => __FUNCTION__,
+ 'user' => @$ldapUser[$this->ldapUserIdField]
+ )
+ );
+
+ return $this->generateRandomPassword();
}
/**
@@ -157,7 +177,7 @@ private function getPiwikPasswordForLdapUser($ldapUser, $user)
*/
public function generateRandomPassword()
{
- return $this->hashLdapPassword(uniqid());
+ return $this->hashLdapPassword(random_bytes(32));
}
private function getEmailAddressForLdapUser($ldapUser, $login)
@@ -290,8 +310,8 @@ public function setAppendUserEmailSuffixToUsername($appendUserEmailSuffixToUsern
}
/**
- * Hashes the LDAP password so no part the real LDAP password (or the hash stored in
- * LDAP) will be stored in Piwik's DB.
+ * Hashes a value into the MD5 shaped hash that UsersManager::checkPasswordHash() expects,
+ * since the value is handed to the UsersManager API as an already hashed password.
*/
protected function hashLdapPassword(
#[\SensitiveParameter]
diff --git a/LoginLdap.php b/LoginLdap.php
index dbcfbc8e..1ec6a303 100644
--- a/LoginLdap.php
+++ b/LoginLdap.php
@@ -94,6 +94,7 @@ public function getClientSideTranslationKeys(&$keys)
$keys[] = 'LoginLdap_UserIdField';
$keys[] = 'LoginLdap_UserIdFieldDescription';
$keys[] = 'LoginLdap_PasswordField';
+ $keys[] = 'LoginLdap_PasswordFieldLegacy';
$keys[] = 'LoginLdap_MailField';
$keys[] = 'LoginLdap_MailFieldDescription';
$keys[] = 'LoginLdap_UsernameSuffix';
@@ -140,6 +141,8 @@ public function getClientSideTranslationKeys(&$keys)
$keys[] = 'LoginLdap_MemberOfDescription2';
$keys[] = 'LoginLdap_PasswordFieldDescription';
$keys[] = 'LoginLdap_PasswordFieldDescription2';
+ $keys[] = 'LoginLdap_PasswordFieldLdapAuthDescription';
+ $keys[] = 'LoginLdap_PasswordFieldLdapAuthDescription2';
$keys[] = 'LoginLdap_LoadUserCommandDesc';
$keys[] = 'LoginLdap_ReadMoreAboutAccessSynchronization';
$keys[] = 'LoginLdap_ThisMatomoInstanceNameDescription';
diff --git a/README.md b/README.md
index 8e511afd..a9d0ca3b 100644
--- a/README.md
+++ b/README.md
@@ -58,8 +58,8 @@ Each strategy has advantages and disadvantages. What you should use depends on y
This strategy is more secure than the one below, but it requires connecting to the LDAP server on each login attempt.
With this strategy, every time a user logs in, LoginLdap will connect to LDAP to authenticate. On successful login, the user can
-be synchronised, but the user's password is never stored in Matomo's DB, just in the LDAP server. Additionally, the token auth is generated using
-a hash of a hash of the password, or is generated randomly.
+be synchronised, but the user's LDAP password is never stored in Matomo's DB. Instead, Matomo stores a random placeholder value for
+LDAP-authenticated users so database-only authentication cannot bypass LDAP-side checks.
This means that if the Matomo DB is ever compromised, your LDAP users' passwords will still be safe.
@@ -238,8 +238,8 @@ If you set the **User Access Attribute Server & Site List Separator** option to
**User passwords**
-For added security, LoginLdap's default configuration will not store user passwords or a hash of a user password within Matomo's DB. So if the Matomo DB is compromised
-for whatever reason, user passwords will not be compromised.
+For added security, LoginLdap's default configuration will not store user passwords or a value derived from an LDAP password attribute within Matomo's DB. LDAP-authenticated
+users receive a random placeholder instead. So if the Matomo DB is compromised for whatever reason, the LDAP password material is not exposed there.
**Token Auths**
diff --git a/lang/en.json b/lang/en.json
index 32bb7723..e3efd108 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -74,6 +74,9 @@
"PasswordField": "User Password Field",
"PasswordFieldDescription": "Name of the LDAP attribute containing a user's password, e.g. 'userPassword' or 'unicodePwd'.",
"PasswordFieldDescription2": "If 'Always Use LDAP for Authentication' is enabled and 'Generate Random token_auth For New Users' is disabled, the value of this field in LDAP must be a user's hashed or encrypted password.",
+ "PasswordFieldLegacy": "User Password Field (legacy in LDAP auth mode)",
+ "PasswordFieldLdapAuthDescription": "When 'Always Use LDAP for Authentication' is enabled, LoginLdap no longer uses this field to generate the Matomo password stored for synchronized users.",
+ "PasswordFieldLdapAuthDescription2": "Instead, LoginLdap stores a random placeholder so database-only authentication cannot bypass LDAP-side checks. This field is still used when LDAP is only used for synchronization.",
"ReadMoreAboutAccessSynchronization": "To learn more about user access synchronization, %1$sread our docs%2$s.",
"ExpectedLdapAttributes": "Expected LDAP attributes",
"ExpectedLdapAttributesPrelude": "With this configuration, LoginLdap will expect attributes in LDAP that look like",
diff --git a/plugin.json b/plugin.json
index 97f86e69..a3f357a9 100644
--- a/plugin.json
+++ b/plugin.json
@@ -1,6 +1,6 @@
{
"name": "LoginLdap",
- "version": "5.2.3",
+ "version": "5.2.4",
"description": "LDAP authentication and synchronization for Matomo.",
"theme": false,
"keywords": ["ldap", "login", "authentication", "active", "directory", "kerberos", "sso"],
diff --git a/tests/Integration/AuthenticationTest.php b/tests/Integration/AuthenticationTest.php
index a83b2520..6bee75f4 100644
--- a/tests/Integration/AuthenticationTest.php
+++ b/tests/Integration/AuthenticationTest.php
@@ -15,6 +15,7 @@
use Piwik\Config;
use Piwik\Container\StaticContainer;
use Piwik\Plugins\LoginLdap\Auth\LdapAuth;
+use Piwik\Plugins\LoginLdap\LdapInterop\UserMapper;
use Piwik\Plugins\UsersManager\API as UsersManagerAPI;
use Piwik\Tests\Framework\Fixture;
@@ -231,6 +232,36 @@ public function test_LdapAuth_DoesNotAuthenticate_WhenAnonymousLoginProvided()
$this->assertEquals(0, $authResult->getCode());
}
+ public function test_LdapAuth_RotatesStoredPlaceholderAfterSuccessfulLogin_WhenSynchronizeUsersAfterLoginDisabled()
+ {
+ Config::getInstance()->LoginLdap['synchronize_users_after_login'] = 0;
+
+ UsersManagerAPI::getInstance()->addUser(
+ self::TEST_LOGIN,
+ 'averywrongpassword',
+ 'billionairephilanthropistplayboy@starkindustries.com'
+ );
+
+ $userMapper = new UserMapper();
+ $userMapper->markUserAsLdapUser(self::TEST_LOGIN);
+
+ $ldapAuth = LdapAuth::makeConfigured();
+ $ldapAuth->setLogin(self::TEST_LOGIN);
+ $ldapAuth->setPassword(self::TEST_PASS);
+ $authResult = $ldapAuth->authenticate();
+
+ $this->assertEquals(AuthResult::SUCCESS, $authResult->getCode());
+
+ $user = $this->getUser(self::TEST_LOGIN);
+ $this->assertPasswordIsRandomPlaceholder($user['password']);
+
+ $normalAuth = new \Piwik\Plugins\Login\Auth();
+ $normalAuth->setLogin(self::TEST_LOGIN);
+ $normalAuth->setPassword('averywrongpassword');
+
+ $this->assertEquals(AuthResult::FAILURE, $normalAuth->authenticate()->getCode());
+ }
+
private function getNonLdapUserTokenAuth()
{
return $this->nonLdapUserAppPassword;
diff --git a/tests/Integration/LdapIntegrationTest.php b/tests/Integration/LdapIntegrationTest.php
index 97c59033..2116cb14 100644
--- a/tests/Integration/LdapIntegrationTest.php
+++ b/tests/Integration/LdapIntegrationTest.php
@@ -157,8 +157,7 @@ protected function assertStarkSynchronized($expectedDomain = 'starkindustries.co
{
$user = $this->getUser(self::TEST_LOGIN);
$this->assertNotEmpty($user);
- $passwordHelper = new Password();
- $this->assertTrue($passwordHelper->verify(md5(self::TEST_PASS_LDAP), $user['password']));
+ $this->assertPasswordIsRandomPlaceholder($user['password']);
unset($user['password']);
$this->assertEquals(array(
'login' => self::TEST_LOGIN,
@@ -168,6 +167,20 @@ protected function assertStarkSynchronized($expectedDomain = 'starkindustries.co
$this->assertTrue($userMapper->isUserLdapUser(self::TEST_LOGIN));
}
+ /**
+ * A synchronized LDAP user's Matomo password column holds an unguessable placeholder. It must
+ * not be derivable from the LDAP userPassword attribute: Matomo treats the column as a real
+ * password hash, so a derivable value would let anyone holding that attribute log in as the
+ * user, without the LDAP side checks (ldap_user_filter, required_member_of, account state)
+ * ever running.
+ */
+ protected function assertPasswordIsRandomPlaceholder($storedPasswordHash)
+ {
+ $passwordHelper = new Password();
+ $this->assertFalse($passwordHelper->verify(md5(self::TEST_PASS_LDAP), $storedPasswordHash));
+ $this->assertFalse($passwordHelper->verify(md5(self::TEST_PASS), $storedPasswordHash));
+ }
+
protected function assertRomanovSynchronized($expectedDomain)
{
$user = $this->getUser('blackwidow');
diff --git a/tests/Integration/LdapUserSynchronizationTest.php b/tests/Integration/LdapUserSynchronizationTest.php
index 538abb2b..3f79454a 100644
--- a/tests/Integration/LdapUserSynchronizationTest.php
+++ b/tests/Integration/LdapUserSynchronizationTest.php
@@ -264,20 +264,20 @@ public function test_SuperUserAccessSynchronized_WhenLdapAccessInfoPresent_AndIn
public function test_RandomPasswordGenerated()
{
- $passwordManager = new Password();
-
$this->authenticateViaLdap();
$user = $this->getUser(self::TEST_LOGIN);
- $this->assertTrue($passwordManager->verify(md5(self::TEST_PASS_LDAP), $user['password']));
+ $this->assertPasswordIsRandomPlaceholder($user['password']);
- // test that password doesn't change after re-synchronizing
+ // the placeholder is regenerated when re-synchronizing. This does not invalidate existing
+ // sessions, since UserSynchronizer resets ts_password_modified afterwards.
$this->authenticateViaLdap();
$userAgain = $this->getUser(self::TEST_LOGIN);
- $this->assertTrue($passwordManager->verify(md5(self::TEST_PASS_LDAP), $userAgain['password']));
+ $this->assertPasswordIsRandomPlaceholder($userAgain['password']);
+ $this->assertNotEquals($user['password'], $userAgain['password']);
}
public function test_CorrectExistingUserUpdated_WhenUserEmailSuffixUsed()
diff --git a/tests/Integration/PasswordConfirmationTest.php b/tests/Integration/PasswordConfirmationTest.php
index 5106aa4d..10803bdc 100644
--- a/tests/Integration/PasswordConfirmationTest.php
+++ b/tests/Integration/PasswordConfirmationTest.php
@@ -167,18 +167,17 @@ public function testSaveLdapConfigRejectsWrongPasswordForLdapUser()
}
/**
- * A synchronized LDAP user's Matomo password column holds md5() of the LDAP password
- * *hash* (see UserMapper::getPiwikPasswordForLdapUser), never the plaintext LDAP
- * password, so confirming with TEST_PASS can only succeed by binding to LDAP.
+ * A synchronized LDAP user's Matomo password column holds an unguessable placeholder (see
+ * UserMapper::getPiwikPasswordForLdapUser), neither the plaintext LDAP password nor anything
+ * derived from the LDAP password attribute, so confirming with TEST_PASS can only succeed by
+ * binding to LDAP.
*/
public function testLdapUserPasswordConfirmationIsCheckedAgainstLdapNotTheMatomoDatabase()
{
$ldapAuth = $this->useRealLdapUser();
$user = $this->getUser(self::TEST_LOGIN);
- $passwordHelper = new \Piwik\Auth\Password();
- $this->assertFalse($passwordHelper->verify(md5(self::TEST_PASS), $user['password']));
- $this->assertTrue($passwordHelper->verify(md5(self::TEST_PASS_LDAP), $user['password']));
+ $this->assertPasswordIsRandomPlaceholder($user['password']);
StaticContainer::getContainer()->set('Piwik\Auth', new \Piwik\Plugins\Login\Auth());
$this->assertFalse($this->passwordVerifier->isPasswordCorrect(self::TEST_LOGIN, self::TEST_PASS));
diff --git a/tests/UI/expected-ui-screenshots/LoginLdap_Admin_admin_page.png b/tests/UI/expected-ui-screenshots/LoginLdap_Admin_admin_page.png
index 1ea38936..1e2f34eb 100644
Binary files a/tests/UI/expected-ui-screenshots/LoginLdap_Admin_admin_page.png and b/tests/UI/expected-ui-screenshots/LoginLdap_Admin_admin_page.png differ
diff --git a/tests/Unit/UserMapperTest.php b/tests/Unit/UserMapperTest.php
index 24e29591..c438acb4 100644
--- a/tests/Unit/UserMapperTest.php
+++ b/tests/Unit/UserMapperTest.php
@@ -84,9 +84,11 @@ public function test_createPiwikUserFromLdapUser_CreatesCorrectPiwikUser_WhenAll
'other' => 'sfdklsdjf'
));
+ $this->assertPasswordIsRandomPlaceholder($result);
+ unset($result['password']);
+
$this->assertEquals(array(
'login' => 'martha',
- 'password' => md5('pass'),
'email' => 'martha@unit.co.uk',
), $result);
}
@@ -107,9 +109,11 @@ public function test_createPiwikUserFromLdapUser_CreatesCorrectPiwikUser_WhenCus
'other3' => 'sdlfdsf'
));
+ $this->assertPasswordIsRandomPlaceholder($result);
+ unset($result['password']);
+
$this->assertEquals(array(
'login' => 'donna',
- 'password' => md5('pass'),
'email' => 'donna@rstad.com'
), $result);
@@ -122,9 +126,11 @@ public function test_createPiwikUserFromLdapUser_CreatesCorrectPiwikUser_WhenCus
'other3' => 'sdlfdsf'
));
+ $this->assertPasswordIsRandomPlaceholder($result);
+ unset($result['password']);
+
$this->assertEquals(array(
'login' => 'donna',
- 'password' => md5('pass'),
'email' => 'donna@rstad.com'
), $result);
}
@@ -151,7 +157,28 @@ public function test_createPiwikUserFromLdapUser_CreatesPiwikUserWithRandomPassw
'mail' => 'clara@coalhill.co.uk'
));
- $this->assertNotEmpty($result['password']);
+ $this->assertPasswordIsRandomPlaceholder($result);
+ }
+
+ /**
+ * The stored password must not be derivable from the LDAP userPassword attribute, otherwise
+ * anyone holding that attribute value could use it to log in as the user.
+ */
+ public function test_createPiwikUserFromLdapUser_DoesNotDerivePasswordFromLdapPassword()
+ {
+ $ldapUser = array(
+ 'uid' => 'alice',
+ 'mail' => 'alice@unit.co.uk',
+ 'userpassword' => '{SSHA}f5k9BA2C5L7VKqARAYvBCHBkPC3oTqaw'
+ );
+
+ $result = $this->userMapper->createPiwikUserFromLdapUser($ldapUser);
+
+ $this->assertPasswordIsRandomPlaceholder($result, '{SSHA}f5k9BA2C5L7VKqARAYvBCHBkPC3oTqaw');
+
+ $again = $this->userMapper->createPiwikUserFromLdapUser($ldapUser);
+
+ $this->assertNotEquals($result['password'], $again['password']);
}
public function test_createPiwikUserFromLdapUser_SetsCorrectEmail_WhenUserHasNone()
@@ -162,9 +189,11 @@ public function test_createPiwikUserFromLdapUser_SetsCorrectEmail_WhenUserHasNon
'userpassword' => 'pass'
));
+ $this->assertPasswordIsRandomPlaceholder($result);
+ unset($result['password']);
+
$this->assertEquals(array(
'login' => 'pond',
- 'password' => md5('pass'),
'email' => 'pond@mydomain.com'
), $result);
@@ -175,9 +204,11 @@ public function test_createPiwikUserFromLdapUser_SetsCorrectEmail_WhenUserHasNon
'userpassword' => 'pass'
));
+ $this->assertPasswordIsRandomPlaceholder($result);
+ unset($result['password']);
+
$this->assertEquals(array(
'login' => 'mrpond',
- 'password' => md5('pass'),
'email' => 'mrpond@royalleadworthhospital.co.uk'
), $result);
}
@@ -192,9 +223,11 @@ public function test_createPiwikUserEntryForLdapUser_SetsCorrectAlias_WhenUserHa
'other' => 'sfdklsdjf'
));
+ $this->assertPasswordIsRandomPlaceholder($result);
+ unset($result['password']);
+
$this->assertEquals(array(
'login' => 'harkness',
- 'password' => md5('pass'),
'email' => 'harkness@mydomain.com'
), $result);
}
@@ -211,15 +244,46 @@ public function test_createPiwikUserEntryForLdapUser_CreatesCorrectPiwikUser_IfL
'other' => array('sfdklsdjf)')
));
+ $this->assertPasswordIsRandomPlaceholder($result);
+ unset($result['password']);
+
$this->assertEquals(array(
'login' => 'rose',
- 'password' => md5('pass'),
'email' => 'rose@linda.com'
), $result);
}
- public function test_createPiwikUserEntryForLdapUser_UsesExistingPassword()
+ public function test_createPiwikUserEntryForLdapUser_ReplacesExistingPasswordInLdapAuthModeWhenSynchronizationAfterLoginDisabled()
+ {
+ Config::getInstance()->LoginLdap['use_ldap_for_authentication'] = 1;
+ Config::getInstance()->LoginLdap['synchronize_users_after_login'] = 0;
+ $existingUser = array(
+ 'login' => 'broken',
+ 'email' => 'wrongmail',
+ 'password' => 'existingpass'
+ );
+
+ $result = $this->userMapper->createPiwikUserFromLdapUser(array(
+ 'uid' => 'leela',
+ 'cn' => 'Leela of the Sevateem',
+ 'mail' => 'leela@gallifrey.???',
+ 'userpassword' => 'pass'
+ ), $existingUser);
+
+ $this->assertPasswordIsRandomPlaceholder($result);
+ $this->assertNotEquals('existingpass', $result['password']);
+ unset($result['password']);
+
+ $this->assertEquals(array(
+ 'login' => 'leela',
+ 'email' => 'leela@gallifrey.???'
+ ), $result);
+ Config::getInstance()->LoginLdap['use_ldap_for_authentication'] = 0;
+ }
+
+ public function test_createPiwikUserEntryForLdapUser_UsesExistingPasswordInSynchronizedAuthModeWhenSynchronizationAfterLoginDisabled()
{
+ Config::getInstance()->LoginLdap['use_ldap_for_authentication'] = 0;
Config::getInstance()->LoginLdap['synchronize_users_after_login'] = 0;
$existingUser = array(
'login' => 'broken',
@@ -243,6 +307,7 @@ public function test_createPiwikUserEntryForLdapUser_UsesExistingPassword()
public function test_createPiwikUserEntryForLdapUser_UpdatesExistingPassword()
{
+ Config::getInstance()->LoginLdap['use_ldap_for_authentication'] = 1;
Config::getInstance()->LoginLdap['synchronize_users_after_login'] = 1;
$existingUser = array(
'login' => 'broken',
@@ -257,14 +322,31 @@ public function test_createPiwikUserEntryForLdapUser_UpdatesExistingPassword()
'userpassword' => 'pass'
), $existingUser);
+ $this->assertPasswordIsRandomPlaceholder($result);
+ $this->assertNotEquals('existingpass', $result['password']);
+ unset($result['password']);
+
$this->assertEquals(array(
'login' => 'leela',
- 'password' => '1a1dc91c907325c69271ddf0c944bc72',
'email' => 'leela@gallifrey.???'
), $result);
+ Config::getInstance()->LoginLdap['use_ldap_for_authentication'] = 0;
Config::getInstance()->LoginLdap['synchronize_users_after_login'] = 0;
}
+ /**
+ * Asserts the generated password is an unguessable placeholder of the shape Matomo expects,
+ * and not derived from the LDAP password attribute.
+ */
+ private function assertPasswordIsRandomPlaceholder(array $result, $ldapPassword = 'pass')
+ {
+ // UsersManager::checkPasswordHash() requires an MD5 shaped hash
+ $this->assertSame(32, strlen($result['password']));
+ $this->assertTrue(ctype_xdigit($result['password']));
+
+ $this->assertNotEquals(md5($ldapPassword), $result['password']);
+ }
+
private function assertUserMapperIsCorrectlyConfigured(UserMapper $userMapper)
{
$this->assertEquals('useridfield', $userMapper->getLdapUserIdField());
diff --git a/vue/dist/LoginLdap.umd.js b/vue/dist/LoginLdap.umd.js
index b9a1fb57..58a7d0b4 100644
--- a/vue/dist/LoginLdap.umd.js
+++ b/vue/dist/LoginLdap.umd.js
@@ -287,12 +287,12 @@ var external_CorePluginsAdmin_ = __webpack_require__("a5a2");
TestableFieldvue_type_script_lang_ts.render = render
/* harmony default export */ var TestableField = (TestableFieldvue_type_script_lang_ts);
-// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/LoginLdap/vue/src/Admin/Admin.vue?vue&type=template&id=700f87d5
+// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/LoginLdap/vue/src/Admin/Admin.vue?vue&type=template&id=47158c76
-const Adminvue_type_template_id_700f87d5_hoisted_1 = {
+const Adminvue_type_template_id_47158c76_hoisted_1 = {
key: 0
};
-const Adminvue_type_template_id_700f87d5_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("hr", null, null, -1);
+const Adminvue_type_template_id_47158c76_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("hr", null, null, -1);
const _hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("hr", null, null, -1);
const _hoisted_4 = ["innerHTML"];
const _hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
@@ -315,7 +315,7 @@ const _hoisted_17 = {
const _hoisted_18 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
const _hoisted_19 = ["innerHTML"];
const _hoisted_20 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("hr", null, null, -1);
-function Adminvue_type_template_id_700f87d5_render(_ctx, _cache, $props, $setup, $data, $options) {
+function Adminvue_type_template_id_47158c76_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_Notification = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Notification");
const _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field");
const _component_TestableField = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("TestableField");
@@ -333,7 +333,7 @@ function Adminvue_type_template_id_700f87d5_render(_ctx, _cache, $props, $setup,
id: "ldapSettings",
"content-title": _ctx.translate('LoginLdap_Settings')
}, {
- default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [_ctx.updatedFromPre30 ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Adminvue_type_template_id_700f87d5_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Notification, {
+ default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [_ctx.updatedFromPre30 ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Adminvue_type_template_id_47158c76_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Notification, {
id: "pre300AlwaysUseLdapWarning",
context: "warning",
noclear: true
@@ -402,7 +402,7 @@ function Adminvue_type_template_id_700f87d5_render(_ctx, _cache, $props, $setup,
"success-translation": "LoginLdap_FilterCount",
title: _ctx.translate('LoginLdap_Filter'),
"inline-help": _ctx.translate('LoginLdap_FilterDescription')
- }, null, 8, ["modelValue", "title", "inline-help"])]), Adminvue_type_template_id_700f87d5_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, {
+ }, null, 8, ["modelValue", "title", "inline-help"])]), Adminvue_type_template_id_47158c76_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, {
saving: _ctx.isSavingConfig,
onConfirm: _cache[8] || (_cache[8] = $event => _ctx.requestSaveLdapConfig())
}, null, 8, ["saving"])]),
@@ -423,7 +423,7 @@ function Adminvue_type_template_id_700f87d5_render(_ctx, _cache, $props, $setup,
name: "ldap_password_field",
modelValue: _ctx.actualLdapConfig.ldap_password_field,
"onUpdate:modelValue": _cache[10] || (_cache[10] = $event => _ctx.actualLdapConfig.ldap_password_field = $event),
- title: _ctx.translate('LoginLdap_PasswordField'),
+ title: _ctx.ldapPasswordFieldTitle,
"inline-help": _ctx.ldapPasswordFieldHelp
}, null, 8, ["modelValue", "title", "inline-help"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
uicontrol: "text",
@@ -601,9 +601,8 @@ function Adminvue_type_template_id_700f87d5_render(_ctx, _cache, $props, $setup,
modelValue: serverInfo.admin_pass,
"onUpdate:modelValue": $event => serverInfo.admin_pass = $event,
uicontrol: "password",
- title: _ctx.translate('LoginLdap_AdminPass'),
- "inline-help": _ctx.translate('LoginLdap_PasswordFieldHelp')
- }, null, 8, ["modelValue", "onUpdate:modelValue", "title", "inline-help"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, {
+ title: _ctx.translate('LoginLdap_AdminPass')
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "title"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, {
onConfirm: $event => _ctx.actualServers.splice(index, 1),
value: _ctx.translate('General_Delete')
}, null, 8, ["onConfirm", "value"])]);
@@ -627,7 +626,7 @@ function Adminvue_type_template_id_700f87d5_render(_ctx, _cache, $props, $setup,
onAborted: _cache[28] || (_cache[28] = $event => _ctx.pendingSaveTarget = null)
}, null, 8, ["modelValue", "onConfirmed"])]);
}
-// CONCATENATED MODULE: ./plugins/LoginLdap/vue/src/Admin/Admin.vue?vue&type=template&id=700f87d5
+// CONCATENATED MODULE: ./plugins/LoginLdap/vue/src/Admin/Admin.vue?vue&type=template&id=47158c76
// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/LoginLdap/vue/src/Admin/Admin.vue?vue&type=script&lang=ts
@@ -815,7 +814,14 @@ function getSampleAccessAttribute(config, accessField, firstValue, secondValue)
const start = Object(external_CoreHome_["translate"])('LoginLdap_MemberOfDescription');
return `${start}
${Object(external_CoreHome_["translate"])('LoginLdap_MemberOfDescription2')}`;
},
+ ldapPasswordFieldTitle() {
+ return this.actualLdapConfig.use_ldap_for_authentication ? Object(external_CoreHome_["translate"])('LoginLdap_PasswordFieldLegacy') : Object(external_CoreHome_["translate"])('LoginLdap_PasswordField');
+ },
ldapPasswordFieldHelp() {
+ if (this.actualLdapConfig.use_ldap_for_authentication) {
+ const start = Object(external_CoreHome_["translate"])('LoginLdap_PasswordFieldLdapAuthDescription');
+ return `${start}
${Object(external_CoreHome_["translate"])('LoginLdap_PasswordFieldLdapAuthDescription2')}`;
+ }
const start = Object(external_CoreHome_["translate"])('LoginLdap_PasswordFieldDescription');
return `${start}
${Object(external_CoreHome_["translate"])('LoginLdap_PasswordFieldDescription2')}`;
}
@@ -827,7 +833,7 @@ function getSampleAccessAttribute(config, accessField, firstValue, secondValue)
-Adminvue_type_script_lang_ts.render = Adminvue_type_template_id_700f87d5_render
+Adminvue_type_script_lang_ts.render = Adminvue_type_template_id_47158c76_render
/* harmony default export */ var Admin = (Adminvue_type_script_lang_ts);
// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/LoginLdap/vue/src/Admin/AdminPage.vue?vue&type=template&id=64035228
diff --git a/vue/dist/LoginLdap.umd.min.js b/vue/dist/LoginLdap.umd.min.js
index 8b71c80e..2e0a254c 100644
--- a/vue/dist/LoginLdap.umd.min.js
+++ b/vue/dist/LoginLdap.umd.min.js
@@ -1,4 +1,4 @@
-(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["LoginLdap"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["LoginLdap"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var l=t[a]={i:a,l:!1,exports:{}};return e[a].call(l.exports,l,l.exports,n),l.l=!0,l.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)n.d(a,l,function(t){return e[t]}.bind(null,l));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/LoginLdap/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"TestableField",(function(){return p})),n.d(t,"Admin",(function(){return M})),n.d(t,"AdminPage",(function(){return P})),"undefined"!==typeof window){var a=window.document.currentScript,l=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);l&&(n.p=l[1])}var o=n("8bbf");const i={class:"loginLdapTestableField"},r=["innerHTML"];function s(e,t,n,a,l,s){const d=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SaveButton");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",i,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(d,{uicontrol:"text",onKeydown:t[0]||(t[0]=t=>e.onKeydown(t)),"model-value":e.actualInputValue,"onUpdate:modelValue":t[1]||(t[1]=t=>{e.actualInputValue=t,e.testResult=e.testError=null,e.$emit("update:modelValue",t)}),name:e.name,title:e.title,"inline-help":e.inlineHelp},null,8,["model-value","name","title","inline-help"])]),Object(o["withDirectives"])(Object(o["createVNode"])(c,{saving:e.isChecking,onConfirm:t[2]||(t[2]=t=>e.testInputValue()),value:e.translate("LoginLdap_Test")},null,8,["saving","value"]),[[o["vShow"],e.actualInputValue]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",{class:"test-config-option-success",innerHTML:e.$sanitize(e.successMessage)},null,8,r),[[o["vShow"],null!==e.testResult]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",{class:"test-config-option-error"},Object(o["toDisplayString"])(e.testError),513),[[o["vShow"],e.testError]])])}var d=n("19dc"),c=n("a5a2"),u=Object(o["defineComponent"])({props:{modelValue:String,name:String,successTranslation:{type:String,required:!0},testApiMethod:{type:String,required:!0},testApiMethodArg:{type:String,required:!0},inlineHelp:String,title:String},components:{Field:c["Field"],SaveButton:c["SaveButton"]},emits:["update:modelValue"],setup(e){let t=null;const n=n=>(t&&(t.abort(),t=null),t=new AbortController,d["AjaxHelper"].fetch({method:e.testApiMethod,[e.testApiMethodArg]:n},{abortController:t,createErrorNotification:!1}).finally(()=>{t=null}));return{sendRequestToTestValue:n}},data(){return{actualInputValue:this.modelValue,testError:null,testResult:null,testValue:null,isChecking:!1}},methods:{testInputValue(){this.testError=null,this.testResult=null,this.actualInputValue&&this.sendRequestToTestValue(this.actualInputValue).then(e=>{this.testResult=null===e.value?null:parseInt(e.value,10)}).catch(e=>{this.testError=e.message||e,this.testResult=null})},onKeydown(e){"Enter"===e.key&&this.testInputValue()}},computed:{successMessage(){if(null===this.testResult)return"";const e=1===this.testResult?Object(d["translate"])("LoginLdap_OneUser"):Object(d["translate"])("General_NUsers",""+this.testResult);return Object(d["translate"])(this.successTranslation,`${e}`)}}});u.render=s;var p=u;const m={key:0},_=Object(o["createElementVNode"])("hr",null,null,-1),b=Object(o["createElementVNode"])("hr",null,null,-1),g=["innerHTML"],f=Object(o["createElementVNode"])("br",null,null,-1),L=Object(o["createElementVNode"])("br",null,null,-1),h=Object(o["createElementVNode"])("br",null,null,-1),V=Object(o["createElementVNode"])("br",null,null,-1),O=["innerHTML"],v=["innerHTML"],j=["innerHTML"],N=Object(o["createElementVNode"])("hr",null,null,-1),C={src:"plugins/Morpheus/images/loading-blue.gif"},S=Object(o["createElementVNode"])("br",null,null,-1),w=Object(o["createElementVNode"])("br",null,null,-1),y=["innerHTML"],E={key:1},U=Object(o["createElementVNode"])("br",null,null,-1),A=["innerHTML"],x=Object(o["createElementVNode"])("hr",null,null,-1);function D(e,t,n,a,l,i){const r=Object(o["resolveComponent"])("Notification"),s=Object(o["resolveComponent"])("Field"),d=Object(o["resolveComponent"])("TestableField"),c=Object(o["resolveComponent"])("SaveButton"),u=Object(o["resolveComponent"])("ContentBlock"),p=Object(o["resolveComponent"])("AjaxForm"),D=Object(o["resolveComponent"])("PasswordConfirmation");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(p,{"submit-api-method":"LoginLdap.saveLdapConfig","use-custom-data-binding":!0,"send-json-payload":!0,"form-data":e.actualLdapConfig},{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(u,{id:"ldapSettings","content-title":e.translate("LoginLdap_Settings")},{default:Object(o["withCtx"])(()=>[e.updatedFromPre30?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",m,[Object(o["createVNode"])(r,{id:"pre300AlwaysUseLdapWarning",context:"warning",noclear:!0},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("General_Note")),1),Object(o["createTextVNode"])(": "+Object(o["toDisplayString"])(e.translate("LoginLdap_UpdateFromPre300Warning")),1)]),_:1})])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",name:"synchronize_users_after_login",modelValue:e.actualLdapConfig.use_ldap_for_authentication,"onUpdate:modelValue":t[0]||(t[0]=t=>e.actualLdapConfig.use_ldap_for_authentication=t),title:e.translate("LoginLdap_UseLdapForAuthentication"),"inline-help":e.useLdapForAuthHelp},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",name:"use_webserver_auth",modelValue:e.actualLdapConfig.use_webserver_auth,"onUpdate:modelValue":t[1]||(t[1]=t=>e.actualLdapConfig.use_webserver_auth=t),title:e.translate("LoginLdap_Kerberos"),"inline-help":e.translate("LoginLdap_KerberosDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",name:"enable_password_confirmation",modelValue:e.actualLdapConfig.enable_password_confirmation,"onUpdate:modelValue":t[2]||(t[2]=t=>e.actualLdapConfig.enable_password_confirmation=t),title:e.translate("LoginLdap_OptionsPWCONFIRMATION"),"inline-help":e.translate("LoginLdap_OptionsPWCONFIRMATIONDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",name:"strip_domain_from_web_auth",modelValue:e.actualLdapConfig.strip_domain_from_web_auth,"onUpdate:modelValue":t[3]||(t[3]=t=>e.actualLdapConfig.strip_domain_from_web_auth=t),title:e.translate("LoginLdap_StripDomainFromWebAuth"),"inline-help":e.translate("LoginLdap_StripDomainFromWebAuthDescription")},null,8,["modelValue","title","inline-help"])])],512),[[o["vShow"],e.actualLdapConfig.use_webserver_auth]]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_network_timeout",modelValue:e.actualLdapConfig.ldap_network_timeout,"onUpdate:modelValue":t[4]||(t[4]=t=>e.actualLdapConfig.ldap_network_timeout=t),title:e.translate("LoginLdap_NetworkTimeout"),"inline-help":e.ldapNetworkTimeoutHelp},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"required_member_of_field",modelValue:e.actualLdapConfig.required_member_of_field,"onUpdate:modelValue":t[5]||(t[5]=t=>e.actualLdapConfig.required_member_of_field=t),title:e.translate("LoginLdap_MemberOfField"),"inline-help":e.translate("LoginLdap_MemberOfFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(d,{uicontrol:"text",modelValue:e.actualLdapConfig.required_member_of,"onUpdate:modelValue":t[6]||(t[6]=t=>e.actualLdapConfig.required_member_of=t),name:"required_member_of","test-api-method":"LoginLdap.getCountOfUsersMemberOf","test-api-method-arg":"memberOf","success-translation":"LoginLdap_MemberOfCount",title:e.translate("LoginLdap_MemberOf"),"inline-help":e.memberOfCountHelp},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(d,{uicontrol:"text",modelValue:e.actualLdapConfig.ldap_user_filter,"onUpdate:modelValue":t[7]||(t[7]=t=>e.actualLdapConfig.ldap_user_filter=t),name:"ldap_user_filter","test-api-method":"LoginLdap.getCountOfUsersMatchingFilter","test-api-method-arg":"filter","success-translation":"LoginLdap_FilterCount",title:e.translate("LoginLdap_Filter"),"inline-help":e.translate("LoginLdap_FilterDescription")},null,8,["modelValue","title","inline-help"])]),_,Object(o["createVNode"])(c,{saving:e.isSavingConfig,onConfirm:t[8]||(t[8]=t=>e.requestSaveLdapConfig())},null,8,["saving"])]),_:1},8,["content-title"]),Object(o["createVNode"])(u,{id:"ldapUserMappingSettings","content-title":e.translate("LoginLdap_UserSyncSettings")},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_user_id_field",modelValue:e.actualLdapConfig.ldap_user_id_field,"onUpdate:modelValue":t[9]||(t[9]=t=>e.actualLdapConfig.ldap_user_id_field=t),title:e.translate("LoginLdap_UserIdField"),"inline-help":e.translate("LoginLdap_UserIdFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_password_field",modelValue:e.actualLdapConfig.ldap_password_field,"onUpdate:modelValue":t[10]||(t[10]=t=>e.actualLdapConfig.ldap_password_field=t),title:e.translate("LoginLdap_PasswordField"),"inline-help":e.ldapPasswordFieldHelp},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_mail_field",modelValue:e.actualLdapConfig.ldap_mail_field,"onUpdate:modelValue":t[11]||(t[11]=t=>e.actualLdapConfig.ldap_mail_field=t),title:e.translate("LoginLdap_MailField"),"inline-help":e.translate("LoginLdap_MailFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"user_email_suffix",modelValue:e.actualLdapConfig.user_email_suffix,"onUpdate:modelValue":t[12]||(t[12]=t=>e.actualLdapConfig.user_email_suffix=t),title:e.translate("LoginLdap_UsernameSuffix"),"inline-help":e.translate("LoginLdap_UsernameSuffixDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"new_user_default_sites_view_access",modelValue:e.actualLdapConfig.new_user_default_sites_view_access,"onUpdate:modelValue":t[13]||(t[13]=t=>e.actualLdapConfig.new_user_default_sites_view_access=t),title:e.translate("LoginLdap_NewUserDefaultSitesViewAccess"),"inline-help":e.translate("LoginLdap_NewUserDefaultSitesViewAccessDescription")},null,8,["modelValue","title","inline-help"])]),b,Object(o["createVNode"])(c,{saving:e.isSavingConfig,onConfirm:t[14]||(t[14]=t=>e.requestSaveLdapConfig())},null,8,["saving"])]),_:1},8,["content-title"]),Object(o["createVNode"])(u,{id:"ldapUserAccessMappingSettings","content-title":e.translate("LoginLdap_AccessSyncSettings")},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("p",{innerHTML:e.$sanitize(e.readMoreAboutAccessSynchronization)},null,8,g),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",name:"enable_synchronize_access_from_ldap",modelValue:e.actualLdapConfig.enable_synchronize_access_from_ldap,"onUpdate:modelValue":t[15]||(t[15]=t=>e.actualLdapConfig.enable_synchronize_access_from_ldap=t),title:e.translate("LoginLdap_EnableLdapAccessSynchronization"),"inline-help":e.translate("LoginLdap_EnableLdapAccessSynchronizationDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{context:"info",noclear:!0},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("LoginLdap_ExpectedLdapAttributes")),1),f,L,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("LoginLdap_ExpectedLdapAttributesPrelude"))+":",1),h,V,Object(o["createElementVNode"])("ul",null,[Object(o["createElementVNode"])("li",{innerHTML:e.$sanitize(e.sampleViewAttribute)},null,8,O),Object(o["createElementVNode"])("li",{innerHTML:e.$sanitize(e.sampleAdminAttribute)},null,8,v),Object(o["createElementVNode"])("li",{innerHTML:e.$sanitize(e.sampleSuperuserAttribute)},null,8,j)])]),_:1})]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_view_access_field",modelValue:e.actualLdapConfig.ldap_view_access_field,"onUpdate:modelValue":t[16]||(t[16]=t=>e.actualLdapConfig.ldap_view_access_field=t),title:e.translate("LoginLdap_LdapViewAccessField"),"inline-help":e.translate("LoginLdap_LdapViewAccessFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_admin_access_field",modelValue:e.actualLdapConfig.ldap_admin_access_field,"onUpdate:modelValue":t[17]||(t[17]=t=>e.actualLdapConfig.ldap_admin_access_field=t),title:e.translate("LoginLdap_LdapAdminAccessField"),"inline-help":e.translate("LoginLdap_LdapAdminAccessFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_superuser_access_field",modelValue:e.actualLdapConfig.ldap_superuser_access_field,"onUpdate:modelValue":t[18]||(t[18]=t=>e.actualLdapConfig.ldap_superuser_access_field=t),title:e.translate("LoginLdap_LdapSuperUserAccessField"),"inline-help":e.translate("LoginLdap_LdapSuperUserAccessFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"user_access_attribute_server_specification_delimiter",modelValue:e.actualLdapConfig.user_access_attribute_server_specification_delimiter,"onUpdate:modelValue":t[19]||(t[19]=t=>e.actualLdapConfig.user_access_attribute_server_specification_delimiter=t),title:e.translate("LoginLdap_LdapUserAccessAttributeServerSpecDelimiter"),"inline-help":e.translate("LoginLdap_LdapUserAccessAttributeServerSpecDelimiterDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"user_access_attribute_server_separator",modelValue:e.actualLdapConfig.user_access_attribute_server_separator,"onUpdate:modelValue":t[20]||(t[20]=t=>e.actualLdapConfig.user_access_attribute_server_separator=t),title:e.translate("LoginLdap_LdapUserAccessAttributeServerSeparator"),"inline-help":e.translate("LoginLdap_LdapUserAccessAttributeServerSeparatorDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"instance_name",modelValue:e.actualLdapConfig.instance_name,"onUpdate:modelValue":t[21]||(t[21]=t=>e.actualLdapConfig.instance_name=t),title:e.translate("LoginLdap_ThisMatomoInstanceName"),"inline-help":e.translate("LoginLdap_ThisMatomoInstanceNameDescription")},null,8,["modelValue","title","inline-help"])]),N,Object(o["createVNode"])(c,{saving:e.isSavingConfig,onConfirm:t[22]||(t[22]=t=>e.requestSaveLdapConfig())},null,8,["saving"])],512),[[o["vShow"],e.actualLdapConfig.enable_synchronize_access_from_ldap]])]),_:1},8,["content-title"])]),_:1},8,["form-data"])]),Object(o["createVNode"])(u,{id:"ldapManualSynchronizeUser","content-title":e.translate("LoginLdap_LoadUser")},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("LoginLdap_LoadUserDescription")),1),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",placeholder:"Enter a username...",modelValue:e.userToSynchronize,"onUpdate:modelValue":t[23]||(t[23]=t=>e.userToSynchronize=t)},null,8,["modelValue"])]),Object(o["createVNode"])(c,{onConfirm:t[24]||(t[24]=t=>e.synchronizeUser(e.userToSynchronize)),value:e.translate("LoginLdap_Go"),style:{"margin-right":"7px"}},null,8,["value"]),Object(o["withDirectives"])(Object(o["createElementVNode"])("img",C,null,512),[[o["vShow"],e.isSynchronizing]]),S,w,Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[e.synchronizeUserError?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.synchronizeUserError)},null,8,y)):Object(o["createCommentVNode"])("",!0),e.synchronizeUserDone?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",E,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("General_Done"))+"!",1)])):Object(o["createCommentVNode"])("",!0),U],512),[[o["vShow"],e.synchronizeUserError||e.synchronizeUserDone]]),Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.loadUserCommandDesc)},null,8,A)]),_:1},8,["content-title"]),Object(o["createVNode"])(u,{"content-title":e.translate("LoginLdap_LDAPServers")},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(p,{"submit-api-method":"LoginLdap.saveServersInfo","send-json-payload":!0,"use-custom-data-binding":!0,"form-data":e.actualServers},{default:Object(o["withCtx"])(()=>[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.actualServers,(t,n)=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{id:"ldapServersTable",key:n},[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",modelValue:t.name,"onUpdate:modelValue":e=>t.name=e,title:e.translate("LoginLdap_ServerName")},null,8,["modelValue","onUpdate:modelValue","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",modelValue:t.hostname,"onUpdate:modelValue":e=>t.hostname=e,placeholder:"localhost",title:e.translate("LoginLdap_ServerUrl")},null,8,["modelValue","onUpdate:modelValue","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",modelValue:t.port,"onUpdate:modelValue":e=>t.port=e,placeholder:"389",title:e.translate("LoginLdap_LdapPort"),"inline-help":e.translate("LoginLdap_LdapUrlPortWarning")},null,8,["modelValue","onUpdate:modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",modelValue:t.start_tls,"onUpdate:modelValue":e=>t.start_tls=e,title:e.translate("LoginLdap_StartTLS"),"inline-help":e.translate("LoginLdap_StartTLSFieldHelp")},null,8,["modelValue","onUpdate:modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",placeholder:"dc=example,dc=site,dc=org",modelValue:t.base_dn,"onUpdate:modelValue":e=>t.base_dn=e,title:e.translate("LoginLdap_BaseDn")},null,8,["modelValue","onUpdate:modelValue","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",placeholder:"cn=admin,dc=example,dc=site,dc=org",modelValue:t.admin_user,"onUpdate:modelValue":e=>t.admin_user=e,title:e.translate("LoginLdap_AdminUser"),"inline-help":e.translate("LoginLdap_AdminUserDescription")},null,8,["modelValue","onUpdate:modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{modelValue:t.admin_pass,"onUpdate:modelValue":e=>t.admin_pass=e,uicontrol:"password",title:e.translate("LoginLdap_AdminPass"),"inline-help":e.translate("LoginLdap_PasswordFieldHelp")},null,8,["modelValue","onUpdate:modelValue","title","inline-help"])]),Object(o["createVNode"])(c,{onConfirm:t=>e.actualServers.splice(n,1),value:e.translate("General_Delete")},null,8,["onConfirm","value"])]))),128)),x,Object(o["createVNode"])(c,{onConfirm:t[25]||(t[25]=t=>e.addServer()),value:e.translate("General_Add"),style:{"margin-right":"3.5px"}},null,8,["value"]),Object(o["createVNode"])(c,{saving:e.isSavingServers,onConfirm:t[26]||(t[26]=t=>e.requestSaveServers())},null,8,["saving"])]),_:1},8,["form-data"])])]),_:1},8,["content-title"]),Object(o["createVNode"])(D,{modelValue:e.showPasswordConfirmation,"onUpdate:modelValue":t[27]||(t[27]=t=>e.showPasswordConfirmation=t),onConfirmed:e.confirmSaveAction,onAborted:t[28]||(t[28]=t=>e.pendingSaveTarget=null)},null,8,["modelValue","onConfirmed"])])}function T(e,t,n,a){let l=t+": ";return e.instance_name?l+=e.instance_name:l+=window.location.hostname,n&&(l+=`${e.user_access_attribute_server_separator}${n}`),l+=e.user_access_attribute_server_specification_delimiter,e.instance_name?l+="piwikB":l+="anotherhost.com",a&&(l+=`${e.user_access_attribute_server_separator}${a}`),l}var F=Object(o["defineComponent"])({props:{ldapConfig:{type:Object,required:!0},servers:{type:Array,required:!0},updatedFromPre30:Boolean},components:{AjaxForm:d["AjaxForm"],ContentBlock:d["ContentBlock"],Notification:d["Notification"],PasswordConfirmation:c["PasswordConfirmation"],Field:c["Field"],TestableField:p,SaveButton:c["SaveButton"]},data(){return{actualLdapConfig:Object.assign({},this.ldapConfig),userToSynchronize:"",actualServers:[...this.servers],synchronizeUserError:null,synchronizeUserDone:null,isSynchronizing:!1,isSavingConfig:!1,isSavingServers:!1,showPasswordConfirmation:!1,pendingSaveTarget:null}},methods:{addServer(){this.actualServers.push({name:"server"+(this.actualServers.length+1),hostname:"",port:389,base_dn:"",admin_user:"",admin_pass:""})},synchronizeUser(e){this.synchronizeUserError=null,this.synchronizeUserDone=null,this.isSynchronizing=!0,d["AjaxHelper"].post({method:"LoginLdap.synchronizeUser"},{login:e},{createErrorNotification:!1}).then(()=>{this.synchronizeUserDone=!0}).catch(e=>{this.synchronizeUserError=e.message||e}).finally(()=>{this.isSynchronizing=!1})},requestSaveLdapConfig(){this.pendingSaveTarget="config",this.showPasswordConfirmation=!0},requestSaveServers(){this.pendingSaveTarget="servers",this.showPasswordConfirmation=!0},confirmSaveAction(e){const{pendingSaveTarget:t}=this;this.showPasswordConfirmation=!1,this.pendingSaveTarget=null,"config"===t?this.saveLdapConfig(e):"servers"===t&&this.saveServers(e)},saveLdapConfig(e){this.isSavingConfig=!0,this.actualLdapConfig.password_confirmation=e||"";const t={data:JSON.stringify(this.actualLdapConfig)};d["AjaxHelper"].post({module:"API",method:"LoginLdap.saveLdapConfig"},t).then(()=>{this.showSaveSuccessNotification()}).finally(()=>{this.actualLdapConfig.password_confirmation="",this.isSavingConfig=!1})},saveServers(e){this.isSavingServers=!0;const t={data:JSON.stringify(this.actualServers)};e&&(t.passwordConfirmation=e),d["AjaxHelper"].post({module:"API",method:"LoginLdap.saveServersInfo"},t).then(()=>{this.showSaveSuccessNotification()}).finally(()=>{this.isSavingServers=!1})},showSaveSuccessNotification(){const e=d["NotificationsStore"].show({message:Object(d["translate"])("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});d["NotificationsStore"].scrollToNotification(e)}},computed:{sampleViewAttribute(){const e=this.actualLdapConfig;return T(e,e.ldap_view_access_field,"1,2","3,4")},sampleAdminAttribute(){const e=this.actualLdapConfig;return T(e,e.ldap_admin_access_field,"all","all")},sampleSuperuserAttribute(){const e=this.actualLdapConfig;return T(e,e.ldap_superuser_access_field)},readMoreAboutAccessSynchronization(){const e="https://github.com/matomo-org/plugin-LoginLdap#matomo-access-synchronization";return Object(d["translate"])("LoginLdap_ReadMoreAboutAccessSynchronization",``,"")},loadUserCommandDesc(){const e="https://github.com/matomo-org/plugin-LoginLdap#commands";return Object(d["translate"])("LoginLdap_LoadUserCommandDesc",`loginldap:synchronize-users`)},useLdapForAuthHelp(){const e=Object(d["translate"])("LoginLdap_UseLdapForAuthenticationDescription");return`${e}
${Object(d["translate"])("LoginLdap_MobileAppIntegrationNote")}`},ldapNetworkTimeoutHelp(){const e=Object(d["translate"])("LoginLdap_NetworkTimeoutDescription");return`${e}
${Object(d["translate"])("LoginLdap_NetworkTimeoutDescription2")}`},memberOfCountHelp(){const e=Object(d["translate"])("LoginLdap_MemberOfDescription");return`${e}
${Object(d["translate"])("LoginLdap_MemberOfDescription2")}`},ldapPasswordFieldHelp(){const e=Object(d["translate"])("LoginLdap_PasswordFieldDescription");return`${e}
${Object(d["translate"])("LoginLdap_PasswordFieldDescription2")}`}}});F.render=D;var M=F;function k(e,t,n,a,l,i){const r=Object(o["resolveComponent"])("Admin");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createVNode"])(r,{servers:e.servers,"ldap-config":e.ldapConfig,"updated-from-pre30":e.updatedFromPre30},null,8,["servers","ldap-config","updated-from-pre30"])])}var z=Object(o["defineComponent"])({props:{ldapConfig:{type:Object,required:!0},servers:{type:Array,required:!0},updatedFromPre30:Boolean},components:{Admin:M}});z.render=k;var P=z;
+(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["LoginLdap"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["LoginLdap"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var l=t[a]={i:a,l:!1,exports:{}};return e[a].call(l.exports,l,l.exports,n),l.l=!0,l.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)n.d(a,l,function(t){return e[t]}.bind(null,l));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/LoginLdap/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"TestableField",(function(){return p})),n.d(t,"Admin",(function(){return M})),n.d(t,"AdminPage",(function(){return z})),"undefined"!==typeof window){var a=window.document.currentScript,l=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);l&&(n.p=l[1])}var o=n("8bbf");const i={class:"loginLdapTestableField"},r=["innerHTML"];function s(e,t,n,a,l,s){const d=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SaveButton");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",i,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(d,{uicontrol:"text",onKeydown:t[0]||(t[0]=t=>e.onKeydown(t)),"model-value":e.actualInputValue,"onUpdate:modelValue":t[1]||(t[1]=t=>{e.actualInputValue=t,e.testResult=e.testError=null,e.$emit("update:modelValue",t)}),name:e.name,title:e.title,"inline-help":e.inlineHelp},null,8,["model-value","name","title","inline-help"])]),Object(o["withDirectives"])(Object(o["createVNode"])(c,{saving:e.isChecking,onConfirm:t[2]||(t[2]=t=>e.testInputValue()),value:e.translate("LoginLdap_Test")},null,8,["saving","value"]),[[o["vShow"],e.actualInputValue]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",{class:"test-config-option-success",innerHTML:e.$sanitize(e.successMessage)},null,8,r),[[o["vShow"],null!==e.testResult]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",{class:"test-config-option-error"},Object(o["toDisplayString"])(e.testError),513),[[o["vShow"],e.testError]])])}var d=n("19dc"),c=n("a5a2"),u=Object(o["defineComponent"])({props:{modelValue:String,name:String,successTranslation:{type:String,required:!0},testApiMethod:{type:String,required:!0},testApiMethodArg:{type:String,required:!0},inlineHelp:String,title:String},components:{Field:c["Field"],SaveButton:c["SaveButton"]},emits:["update:modelValue"],setup(e){let t=null;const n=n=>(t&&(t.abort(),t=null),t=new AbortController,d["AjaxHelper"].fetch({method:e.testApiMethod,[e.testApiMethodArg]:n},{abortController:t,createErrorNotification:!1}).finally(()=>{t=null}));return{sendRequestToTestValue:n}},data(){return{actualInputValue:this.modelValue,testError:null,testResult:null,testValue:null,isChecking:!1}},methods:{testInputValue(){this.testError=null,this.testResult=null,this.actualInputValue&&this.sendRequestToTestValue(this.actualInputValue).then(e=>{this.testResult=null===e.value?null:parseInt(e.value,10)}).catch(e=>{this.testError=e.message||e,this.testResult=null})},onKeydown(e){"Enter"===e.key&&this.testInputValue()}},computed:{successMessage(){if(null===this.testResult)return"";const e=1===this.testResult?Object(d["translate"])("LoginLdap_OneUser"):Object(d["translate"])("General_NUsers",""+this.testResult);return Object(d["translate"])(this.successTranslation,`${e}`)}}});u.render=s;var p=u;const m={key:0},_=Object(o["createElementVNode"])("hr",null,null,-1),b=Object(o["createElementVNode"])("hr",null,null,-1),g=["innerHTML"],f=Object(o["createElementVNode"])("br",null,null,-1),L=Object(o["createElementVNode"])("br",null,null,-1),h=Object(o["createElementVNode"])("br",null,null,-1),V=Object(o["createElementVNode"])("br",null,null,-1),O=["innerHTML"],v=["innerHTML"],j=["innerHTML"],C=Object(o["createElementVNode"])("hr",null,null,-1),N={src:"plugins/Morpheus/images/loading-blue.gif"},S=Object(o["createElementVNode"])("br",null,null,-1),w=Object(o["createElementVNode"])("br",null,null,-1),y=["innerHTML"],E={key:1},A=Object(o["createElementVNode"])("br",null,null,-1),U=["innerHTML"],x=Object(o["createElementVNode"])("hr",null,null,-1);function D(e,t,n,a,l,i){const r=Object(o["resolveComponent"])("Notification"),s=Object(o["resolveComponent"])("Field"),d=Object(o["resolveComponent"])("TestableField"),c=Object(o["resolveComponent"])("SaveButton"),u=Object(o["resolveComponent"])("ContentBlock"),p=Object(o["resolveComponent"])("AjaxForm"),D=Object(o["resolveComponent"])("PasswordConfirmation");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(p,{"submit-api-method":"LoginLdap.saveLdapConfig","use-custom-data-binding":!0,"send-json-payload":!0,"form-data":e.actualLdapConfig},{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(u,{id:"ldapSettings","content-title":e.translate("LoginLdap_Settings")},{default:Object(o["withCtx"])(()=>[e.updatedFromPre30?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",m,[Object(o["createVNode"])(r,{id:"pre300AlwaysUseLdapWarning",context:"warning",noclear:!0},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("General_Note")),1),Object(o["createTextVNode"])(": "+Object(o["toDisplayString"])(e.translate("LoginLdap_UpdateFromPre300Warning")),1)]),_:1})])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",name:"synchronize_users_after_login",modelValue:e.actualLdapConfig.use_ldap_for_authentication,"onUpdate:modelValue":t[0]||(t[0]=t=>e.actualLdapConfig.use_ldap_for_authentication=t),title:e.translate("LoginLdap_UseLdapForAuthentication"),"inline-help":e.useLdapForAuthHelp},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",name:"use_webserver_auth",modelValue:e.actualLdapConfig.use_webserver_auth,"onUpdate:modelValue":t[1]||(t[1]=t=>e.actualLdapConfig.use_webserver_auth=t),title:e.translate("LoginLdap_Kerberos"),"inline-help":e.translate("LoginLdap_KerberosDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",name:"enable_password_confirmation",modelValue:e.actualLdapConfig.enable_password_confirmation,"onUpdate:modelValue":t[2]||(t[2]=t=>e.actualLdapConfig.enable_password_confirmation=t),title:e.translate("LoginLdap_OptionsPWCONFIRMATION"),"inline-help":e.translate("LoginLdap_OptionsPWCONFIRMATIONDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",name:"strip_domain_from_web_auth",modelValue:e.actualLdapConfig.strip_domain_from_web_auth,"onUpdate:modelValue":t[3]||(t[3]=t=>e.actualLdapConfig.strip_domain_from_web_auth=t),title:e.translate("LoginLdap_StripDomainFromWebAuth"),"inline-help":e.translate("LoginLdap_StripDomainFromWebAuthDescription")},null,8,["modelValue","title","inline-help"])])],512),[[o["vShow"],e.actualLdapConfig.use_webserver_auth]]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_network_timeout",modelValue:e.actualLdapConfig.ldap_network_timeout,"onUpdate:modelValue":t[4]||(t[4]=t=>e.actualLdapConfig.ldap_network_timeout=t),title:e.translate("LoginLdap_NetworkTimeout"),"inline-help":e.ldapNetworkTimeoutHelp},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"required_member_of_field",modelValue:e.actualLdapConfig.required_member_of_field,"onUpdate:modelValue":t[5]||(t[5]=t=>e.actualLdapConfig.required_member_of_field=t),title:e.translate("LoginLdap_MemberOfField"),"inline-help":e.translate("LoginLdap_MemberOfFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(d,{uicontrol:"text",modelValue:e.actualLdapConfig.required_member_of,"onUpdate:modelValue":t[6]||(t[6]=t=>e.actualLdapConfig.required_member_of=t),name:"required_member_of","test-api-method":"LoginLdap.getCountOfUsersMemberOf","test-api-method-arg":"memberOf","success-translation":"LoginLdap_MemberOfCount",title:e.translate("LoginLdap_MemberOf"),"inline-help":e.memberOfCountHelp},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(d,{uicontrol:"text",modelValue:e.actualLdapConfig.ldap_user_filter,"onUpdate:modelValue":t[7]||(t[7]=t=>e.actualLdapConfig.ldap_user_filter=t),name:"ldap_user_filter","test-api-method":"LoginLdap.getCountOfUsersMatchingFilter","test-api-method-arg":"filter","success-translation":"LoginLdap_FilterCount",title:e.translate("LoginLdap_Filter"),"inline-help":e.translate("LoginLdap_FilterDescription")},null,8,["modelValue","title","inline-help"])]),_,Object(o["createVNode"])(c,{saving:e.isSavingConfig,onConfirm:t[8]||(t[8]=t=>e.requestSaveLdapConfig())},null,8,["saving"])]),_:1},8,["content-title"]),Object(o["createVNode"])(u,{id:"ldapUserMappingSettings","content-title":e.translate("LoginLdap_UserSyncSettings")},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_user_id_field",modelValue:e.actualLdapConfig.ldap_user_id_field,"onUpdate:modelValue":t[9]||(t[9]=t=>e.actualLdapConfig.ldap_user_id_field=t),title:e.translate("LoginLdap_UserIdField"),"inline-help":e.translate("LoginLdap_UserIdFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_password_field",modelValue:e.actualLdapConfig.ldap_password_field,"onUpdate:modelValue":t[10]||(t[10]=t=>e.actualLdapConfig.ldap_password_field=t),title:e.ldapPasswordFieldTitle,"inline-help":e.ldapPasswordFieldHelp},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_mail_field",modelValue:e.actualLdapConfig.ldap_mail_field,"onUpdate:modelValue":t[11]||(t[11]=t=>e.actualLdapConfig.ldap_mail_field=t),title:e.translate("LoginLdap_MailField"),"inline-help":e.translate("LoginLdap_MailFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"user_email_suffix",modelValue:e.actualLdapConfig.user_email_suffix,"onUpdate:modelValue":t[12]||(t[12]=t=>e.actualLdapConfig.user_email_suffix=t),title:e.translate("LoginLdap_UsernameSuffix"),"inline-help":e.translate("LoginLdap_UsernameSuffixDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"new_user_default_sites_view_access",modelValue:e.actualLdapConfig.new_user_default_sites_view_access,"onUpdate:modelValue":t[13]||(t[13]=t=>e.actualLdapConfig.new_user_default_sites_view_access=t),title:e.translate("LoginLdap_NewUserDefaultSitesViewAccess"),"inline-help":e.translate("LoginLdap_NewUserDefaultSitesViewAccessDescription")},null,8,["modelValue","title","inline-help"])]),b,Object(o["createVNode"])(c,{saving:e.isSavingConfig,onConfirm:t[14]||(t[14]=t=>e.requestSaveLdapConfig())},null,8,["saving"])]),_:1},8,["content-title"]),Object(o["createVNode"])(u,{id:"ldapUserAccessMappingSettings","content-title":e.translate("LoginLdap_AccessSyncSettings")},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("p",{innerHTML:e.$sanitize(e.readMoreAboutAccessSynchronization)},null,8,g),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",name:"enable_synchronize_access_from_ldap",modelValue:e.actualLdapConfig.enable_synchronize_access_from_ldap,"onUpdate:modelValue":t[15]||(t[15]=t=>e.actualLdapConfig.enable_synchronize_access_from_ldap=t),title:e.translate("LoginLdap_EnableLdapAccessSynchronization"),"inline-help":e.translate("LoginLdap_EnableLdapAccessSynchronizationDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{context:"info",noclear:!0},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("LoginLdap_ExpectedLdapAttributes")),1),f,L,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("LoginLdap_ExpectedLdapAttributesPrelude"))+":",1),h,V,Object(o["createElementVNode"])("ul",null,[Object(o["createElementVNode"])("li",{innerHTML:e.$sanitize(e.sampleViewAttribute)},null,8,O),Object(o["createElementVNode"])("li",{innerHTML:e.$sanitize(e.sampleAdminAttribute)},null,8,v),Object(o["createElementVNode"])("li",{innerHTML:e.$sanitize(e.sampleSuperuserAttribute)},null,8,j)])]),_:1})]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_view_access_field",modelValue:e.actualLdapConfig.ldap_view_access_field,"onUpdate:modelValue":t[16]||(t[16]=t=>e.actualLdapConfig.ldap_view_access_field=t),title:e.translate("LoginLdap_LdapViewAccessField"),"inline-help":e.translate("LoginLdap_LdapViewAccessFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_admin_access_field",modelValue:e.actualLdapConfig.ldap_admin_access_field,"onUpdate:modelValue":t[17]||(t[17]=t=>e.actualLdapConfig.ldap_admin_access_field=t),title:e.translate("LoginLdap_LdapAdminAccessField"),"inline-help":e.translate("LoginLdap_LdapAdminAccessFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"ldap_superuser_access_field",modelValue:e.actualLdapConfig.ldap_superuser_access_field,"onUpdate:modelValue":t[18]||(t[18]=t=>e.actualLdapConfig.ldap_superuser_access_field=t),title:e.translate("LoginLdap_LdapSuperUserAccessField"),"inline-help":e.translate("LoginLdap_LdapSuperUserAccessFieldDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"user_access_attribute_server_specification_delimiter",modelValue:e.actualLdapConfig.user_access_attribute_server_specification_delimiter,"onUpdate:modelValue":t[19]||(t[19]=t=>e.actualLdapConfig.user_access_attribute_server_specification_delimiter=t),title:e.translate("LoginLdap_LdapUserAccessAttributeServerSpecDelimiter"),"inline-help":e.translate("LoginLdap_LdapUserAccessAttributeServerSpecDelimiterDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"user_access_attribute_server_separator",modelValue:e.actualLdapConfig.user_access_attribute_server_separator,"onUpdate:modelValue":t[20]||(t[20]=t=>e.actualLdapConfig.user_access_attribute_server_separator=t),title:e.translate("LoginLdap_LdapUserAccessAttributeServerSeparator"),"inline-help":e.translate("LoginLdap_LdapUserAccessAttributeServerSeparatorDescription")},null,8,["modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",name:"instance_name",modelValue:e.actualLdapConfig.instance_name,"onUpdate:modelValue":t[21]||(t[21]=t=>e.actualLdapConfig.instance_name=t),title:e.translate("LoginLdap_ThisMatomoInstanceName"),"inline-help":e.translate("LoginLdap_ThisMatomoInstanceNameDescription")},null,8,["modelValue","title","inline-help"])]),C,Object(o["createVNode"])(c,{saving:e.isSavingConfig,onConfirm:t[22]||(t[22]=t=>e.requestSaveLdapConfig())},null,8,["saving"])],512),[[o["vShow"],e.actualLdapConfig.enable_synchronize_access_from_ldap]])]),_:1},8,["content-title"])]),_:1},8,["form-data"])]),Object(o["createVNode"])(u,{id:"ldapManualSynchronizeUser","content-title":e.translate("LoginLdap_LoadUser")},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("LoginLdap_LoadUserDescription")),1),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",placeholder:"Enter a username...",modelValue:e.userToSynchronize,"onUpdate:modelValue":t[23]||(t[23]=t=>e.userToSynchronize=t)},null,8,["modelValue"])]),Object(o["createVNode"])(c,{onConfirm:t[24]||(t[24]=t=>e.synchronizeUser(e.userToSynchronize)),value:e.translate("LoginLdap_Go"),style:{"margin-right":"7px"}},null,8,["value"]),Object(o["withDirectives"])(Object(o["createElementVNode"])("img",N,null,512),[[o["vShow"],e.isSynchronizing]]),S,w,Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[e.synchronizeUserError?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.synchronizeUserError)},null,8,y)):Object(o["createCommentVNode"])("",!0),e.synchronizeUserDone?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",E,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("General_Done"))+"!",1)])):Object(o["createCommentVNode"])("",!0),A],512),[[o["vShow"],e.synchronizeUserError||e.synchronizeUserDone]]),Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.loadUserCommandDesc)},null,8,U)]),_:1},8,["content-title"]),Object(o["createVNode"])(u,{"content-title":e.translate("LoginLdap_LDAPServers")},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(p,{"submit-api-method":"LoginLdap.saveServersInfo","send-json-payload":!0,"use-custom-data-binding":!0,"form-data":e.actualServers},{default:Object(o["withCtx"])(()=>[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.actualServers,(t,n)=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{id:"ldapServersTable",key:n},[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",modelValue:t.name,"onUpdate:modelValue":e=>t.name=e,title:e.translate("LoginLdap_ServerName")},null,8,["modelValue","onUpdate:modelValue","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",modelValue:t.hostname,"onUpdate:modelValue":e=>t.hostname=e,placeholder:"localhost",title:e.translate("LoginLdap_ServerUrl")},null,8,["modelValue","onUpdate:modelValue","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",modelValue:t.port,"onUpdate:modelValue":e=>t.port=e,placeholder:"389",title:e.translate("LoginLdap_LdapPort"),"inline-help":e.translate("LoginLdap_LdapUrlPortWarning")},null,8,["modelValue","onUpdate:modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"checkbox",modelValue:t.start_tls,"onUpdate:modelValue":e=>t.start_tls=e,title:e.translate("LoginLdap_StartTLS"),"inline-help":e.translate("LoginLdap_StartTLSFieldHelp")},null,8,["modelValue","onUpdate:modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",placeholder:"dc=example,dc=site,dc=org",modelValue:t.base_dn,"onUpdate:modelValue":e=>t.base_dn=e,title:e.translate("LoginLdap_BaseDn")},null,8,["modelValue","onUpdate:modelValue","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{uicontrol:"text",placeholder:"cn=admin,dc=example,dc=site,dc=org",modelValue:t.admin_user,"onUpdate:modelValue":e=>t.admin_user=e,title:e.translate("LoginLdap_AdminUser"),"inline-help":e.translate("LoginLdap_AdminUserDescription")},null,8,["modelValue","onUpdate:modelValue","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{modelValue:t.admin_pass,"onUpdate:modelValue":e=>t.admin_pass=e,uicontrol:"password",title:e.translate("LoginLdap_AdminPass")},null,8,["modelValue","onUpdate:modelValue","title"])]),Object(o["createVNode"])(c,{onConfirm:t=>e.actualServers.splice(n,1),value:e.translate("General_Delete")},null,8,["onConfirm","value"])]))),128)),x,Object(o["createVNode"])(c,{onConfirm:t[25]||(t[25]=t=>e.addServer()),value:e.translate("General_Add"),style:{"margin-right":"3.5px"}},null,8,["value"]),Object(o["createVNode"])(c,{saving:e.isSavingServers,onConfirm:t[26]||(t[26]=t=>e.requestSaveServers())},null,8,["saving"])]),_:1},8,["form-data"])])]),_:1},8,["content-title"]),Object(o["createVNode"])(D,{modelValue:e.showPasswordConfirmation,"onUpdate:modelValue":t[27]||(t[27]=t=>e.showPasswordConfirmation=t),onConfirmed:e.confirmSaveAction,onAborted:t[28]||(t[28]=t=>e.pendingSaveTarget=null)},null,8,["modelValue","onConfirmed"])])}function F(e,t,n,a){let l=t+": ";return e.instance_name?l+=e.instance_name:l+=window.location.hostname,n&&(l+=`${e.user_access_attribute_server_separator}${n}`),l+=e.user_access_attribute_server_specification_delimiter,e.instance_name?l+="piwikB":l+="anotherhost.com",a&&(l+=`${e.user_access_attribute_server_separator}${a}`),l}var T=Object(o["defineComponent"])({props:{ldapConfig:{type:Object,required:!0},servers:{type:Array,required:!0},updatedFromPre30:Boolean},components:{AjaxForm:d["AjaxForm"],ContentBlock:d["ContentBlock"],Notification:d["Notification"],PasswordConfirmation:c["PasswordConfirmation"],Field:c["Field"],TestableField:p,SaveButton:c["SaveButton"]},data(){return{actualLdapConfig:Object.assign({},this.ldapConfig),userToSynchronize:"",actualServers:[...this.servers],synchronizeUserError:null,synchronizeUserDone:null,isSynchronizing:!1,isSavingConfig:!1,isSavingServers:!1,showPasswordConfirmation:!1,pendingSaveTarget:null}},methods:{addServer(){this.actualServers.push({name:"server"+(this.actualServers.length+1),hostname:"",port:389,base_dn:"",admin_user:"",admin_pass:""})},synchronizeUser(e){this.synchronizeUserError=null,this.synchronizeUserDone=null,this.isSynchronizing=!0,d["AjaxHelper"].post({method:"LoginLdap.synchronizeUser"},{login:e},{createErrorNotification:!1}).then(()=>{this.synchronizeUserDone=!0}).catch(e=>{this.synchronizeUserError=e.message||e}).finally(()=>{this.isSynchronizing=!1})},requestSaveLdapConfig(){this.pendingSaveTarget="config",this.showPasswordConfirmation=!0},requestSaveServers(){this.pendingSaveTarget="servers",this.showPasswordConfirmation=!0},confirmSaveAction(e){const{pendingSaveTarget:t}=this;this.showPasswordConfirmation=!1,this.pendingSaveTarget=null,"config"===t?this.saveLdapConfig(e):"servers"===t&&this.saveServers(e)},saveLdapConfig(e){this.isSavingConfig=!0,this.actualLdapConfig.password_confirmation=e||"";const t={data:JSON.stringify(this.actualLdapConfig)};d["AjaxHelper"].post({module:"API",method:"LoginLdap.saveLdapConfig"},t).then(()=>{this.showSaveSuccessNotification()}).finally(()=>{this.actualLdapConfig.password_confirmation="",this.isSavingConfig=!1})},saveServers(e){this.isSavingServers=!0;const t={data:JSON.stringify(this.actualServers)};e&&(t.passwordConfirmation=e),d["AjaxHelper"].post({module:"API",method:"LoginLdap.saveServersInfo"},t).then(()=>{this.showSaveSuccessNotification()}).finally(()=>{this.isSavingServers=!1})},showSaveSuccessNotification(){const e=d["NotificationsStore"].show({message:Object(d["translate"])("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});d["NotificationsStore"].scrollToNotification(e)}},computed:{sampleViewAttribute(){const e=this.actualLdapConfig;return F(e,e.ldap_view_access_field,"1,2","3,4")},sampleAdminAttribute(){const e=this.actualLdapConfig;return F(e,e.ldap_admin_access_field,"all","all")},sampleSuperuserAttribute(){const e=this.actualLdapConfig;return F(e,e.ldap_superuser_access_field)},readMoreAboutAccessSynchronization(){const e="https://github.com/matomo-org/plugin-LoginLdap#matomo-access-synchronization";return Object(d["translate"])("LoginLdap_ReadMoreAboutAccessSynchronization",``,"")},loadUserCommandDesc(){const e="https://github.com/matomo-org/plugin-LoginLdap#commands";return Object(d["translate"])("LoginLdap_LoadUserCommandDesc",`loginldap:synchronize-users`)},useLdapForAuthHelp(){const e=Object(d["translate"])("LoginLdap_UseLdapForAuthenticationDescription");return`${e}
${Object(d["translate"])("LoginLdap_MobileAppIntegrationNote")}`},ldapNetworkTimeoutHelp(){const e=Object(d["translate"])("LoginLdap_NetworkTimeoutDescription");return`${e}
${Object(d["translate"])("LoginLdap_NetworkTimeoutDescription2")}`},memberOfCountHelp(){const e=Object(d["translate"])("LoginLdap_MemberOfDescription");return`${e}
${Object(d["translate"])("LoginLdap_MemberOfDescription2")}`},ldapPasswordFieldTitle(){return this.actualLdapConfig.use_ldap_for_authentication?Object(d["translate"])("LoginLdap_PasswordFieldLegacy"):Object(d["translate"])("LoginLdap_PasswordField")},ldapPasswordFieldHelp(){if(this.actualLdapConfig.use_ldap_for_authentication){const e=Object(d["translate"])("LoginLdap_PasswordFieldLdapAuthDescription");return`${e}
${Object(d["translate"])("LoginLdap_PasswordFieldLdapAuthDescription2")}`}const e=Object(d["translate"])("LoginLdap_PasswordFieldDescription");return`${e}
${Object(d["translate"])("LoginLdap_PasswordFieldDescription2")}`}}});T.render=D;var M=T;function k(e,t,n,a,l,i){const r=Object(o["resolveComponent"])("Admin");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createVNode"])(r,{servers:e.servers,"ldap-config":e.ldapConfig,"updated-from-pre30":e.updatedFromPre30},null,8,["servers","ldap-config","updated-from-pre30"])])}var P=Object(o["defineComponent"])({props:{ldapConfig:{type:Object,required:!0},servers:{type:Array,required:!0},updatedFromPre30:Boolean},components:{Admin:M}});P.render=k;var z=P;
/*!
* Matomo - free/libre analytics platform
*
diff --git a/vue/src/Admin/Admin.vue b/vue/src/Admin/Admin.vue
index b08ee1ec..af0a6f3f 100644
--- a/vue/src/Admin/Admin.vue
+++ b/vue/src/Admin/Admin.vue
@@ -141,7 +141,7 @@
uicontrol="text"
name="ldap_password_field"
v-model="actualLdapConfig.ldap_password_field"
- :title="translate('LoginLdap_PasswordField')"
+ :title="ldapPasswordFieldTitle"
:inline-help="ldapPasswordFieldHelp"
>
@@ -390,7 +390,6 @@
v-model="serverInfo.admin_pass"
uicontrol="password"
:title="translate('LoginLdap_AdminPass')"
- :inline-help="translate('LoginLdap_PasswordFieldHelp')"
>
@@ -693,7 +692,17 @@ export default defineComponent({
const start = translate('LoginLdap_MemberOfDescription');
return `${start}
${translate('LoginLdap_MemberOfDescription2')}`;
},
+ ldapPasswordFieldTitle() {
+ return this.actualLdapConfig.use_ldap_for_authentication
+ ? translate('LoginLdap_PasswordFieldLegacy')
+ : translate('LoginLdap_PasswordField');
+ },
ldapPasswordFieldHelp() {
+ if (this.actualLdapConfig.use_ldap_for_authentication) {
+ const start = translate('LoginLdap_PasswordFieldLdapAuthDescription');
+ return `${start}
${translate('LoginLdap_PasswordFieldLdapAuthDescription2')}`;
+ }
+
const start = translate('LoginLdap_PasswordFieldDescription');
return `${start}
${translate('LoginLdap_PasswordFieldDescription2')}`;
},