Skip to content

Commit

Permalink
Release v.15.1.8300.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nader-dab committed Apr 10, 2024
1 parent d2f143b commit c9c3f4f
Show file tree
Hide file tree
Showing 28 changed files with 7,802 additions and 7,192 deletions.
27 changes: 27 additions & 0 deletions AssemblyInfoShare/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyCompany("Telerik")]
[assembly: AssemblyProduct("Telerik Sitefinity CMS")]
[assembly: AssemblyCopyright("Copyright © 2005-2023 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.")]
[assembly: AssemblyTrademark("Sitefinity")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("15.1.8300.0")]
[assembly: AssemblyFileVersion("15.1.8300.0")]
12 changes: 6 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<ItemGroup>
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="RazorGenerator.MsBuild" Version="2.4.1" />
<PackageVersion Include="Telerik.Sitefinity.Content" Version="15.0.8200" />
<PackageVersion Include="Telerik.Sitefinity.Core" Version="15.0.8200" />
<PackageVersion Include="Telerik.Sitefinity.Feather.Core" Version="15.0.8200" />
<PackageVersion Include="Telerik.Sitefinity.Mvc" Version="15.0.8200" />
<PackageVersion Include="Telerik.Sitefinity.Content" Version="15.1.8300" />
<PackageVersion Include="Telerik.Sitefinity.Core" Version="15.1.8300" />
<PackageVersion Include="Telerik.Sitefinity.Feather.Core" Version="15.1.8300" />
<PackageVersion Include="Telerik.Sitefinity.Mvc" Version="15.1.8300" />
<PackageVersion Include="Microsoft.Owin" Version="4.2.2" />
<PackageVersion Include="Microsoft.Owin.Host.SystemWeb" Version="4.2.2" />
<PackageVersion Include="Progress.Sitefinity.Renderer" Version="15.0.8200.218" />
<PackageVersion Include="Telerik.Sitefinity.ServicesImpl" Version="15.0.8200" />
<PackageVersion Include="Progress.Sitefinity.Renderer" Version="15.1.8300.303" />
<PackageVersion Include="Telerik.Sitefinity.ServicesImpl" Version="15.1.8300" />
</ItemGroup>
</Project>
820 changes: 424 additions & 396 deletions Telerik.Sitefinity.Frontend.Blogs/Mvc/Views/web.config

Large diffs are not rendered by default.

820 changes: 424 additions & 396 deletions Telerik.Sitefinity.Frontend.Card/Mvc/Views/web.config

Large diffs are not rendered by default.

820 changes: 424 additions & 396 deletions Telerik.Sitefinity.Frontend.Comments/Mvc/Views/web.config

Large diffs are not rendered by default.

820 changes: 424 additions & 396 deletions Telerik.Sitefinity.Frontend.ContentBlock/Mvc/Views/web.config

Large diffs are not rendered by default.

820 changes: 424 additions & 396 deletions Telerik.Sitefinity.Frontend.DynamicContent/Mvc/Views/web.config

Large diffs are not rendered by default.

820 changes: 424 additions & 396 deletions Telerik.Sitefinity.Frontend.EmailCampaigns/Mvc/Views/web.config

Large diffs are not rendered by default.

820 changes: 424 additions & 396 deletions Telerik.Sitefinity.Frontend.Events/Mvc/Views/web.config

Large diffs are not rendered by default.

820 changes: 424 additions & 396 deletions Telerik.Sitefinity.Frontend.Forms/Mvc/Views/web.config

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Telerik.Sitefinity.Localization;
using Telerik.Sitefinity.ModuleEditor.Web.Services.Model;
using Telerik.Sitefinity.Security.Model;
using Telerik.Sitefinity.Web.UI.ContentUI.Config;
using Telerik.Sitefinity.Web.UI.Fields.Config;
using Telerik.Sitefinity.Web.UI.Validation.Contracts;

