]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add settings to ignore second display name in search 31932/head
authorLouis Chemineau <louis@chmn.me>
Tue, 12 Apr 2022 10:54:39 +0000 (12:54 +0200)
committerLouis Chemineau <louis@chmn.me>
Tue, 12 Apr 2022 15:27:59 +0000 (17:27 +0200)
Signed-off-by: Louis Chemineau <louis@chmn.me>
apps/settings/lib/Settings/Admin/Sharing.php
apps/settings/src/admin.js
apps/settings/templates/settings/admin/sharing.php
apps/settings/tests/Settings/Admin/SharingTest.php
build/integration/features/bootstrap/CollaborationContext.php
dist/settings-legacy-admin.js
dist/settings-legacy-admin.js.map
lib/private/Collaboration/Collaborators/UserPlugin.php
tests/lib/Collaboration/Collaborators/UserPluginTest.php

index d2c3e907b3e8641b4d9bfde07f45873c13a9e26b..56c89c515a81b8ed7bfb9984fd6668276f1120e6 100644 (file)
@@ -90,6 +90,7 @@ class Sharing implements IDelegatedSettings {
                        'restrictUserEnumerationToPhone' => $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_to_phone', 'no'),
                        'restrictUserEnumerationFullMatch' => $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match', 'yes'),
                        'restrictUserEnumerationFullMatchUserId' => $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match_userid', 'yes'),
+                       'restrictUserEnumerationFullMatchIgnoreSecondDisplayName' => $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match_ignore_second_display_name', 'no'),
                        'enforceLinkPassword' => Util::isPublicLinkPasswordRequired(false),
                        'passwordExcludedGroups' => $excludedPasswordGroupsList,
                        'passwordExcludedGroupsFeatureEnabled' => $this->config->getSystemValueBool('sharing.allow_disabled_password_enforcement_groups', false),
index ee7b4b6b202599e6469bb3e35e896ab4893dff98..feb03a865b97b26d4d31189dbf7a135c3bdf1721 100644 (file)
@@ -157,6 +157,7 @@ window.addEventListener('DOMContentLoaded', () => {
 
        $('#shareapi_restrict_user_enumeration_full_match').on('change', function() {
                $('#shareapi_restrict_user_enumeration_full_match_userid_setting').toggleClass('hidden', !this.checked)
+               $('#shareapi_restrict_user_enumeration_full_match_ignore_second_display_name_setting').toggleClass('hidden', !this.checked)
        })
 
        $('#allowLinks').change(function() {
index 09918d4bc64322c6bcf90587062a58397a83f1b3..3cf410727ccff3c2278b9b4f311de96d7548c21d 100644 (file)
 } ?> />
                        <label for="shareapi_restrict_user_enumeration_full_match"><?php p($l->t('Allow autocompletion when entering the full name or email address (ignoring missing phonebook match and being in the same group)'));?></label><br />
                </p>
-               <p id="shareapi_restrict_user_enumeration_full_match_userid_setting" class="double-indent <?php if ($_['shareAPIEnabled'] === 'no' || $_['restrictUserEnumerationFullMatchUserId'] === 'no') {
+               <p id="shareapi_restrict_user_enumeration_full_match_userid_setting" class="double-indent <?php if ($_['shareAPIEnabled'] === 'no' || $_['restrictUserEnumerationFullMatch'] === 'no') {
        p('hidden');
 }?>">
                        <input type="checkbox" name="shareapi_restrict_user_enumeration_full_match_userid" value="1" id="shareapi_restrict_user_enumeration_full_match_userid" class="checkbox"
-                                       <?php if ($_['shareeEnumerationFullMatchUserId'] === 'yes') {
+                                       <?php if ($_['restrictUserEnumerationFullMatchUserId'] === 'yes') {
        print_unescaped('checked="checked"');
 } ?> />
                        <label for="shareapi_restrict_user_enumeration_full_match_userid"><?php p($l->t('Match username when restricting to full match'));?></label><br />
                </p>
+               <p id="shareapi_restrict_user_enumeration_full_match_ignore_second_display_name_setting" class="double-indent <?php if ($_['shareAPIEnabled'] === 'no' || $_['restrictUserEnumerationFullMatch'] === 'no') {
+       p('hidden');
+}?>">
+                       <input type="checkbox" name="shareapi_restrict_user_enumeration_full_match_ignore_second_display_name" value="1" id="shareapi_restrict_user_enumeration_full_match_ignore_second_display_name" class="checkbox"
+                                       <?php if ($_['restrictUserEnumerationFullMatchIgnoreSecondDisplayName'] === 'yes') {
+       print_unescaped('checked="checked"');
+} ?> />
+                       <label for="shareapi_restrict_user_enumeration_full_match_ignore_second_display_name"><?php p($l->t('Ignore second display name in parentheses if any. Example: "First display name (second ignored display name)"'));?></label><br />
+               </p>
 
                <p>
                        <input type="checkbox" id="publicShareDisclaimer" class="checkbox noJSAutoUpdate"
index f472685574d6300a45bcb21e3fb97d9f7dd145f6..e0693b4f9638fb7bc0e2ce5344e23f857d07d4a2 100644 (file)
@@ -84,6 +84,7 @@ class SharingTest extends TestCase {
                                ['core', 'shareapi_restrict_user_enumeration_to_phone', 'no', 'no'],
                                ['core', 'shareapi_restrict_user_enumeration_full_match', 'yes', 'yes'],
                                ['core', 'shareapi_restrict_user_enumeration_full_match_userid', 'yes', 'yes'],
+                               ['core', 'shareapi_restrict_user_enumeration_full_match_ignore_second_display_name', 'no', 'no'],
                                ['core', 'shareapi_enabled', 'yes', 'yes'],
                                ['core', 'shareapi_default_expire_date', 'no', 'no'],
                                ['core', 'shareapi_expire_after_n_days', '7', '7'],
@@ -118,6 +119,7 @@ class SharingTest extends TestCase {
                                'restrictUserEnumerationToPhone' => 'no',
                                'restrictUserEnumerationFullMatch' => 'yes',
                                'restrictUserEnumerationFullMatchUserId' => 'yes',
+                               'restrictUserEnumerationFullMatchIgnoreSecondDisplayName' => 'no',
                                'enforceLinkPassword' => false,
                                'onlyShareWithGroupMembers' => false,
                                'shareAPIEnabled' => 'yes',
@@ -161,6 +163,7 @@ class SharingTest extends TestCase {
                                ['core', 'shareapi_restrict_user_enumeration_to_phone', 'no', 'no'],
                                ['core', 'shareapi_restrict_user_enumeration_full_match', 'yes', 'yes'],
                                ['core', 'shareapi_restrict_user_enumeration_full_match_userid', 'yes', 'yes'],
+                               ['core', 'shareapi_restrict_user_enumeration_full_match_ignore_second_display_name', 'no', 'no'],
                                ['core', 'shareapi_enabled', 'yes', 'yes'],
                                ['core', 'shareapi_default_expire_date', 'no', 'no'],
                                ['core', 'shareapi_expire_after_n_days', '7', '7'],
@@ -195,6 +198,7 @@ class SharingTest extends TestCase {
                                'restrictUserEnumerationToPhone' => 'no',
                                'restrictUserEnumerationFullMatch' => 'yes',
                                'restrictUserEnumerationFullMatchUserId' => 'yes',
+                               'restrictUserEnumerationFullMatchIgnoreSecondDisplayName' => 'no',
                                'enforceLinkPassword' => false,
                                'onlyShareWithGroupMembers' => false,
                                'shareAPIEnabled' => 'yes',
index bc01a32f12cf48cffe626225ede63b4743fa13cd..b62588060a4898fd577633ce2d4abf5fed375e32 100644 (file)
@@ -123,6 +123,7 @@ EOF;
                $this->deleteServerConfig('core', 'shareapi_restrict_user_enumeration_to_phone');
                $this->deleteServerConfig('core', 'shareapi_restrict_user_enumeration_full_match');
                $this->deleteServerConfig('core', 'shareapi_restrict_user_enumeration_full_match_userid');
+               $this->deleteServerConfig('core', 'shareapi_restrict_user_enumeration_full_match_ignore_second_display_name');
                $this->deleteServerConfig('core', 'shareapi_only_share_with_group_members');
        }
 
index acf1b69cbf310b7013494ed7d84165e92ead2b55..f38a60f2b0d1ace01fcba4e343ed6deb358b3d61 100644 (file)
@@ -1,2 +1,2 @@
-({39583:function(){var e=this;window.addEventListener("DOMContentLoaded",(function(){$("#excludedGroups,#linksExcludedGroups,#passwordsExcludedGroups").each((function(e,t){var s=this;OC.Settings.setupGroupsSelect($(t)),$(t).change((function(e){var t=e.val||[];t=JSON.stringify(t),OCP.AppConfig.setValue("core",$(s).attr("name"),t)}))})),$("#loglevel").change((function(){$.post(OC.generateUrl("/settings/admin/log/level"),{level:$(e).val()},(function(){OC.Log.reload()}))})),$("#backgroundjobs span.crondate").tooltip({placement:"top"}),$("#backgroundjobs input").change((function(){if($(e).is(":checked")){var t=$(e).val();"ajax"!==t&&"webcron"!==t&&"cron"!==t||OCP.AppConfig.setValue("core","backgroundjobs_mode",t,{success:function(){OCP.AppConfig.deleteKey("core","cronErrors")}})}})),$("#shareAPIEnabled").change((function(){$("#shareAPI p:not(#enable)").toggleClass("hidden",!e.checked)})),$("#enableEncryption").change((function(){$("#encryptionAPI div#EncryptionWarning").toggleClass("hidden")})),$("#reallyEnableEncryption").click((function(){$("#encryptionAPI div#EncryptionWarning").toggleClass("hidden"),$("#encryptionAPI div#EncryptionSettingsArea").toggleClass("hidden"),OCP.AppConfig.setValue("core","encryption_enabled","yes"),$("#enableEncryption").attr("disabled","disabled")})),$("#startmigration").click((function(e){$(window).on("beforeunload.encryption",(function(e){return t("settings","Migration in progress. Please wait until the migration is finished")})),e.preventDefault(),$("#startmigration").prop("disabled",!0),OC.msg.startAction("#startmigration_msg",t("settings","Migration started …")),$.post(OC.generateUrl("/settings/admin/startmigration"),"",(function(e){OC.msg.finishedAction("#startmigration_msg",e),"success"===e.status?($("#encryptionAPI div#selectEncryptionModules").toggleClass("hidden"),$("#encryptionAPI div#migrationWarning").toggleClass("hidden")):$("#startmigration").prop("disabled",!1),$(window).off("beforeunload.encryption")}))})),$("#shareapiExpireAfterNDays").on("input",(function(){this.value=this.value.replace(/\D/g,"")})),$("#shareAPI input:not(.noJSAutoUpdate)").change((function(){var e=$(this).val();"checkbox"===$(this).attr("type")&&(e=this.checked?"yes":"no"),OCP.AppConfig.setValue("core",$(this).attr("name"),e)})),$("#shareapiDefaultExpireDate").change((function(){$("setDefaultExpireDate").toggleClass("hidden",!this.checked)})),$("#shareapiDefaultInternalExpireDate").change((function(){$("#setDefaultInternalExpireDate").toggleClass("hidden",!this.checked)})),$("#shareapiDefaultRemoteExpireDate").change((function(){$("#setDefaultRemoteExpireDate").toggleClass("hidden",!this.checked)})),$("#enforceLinkPassword").change((function(){$("#selectPasswordsExcludedGroups").toggleClass("hidden",!this.checked)})),$("#publicShareDisclaimer").change((function(){$("#publicShareDisclaimerText").toggleClass("hidden",!this.checked),this.checked||s("")})),$("#shareApiDefaultPermissionsSection input").change((function(e){var t=$("#shareApiDefaultPermissions"),s=$(e.target),n=t.val();return s.is(":checked")?n|=s.val():n&=~s.val(),n|=OC.PERMISSION_READ,t.val(n).change(),e.preventDefault(),!1}));var s=_.debounce((function(e){var s={success:function(){OC.msg.finishedSuccess("#publicShareDisclaimerStatus",t("settings","Saved"))},error:function(){OC.msg.finishedError("#publicShareDisclaimerStatus",t("settings","Not saved"))}};OC.msg.startSaving("#publicShareDisclaimerStatus"),_.isString(e)&&""!==e?OCP.AppConfig.setValue("core","shareapi_public_link_disclaimertext",e,s):($("#publicShareDisclaimerText").val(""),OCP.AppConfig.deleteKey("core","shareapi_public_link_disclaimertext",s))}),500);$("#publicShareDisclaimerText").on("change, keyup",(function(){s(this.value)})),$("#shareapi_allow_share_dialog_user_enumeration").on("change",(function(){$("#shareapi_restrict_user_enumeration_to_group_setting").toggleClass("hidden",!this.checked),$("#shareapi_restrict_user_enumeration_to_phone_setting").toggleClass("hidden",!this.checked),$("#shareapi_restrict_user_enumeration_combinewarning_setting").toggleClass("hidden",!this.checked)})),$("#shareapi_restrict_user_enumeration_full_match").on("change",(function(){$("#shareapi_restrict_user_enumeration_full_match_userid_setting").toggleClass("hidden",!this.checked)})),$("#allowLinks").change((function(){$("#publicLinkSettings").toggleClass("hidden",!this.checked),$("#setDefaultExpireDate").toggleClass("hidden",!(this.checked&&$("#shareapiDefaultExpireDate")[0].checked))})),$("#mail_smtpauth").change((function(){this.checked?$("#mail_credentials").removeClass("hidden"):$("#mail_credentials").addClass("hidden")})),$("#mail_smtpmode").change((function(){"smtp"!==$(this).val()?($("#setting_smtpauth").addClass("hidden"),$("#setting_smtphost").addClass("hidden"),$("#mail_smtpsecure_label").addClass("hidden"),$("#mail_smtpsecure").addClass("hidden"),$("#mail_credentials").addClass("hidden"),$("#mail_sendmailmode_label, #mail_sendmailmode").removeClass("hidden")):($("#setting_smtpauth").removeClass("hidden"),$("#setting_smtphost").removeClass("hidden"),$("#mail_smtpsecure_label").removeClass("hidden"),$("#mail_smtpsecure").removeClass("hidden"),$("#mail_smtpauth").is(":checked")&&$("#mail_credentials").removeClass("hidden"),$("#mail_sendmailmode_label, #mail_sendmailmode").addClass("hidden"))})),$("#mail_general_settings_form").change((function e(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(e):(OC.msg.startSaving("#mail_settings_msg"),$.ajax({url:OC.generateUrl("/settings/admin/mailsettings"),type:"POST",data:$("#mail_general_settings_form").serialize(),success:function(){OC.msg.finishedSuccess("#mail_settings_msg",t("settings","Saved"))},error:function(e){OC.msg.finishedError("#mail_settings_msg",e.responseJSON)}}))})),$("#mail_credentials_settings_submit").click((function e(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(e):(OC.msg.startSaving("#mail_settings_msg"),$.ajax({url:OC.generateUrl("/settings/admin/mailsettings/credentials"),type:"POST",data:$("#mail_credentials_settings").serialize(),success:function(){OC.msg.finishedSuccess("#mail_settings_msg",t("settings","Saved"))},error:function(e){OC.msg.finishedError("#mail_settings_msg",e.responseJSON)}}))})),$("#mail_smtppassword").click((function(){"text"===e.type&&"********"===e.value&&(e.type="password",e.value="")})),$("#sendtestemail").click((function(e){e.preventDefault(),OC.msg.startAction("#sendtestmail_msg",t("settings","Sending…")),$.ajax({url:OC.generateUrl("/settings/admin/mailtest"),type:"POST",success:function(){OC.msg.finishedSuccess("#sendtestmail_msg",t("settings","Email sent"))},error:function(e){OC.msg.finishedError("#sendtestmail_msg",e.responseJSON)}})})),$("#allowGroupSharing").change((function(){$("#allowGroupSharing").toggleClass("hidden",!e.checked)})),$("#shareapiExcludeGroups").change((function(){$("#selectExcludedGroups").toggleClass("hidden",!e.checked)})),null!==document.getElementById("security-warning")&&$.when(OC.SetupChecks.checkWebDAV(),OC.SetupChecks.checkWellKnownUrl("GET","/.well-known/webfinger",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown"),[200,404],!0),OC.SetupChecks.checkWellKnownUrl("GET","/.well-known/nodeinfo",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown"),[200,404],!0),OC.SetupChecks.checkWellKnownUrl("PROPFIND","/.well-known/caldav",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown")),OC.SetupChecks.checkWellKnownUrl("PROPFIND","/.well-known/carddav",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown")),OC.SetupChecks.checkProviderUrl(OC.getRootPath()+"/ocm-provider/",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown")),OC.SetupChecks.checkProviderUrl(OC.getRootPath()+"/ocs-provider/",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown")),OC.SetupChecks.checkSetup(),OC.SetupChecks.checkGeneric(),OC.SetupChecks.checkWOFF2Loading(OC.filePath("core","","fonts/NotoSans-Regular-latin.woff2"),OC.theme.docPlaceholderUrl),OC.SetupChecks.checkDataProtected()).then((function(e,t,s,n,i,a,r,c,l,o,d){var h=[].concat(e,t,s,n,i,a,r,c,l,o,d),g=$("#postsetupchecks");$("#security-warning-state-loading").addClass("hidden");for(var u=!1,p=g.find(".errors"),m=g.find(".warnings"),C=g.find(".info"),f=0;f<h.length;f++)switch(h[f].type){case OC.SetupChecks.MESSAGE_TYPE_INFO:C.append("<li>"+h[f].msg+"</li>");break;case OC.SetupChecks.MESSAGE_TYPE_WARNING:m.append("<li>"+h[f].msg+"</li>");break;case OC.SetupChecks.MESSAGE_TYPE_ERROR:default:p.append("<li>"+h[f].msg+"</li>")}p.find("li").length>0&&(p.removeClass("hidden"),u=!0),m.find("li").length>0&&(m.removeClass("hidden"),u=!0),C.find("li").length>0&&(C.removeClass("hidden"),u=!0),u?($("#postsetupchecks-hint").removeClass("hidden"),p.find("li").length>0?$("#security-warning-state-failure").removeClass("hidden"):$("#security-warning-state-warning").removeClass("hidden")):0===$("#security-warning").children("ul").children().length?$("#security-warning-state-ok").removeClass("hidden"):$("#security-warning-state-failure").removeClass("hidden")}))}))}})[39583]();
-//# sourceMappingURL=settings-legacy-admin.js.map?v=296372aee39ac7e22940
\ No newline at end of file
+({39583:function(){var e=this;window.addEventListener("DOMContentLoaded",(function(){$("#excludedGroups,#linksExcludedGroups,#passwordsExcludedGroups").each((function(e,t){var s=this;OC.Settings.setupGroupsSelect($(t)),$(t).change((function(e){var t=e.val||[];t=JSON.stringify(t),OCP.AppConfig.setValue("core",$(s).attr("name"),t)}))})),$("#loglevel").change((function(){$.post(OC.generateUrl("/settings/admin/log/level"),{level:$(e).val()},(function(){OC.Log.reload()}))})),$("#backgroundjobs span.crondate").tooltip({placement:"top"}),$("#backgroundjobs input").change((function(){if($(e).is(":checked")){var t=$(e).val();"ajax"!==t&&"webcron"!==t&&"cron"!==t||OCP.AppConfig.setValue("core","backgroundjobs_mode",t,{success:function(){OCP.AppConfig.deleteKey("core","cronErrors")}})}})),$("#shareAPIEnabled").change((function(){$("#shareAPI p:not(#enable)").toggleClass("hidden",!e.checked)})),$("#enableEncryption").change((function(){$("#encryptionAPI div#EncryptionWarning").toggleClass("hidden")})),$("#reallyEnableEncryption").click((function(){$("#encryptionAPI div#EncryptionWarning").toggleClass("hidden"),$("#encryptionAPI div#EncryptionSettingsArea").toggleClass("hidden"),OCP.AppConfig.setValue("core","encryption_enabled","yes"),$("#enableEncryption").attr("disabled","disabled")})),$("#startmigration").click((function(e){$(window).on("beforeunload.encryption",(function(e){return t("settings","Migration in progress. Please wait until the migration is finished")})),e.preventDefault(),$("#startmigration").prop("disabled",!0),OC.msg.startAction("#startmigration_msg",t("settings","Migration started …")),$.post(OC.generateUrl("/settings/admin/startmigration"),"",(function(e){OC.msg.finishedAction("#startmigration_msg",e),"success"===e.status?($("#encryptionAPI div#selectEncryptionModules").toggleClass("hidden"),$("#encryptionAPI div#migrationWarning").toggleClass("hidden")):$("#startmigration").prop("disabled",!1),$(window).off("beforeunload.encryption")}))})),$("#shareapiExpireAfterNDays").on("input",(function(){this.value=this.value.replace(/\D/g,"")})),$("#shareAPI input:not(.noJSAutoUpdate)").change((function(){var e=$(this).val();"checkbox"===$(this).attr("type")&&(e=this.checked?"yes":"no"),OCP.AppConfig.setValue("core",$(this).attr("name"),e)})),$("#shareapiDefaultExpireDate").change((function(){$("setDefaultExpireDate").toggleClass("hidden",!this.checked)})),$("#shareapiDefaultInternalExpireDate").change((function(){$("#setDefaultInternalExpireDate").toggleClass("hidden",!this.checked)})),$("#shareapiDefaultRemoteExpireDate").change((function(){$("#setDefaultRemoteExpireDate").toggleClass("hidden",!this.checked)})),$("#enforceLinkPassword").change((function(){$("#selectPasswordsExcludedGroups").toggleClass("hidden",!this.checked)})),$("#publicShareDisclaimer").change((function(){$("#publicShareDisclaimerText").toggleClass("hidden",!this.checked),this.checked||s("")})),$("#shareApiDefaultPermissionsSection input").change((function(e){var t=$("#shareApiDefaultPermissions"),s=$(e.target),n=t.val();return s.is(":checked")?n|=s.val():n&=~s.val(),n|=OC.PERMISSION_READ,t.val(n).change(),e.preventDefault(),!1}));var s=_.debounce((function(e){var s={success:function(){OC.msg.finishedSuccess("#publicShareDisclaimerStatus",t("settings","Saved"))},error:function(){OC.msg.finishedError("#publicShareDisclaimerStatus",t("settings","Not saved"))}};OC.msg.startSaving("#publicShareDisclaimerStatus"),_.isString(e)&&""!==e?OCP.AppConfig.setValue("core","shareapi_public_link_disclaimertext",e,s):($("#publicShareDisclaimerText").val(""),OCP.AppConfig.deleteKey("core","shareapi_public_link_disclaimertext",s))}),500);$("#publicShareDisclaimerText").on("change, keyup",(function(){s(this.value)})),$("#shareapi_allow_share_dialog_user_enumeration").on("change",(function(){$("#shareapi_restrict_user_enumeration_to_group_setting").toggleClass("hidden",!this.checked),$("#shareapi_restrict_user_enumeration_to_phone_setting").toggleClass("hidden",!this.checked),$("#shareapi_restrict_user_enumeration_combinewarning_setting").toggleClass("hidden",!this.checked)})),$("#shareapi_restrict_user_enumeration_full_match").on("change",(function(){$("#shareapi_restrict_user_enumeration_full_match_userid_setting").toggleClass("hidden",!this.checked),$("#shareapi_restrict_user_enumeration_full_match_ignore_second_display_name_setting").toggleClass("hidden",!this.checked)})),$("#allowLinks").change((function(){$("#publicLinkSettings").toggleClass("hidden",!this.checked),$("#setDefaultExpireDate").toggleClass("hidden",!(this.checked&&$("#shareapiDefaultExpireDate")[0].checked))})),$("#mail_smtpauth").change((function(){this.checked?$("#mail_credentials").removeClass("hidden"):$("#mail_credentials").addClass("hidden")})),$("#mail_smtpmode").change((function(){"smtp"!==$(this).val()?($("#setting_smtpauth").addClass("hidden"),$("#setting_smtphost").addClass("hidden"),$("#mail_smtpsecure_label").addClass("hidden"),$("#mail_smtpsecure").addClass("hidden"),$("#mail_credentials").addClass("hidden"),$("#mail_sendmailmode_label, #mail_sendmailmode").removeClass("hidden")):($("#setting_smtpauth").removeClass("hidden"),$("#setting_smtphost").removeClass("hidden"),$("#mail_smtpsecure_label").removeClass("hidden"),$("#mail_smtpsecure").removeClass("hidden"),$("#mail_smtpauth").is(":checked")&&$("#mail_credentials").removeClass("hidden"),$("#mail_sendmailmode_label, #mail_sendmailmode").addClass("hidden"))})),$("#mail_general_settings_form").change((function e(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(e):(OC.msg.startSaving("#mail_settings_msg"),$.ajax({url:OC.generateUrl("/settings/admin/mailsettings"),type:"POST",data:$("#mail_general_settings_form").serialize(),success:function(){OC.msg.finishedSuccess("#mail_settings_msg",t("settings","Saved"))},error:function(e){OC.msg.finishedError("#mail_settings_msg",e.responseJSON)}}))})),$("#mail_credentials_settings_submit").click((function e(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(e):(OC.msg.startSaving("#mail_settings_msg"),$.ajax({url:OC.generateUrl("/settings/admin/mailsettings/credentials"),type:"POST",data:$("#mail_credentials_settings").serialize(),success:function(){OC.msg.finishedSuccess("#mail_settings_msg",t("settings","Saved"))},error:function(e){OC.msg.finishedError("#mail_settings_msg",e.responseJSON)}}))})),$("#mail_smtppassword").click((function(){"text"===e.type&&"********"===e.value&&(e.type="password",e.value="")})),$("#sendtestemail").click((function(e){e.preventDefault(),OC.msg.startAction("#sendtestmail_msg",t("settings","Sending…")),$.ajax({url:OC.generateUrl("/settings/admin/mailtest"),type:"POST",success:function(){OC.msg.finishedSuccess("#sendtestmail_msg",t("settings","Email sent"))},error:function(e){OC.msg.finishedError("#sendtestmail_msg",e.responseJSON)}})})),$("#allowGroupSharing").change((function(){$("#allowGroupSharing").toggleClass("hidden",!e.checked)})),$("#shareapiExcludeGroups").change((function(){$("#selectExcludedGroups").toggleClass("hidden",!e.checked)})),null!==document.getElementById("security-warning")&&$.when(OC.SetupChecks.checkWebDAV(),OC.SetupChecks.checkWellKnownUrl("GET","/.well-known/webfinger",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown"),[200,404],!0),OC.SetupChecks.checkWellKnownUrl("GET","/.well-known/nodeinfo",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown"),[200,404],!0),OC.SetupChecks.checkWellKnownUrl("PROPFIND","/.well-known/caldav",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown")),OC.SetupChecks.checkWellKnownUrl("PROPFIND","/.well-known/carddav",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown")),OC.SetupChecks.checkProviderUrl(OC.getRootPath()+"/ocm-provider/",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown")),OC.SetupChecks.checkProviderUrl(OC.getRootPath()+"/ocs-provider/",OC.theme.docPlaceholderUrl,!0===$("#postsetupchecks").data("check-wellknown")),OC.SetupChecks.checkSetup(),OC.SetupChecks.checkGeneric(),OC.SetupChecks.checkWOFF2Loading(OC.filePath("core","","fonts/NotoSans-Regular-latin.woff2"),OC.theme.docPlaceholderUrl),OC.SetupChecks.checkDataProtected()).then((function(e,t,s,n,i,a,r,c,l,o,d){var h=[].concat(e,t,s,n,i,a,r,c,l,o,d),g=$("#postsetupchecks");$("#security-warning-state-loading").addClass("hidden");for(var u=!1,p=g.find(".errors"),m=g.find(".warnings"),C=g.find(".info"),f=0;f<h.length;f++)switch(h[f].type){case OC.SetupChecks.MESSAGE_TYPE_INFO:C.append("<li>"+h[f].msg+"</li>");break;case OC.SetupChecks.MESSAGE_TYPE_WARNING:m.append("<li>"+h[f].msg+"</li>");break;case OC.SetupChecks.MESSAGE_TYPE_ERROR:default:p.append("<li>"+h[f].msg+"</li>")}p.find("li").length>0&&(p.removeClass("hidden"),u=!0),m.find("li").length>0&&(m.removeClass("hidden"),u=!0),C.find("li").length>0&&(C.removeClass("hidden"),u=!0),u?($("#postsetupchecks-hint").removeClass("hidden"),p.find("li").length>0?$("#security-warning-state-failure").removeClass("hidden"):$("#security-warning-state-warning").removeClass("hidden")):0===$("#security-warning").children("ul").children().length?$("#security-warning-state-ok").removeClass("hidden"):$("#security-warning-state-failure").removeClass("hidden")}))}))}})[39583]();
+//# sourceMappingURL=settings-legacy-admin.js.map?v=30352b4a27a5447a55d9
\ No newline at end of file
index bcef1589145dde9057737e6e46f68f12fdaece08..0ceb751e8cf719665713a1d6f2b26907ce3f9b5c 100644 (file)
@@ -1 +1 @@
-{"version":3,"file":"settings-legacy-admin.js?v=296372aee39ac7e22940","mappings":"8BAAAA,OAAOC,iBAAiB,oBAAoB,WAC3CC,EAAE,iEAAiEC,MAAK,SAASC,EAAOC,GAAS,WAChGC,GAAGC,SAASC,kBAAkBN,EAAEG,IAChCH,EAAEG,GAASI,QAAO,SAACC,GAClB,IAAIC,EAASD,EAAGE,KAAO,GACvBD,EAASE,KAAKC,UAAUH,GACxBI,IAAIC,UAAUC,SAAS,OAAQf,EAAE,GAAMgB,KAAK,QAASP,SAIvDT,EAAE,aAAaO,QAAO,WACrBP,EAAEiB,KAAKb,GAAGc,YAAY,6BAA8B,CAAEC,MAAOnB,EAAE,GAAMU,QAAS,WAC7EN,GAAGgB,IAAIC,eAITrB,EAAE,iCAAiCsB,QAAQ,CAAEC,UAAW,QAExDvB,EAAE,yBAAyBO,QAAO,WACjC,GAAIP,EAAE,GAAMwB,GAAG,YAAa,CAC3B,IAAMC,EAAOzB,EAAE,GAAMU,MACR,SAATe,GAA4B,YAATA,GAA+B,SAATA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,GAAGuE,YAAYmC,qBACnBN,EAAYK,OAAO,OAASV,EAASO,GAAGrE,IAAM,SAC9C,MACD,KAAKjC,GAAGuE,YAAYoC,mBACpB,QACCT,EAAUO,OAAO,OAASV,EAASO,GAAGrE,IAAM,SAI1CiE,EAAUC,KAAK,MAAMI,OAAS,IACjCL,EAAU3C,YAAY,UACtB0C,GAAc,GAEXG,EAAYD,KAAK,MAAMI,OAAS,IACnCH,EAAY7C,YAAY,UACxB0C,GAAc,GAEXI,EAAQF,KAAK,MAAMI,OAAS,IAC/BF,EAAQ9C,YAAY,UACpB0C,GAAc,GAGXA,GACHrG,EAAE,yBAAyB2D,YAAY,UACnC2C,EAAUC,KAAK,MAAMI,OAAS,EACjC3G,EAAE,mCAAmC2D,YAAY,UAEjD3D,EAAE,mCAAmC2D,YAAY,WAIO,IADjC3D,EAAE,qBACNgH,SAAS,MAAMA,WAAWL,OAC7C3G,EAAE,8BAA8B2D,YAAY,UAE5C3D,EAAE,mCAAmC2D,YAAY,mBCtUlC","sources":["webpack:///nextcloud/apps/settings/src/admin.js","webpack:///nextcloud/webpack/startup"],"sourcesContent":["window.addEventListener('DOMContentLoaded', () => {\n\t$('#excludedGroups,#linksExcludedGroups,#passwordsExcludedGroups').each(function(index, element) {\n\t\tOC.Settings.setupGroupsSelect($(element))\n\t\t$(element).change((ev) => {\n\t\t\tlet groups = ev.val || []\n\t\t\tgroups = JSON.stringify(groups)\n\t\t\tOCP.AppConfig.setValue('core', $(this).attr('name'), groups)\n\t\t})\n\t})\n\n\t$('#loglevel').change(() => {\n\t\t$.post(OC.generateUrl('/settings/admin/log/level'), { level: $(this).val() }, () => {\n\t\t\tOC.Log.reload()\n\t\t})\n\t})\n\n\t$('#backgroundjobs span.crondate').tooltip({ placement: 'top' })\n\n\t$('#backgroundjobs input').change(() => {\n\t\tif ($(this).is(':checked')) {\n\t\t\tconst mode = $(this).val()\n\t\t\tif (mode === 'ajax' || mode === 'webcron' || mode === 'cron') {\n\t\t\t\tOCP.AppConfig.setValue('core', 'backgroundjobs_mode', mode, {\n\t\t\t\t\tsuccess: () => {\n\t\t\t\t\t\t// clear cron errors on background job mode change\n\t\t\t\t\t\tOCP.AppConfig.deleteKey('core', 'cronErrors')\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t})\n\n\t$('#shareAPIEnabled').change(() => {\n\t\t$('#shareAPI p:not(#enable)').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#enableEncryption').change(() => {\n\t\t$('#encryptionAPI div#EncryptionWarning').toggleClass('hidden')\n\t})\n\n\t$('#reallyEnableEncryption').click(() => {\n\t\t$('#encryptionAPI div#EncryptionWarning').toggleClass('hidden')\n\t\t$('#encryptionAPI div#EncryptionSettingsArea').toggleClass('hidden')\n\t\tOCP.AppConfig.setValue('core', 'encryption_enabled', 'yes')\n\t\t$('#enableEncryption').attr('disabled', 'disabled')\n\t})\n\n\t$('#startmigration').click((event) => {\n\t\t$(window).on('beforeunload.encryption', (e) => {\n\t\t\treturn t('settings', 'Migration in progress. Please wait until the migration is finished')\n\t\t})\n\t\tevent.preventDefault()\n\t\t$('#startmigration').prop('disabled', true)\n\t\tOC.msg.startAction('#startmigration_msg', t('settings', 'Migration started …'))\n\t\t$.post(OC.generateUrl('/settings/admin/startmigration'), '', function(data) {\n\t\t\tOC.msg.finishedAction('#startmigration_msg', data)\n\t\t\tif (data.status === 'success') {\n\t\t\t\t$('#encryptionAPI div#selectEncryptionModules').toggleClass('hidden')\n\t\t\t\t$('#encryptionAPI div#migrationWarning').toggleClass('hidden')\n\t\t\t} else {\n\t\t\t\t$('#startmigration').prop('disabled', false)\n\t\t\t}\n\t\t\t$(window).off('beforeunload.encryption')\n\n\t\t})\n\t})\n\n\t$('#shareapiExpireAfterNDays').on('input', function() {\n\t\tthis.value = this.value.replace(/\\D/g, '')\n\t})\n\n\t$('#shareAPI input:not(.noJSAutoUpdate)').change(function() {\n\t\tlet value = $(this).val()\n\t\tif ($(this).attr('type') === 'checkbox') {\n\t\t\tif (this.checked) {\n\t\t\t\tvalue = 'yes'\n\t\t\t} else {\n\t\t\t\tvalue = 'no'\n\t\t\t}\n\t\t}\n\t\tOCP.AppConfig.setValue('core', $(this).attr('name'), value)\n\t})\n\n\t$('#shareapiDefaultExpireDate').change(function() {\n\t\t$('setDefaultExpireDate').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#shareapiDefaultInternalExpireDate').change(function() {\n\t\t$('#setDefaultInternalExpireDate').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#shareapiDefaultRemoteExpireDate').change(function() {\n\t\t$('#setDefaultRemoteExpireDate').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#enforceLinkPassword').change(function() {\n\t\t$('#selectPasswordsExcludedGroups').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#publicShareDisclaimer').change(function() {\n\t\t$('#publicShareDisclaimerText').toggleClass('hidden', !this.checked)\n\t\tif (!this.checked) {\n\t\t\tsavePublicShareDisclaimerText('')\n\t\t}\n\t})\n\n\t$('#shareApiDefaultPermissionsSection input').change(function(ev) {\n\t\tconst $el = $('#shareApiDefaultPermissions')\n\t\tconst $target = $(ev.target)\n\n\t\tlet value = $el.val()\n\t\tif ($target.is(':checked')) {\n\t\t\tvalue = value | $target.val()\n\t\t} else {\n\t\t\tvalue = value & ~$target.val()\n\t\t}\n\n\t\t// always set read permission\n\t\tvalue |= OC.PERMISSION_READ\n\n\t\t// this will trigger the field's change event and will save it\n\t\t$el.val(value).change()\n\n\t\tev.preventDefault()\n\n\t\treturn false\n\t})\n\n\tconst savePublicShareDisclaimerText = _.debounce(function(value) {\n\t\tconst options = {\n\t\t\tsuccess: () => {\n\t\t\t\tOC.msg.finishedSuccess('#publicShareDisclaimerStatus', t('settings', 'Saved'))\n\t\t\t},\n\t\t\terror: () => {\n\t\t\t\tOC.msg.finishedError('#publicShareDisclaimerStatus', t('settings', 'Not saved'))\n\t\t\t}\n\t\t}\n\n\t\tOC.msg.startSaving('#publicShareDisclaimerStatus')\n\t\tif (_.isString(value) && value !== '') {\n\t\t\tOCP.AppConfig.setValue('core', 'shareapi_public_link_disclaimertext', value, options)\n\t\t} else {\n\t\t\t$('#publicShareDisclaimerText').val('')\n\t\t\tOCP.AppConfig.deleteKey('core', 'shareapi_public_link_disclaimertext', options)\n\t\t}\n\t}, 500)\n\n\t$('#publicShareDisclaimerText').on('change, keyup', function() {\n\t\tsavePublicShareDisclaimerText(this.value)\n\t})\n\n\t$('#shareapi_allow_share_dialog_user_enumeration').on('change', function() {\n\t\t$('#shareapi_restrict_user_enumeration_to_group_setting').toggleClass('hidden', !this.checked)\n\t\t$('#shareapi_restrict_user_enumeration_to_phone_setting').toggleClass('hidden', !this.checked)\n\t\t$('#shareapi_restrict_user_enumeration_combinewarning_setting').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#shareapi_restrict_user_enumeration_full_match').on('change', function() {\n\t\t$('#shareapi_restrict_user_enumeration_full_match_userid_setting').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#allowLinks').change(function() {\n\t\t$('#publicLinkSettings').toggleClass('hidden', !this.checked)\n\t\t$('#setDefaultExpireDate').toggleClass('hidden', !(this.checked && $('#shareapiDefaultExpireDate')[0].checked))\n\t})\n\n\t$('#mail_smtpauth').change(function() {\n\t\tif (!this.checked) {\n\t\t\t$('#mail_credentials').addClass('hidden')\n\t\t} else {\n\t\t\t$('#mail_credentials').removeClass('hidden')\n\t\t}\n\t})\n\n\t$('#mail_smtpmode').change(function() {\n\t\tif ($(this).val() !== 'smtp') {\n\t\t\t$('#setting_smtpauth').addClass('hidden')\n\t\t\t$('#setting_smtphost').addClass('hidden')\n\t\t\t$('#mail_smtpsecure_label').addClass('hidden')\n\t\t\t$('#mail_smtpsecure').addClass('hidden')\n\t\t\t$('#mail_credentials').addClass('hidden')\n\t\t\t$('#mail_sendmailmode_label, #mail_sendmailmode').removeClass('hidden')\n\t\t} else {\n\t\t\t$('#setting_smtpauth').removeClass('hidden')\n\t\t\t$('#setting_smtphost').removeClass('hidden')\n\t\t\t$('#mail_smtpsecure_label').removeClass('hidden')\n\t\t\t$('#mail_smtpsecure').removeClass('hidden')\n\t\t\tif ($('#mail_smtpauth').is(':checked')) {\n\t\t\t\t$('#mail_credentials').removeClass('hidden')\n\t\t\t}\n\t\t\t$('#mail_sendmailmode_label, #mail_sendmailmode').addClass('hidden')\n\t\t}\n\t})\n\n\tconst changeEmailSettings = function() {\n\t\tif (OC.PasswordConfirmation.requiresPasswordConfirmation()) {\n\t\t\tOC.PasswordConfirmation.requirePasswordConfirmation(changeEmailSettings)\n\t\t\treturn\n\t\t}\n\n\t\tOC.msg.startSaving('#mail_settings_msg')\n\t\t$.ajax({\n\t\t\turl: OC.generateUrl('/settings/admin/mailsettings'),\n\t\t\ttype: 'POST',\n\t\t\tdata: $('#mail_general_settings_form').serialize(),\n\t\t\tsuccess: () => {\n\t\t\t\tOC.msg.finishedSuccess('#mail_settings_msg', t('settings', 'Saved'))\n\t\t\t},\n\t\t\terror: (xhr) => {\n\t\t\t\tOC.msg.finishedError('#mail_settings_msg', xhr.responseJSON)\n\t\t\t}\n\t\t})\n\t}\n\n\tconst toggleEmailCredentials = function() {\n\t\tif (OC.PasswordConfirmation.requiresPasswordConfirmation()) {\n\t\t\tOC.PasswordConfirmation.requirePasswordConfirmation(toggleEmailCredentials)\n\t\t\treturn\n\t\t}\n\n\t\tOC.msg.startSaving('#mail_settings_msg')\n\t\t$.ajax({\n\t\t\turl: OC.generateUrl('/settings/admin/mailsettings/credentials'),\n\t\t\ttype: 'POST',\n\t\t\tdata: $('#mail_credentials_settings').serialize(),\n\t\t\tsuccess: () => {\n\t\t\t\tOC.msg.finishedSuccess('#mail_settings_msg', t('settings', 'Saved'))\n\t\t\t},\n\t\t\terror: (xhr) => {\n\t\t\t\tOC.msg.finishedError('#mail_settings_msg', xhr.responseJSON)\n\t\t\t}\n\t\t})\n\t}\n\n\t$('#mail_general_settings_form').change(changeEmailSettings)\n\t$('#mail_credentials_settings_submit').click(toggleEmailCredentials)\n\t$('#mail_smtppassword').click(() => {\n\t\tif (this.type === 'text' && this.value === '********') {\n\t\t\tthis.type = 'password'\n\t\t\tthis.value = ''\n\t\t}\n\t})\n\n\t$('#sendtestemail').click((event) => {\n\t\tevent.preventDefault()\n\t\tOC.msg.startAction('#sendtestmail_msg', t('settings', 'Sending…'))\n\n\t\t$.ajax({\n\t\t\turl: OC.generateUrl('/settings/admin/mailtest'),\n\t\t\ttype: 'POST',\n\t\t\tsuccess: () => {\n\t\t\t\tOC.msg.finishedSuccess('#sendtestmail_msg', t('settings', 'Email sent'))\n\t\t\t},\n\t\t\terror: (xhr) => {\n\t\t\t\tOC.msg.finishedError('#sendtestmail_msg', xhr.responseJSON)\n\t\t\t}\n\t\t})\n\t})\n\n\t$('#allowGroupSharing').change(() => {\n\t\t$('#allowGroupSharing').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#shareapiExcludeGroups').change(() => {\n\t\t$('#selectExcludedGroups').toggleClass('hidden', !this.checked)\n\t})\n\n\tconst setupChecks = () => {\n\t\t// run setup checks then gather error messages\n\t\t$.when(\n\t\t\tOC.SetupChecks.checkWebDAV(),\n\t\t\tOC.SetupChecks.checkWellKnownUrl('GET', '/.well-known/webfinger', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true, [200, 404], true),\n\t\t\tOC.SetupChecks.checkWellKnownUrl('GET', '/.well-known/nodeinfo', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true, [200, 404], true),\n\t\t\tOC.SetupChecks.checkWellKnownUrl('PROPFIND', '/.well-known/caldav', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),\n\t\t\tOC.SetupChecks.checkWellKnownUrl('PROPFIND', '/.well-known/carddav', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),\n\t\t\tOC.SetupChecks.checkProviderUrl(OC.getRootPath() + '/ocm-provider/', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),\n\t\t\tOC.SetupChecks.checkProviderUrl(OC.getRootPath() + '/ocs-provider/', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),\n\t\t\tOC.SetupChecks.checkSetup(),\n\t\t\tOC.SetupChecks.checkGeneric(),\n\t\t\tOC.SetupChecks.checkWOFF2Loading(OC.filePath('core', '', 'fonts/NotoSans-Regular-latin.woff2'), OC.theme.docPlaceholderUrl),\n\t\t\tOC.SetupChecks.checkDataProtected()\n\t\t).then((check1, check2, check3, check4, check5, check6, check7, check8, check9, check10, check11) => {\n\t\t\tconst messages = [].concat(check1, check2, check3, check4, check5, check6, check7, check8, check9, check10, check11)\n\t\t\tconst $el = $('#postsetupchecks')\n\t\t\t$('#security-warning-state-loading').addClass('hidden')\n\n\t\t\tlet hasMessages = false\n\t\t\tconst $errorsEl = $el.find('.errors')\n\t\t\tconst $warningsEl = $el.find('.warnings')\n\t\t\tconst $infoEl = $el.find('.info')\n\n\t\t\tfor (let i = 0; i < messages.length; i++) {\n\t\t\t\tswitch (messages[i].type) {\n\t\t\t\tcase OC.SetupChecks.MESSAGE_TYPE_INFO:\n\t\t\t\t\t$infoEl.append('<li>' + messages[i].msg + '</li>')\n\t\t\t\t\tbreak\n\t\t\t\tcase OC.SetupChecks.MESSAGE_TYPE_WARNING:\n\t\t\t\t\t$warningsEl.append('<li>' + messages[i].msg + '</li>')\n\t\t\t\t\tbreak\n\t\t\t\tcase OC.SetupChecks.MESSAGE_TYPE_ERROR:\n\t\t\t\tdefault:\n\t\t\t\t\t$errorsEl.append('<li>' + messages[i].msg + '</li>')\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($errorsEl.find('li').length > 0) {\n\t\t\t\t$errorsEl.removeClass('hidden')\n\t\t\t\thasMessages = true\n\t\t\t}\n\t\t\tif ($warningsEl.find('li').length > 0) {\n\t\t\t\t$warningsEl.removeClass('hidden')\n\t\t\t\thasMessages = true\n\t\t\t}\n\t\t\tif ($infoEl.find('li').length > 0) {\n\t\t\t\t$infoEl.removeClass('hidden')\n\t\t\t\thasMessages = true\n\t\t\t}\n\n\t\t\tif (hasMessages) {\n\t\t\t\t$('#postsetupchecks-hint').removeClass('hidden')\n\t\t\t\tif ($errorsEl.find('li').length > 0) {\n\t\t\t\t\t$('#security-warning-state-failure').removeClass('hidden')\n\t\t\t\t} else {\n\t\t\t\t\t$('#security-warning-state-warning').removeClass('hidden')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst securityWarning = $('#security-warning')\n\t\t\t\tif (securityWarning.children('ul').children().length === 0) {\n\t\t\t\t\t$('#security-warning-state-ok').removeClass('hidden')\n\t\t\t\t} else {\n\t\t\t\t\t$('#security-warning-state-failure').removeClass('hidden')\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tif (document.getElementById('security-warning') !== null) {\n\t\tsetupChecks()\n\t}\n})\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = {};\n__webpack_modules__[39583]();\n"],"names":["window","addEventListener","$","each","index","element","OC","Settings","setupGroupsSelect","change","ev","groups","val","JSON","stringify","OCP","AppConfig","setValue","attr","post","generateUrl","level","Log","reload","tooltip","placement","is","mode","success","deleteKey","toggleClass","checked","click","event","on","e","t","preventDefault","prop","msg","startAction","data","finishedAction","status","off","this","value","replace","savePublicShareDisclaimerText","$el","$target","target","PERMISSION_READ","_","debounce","options","finishedSuccess","error","finishedError","startSaving","isString","removeClass","addClass","changeEmailSettings","PasswordConfirmation","requiresPasswordConfirmation","requirePasswordConfirmation","ajax","url","type","serialize","xhr","responseJSON","toggleEmailCredentials","document","getElementById","when","SetupChecks","checkWebDAV","checkWellKnownUrl","theme","docPlaceholderUrl","checkProviderUrl","getRootPath","checkSetup","checkGeneric","checkWOFF2Loading","filePath","checkDataProtected","then","check1","check2","check3","check4","check5","check6","check7","check8","check9","check10","check11","messages","concat","hasMessages","$errorsEl","find","$warningsEl","$infoEl","i","length","MESSAGE_TYPE_INFO","append","MESSAGE_TYPE_WARNING","MESSAGE_TYPE_ERROR","children"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"settings-legacy-admin.js?v=30352b4a27a5447a55d9","mappings":"8BAAAA,OAAOC,iBAAiB,oBAAoB,WAC3CC,EAAE,iEAAiEC,MAAK,SAASC,EAAOC,GAAS,WAChGC,GAAGC,SAASC,kBAAkBN,EAAEG,IAChCH,EAAEG,GAASI,QAAO,SAACC,GAClB,IAAIC,EAASD,EAAGE,KAAO,GACvBD,EAASE,KAAKC,UAAUH,GACxBI,IAAIC,UAAUC,SAAS,OAAQf,EAAE,GAAMgB,KAAK,QAASP,SAIvDT,EAAE,aAAaO,QAAO,WACrBP,EAAEiB,KAAKb,GAAGc,YAAY,6BAA8B,CAAEC,MAAOnB,EAAE,GAAMU,QAAS,WAC7EN,GAAGgB,IAAIC,eAITrB,EAAE,iCAAiCsB,QAAQ,CAAEC,UAAW,QAExDvB,EAAE,yBAAyBO,QAAO,WACjC,GAAIP,EAAE,GAAMwB,GAAG,YAAa,CAC3B,IAAMC,EAAOzB,EAAE,GAAMU,MACR,SAATe,GAA4B,YAATA,GAA+B,SAATA,GAC5CZ,IAAIC,UAAUC,SAAS,OAAQ,sBAAuBU,EAAM,CAC3DC,QAAS,WAERb,IAAIC,UAAUa,UAAU,OAAQ,qBAOrC3B,EAAE,oBAAoBO,QAAO,WAC5BP,EAAE,4BAA4B4B,YAAY,UAAW,EAAKC,YAG3D7B,EAAE,qBAAqBO,QAAO,WAC7BP,EAAE,wCAAwC4B,YAAY,aAGvD5B,EAAE,2BAA2B8B,OAAM,WAClC9B,EAAE,wCAAwC4B,YAAY,UACtD5B,EAAE,6CAA6C4B,YAAY,UAC3Df,IAAIC,UAAUC,SAAS,OAAQ,qBAAsB,OACrDf,EAAE,qBAAqBgB,KAAK,WAAY,eAGzChB,EAAE,mBAAmB8B,OAAM,SAACC,GAC3B/B,EAAEF,QAAQkC,GAA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OAAS,EACjC3G,EAAE,mCAAmC2D,YAAY,UAEjD3D,EAAE,mCAAmC2D,YAAY,WAIO,IADjC3D,EAAE,qBACNgH,SAAS,MAAMA,WAAWL,OAC7C3G,EAAE,8BAA8B2D,YAAY,UAE5C3D,EAAE,mCAAmC2D,YAAY,mBCvUlC","sources":["webpack:///nextcloud/apps/settings/src/admin.js","webpack:///nextcloud/webpack/startup"],"sourcesContent":["window.addEventListener('DOMContentLoaded', () => {\n\t$('#excludedGroups,#linksExcludedGroups,#passwordsExcludedGroups').each(function(index, element) {\n\t\tOC.Settings.setupGroupsSelect($(element))\n\t\t$(element).change((ev) => {\n\t\t\tlet groups = ev.val || []\n\t\t\tgroups = JSON.stringify(groups)\n\t\t\tOCP.AppConfig.setValue('core', $(this).attr('name'), groups)\n\t\t})\n\t})\n\n\t$('#loglevel').change(() => {\n\t\t$.post(OC.generateUrl('/settings/admin/log/level'), { level: $(this).val() }, () => {\n\t\t\tOC.Log.reload()\n\t\t})\n\t})\n\n\t$('#backgroundjobs span.crondate').tooltip({ placement: 'top' })\n\n\t$('#backgroundjobs input').change(() => {\n\t\tif ($(this).is(':checked')) {\n\t\t\tconst mode = $(this).val()\n\t\t\tif (mode === 'ajax' || mode === 'webcron' || mode === 'cron') {\n\t\t\t\tOCP.AppConfig.setValue('core', 'backgroundjobs_mode', mode, {\n\t\t\t\t\tsuccess: () => {\n\t\t\t\t\t\t// clear cron errors on background job mode change\n\t\t\t\t\t\tOCP.AppConfig.deleteKey('core', 'cronErrors')\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t})\n\n\t$('#shareAPIEnabled').change(() => {\n\t\t$('#shareAPI p:not(#enable)').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#enableEncryption').change(() => {\n\t\t$('#encryptionAPI div#EncryptionWarning').toggleClass('hidden')\n\t})\n\n\t$('#reallyEnableEncryption').click(() => {\n\t\t$('#encryptionAPI div#EncryptionWarning').toggleClass('hidden')\n\t\t$('#encryptionAPI div#EncryptionSettingsArea').toggleClass('hidden')\n\t\tOCP.AppConfig.setValue('core', 'encryption_enabled', 'yes')\n\t\t$('#enableEncryption').attr('disabled', 'disabled')\n\t})\n\n\t$('#startmigration').click((event) => {\n\t\t$(window).on('beforeunload.encryption', (e) => {\n\t\t\treturn t('settings', 'Migration in progress. Please wait until the migration is finished')\n\t\t})\n\t\tevent.preventDefault()\n\t\t$('#startmigration').prop('disabled', true)\n\t\tOC.msg.startAction('#startmigration_msg', t('settings', 'Migration started …'))\n\t\t$.post(OC.generateUrl('/settings/admin/startmigration'), '', function(data) {\n\t\t\tOC.msg.finishedAction('#startmigration_msg', data)\n\t\t\tif (data.status === 'success') {\n\t\t\t\t$('#encryptionAPI div#selectEncryptionModules').toggleClass('hidden')\n\t\t\t\t$('#encryptionAPI div#migrationWarning').toggleClass('hidden')\n\t\t\t} else {\n\t\t\t\t$('#startmigration').prop('disabled', false)\n\t\t\t}\n\t\t\t$(window).off('beforeunload.encryption')\n\n\t\t})\n\t})\n\n\t$('#shareapiExpireAfterNDays').on('input', function() {\n\t\tthis.value = this.value.replace(/\\D/g, '')\n\t})\n\n\t$('#shareAPI input:not(.noJSAutoUpdate)').change(function() {\n\t\tlet value = $(this).val()\n\t\tif ($(this).attr('type') === 'checkbox') {\n\t\t\tif (this.checked) {\n\t\t\t\tvalue = 'yes'\n\t\t\t} else {\n\t\t\t\tvalue = 'no'\n\t\t\t}\n\t\t}\n\t\tOCP.AppConfig.setValue('core', $(this).attr('name'), value)\n\t})\n\n\t$('#shareapiDefaultExpireDate').change(function() {\n\t\t$('setDefaultExpireDate').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#shareapiDefaultInternalExpireDate').change(function() {\n\t\t$('#setDefaultInternalExpireDate').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#shareapiDefaultRemoteExpireDate').change(function() {\n\t\t$('#setDefaultRemoteExpireDate').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#enforceLinkPassword').change(function() {\n\t\t$('#selectPasswordsExcludedGroups').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#publicShareDisclaimer').change(function() {\n\t\t$('#publicShareDisclaimerText').toggleClass('hidden', !this.checked)\n\t\tif (!this.checked) {\n\t\t\tsavePublicShareDisclaimerText('')\n\t\t}\n\t})\n\n\t$('#shareApiDefaultPermissionsSection input').change(function(ev) {\n\t\tconst $el = $('#shareApiDefaultPermissions')\n\t\tconst $target = $(ev.target)\n\n\t\tlet value = $el.val()\n\t\tif ($target.is(':checked')) {\n\t\t\tvalue = value | $target.val()\n\t\t} else {\n\t\t\tvalue = value & ~$target.val()\n\t\t}\n\n\t\t// always set read permission\n\t\tvalue |= OC.PERMISSION_READ\n\n\t\t// this will trigger the field's change event and will save it\n\t\t$el.val(value).change()\n\n\t\tev.preventDefault()\n\n\t\treturn false\n\t})\n\n\tconst savePublicShareDisclaimerText = _.debounce(function(value) {\n\t\tconst options = {\n\t\t\tsuccess: () => {\n\t\t\t\tOC.msg.finishedSuccess('#publicShareDisclaimerStatus', t('settings', 'Saved'))\n\t\t\t},\n\t\t\terror: () => {\n\t\t\t\tOC.msg.finishedError('#publicShareDisclaimerStatus', t('settings', 'Not saved'))\n\t\t\t}\n\t\t}\n\n\t\tOC.msg.startSaving('#publicShareDisclaimerStatus')\n\t\tif (_.isString(value) && value !== '') {\n\t\t\tOCP.AppConfig.setValue('core', 'shareapi_public_link_disclaimertext', value, options)\n\t\t} else {\n\t\t\t$('#publicShareDisclaimerText').val('')\n\t\t\tOCP.AppConfig.deleteKey('core', 'shareapi_public_link_disclaimertext', options)\n\t\t}\n\t}, 500)\n\n\t$('#publicShareDisclaimerText').on('change, keyup', function() {\n\t\tsavePublicShareDisclaimerText(this.value)\n\t})\n\n\t$('#shareapi_allow_share_dialog_user_enumeration').on('change', function() {\n\t\t$('#shareapi_restrict_user_enumeration_to_group_setting').toggleClass('hidden', !this.checked)\n\t\t$('#shareapi_restrict_user_enumeration_to_phone_setting').toggleClass('hidden', !this.checked)\n\t\t$('#shareapi_restrict_user_enumeration_combinewarning_setting').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#shareapi_restrict_user_enumeration_full_match').on('change', function() {\n\t\t$('#shareapi_restrict_user_enumeration_full_match_userid_setting').toggleClass('hidden', !this.checked)\n\t\t$('#shareapi_restrict_user_enumeration_full_match_ignore_second_display_name_setting').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#allowLinks').change(function() {\n\t\t$('#publicLinkSettings').toggleClass('hidden', !this.checked)\n\t\t$('#setDefaultExpireDate').toggleClass('hidden', !(this.checked && $('#shareapiDefaultExpireDate')[0].checked))\n\t})\n\n\t$('#mail_smtpauth').change(function() {\n\t\tif (!this.checked) {\n\t\t\t$('#mail_credentials').addClass('hidden')\n\t\t} else {\n\t\t\t$('#mail_credentials').removeClass('hidden')\n\t\t}\n\t})\n\n\t$('#mail_smtpmode').change(function() {\n\t\tif ($(this).val() !== 'smtp') {\n\t\t\t$('#setting_smtpauth').addClass('hidden')\n\t\t\t$('#setting_smtphost').addClass('hidden')\n\t\t\t$('#mail_smtpsecure_label').addClass('hidden')\n\t\t\t$('#mail_smtpsecure').addClass('hidden')\n\t\t\t$('#mail_credentials').addClass('hidden')\n\t\t\t$('#mail_sendmailmode_label, #mail_sendmailmode').removeClass('hidden')\n\t\t} else {\n\t\t\t$('#setting_smtpauth').removeClass('hidden')\n\t\t\t$('#setting_smtphost').removeClass('hidden')\n\t\t\t$('#mail_smtpsecure_label').removeClass('hidden')\n\t\t\t$('#mail_smtpsecure').removeClass('hidden')\n\t\t\tif ($('#mail_smtpauth').is(':checked')) {\n\t\t\t\t$('#mail_credentials').removeClass('hidden')\n\t\t\t}\n\t\t\t$('#mail_sendmailmode_label, #mail_sendmailmode').addClass('hidden')\n\t\t}\n\t})\n\n\tconst changeEmailSettings = function() {\n\t\tif (OC.PasswordConfirmation.requiresPasswordConfirmation()) {\n\t\t\tOC.PasswordConfirmation.requirePasswordConfirmation(changeEmailSettings)\n\t\t\treturn\n\t\t}\n\n\t\tOC.msg.startSaving('#mail_settings_msg')\n\t\t$.ajax({\n\t\t\turl: OC.generateUrl('/settings/admin/mailsettings'),\n\t\t\ttype: 'POST',\n\t\t\tdata: $('#mail_general_settings_form').serialize(),\n\t\t\tsuccess: () => {\n\t\t\t\tOC.msg.finishedSuccess('#mail_settings_msg', t('settings', 'Saved'))\n\t\t\t},\n\t\t\terror: (xhr) => {\n\t\t\t\tOC.msg.finishedError('#mail_settings_msg', xhr.responseJSON)\n\t\t\t}\n\t\t})\n\t}\n\n\tconst toggleEmailCredentials = function() {\n\t\tif (OC.PasswordConfirmation.requiresPasswordConfirmation()) {\n\t\t\tOC.PasswordConfirmation.requirePasswordConfirmation(toggleEmailCredentials)\n\t\t\treturn\n\t\t}\n\n\t\tOC.msg.startSaving('#mail_settings_msg')\n\t\t$.ajax({\n\t\t\turl: OC.generateUrl('/settings/admin/mailsettings/credentials'),\n\t\t\ttype: 'POST',\n\t\t\tdata: $('#mail_credentials_settings').serialize(),\n\t\t\tsuccess: () => {\n\t\t\t\tOC.msg.finishedSuccess('#mail_settings_msg', t('settings', 'Saved'))\n\t\t\t},\n\t\t\terror: (xhr) => {\n\t\t\t\tOC.msg.finishedError('#mail_settings_msg', xhr.responseJSON)\n\t\t\t}\n\t\t})\n\t}\n\n\t$('#mail_general_settings_form').change(changeEmailSettings)\n\t$('#mail_credentials_settings_submit').click(toggleEmailCredentials)\n\t$('#mail_smtppassword').click(() => {\n\t\tif (this.type === 'text' && this.value === '********') {\n\t\t\tthis.type = 'password'\n\t\t\tthis.value = ''\n\t\t}\n\t})\n\n\t$('#sendtestemail').click((event) => {\n\t\tevent.preventDefault()\n\t\tOC.msg.startAction('#sendtestmail_msg', t('settings', 'Sending…'))\n\n\t\t$.ajax({\n\t\t\turl: OC.generateUrl('/settings/admin/mailtest'),\n\t\t\ttype: 'POST',\n\t\t\tsuccess: () => {\n\t\t\t\tOC.msg.finishedSuccess('#sendtestmail_msg', t('settings', 'Email sent'))\n\t\t\t},\n\t\t\terror: (xhr) => {\n\t\t\t\tOC.msg.finishedError('#sendtestmail_msg', xhr.responseJSON)\n\t\t\t}\n\t\t})\n\t})\n\n\t$('#allowGroupSharing').change(() => {\n\t\t$('#allowGroupSharing').toggleClass('hidden', !this.checked)\n\t})\n\n\t$('#shareapiExcludeGroups').change(() => {\n\t\t$('#selectExcludedGroups').toggleClass('hidden', !this.checked)\n\t})\n\n\tconst setupChecks = () => {\n\t\t// run setup checks then gather error messages\n\t\t$.when(\n\t\t\tOC.SetupChecks.checkWebDAV(),\n\t\t\tOC.SetupChecks.checkWellKnownUrl('GET', '/.well-known/webfinger', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true, [200, 404], true),\n\t\t\tOC.SetupChecks.checkWellKnownUrl('GET', '/.well-known/nodeinfo', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true, [200, 404], true),\n\t\t\tOC.SetupChecks.checkWellKnownUrl('PROPFIND', '/.well-known/caldav', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),\n\t\t\tOC.SetupChecks.checkWellKnownUrl('PROPFIND', '/.well-known/carddav', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),\n\t\t\tOC.SetupChecks.checkProviderUrl(OC.getRootPath() + '/ocm-provider/', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),\n\t\t\tOC.SetupChecks.checkProviderUrl(OC.getRootPath() + '/ocs-provider/', OC.theme.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),\n\t\t\tOC.SetupChecks.checkSetup(),\n\t\t\tOC.SetupChecks.checkGeneric(),\n\t\t\tOC.SetupChecks.checkWOFF2Loading(OC.filePath('core', '', 'fonts/NotoSans-Regular-latin.woff2'), OC.theme.docPlaceholderUrl),\n\t\t\tOC.SetupChecks.checkDataProtected()\n\t\t).then((check1, check2, check3, check4, check5, check6, check7, check8, check9, check10, check11) => {\n\t\t\tconst messages = [].concat(check1, check2, check3, check4, check5, check6, check7, check8, check9, check10, check11)\n\t\t\tconst $el = $('#postsetupchecks')\n\t\t\t$('#security-warning-state-loading').addClass('hidden')\n\n\t\t\tlet hasMessages = false\n\t\t\tconst $errorsEl = $el.find('.errors')\n\t\t\tconst $warningsEl = $el.find('.warnings')\n\t\t\tconst $infoEl = $el.find('.info')\n\n\t\t\tfor (let i = 0; i < messages.length; i++) {\n\t\t\t\tswitch (messages[i].type) {\n\t\t\t\tcase OC.SetupChecks.MESSAGE_TYPE_INFO:\n\t\t\t\t\t$infoEl.append('<li>' + messages[i].msg + '</li>')\n\t\t\t\t\tbreak\n\t\t\t\tcase OC.SetupChecks.MESSAGE_TYPE_WARNING:\n\t\t\t\t\t$warningsEl.append('<li>' + messages[i].msg + '</li>')\n\t\t\t\t\tbreak\n\t\t\t\tcase OC.SetupChecks.MESSAGE_TYPE_ERROR:\n\t\t\t\tdefault:\n\t\t\t\t\t$errorsEl.append('<li>' + messages[i].msg + '</li>')\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($errorsEl.find('li').length > 0) {\n\t\t\t\t$errorsEl.removeClass('hidden')\n\t\t\t\thasMessages = true\n\t\t\t}\n\t\t\tif ($warningsEl.find('li').length > 0) {\n\t\t\t\t$warningsEl.removeClass('hidden')\n\t\t\t\thasMessages = true\n\t\t\t}\n\t\t\tif ($infoEl.find('li').length > 0) {\n\t\t\t\t$infoEl.removeClass('hidden')\n\t\t\t\thasMessages = true\n\t\t\t}\n\n\t\t\tif (hasMessages) {\n\t\t\t\t$('#postsetupchecks-hint').removeClass('hidden')\n\t\t\t\tif ($errorsEl.find('li').length > 0) {\n\t\t\t\t\t$('#security-warning-state-failure').removeClass('hidden')\n\t\t\t\t} else {\n\t\t\t\t\t$('#security-warning-state-warning').removeClass('hidden')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst securityWarning = $('#security-warning')\n\t\t\t\tif (securityWarning.children('ul').children().length === 0) {\n\t\t\t\t\t$('#security-warning-state-ok').removeClass('hidden')\n\t\t\t\t} else {\n\t\t\t\t\t$('#security-warning-state-failure').removeClass('hidden')\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tif (document.getElementById('security-warning') !== null) {\n\t\tsetupChecks()\n\t}\n})\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = {};\n__webpack_modules__[39583]();\n"],"names":["window","addEventListener","$","each","index","element","OC","Settings","setupGroupsSelect","change","ev","groups","val","JSON","stringify","OCP","AppConfig","setValue","attr","post","generateUrl","level","Log","reload","tooltip","placement","is","mode","success","deleteKey","toggleClass","checked","click","event","on","e","t","preventDefault","prop","msg","startAction","data","finishedAction","status","off","this","value","replace","savePublicShareDisclaimerText","$el","$target","target","PERMISSION_READ","_","debounce","options","finishedSuccess","error","finishedError","startSaving","isString","removeClass","addClass","changeEmailSettings","PasswordConfirmation","requiresPasswordConfirmation","requirePasswordConfirmation","ajax","url","type","serialize","xhr","responseJSON","toggleEmailCredentials","document","getElementById","when","SetupChecks","checkWebDAV","checkWellKnownUrl","theme","docPlaceholderUrl","checkProviderUrl","getRootPath","checkSetup","checkGeneric","checkWOFF2Loading","filePath","checkDataProtected","then","check1","check2","check3","check4","check5","check6","check7","check8","check9","check10","check11","messages","concat","hasMessages","$errorsEl","find","$warningsEl","$infoEl","i","length","MESSAGE_TYPE_INFO","append","MESSAGE_TYPE_WARNING","MESSAGE_TYPE_ERROR","children"],"sourceRoot":""}
\ No newline at end of file
index 4d8bc4cbf3ad79f376f9945c99c498c3c1e5ef17..af4d8b2ccca0e62d88fb8c1939aedfc67cbb6064 100644 (file)
@@ -56,6 +56,8 @@ class UserPlugin implements ISearchPlugin {
        protected $shareeEnumerationFullMatch;
        /* @var bool */
        protected $shareeEnumerationFullMatchUserId;
+       /* @var bool */
+       protected $shareeEnumerationFullMatchIgnoreSecondDisplayName;
 
        /** @var IConfig */
        private $config;
@@ -90,6 +92,7 @@ class UserPlugin implements ISearchPlugin {
                $this->shareeEnumerationPhone = $this->shareeEnumeration && $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_to_phone', 'no') === 'yes';
                $this->shareeEnumerationFullMatch = $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match', 'yes') === 'yes';
                $this->shareeEnumerationFullMatchUserId = $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match_userid', 'yes') === 'yes';
+               $this->shareeEnumerationFullMatchIgnoreSecondDisplayName = $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match_ignore_second_display_name', 'no') === 'yes';
        }
 
        public function search($search, $limit, $offset, ISearchResult $searchResult) {
@@ -181,6 +184,7 @@ class UserPlugin implements ISearchPlugin {
                                $this->shareeEnumerationFullMatch &&
                                $lowerSearch !== '' && (strtolower($uid) === $lowerSearch ||
                                strtolower($userDisplayName) === $lowerSearch ||
+                               ($this->shareeEnumerationFullMatchIgnoreSecondDisplayName && trim(strtolower(preg_replace('/ \(.*\)$/', '', $userDisplayName))) === $lowerSearch) ||
                                strtolower($userEmail ?? '') === $lowerSearch)
                        ) {
                                if (strtolower($uid) === $lowerSearch) {
index acbcd42f04f75a5853c72d4939b8756c59843f3b..20e1ed898ad728f5030729165ce627ccb8a3533c 100644 (file)
@@ -104,21 +104,12 @@ class UserPluginTest extends TestCase {
                );
        }
 
-       public function mockConfig($shareWithGroupOnly, $shareeEnumeration, $shareeEnumerationLimitToGroup, $shareeEnumerationPhone = false) {
+       public function mockConfig($mockedSettings) {
                $this->config->expects($this->any())
                        ->method('getAppValue')
                        ->willReturnCallback(
-                               function ($appName, $key, $default) use ($shareWithGroupOnly, $shareeEnumeration, $shareeEnumerationLimitToGroup, $shareeEnumerationPhone) {
-                                       if ($appName === 'core' && $key === 'shareapi_only_share_with_group_members') {
-                                               return $shareWithGroupOnly ? 'yes' : 'no';
-                                       } elseif ($appName === 'core' && $key === 'shareapi_allow_share_dialog_user_enumeration') {
-                                               return $shareeEnumeration ? 'yes' : 'no';
-                                       } elseif ($appName === 'core' && $key === 'shareapi_restrict_user_enumeration_to_group') {
-                                               return $shareeEnumerationLimitToGroup ? 'yes' : 'no';
-                                       } elseif ($appName === 'core' && $key === 'shareapi_restrict_user_enumeration_to_phone') {
-                                               return $shareeEnumerationPhone ? 'yes' : 'no';
-                                       }
-                                       return $default;
+                               function ($appName, $key, $default) use ($mockedSettings) {
+                                       return $mockedSettings[$appName][$key] ?? $default;
                                }
                        );
        }
@@ -470,7 +461,13 @@ class UserPluginTest extends TestCase {
                array $users = [],
                $shareeEnumerationPhone = false
        ) {
-               $this->mockConfig($shareWithGroupOnly, $shareeEnumeration, false, $shareeEnumerationPhone);
+               $this->mockConfig(["core" => [
+                       'shareapi_only_share_with_group_members' => $shareWithGroupOnly ? 'yes' : 'no',
+                       'shareapi_allow_share_dialog_user_enumeration' => $shareeEnumeration? 'yes' : 'no',
+                       'shareapi_restrict_user_enumeration_to_group' => false ? 'yes' : 'no',
+                       'shareapi_restrict_user_enumeration_to_phone' => $shareeEnumerationPhone ? 'yes' : 'no',
+               ]]);
+
                $this->instantiatePlugin();
 
                $this->session->expects($this->any())
@@ -586,6 +583,83 @@ class UserPluginTest extends TestCase {
                                        ['uid' => 'test2', 'groups' => ['groupB']],
                                ],
                                ['exact' => [], 'wide' => ['test1']],
+                               ['core' => ['shareapi_restrict_user_enumeration_to_group' => 'yes']],
+                       ],
+                       [
+                               'test',
+                               ['groupA'],
+                               [
+                                       ['uid' => 'test1', 'displayName' => 'Test user 1', 'groups' => ['groupA']],
+                                       ['uid' => 'test2', 'displayName' => 'Test user 2', 'groups' => ['groupA']],
+                               ],
+                               ['exact' => [], 'wide' => []],
+                               ['core' => ['shareapi_allow_share_dialog_user_enumeration' => 'no']],
+                       ],
+                       [
+                               'test1',
+                               ['groupA'],
+                               [
+                                       ['uid' => 'test1', 'displayName' => 'Test user 1', 'groups' => ['groupA']],
+                                       ['uid' => 'test2', 'displayName' => 'Test user 2', 'groups' => ['groupA']],
+                               ],
+                               ['exact' => ['test1'], 'wide' => []],
+                               ['core' => ['shareapi_allow_share_dialog_user_enumeration' => 'no']],
+                       ],
+                       [
+                               'test1',
+                               ['groupA'],
+                               [
+                                       ['uid' => 'test1', 'displayName' => 'Test user 1', 'groups' => ['groupA']],
+                                       ['uid' => 'test2', 'displayName' => 'Test user 2', 'groups' => ['groupA']],
+                               ],
+                               ['exact' => [], 'wide' => []],
+                               [
+                                       'core' => [
+                                               'shareapi_allow_share_dialog_user_enumeration' => 'no',
+                                               'shareapi_restrict_user_enumeration_full_match_userid' => 'no',
+                                       ],
+                               ]
+                       ],
+                       [
+                               'Test user 1',
+                               ['groupA'],
+                               [
+                                       ['uid' => 'test1', 'displayName' => 'Test user 1', 'groups' => ['groupA']],
+                                       ['uid' => 'test2', 'displayName' => 'Test user 2', 'groups' => ['groupA']],
+                               ],
+                               ['exact' => ['test1'], 'wide' => []],
+                               [
+                                       'core' => [
+                                               'shareapi_allow_share_dialog_user_enumeration' => 'no',
+                                               'shareapi_restrict_user_enumeration_full_match_userid' => 'no',
+                                       ],
+                               ]
+                       ],
+                       [
+                               'Test user 1',
+                               ['groupA'],
+                               [
+                                       ['uid' => 'test1', 'displayName' => 'Test user 1 (Second displayName for user 1)', 'groups' => ['groupA']],
+                                       ['uid' => 'test2', 'displayName' => 'Test user 2 (Second displayName for user 2)', 'groups' => ['groupA']],
+                               ],
+                               ['exact' => [], 'wide' => []],
+                               ['core' => ['shareapi_allow_share_dialog_user_enumeration' => 'no'],
+                               ]
+                       ],
+                       [
+                               'Test user 1',
+                               ['groupA'],
+                               [
+                                       ['uid' => 'test1', 'displayName' => 'Test user 1 (Second displayName for user 1)', 'groups' => ['groupA']],
+                                       ['uid' => 'test2', 'displayName' => 'Test user 2 (Second displayName for user 2)', 'groups' => ['groupA']],
+                               ],
+                               ['exact' => ['test1'], 'wide' => []],
+                               [
+                                       'core' => [
+                                               'shareapi_allow_share_dialog_user_enumeration' => 'no',
+                                               'shareapi_restrict_user_enumeration_full_match_ignore_second_display_name' => 'yes',
+                                       ],
+                               ]
                        ],
                        [
                                'test1',
@@ -595,6 +669,7 @@ class UserPluginTest extends TestCase {
                                        ['uid' => 'test2', 'groups' => ['groupB']],
                                ],
                                ['exact' => ['test1'], 'wide' => []],
+                               ['core' => ['shareapi_restrict_user_enumeration_to_group' => 'yes']],
                        ],
                        [
                                'test',
@@ -604,6 +679,7 @@ class UserPluginTest extends TestCase {
                                        ['uid' => 'test2', 'groups' => ['groupB', 'groupA']],
                                ],
                                ['exact' => [], 'wide' => ['test1', 'test2']],
+                               ['core' => ['shareapi_restrict_user_enumeration_to_group' => 'yes']],
                        ],
                        [
                                'test',
@@ -613,6 +689,7 @@ class UserPluginTest extends TestCase {
                                        ['uid' => 'test2', 'groups' => ['groupB', 'groupA']],
                                ],
                                ['exact' => [], 'wide' => ['test1', 'test2']],
+                               ['core' => ['shareapi_restrict_user_enumeration_to_group' => 'yes']],
                        ],
                        [
                                'test',
@@ -622,6 +699,7 @@ class UserPluginTest extends TestCase {
                                        ['uid' => 'test2', 'groups' => ['groupB', 'groupA']],
                                ],
                                ['exact' => [], 'wide' => ['test1', 'test2']],
+                               ['core' => ['shareapi_restrict_user_enumeration_to_group' => 'yes']],
                        ],
                        [
                                'test',
@@ -631,6 +709,7 @@ class UserPluginTest extends TestCase {
                                        ['uid' => 'test2', 'groups' => ['groupB', 'groupA']],
                                ],
                                ['exact' => [], 'wide' => []],
+                               ['core' => ['shareapi_restrict_user_enumeration_to_group' => 'yes']],
                        ],
                        [
                                'test',
@@ -640,6 +719,7 @@ class UserPluginTest extends TestCase {
                                        ['uid' => 'test2', 'groups' => []],
                                ],
                                ['exact' => [], 'wide' => []],
+                               ['core' => ['shareapi_restrict_user_enumeration_to_group' => 'yes']],
                        ],
                        [
                                'test',
@@ -649,6 +729,7 @@ class UserPluginTest extends TestCase {
                                        ['uid' => 'test2', 'groups' => []],
                                ],
                                ['exact' => [], 'wide' => []],
+                               ['core' => ['shareapi_restrict_user_enumeration_to_group' => 'yes']],
                        ],
                ];
        }
@@ -656,19 +737,38 @@ class UserPluginTest extends TestCase {
        /**
         * @dataProvider dataSearchEnumeration
         */
-       public function testSearchEnumerationLimit($search, $userGroups, $matchingUsers, $result) {
-               $this->mockConfig(false, true, true);
+       public function testSearchEnumerationLimit($search, $userGroups, $matchingUsers, $result, $mockedSettings) {
+               $this->mockConfig($mockedSettings);
 
                $userResults = [];
                foreach ($matchingUsers as $user) {
                        $userResults[$user['uid']] = $user['uid'];
                }
 
-               $mappedResultExact = array_map(function ($user) {
-                       return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => $user];
+               $usersById = [];
+               foreach ($matchingUsers as $user) {
+                       $usersById[$user['uid']] = $user;
+               }
+
+               $mappedResultExact = array_map(function ($user) use ($usersById, $search) {
+                       return [
+                               'label' => $search === $user ? $user : $usersById[$user]['displayName'],
+                               'value' => ['shareType' => 0, 'shareWith' => $user],
+                               'icon' => 'icon-user',
+                               'subline' => null,
+                               'status' => [],
+                               'shareWithDisplayNameUnique' => $user,
+                       ];
                }, $result['exact']);
                $mappedResultWide = array_map(function ($user) {
-                       return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => $user];
+                       return [
+                               'label' => $user,
+                               'value' => ['shareType' => 0, 'shareWith' => $user],
+                               'icon' => 'icon-user',
+                               'subline' => null,
+                               'status' => [],
+                               'shareWithDisplayNameUnique' => $user,
+                       ];
                }, $result['wide']);
 
                $this->userManager
@@ -679,6 +779,17 @@ class UserPluginTest extends TestCase {
                                }
                                return null;
                        });
+               $this->userManager
+               ->method('searchDisplayName')
+               ->willReturnCallback(function ($search) use ($matchingUsers) {
+                       $users = array_filter(
+                               $matchingUsers,
+                               fn ($user) => str_contains(strtolower($user['displayName']), strtolower($search))
+                       );
+                       return array_map(
+                               fn ($user) => $this->getUserMock($user['uid'], $user['displayName']),
+                               $users);
+               });
 
                $this->groupManager->method('displayNamesInGroup')
                        ->willReturn($userResults);