diff --git a/src/Umbraco.Core/Security/BackOfficeSignInManager.cs b/src/Umbraco.Core/Security/BackOfficeSignInManager.cs index fc76b2e6bc..b9a285c4a5 100644 --- a/src/Umbraco.Core/Security/BackOfficeSignInManager.cs +++ b/src/Umbraco.Core/Security/BackOfficeSignInManager.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Models.Identity; namespace Umbraco.Core.Security { + //TODO: In v8 we need to change this to use an int? nullable TKey instead, see notes against overridden TwoFactorSignInAsync public class BackOfficeSignInManager : SignInManager { private readonly ILogger _logger; @@ -262,5 +263,67 @@ namespace Umbraco.Core.Security } return null; } + + /// + /// Two factor verification step + /// + /// + /// + /// + /// + /// + /// + /// This is implemented because we cannot override GetVerifiedUserIdAsync and instead we have to shadow it + /// so due to this and because we are using an INT as the TKey and not an object, it can never be null. Adding to that + /// the default(int) value returned by the base class is always a valid user (i.e. the admin) so we just have to duplicate + /// all of this code to check for -1 instead. + /// + public override async Task TwoFactorSignInAsync(string provider, string code, bool isPersistent, bool rememberBrowser) + { + var userId = await GetVerifiedUserIdAsync(); + if (userId == -1) + { + return SignInStatus.Failure; + } + var user = await UserManager.FindByIdAsync(userId); + if (user == null) + { + return SignInStatus.Failure; + } + if (await UserManager.IsLockedOutAsync(user.Id)) + { + return SignInStatus.LockedOut; + } + if (await UserManager.VerifyTwoFactorTokenAsync(user.Id, provider, code)) + { + // When token is verified correctly, clear the access failed count used for lockout + await UserManager.ResetAccessFailedCountAsync(user.Id); + await SignInAsync(user, isPersistent, rememberBrowser); + return SignInStatus.Success; + } + // If the token is incorrect, record the failure which also may cause the user to be locked out + await UserManager.AccessFailedAsync(user.Id); + return SignInStatus.Failure; + } + + /// Send a two factor code to a user + /// + /// + /// + /// This is implemented because we cannot override GetVerifiedUserIdAsync and instead we have to shadow it + /// so due to this and because we are using an INT as the TKey and not an object, it can never be null. Adding to that + /// the default(int) value returned by the base class is always a valid user (i.e. the admin) so we just have to duplicate + /// all of this code to check for -1 instead. + /// + public override async Task SendTwoFactorCodeAsync(string provider) + { + var userId = await GetVerifiedUserIdAsync(); + if (userId == -1) + return false; + + var token = await UserManager.GenerateTwoFactorTokenAsync(userId, provider); + var identityResult = await UserManager.NotifyTwoFactorTokenAsync(userId, provider, token); + return identityResult.Succeeded; + } } } diff --git a/src/Umbraco.Tests/UdiTests.cs b/src/Umbraco.Tests/UdiTests.cs index 82608a5513..881bee870f 100644 --- a/src/Umbraco.Tests/UdiTests.cs +++ b/src/Umbraco.Tests/UdiTests.cs @@ -14,6 +14,12 @@ namespace Umbraco.Tests [TestFixture] public class UdiTests : BaseUmbracoApplicationTest { + [SetUp] + public void Setup() + { + Udi.ResetUdiTypes(); + } + [Test] public void StringUdiCtorTest() { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js index 2d0515d764..734903e46c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js @@ -5,12 +5,20 @@ function textboxController($scope) { $scope.model.config = {}; } + $scope.model.maxlength = false; + if ($scope.model.config && $scope.model.config.maxChars) { + $scope.model.maxlength = true; + } + if (!$scope.model.config.maxChars) { + // 500 is the maximum number that can be stored + // in the database, so set it to the max, even + // if no max is specified in the config $scope.model.config.maxChars = 500; } - if ($scope.model.config && $scope.model.config.maxChars) { - if ($scope.model.value == undefined) { + if ($scope.model.maxlength) { + if ($scope.model.value === undefined) { $scope.model.count = ($scope.model.config.maxChars * 1); } else { $scope.model.count = ($scope.model.config.maxChars * 1) - $scope.model.value.length; @@ -19,7 +27,7 @@ function textboxController($scope) { $scope.model.change = function () { if ($scope.model.config && $scope.model.config.maxChars) { - if ($scope.model.value == undefined) { + if ($scope.model.value === undefined) { $scope.model.count = ($scope.model.config.maxChars * 1); } else { $scope.model.count = ($scope.model.config.maxChars * 1) - $scope.model.value.length; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html index a386bd38b9..77656ac618 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html @@ -7,7 +7,7 @@ ng-keyup="model.change()" /> Required -
+
{{model.count}} characters left
diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml index 04722f9518..4c72991589 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml @@ -771,7 +771,7 @@ Creation date Třídění bylo ukončeno. Abyste nastavili, jak mají být položky seřazeny, přetáhněte jednotlivé z nich nahoru či dolů. Anebo klikněte na hlavičku sloupce pro setřídění celé kolekce -
Během třídění nezavírejte toto okno]]>
+ Publikování bylo zrušeno doplňkem třetí strany diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml index 34d5c9c0bc..06c8eb017f 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml @@ -733,7 +733,7 @@ Vennlig hilsen Umbraco roboten Creation date Sortering ferdig. Dra elementene opp eller ned for å arrangere dem. Du kan også klikke kolonneoverskriftene for å sortere alt på en gang. -
Ikke lukk dette vinduet under sortering]]>
+ En feil oppsto diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml index 03933f34ff..24b9cc57f0 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml @@ -905,7 +905,7 @@ 增添時間 排序完成。 上下拖拽項目或按一下列頭進行排序 -
排序中請不要關閉視窗。]]>
+ 驗證 diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml index 16ed8de775..4f5bd4fbb5 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml @@ -1014,7 +1014,7 @@ Mange hilsner fra Umbraco robotten Oprettelsesdato Sortering udført Træk de forskellige sider op eller ned for at indstille hvordan de skal arrangeres, eller klik på kolonnehovederne for at sortere hele rækken af sider -
Luk ikke dette vindue imens]]>
+ Annulleret diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/de.xml b/src/Umbraco.Web.UI/umbraco/config/lang/de.xml index 6626cb35c3..5e3740f46c 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/de.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/de.xml @@ -764,7 +764,7 @@ Wenn Sie sich für Runway entscheiden, können Sie optional Blöcke nutzen, die Erstellungsdatum Sortierung abgeschlossen. Ziehen Sie die Elemente an ihre gewünschte neue Position. - Bitte warten, die Seiten werden sortiert. Das kann einen Moment dauern. Bitte schließen Sie dieses Fenster nicht, bis der Sortiervorgang abgeschlossen ist. + Bitte warten, die Seiten werden sortiert. Das kann einen Moment dauern. Fehlgeschlagen diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 65256f5e78..4d82fa69a4 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -1298,7 +1298,7 @@ To manage your website, simply open the Umbraco back office and start adding con Creation date Sorting complete. Drag the different items up or down below to set how they should be arranged. Or click the column headers to sort the entire collection of items -
Do not close this window during sorting]]>
+ Validation diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index 4abe10de31..11461a1581 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -1304,7 +1304,7 @@ To manage your website, simply open the Umbraco back office and start adding con Creation date Sorting complete. Drag the different items up or down below to set how they should be arranged. Or click the column headers to sort the entire collection of items -
Do not close this window during sorting]]>
+ Validation diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/es.xml b/src/Umbraco.Web.UI/umbraco/config/lang/es.xml index 99283482aa..91c3aa3b0f 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/es.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/es.xml @@ -685,8 +685,7 @@ Creation date Ordenación completa. Arrastra las diferentes páginas debajo para colocarlas como deberían estar. O haz click en las cabeceras de las columnas para ordenar todas las páginas - -
No cierre esta ventana mientras se está ordenando ]]>
+ La publicación fue cancelada por un complemento de terceros diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml index 29bcdca039..1d3a237c67 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml @@ -1015,7 +1015,7 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à Date de création Tri achevé. Faites glisser les différents éléments vers le haut ou vers le bas pour définir la manière dont ils doivent être organisés. Ou cliquez sur les entêtes de colonnes pour trier la collection complète d'éléments -
Ne fermez pas cette fenêtre durant le tri.]]>
+ Validation diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/he.xml b/src/Umbraco.Web.UI/umbraco/config/lang/he.xml index e8436ec399..a3a562d152 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/he.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/he.xml @@ -681,7 +681,7 @@ To manage your website, simply open the Umbraco back office and start adding con Creation date המיון הושלם. יש לגרור את הפריטים מעלה או מטה כדי להגדיר את סדר התוכן. או לחץ על כותרת העמודה כדי למיין את כל פריטי התוכן -
נא לא לסגור את החלון בזמן המיון]]>
+ הפירסום בוטל על ידי תוסף צד שלישי diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/it.xml b/src/Umbraco.Web.UI/umbraco/config/lang/it.xml index 344b0dc7d5..decce2b78a 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/it.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/it.xml @@ -657,7 +657,7 @@ Per gestire il tuo sito web, è sufficiente aprire il back office di Umbraco e i Creation date -
Non chiudere questa finestra durante l'operazione]]>
+ diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml index 575e9d6766..ceb6a05846 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml @@ -887,7 +887,7 @@ Runwayをインストールして作られた新しいウェブサイトがど Creation date ソートが完了しました。 上下にアイテムをドラッグするなどして適当に配置したり、列のヘッダーをクリックしてコレクション全体をソートできます -
並び替え中はウィンドウを閉じないでください。]]>
+ 検証 diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml index ac956f85ea..5a2908275f 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml @@ -658,7 +658,7 @@ Creation date 정렬 완료 다른 아이템을 마우스로 위,아래로 드래그 하여 이동하거나 열의 헤더를 클릭하여 아이템을 정렬할 수 있습니다 -
정렬하는 동안 이 창을 닫지 마십시오]]>
+ 3rd party add-in 때문에 발행이 취소되었습니다. diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml index 7b170cdc41..65fe8341e6 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml @@ -949,7 +949,7 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je Creation date Sorteren gereed. Sleep de pagina's omhoog of omlaag om de volgorde te veranderen. Of klik op de kolom-header om alle pagina's daarop te sorteren. -
Sluit dit venster niet tijdens het sorteren]]>
+ Validatie diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml index b7ac6c0088..f291aab7ea 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml @@ -1012,7 +1012,7 @@ Naciśnij przycisk instaluj, aby zainstalować bazę danych Umb Data utworzenia Sortowanie zakończone. Przesuń poszczególne elementy w górę oraz w dół aż będą w odpowiedniej kolejności lub kliknij na nagłówku kolumny, aby posortować całą kolekcję elementów -
Nie zamykaj tego okna podczas sortowania]]>
+ Walidacja diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml b/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml index dbf494f990..a1f1c69f8e 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml @@ -646,7 +646,7 @@ Você pode publicar esta página e todas suas sub-páginas ao selecionar pub Creation date Classificação concluída. Arraste os diferentes itens para cima ou para baixo para definir como os mesmos serão arranjados. Ou clique no título da coluna para classificar a coleção completa de itens -
Não feche esta janela durante a classificação]]>
+ Publicação foi cancelada por add-in de terceiros diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml index 86579a2a95..ec24bd69cb 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml @@ -1310,7 +1310,7 @@ Дата создания Сортировка завершена Перетаскивайте элементы на нужное место вверх или вниз для определения необходимого Вам порядка сортировки. Также можно использовать заголовки столбцов, чтобы отсортировать все элементы сразу. -
Не закрывайте это окно до окончания процесса сортировки.]]>
+ Процесс публикации был отменен установленным пакетом дополнений. diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml b/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml index d0860820c7..2fae24db21 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml @@ -694,7 +694,7 @@ Creation date Sortering klar Välj i vilken ordning du vill ha sidorna genom att dra dem upp eller ner i listan. Du kan också klicka på kolumnrubrikerna för att sortera grupper av sidor -
Stäng inte fönstret under tiden sidorna sorteras.]]>
+ Publiceringen avbröts av ett tredjepartstillägg diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/tr.xml b/src/Umbraco.Web.UI/umbraco/config/lang/tr.xml index d8b1c9f85d..3bf32cc50d 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/tr.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/tr.xml @@ -844,7 +844,7 @@ To manage your website, simply open the Umbraco back office and start adding con Sorting complete. Drag the different items up or down below to set how they should be arranged. Or click the column headers to sort the entire collection of items -
Do not close this window during sorting]]>
+ Hata diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml index 3202ea5a1b..b34deedc6e 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml @@ -1065,7 +1065,7 @@ 创建日期 排序完成。 上下拖拽项目或单击列头进行排序 -
请不要关闭窗口]]>
+ 验证 diff --git a/src/Umbraco.Web.UI/umbraco_client/Dialogs/SortDialog.js b/src/Umbraco.Web.UI/umbraco_client/Dialogs/SortDialog.js index dc74ad95ff..3de038c859 100644 --- a/src/Umbraco.Web.UI/umbraco_client/Dialogs/SortDialog.js +++ b/src/Umbraco.Web.UI/umbraco_client/Dialogs/SortDialog.js @@ -105,6 +105,7 @@ //wire up the submit button self._opts.submitButton.click(function() { + this.disabled = true; self._saveSort(); });