Expand Down Expand Up @@ -56,27 +57,7 @@ public static Dictionary<string, object> GetProfileValidationAttributes(string f
/// <returns></returns>
public static IValidatorDefinition GetFieldValidatorDefinition(string fieldName)
{
var views = CustomFieldsContext.GetViews(typeof(SitefinityProfile).FullName);
var view = views.FirstOrDefault();

foreach (var section in view.Sections.Values)
{
if (section != null)
{
// get configuration element
FieldDefinitionElement fieldDefinitionElement = WcfDefinitionBuilder.GetFieldDefinitionElement(fieldName, section);
var fieldControlDefinitionElement = fieldDefinitionElement as FieldControlDefinitionElement;

if (fieldControlDefinitionElement != null)
{
// transfer complex properties like validation
if (fieldControlDefinitionElement.Validation != null)
return fieldControlDefinitionElement.Validation;
}
}
}

return null;
return ContentViewConfig.GetFieldValidatorDefinition(typeof(SitefinityProfile), fieldName);
}

private const string MissingResourcePrefix = "#ResourceNotFound#";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,20 +583,17 @@ protected internal string GetReturnURL(HttpContextBase context)
redirectUrl = redirectUrl.Replace("&err=true", string.Empty).Replace("err=true", string.Empty);
}

if (this.LoginRedirectPageId.HasValue)
// Get redirectUrl from query string parameter
string redirectUrlFromQS;
this.TryResolveUrlFromUrlReferrer(context, out redirectUrlFromQS);

if (!string.IsNullOrWhiteSpace(redirectUrlFromQS))
{
redirectUrl = this.GetPageUrl(this.LoginRedirectPageId);
redirectUrl = redirectUrlFromQS;
}
else
else if (this.LoginRedirectPageId.HasValue)
{
// Get redirectUrl from query string parameter
string redirectUrlFromQS;
this.TryResolveUrlFromUrlReferrer(context, out redirectUrlFromQS);

if (!string.IsNullOrWhiteSpace(redirectUrlFromQS))
{
redirectUrl = redirectUrlFromQS;
}
redirectUrl = this.GetPageUrl(this.LoginRedirectPageId);
}

return redirectUrl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -7,6 +8,7 @@
using System.Web.Script.Serialization;
using Telerik.Sitefinity.Data;
using Telerik.Sitefinity.Data.ContentLinks;
using Telerik.Sitefinity.Frontend.Identity.Mvc.Helpers;
using Telerik.Sitefinity.Frontend.Identity.Mvc.StringResources;
using Telerik.Sitefinity.Frontend.Mvc.Helpers;
using Telerik.Sitefinity.Libraries.Model;
Expand Down Expand Up @@ -327,21 +329,60 @@ public virtual void ValidateProfileData(ProfileEditViewModel viewModel, System.W
var profileBindings = profileBindingsList.SingleOrDefault(p => p.ProfileType == profile.GetType().FullName);
if (profileBindings != null)
{
var requiredProperties = profileBindings.Properties.Where(p => p.Required);
var requiredProperties = profileBindings.Properties;

foreach (var prop in requiredProperties)
{
string propValue;
var tryGetPropValue = viewModel.Profile.TryGetValue(prop.Name, out propValue);
var profileValue = profile.GetType().GetProperty(prop.Name)?.GetValue(profile) as string;

if (readOnlyFields.Any(x => x.Equals(prop.Name, StringComparison.OrdinalIgnoreCase)))
{
if (!(propValue.Equals(profileValue) || (string.IsNullOrEmpty(propValue) && string.IsNullOrEmpty(profileValue))))
{
modelState.AddModelError(string.Format("Profile[{0}]", prop.Name), string.Format(this.GetErrorMessageFromResource("ReadOnlyField"), prop.Name));
}

// skip validation for read-only fields
continue;
}

string propValue;

if (!viewModel.Profile.TryGetValue(prop.Name, out propValue) || string.IsNullOrWhiteSpace(propValue))
if (!tryGetPropValue || string.IsNullOrWhiteSpace(propValue))
{
if (prop.Required)
{
modelState.AddModelError(string.Format("Profile[{0}]", prop.Name), string.Format(Res.Get<ProfileResources>().RequiredProfileField, prop.Name));
}
}
else
{
modelState.AddModelError(string.Format("Profile[{0}]", prop.Name), string.Format(Res.Get<ProfileResources>().RequiredProfileField, prop.Name));
var validation = RegistrationHelper.GetFieldValidatorDefinition(prop.Name);

if (validation != null)
{
var value = viewModel.Profile[prop.Name];
if (validation.Required.HasValue && validation.Required.Value && string.IsNullOrEmpty(value))
{
modelState.AddModelError(string.Format("Profile[{0}]", prop.Name), this.GetErrorMessageFromResource(validation.RequiredViolationMessage));
}
else if (value.Length > 0)
{
if (value.Length < (int)validation.MinLength || ((int)validation.MaxLength != 0 && value.Length > (int)validation.MaxLength))
{
modelState.AddModelError(string.Format("Profile[{0}]", prop.Name), this.GetErrorMessageFromResource(validation.MaxLengthViolationMessage));
}
if (!string.IsNullOrEmpty(validation.RegularExpression))
{
var regex = new Regex(validation.RegularExpression);
if (!regex.IsMatch(value))
{
modelState.AddModelError(string.Format("Profile[{0}]", prop.Name), this.GetErrorMessageFromResource(validation.RegularExpressionViolationMessage));
}
}
}
}
}
}
}
Expand Down Expand Up @@ -572,6 +613,19 @@ private Album GetProfileImagesAlbum(LibrariesManager manager)
return album;
}

