Merge remote-tracking branch 'origin/6.2.0' into 7.1.2
Conflicts: src/Umbraco.Core/Models/PropertyType.cs src/Umbraco.Web.UI/umbraco_client/GenericProperty/genericProperty.js src/Umbraco.Web/WebServices/CoreStringsController.cs src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs src/Umbraco.Web/umbraco.presentation/umbraco/create/nodetypeTasks.cs src/umbraco.providers/members/UmbracoMembershipProvider.cs
This commit is contained in:
@@ -406,7 +406,9 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//TODO: We must ensure that the property value can actually be saved based on the specified database type
|
||||
|
||||
//TODO Add PropertyEditor validation when its relevant to introduce
|
||||
/*if (value is IEditorModel && DataTypeControlId != Guid.Empty)
|
||||
{
|
||||
|
||||
@@ -256,7 +256,21 @@
|
||||
contentType: 'application/json; charset=utf-8',
|
||||
error: function (x, t, e) {
|
||||
if (x.status.toString().startsWith("500")) {
|
||||
$u.Sys.ApiMgr.getApp().handleAjaxException(x, t, e);
|
||||
//show ysod overlay if we can
|
||||
if (UmbClientMgr) {
|
||||
var startIndex = x.responseText.indexOf("<body");
|
||||
var endIndex = x.responseText.lastIndexOf("</body>");
|
||||
var body = x.responseText.substring(startIndex, endIndex + 7);
|
||||
var $div = $(body.replace("<body bgcolor=\"white\">", "<div style='display:none;overflow:auto;height:613px;'>").replace("</body>", "</div>"));
|
||||
$div.appendTo($(UmbClientMgr.mainWindow().document.getElementsByTagName("body")[0]));
|
||||
UmbClientMgr.openModalWindowForContent($div, "ysod", true, 640, 640, null, null, null, function() {
|
||||
//remove the $div
|
||||
$div.closest(".umbModalBox").remove();
|
||||
});
|
||||
}
|
||||
else {
|
||||
alert("Unhandled exception occurred.\nStatus: " + x.status + "\nMessage: " + x.statusText + "\n\n" + x.responseText);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -177,6 +177,26 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
|
||||
}
|
||||
}
|
||||
},
|
||||
openModalWindowForContent: function (jQueryElement, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback) {
|
||||
//need to create the modal on the top window if the top window has a client manager, if not, create it on the current window
|
||||
|
||||
//if this is the top window, or if the top window doesn't have a client manager, create the modal in this manager
|
||||
if (window == this.mainWindow() || !this.mainWindow().UmbClientMgr) {
|
||||
var m = new Umbraco.Controls.ModalWindow();
|
||||
this._modal.push(m);
|
||||
m.show(jQueryElement, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback);
|
||||
}
|
||||
else {
|
||||
//if the main window has a client manager, then call the main window's open modal method whilst keeping the context of it's manager.
|
||||
if (this.mainWindow().UmbClientMgr) {
|
||||
this.mainWindow().UmbClientMgr.openModalWindowForContent.apply(this.mainWindow().UmbClientMgr,
|
||||
[jQueryElement, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback]);
|
||||
}
|
||||
else {
|
||||
return; //exit recurse.
|
||||
}
|
||||
}
|
||||
},
|
||||
closeModalWindow: function(rVal) {
|
||||
/// <summary>
|
||||
/// will close the latest open modal window.
|
||||
|
||||
@@ -118,6 +118,7 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls");
|
||||
/// The callback will receive one parameter with 2 properties:
|
||||
/// modalContent = the jQuery object for the popup window to query against
|
||||
/// outVal = the value passed to the close window method that was used to close the window (if it was specified)
|
||||
/// </param>
|
||||
/// <returns>The generated jquery object bound to the modal window</returns>
|
||||
|
||||
|
||||
@@ -355,7 +356,7 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls");
|
||||
$.fn.jqmAddClose = function(e) { return hs(this, e, 'jqmHide'); };
|
||||
$.fn.jqmAddTrigger = function(e) { return hs(this, e, 'jqmShow'); };
|
||||
$.fn.jqmShow = function(t) { return this.each(function() { $.jqm.open(this._jqm, t); }); };
|
||||
$.fn.jqmHide = function(t) { return this.each(function() { $.jqm.close(this._jqm, t) }); };
|
||||
$.fn.jqmHide = function(t) { return this.each(function() { $.jqm.close(this._jqm, t); }); };
|
||||
|
||||
$.jqm = {
|
||||
hash: {},
|
||||
|
||||
@@ -330,7 +330,10 @@ namespace Umbraco.Web.Security.Providers
|
||||
{
|
||||
member.LastLoginDate = DateTime.Now;
|
||||
member.UpdateDate = DateTime.Now;
|
||||
MemberService.Save(member);
|
||||
//don't raise events for this! It just sets the member dates, if we do raise events this will
|
||||
// cause all distributed cache to execute - which will clear out some caches we don't want.
|
||||
// http://issues.umbraco.org/issue/U4-3451
|
||||
MemberService.Save(member, false);
|
||||
}
|
||||
|
||||
return ConvertToMembershipUser(member);
|
||||
@@ -356,7 +359,10 @@ namespace Umbraco.Web.Security.Providers
|
||||
{
|
||||
member.LastLoginDate = DateTime.Now;
|
||||
member.UpdateDate = DateTime.Now;
|
||||
MemberService.Save(member);
|
||||
//don't raise events for this! It just sets the member dates, if we do raise events this will
|
||||
// cause all distributed cache to execute - which will clear out some caches we don't want.
|
||||
// http://issues.umbraco.org/issue/U4-3451
|
||||
MemberService.Save(member, false);
|
||||
}
|
||||
|
||||
return ConvertToMembershipUser(member);
|
||||
@@ -530,7 +536,11 @@ namespace Umbraco.Web.Security.Providers
|
||||
member.LastLoginDate = DateTime.Now;
|
||||
}
|
||||
|
||||
MemberService.Save(member);
|
||||
//don't raise events for this! It just sets the member dates, if we do raise events this will
|
||||
// cause all distributed cache to execute - which will clear out some caches we don't want.
|
||||
// http://issues.umbraco.org/issue/U4-3451
|
||||
MemberService.Save(member, false);
|
||||
|
||||
return authenticated;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Web.UI.Controls;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.cms.businesslogic;
|
||||
|
||||
@@ -8,6 +8,7 @@ using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Web.UI;
|
||||
using umbraco.BusinessLogic;
|
||||
using Umbraco.Core.Strings;
|
||||
using umbraco.DataLayer;
|
||||
using umbraco.BasePages;
|
||||
using Umbraco.Core.IO;
|
||||
|
||||
@@ -578,11 +578,11 @@ namespace umbraco.cms.businesslogic.member
|
||||
Version = MemberItem.Version;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Used to persist object changes to the database. In Version3.0 it's just a stub for future compatibility
|
||||
/// Used to persist object changes to the database
|
||||
/// </summary>
|
||||
public override void Save()
|
||||
/// <param name="raiseEvents"></param>
|
||||
public void Save(bool raiseEvents)
|
||||
{
|
||||
var provider = MembershipProviderExtensions.GetMembersMembershipProvider();
|
||||
//Due to backwards compatibility with this API we need to check for duplicate emails here if required.
|
||||
@@ -596,17 +596,19 @@ namespace umbraco.cms.businesslogic.member
|
||||
}
|
||||
|
||||
var e = new SaveEventArgs();
|
||||
FireBeforeSave(e);
|
||||
if (raiseEvents)
|
||||
{
|
||||
FireBeforeSave(e);
|
||||
}
|
||||
|
||||
foreach (var property in GenericProperties)
|
||||
{
|
||||
MemberItem.SetValue(property.PropertyType.Alias, property.Value);
|
||||
}
|
||||
|
||||
if (!e.Cancel)
|
||||
if (e.Cancel == false)
|
||||
{
|
||||
|
||||
ApplicationContext.Current.Services.MemberService.Save(MemberItem);
|
||||
ApplicationContext.Current.Services.MemberService.Save(MemberItem, raiseEvents);
|
||||
|
||||
//base.VersionDate = MemberItem.UpdateDate;
|
||||
|
||||
@@ -622,88 +624,19 @@ namespace umbraco.cms.businesslogic.member
|
||||
SavePreviewXml(generateXmlWithoutSaving(xd), Guid.NewGuid());
|
||||
}
|
||||
|
||||
FireAfterSave(e);
|
||||
if (raiseEvents)
|
||||
{
|
||||
FireAfterSave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//var e = new SaveEventArgs();
|
||||
//FireBeforeSave(e);
|
||||
|
||||
//if (!e.Cancel)
|
||||
//{
|
||||
// var db = ApplicationContext.Current.DatabaseContext.Database;
|
||||
// using (var transaction = db.GetTransaction())
|
||||
// {
|
||||
// foreach (var property in GenericProperties)
|
||||
// {
|
||||
// var poco = new PropertyDataDto
|
||||
// {
|
||||
// Id = property.Id,
|
||||
// PropertyTypeId = property.PropertyType.Id,
|
||||
// NodeId = Id,
|
||||
// VersionId = property.VersionId
|
||||
// };
|
||||
// if (property.Value != null)
|
||||
// {
|
||||
// string dbType = property.PropertyType.DataTypeDefinition.DbType;
|
||||
// if (dbType.Equals("Integer"))
|
||||
// {
|
||||
// if (property.Value is bool || property.PropertyType.DataTypeDefinition.DataType.Id == new Guid("38b352c1-e9f8-4fd8-9324-9a2eab06d97a"))
|
||||
// {
|
||||
// poco.Integer = property.Value != null && string.IsNullOrEmpty(property.Value.ToString())
|
||||
// ? 0
|
||||
// : Convert.ToInt32(property.Value);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// int value = 0;
|
||||
// if (int.TryParse(property.Value.ToString(), out value))
|
||||
// {
|
||||
// poco.Integer = value;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else if (dbType.Equals("Date"))
|
||||
// {
|
||||
// DateTime date;
|
||||
|
||||
// if (DateTime.TryParse(property.Value.ToString(), out date))
|
||||
// poco.Date = date;
|
||||
// }
|
||||
// else if (dbType.Equals("Nvarchar"))
|
||||
// {
|
||||
// poco.VarChar = property.Value.ToString();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// poco.Text = property.Value.ToString();
|
||||
// }
|
||||
// }
|
||||
// bool isNew = db.IsNew(poco);
|
||||
// if (isNew)
|
||||
// {
|
||||
// db.Insert(poco);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// db.Update(poco);
|
||||
// }
|
||||
// }
|
||||
// transaction.Complete();
|
||||
// }
|
||||
|
||||
// // re-generate xml
|
||||
// var xd = new XmlDocument();
|
||||
// XmlGenerate(xd);
|
||||
|
||||
// // generate preview for blame history?
|
||||
// if (UmbracoSettings.EnableGlobalPreviewStorage)
|
||||
// {
|
||||
// // Version as new guid to ensure different versions are generated as members are not versioned currently!
|
||||
// SavePreviewXml(generateXmlWithoutSaving(xd), Guid.NewGuid());
|
||||
// }
|
||||
|
||||
// FireAfterSave(e);
|
||||
//}
|
||||
/// <summary>
|
||||
/// Used to persist object changes to the database. In Version3.0 it's just a stub for future compatibility
|
||||
/// </summary>
|
||||
public override void Save()
|
||||
{
|
||||
Save(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -512,6 +512,11 @@ namespace umbraco.providers.members
|
||||
if (userIsOnline && LastLoginPropertyTypeAlias.IsNullOrWhiteSpace() == false)
|
||||
{
|
||||
UpdateMemberProperty(m, LastLoginPropertyTypeAlias, DateTime.Now);
|
||||
|
||||
//don't raise events for this! It just sets the member dates, if we do raise events this will
|
||||
// cause all distributed cache to execute - which will clear out some caches we don't want.
|
||||
// http://issues.umbraco.org/issue/U4-3451
|
||||
m.Save(false);
|
||||
}
|
||||
|
||||
return ConvertToMembershipUser(m);
|
||||
@@ -534,6 +539,10 @@ namespace umbraco.providers.members
|
||||
if (userIsOnline && LastLoginPropertyTypeAlias.IsNullOrWhiteSpace() == false)
|
||||
{
|
||||
UpdateMemberProperty(m, LastLoginPropertyTypeAlias, DateTime.Now);
|
||||
//don't raise events for this! It just sets the member dates, if we do raise events this will
|
||||
// cause all distributed cache to execute - which will clear out some caches we don't want.
|
||||
// http://issues.umbraco.org/issue/U4-3451
|
||||
m.Save(false);
|
||||
}
|
||||
return ConvertToMembershipUser(m);
|
||||
}
|
||||
@@ -544,6 +553,10 @@ namespace umbraco.providers.members
|
||||
if (userIsOnline && LastLoginPropertyTypeAlias.IsNullOrWhiteSpace() == false)
|
||||
{
|
||||
UpdateMemberProperty(m, LastLoginPropertyTypeAlias, DateTime.Now);
|
||||
//don't raise events for this! It just sets the member dates, if we do raise events this will
|
||||
// cause all distributed cache to execute - which will clear out some caches we don't want.
|
||||
// http://issues.umbraco.org/issue/U4-3451
|
||||
m.Save(false);
|
||||
}
|
||||
return ConvertToMembershipUser(m);
|
||||
}
|
||||
@@ -744,7 +757,11 @@ namespace umbraco.providers.members
|
||||
}
|
||||
|
||||
// persist data
|
||||
m.Save();
|
||||
|
||||
//don't raise events for this! It just sets the member dates, if we do raise events this will
|
||||
// cause all distributed cache to execute - which will clear out some caches we don't want.
|
||||
// http://issues.umbraco.org/issue/U4-3451
|
||||
m.Save(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -768,7 +785,11 @@ namespace umbraco.providers.members
|
||||
UpdateMemberProperty(m, LastLockedOutPropertyTypeAlias, DateTime.Now);
|
||||
LogHelper.Info<UmbracoMembershipProvider>("Member " + username + " is now locked out, max invalid password attempts exceeded");
|
||||
}
|
||||
m.Save();
|
||||
|
||||
//don't raise events for this! It just sets the member dates, if we do raise events this will
|
||||
// cause all distributed cache to execute - which will clear out some caches we don't want.
|
||||
// http://issues.umbraco.org/issue/U4-3451
|
||||
m.Save(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user