private string GetErrorMessageFromResource(string violationMessage)
{
const string MissingResourcePrefix = "#ResourceNotFound#";
string errorMessage = string.Empty;

if (violationMessage != null)
{
errorMessage = Res.Get<ErrorMessages>(violationMessage).StartsWith(MissingResourcePrefix) ? violationMessage : Res.Get<ErrorMessages>(violationMessage);
}

return errorMessage;
}

#endregion

#region Private fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Configuration;
using System.Text.RegularExpressions;
using System.Threading;
using System.Web.Mvc;
using Telerik.Sitefinity.Frontend.Identity.Mvc.Helpers;
using Telerik.Sitefinity.Frontend.Identity.Mvc.StringResources;
Expand Down Expand Up @@ -142,14 +145,24 @@ public virtual IEnumerable<ValidationResult> Validate(ValidationContext validati

yield return new ValidationResult($"{requiredErrorMessage}", new List<string> { "Profile[" + info.Key + "]" });
}
else if (info.Value.Length > 1)
else if (info.Value.Length > 0)
{
if (info.Value.Length < (int)validation.MinLength || ((int)validation.MaxLength != 0 && info.Value.Length > (int)validation.MaxLength))
{
var lengthErrorMessage = this.GetErrorMessageFromResource(validation.MaxLengthViolationMessage);

yield return new ValidationResult($"{lengthErrorMessage}", new List<string> { "Profile[" + info.Key + "]" });
}

if (!string.IsNullOrEmpty(validation.RegularExpression))
{
var regex = new Regex(validation.RegularExpression);
if (!regex.IsMatch(info.Value))
{
var patternErrorMessage = this.GetErrorMessageFromResource(validation.RegularExpressionViolationMessage);
yield return new ValidationResult(patternErrorMessage, new List<string> { "Profile[" + info.Key + "]" });
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
@Html.Resource("EditProfileFirstName")
@Html.HiddenFor(u => u.Profile["FirstName"])
@Model.Profile["FirstName"]
@if (Html.ValidationMessageFor(u => u.Profile["FirstName"]) != null)
{
@Html.ValidationMessageFor(u => u.Profile["FirstName"])
}
</label>
</div>
}
Expand All @@ -77,6 +81,10 @@
@Html.Resource("EditProfileLastName")
@Html.HiddenFor(u => u.Profile["LastName"])
@Model.Profile["LastName"]
@if (Html.ValidationMessageFor(u => u.Profile["LastName"]) != null)
{
@Html.ValidationMessageFor(u => u.Profile["LastName"])
}
</label>
</div>
}
Expand All @@ -97,6 +105,10 @@
@Html.Resource("EditProfileNickname")
@Html.HiddenFor(u => u.Profile["Nickname"])
@Model.Profile["Nickname"]
@if (Html.ValidationMessageFor(u => u.Profile["NickName"]) != null)
{
@Html.ValidationMessageFor(u => u.Profile["Nickname"])
}
</label>
</div>
}
Expand All @@ -116,6 +128,10 @@
@Html.Resource("EditProfileAbout")
@Html.HiddenFor(u => u.Profile["About"])
@Model.Profile["About"]
@if (Html.ValidationMessageFor(u => u.Profile["About"]) != null)
{
@Html.ValidationMessageFor(u => u.Profile["About"])
}
</div>
}
else
Expand Down
Loading

0 comments on commit c9c3f4f

Please sign in to comment.