11841 Commits

Author SHA1 Message Date
Hermes Sbicego
0234738573 8620 Adds filehash to static resources (#8621)
fixes #8620
2022-09-23 08:05:17 +02:00
Matteo Piovanelli
a402c82c23 Bump version for owin packages. (#8617)
* Bump version for owin packages.

* restored project settings that had been altered when updating packages
2022-09-19 08:41:21 +02:00
Matteo Piovanelli
526a652ab5 bump version for owin packages. (#8616) 2022-09-16 08:46:47 +02:00
Andrea Piovanelli
ddc56c8baa Moved logic for max file path length in file storage provider (#8603)
Co-authored-by: matteo.piovanelli <matteo.piovanelli@laser-group.com>
2022-09-05 09:01:30 +02:00
Sébastien Ros
5bb6c8b27e Create SECURITY.md 2022-08-04 10:03:47 -07:00
Andrea Piovanelli
343ceb777b 8599 nullable field values (#8600)
* Added nullable type to DescribeMemberContext for BooleanField and NumericField.

* Rollback of nullable member value for NumericFieldDriver, which is unnecessary because Editor function doesn't let a null value to be saved.
2022-07-15 08:38:03 +02:00
Matteo Piovanelli
63cfe7babe Fix/cache by role exception (#8574) 2022-07-08 16:52:30 +02:00
Andrea Piovanelli
c38e6814a9 Feature/blogposts search (#8570) 2022-07-08 16:51:07 +02:00
Hermes Sbicego
d0bd8d0af0 Create unique HTML element ids for boolean fields edited via radio buttons (#8598) 2022-07-08 16:49:56 +02:00
Hermes Sbicego
f2ec2a70cd Fix/newtonsoft.json 13.0.1 (#8596)
* Bump Newtonsoft.Json from 12.0.3 to 13.0.1 in /src/Orchard

Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 12.0.3 to 13.0.1.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/12.0.3...13.0.1)

---
updated-dependencies:
- dependency-name: Newtonsoft.Json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump Newtonsoft.Json from 12.0.3 to 13.0.1 in /src/Orchard.Azure.Tests

Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 12.0.3 to 13.0.1.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/12.0.3...13.0.1)

---
updated-dependencies:
- dependency-name: Newtonsoft.Json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updates Newtonsoft.Json from 12.0.3 to 13.0.1

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-05 09:30:08 +02:00
Andrea Piovanelli
9f37c23dd7 allow RecipeManager to affect execution timeout (#8572)
Co-authored-by: matteo.piovanelli <matteo.piovanelli@laser-group.com>
2022-06-17 08:51:25 +02:00
Andrea Piovanelli
64fad63e02 Fixed search function when searching inside the "Recent" folder. (#8568) 2022-06-17 08:51:10 +02:00
Andrea Piovanelli
f161693d52 Moved ShapeTracing js includes at head (#8560) 2022-06-17 08:50:56 +02:00
Andrea Piovanelli
520dc06b46 8557 check valid taxonomy (#8558)
* Added checks on taxonomyId validity (it needs to be > 0) before executing queries that would return no result.

* Added id check on GetTaxonomy(int id) functions.

* Added id check on GetTerm(int id)

* Removed id check on GetTaxonomy(int) function to avoid changing previous behaviour.

* Returned "Array.Empty" instead of "new List" where an empty list must be returned.
2022-06-17 08:50:43 +02:00
Andrea Piovanelli
aff9b2542c Fix to replace media when original file has been deleted from filesystem (#8555)
* Added statuses management instead of notifier when catching file not found exception

# Conflicts:
#	src/Orchard.Web/Modules/Orchard.MediaLibrary/Controllers/ClientStorageController.cs

* Visual studio automatic code formatting.
2022-04-29 15:33:23 +02:00
Matteo Piovanelli
aed260544d Fixes #8550 (#8551)
* Added permissions allowing management of users belonging to specific roles only

* Added condition to manage superuser

* Fixed the case where an user with no special ManageUserByRole Permission would
end up being able to manage a user with no role, because of the behavior of
Enumerable.All on empty collections.
2022-04-08 08:45:56 +02:00
ElenaRepository
0973810c09 added the missing minification files (#8553)
Co-authored-by: elena.lampugnani <elena.lampugnani@laser-group.com>
2022-04-01 14:15:49 +02:00
Matteo Piovanelli
c0fa82fcf9 Handlers to redirect creating and editing users to the correct controller (#8549) 2022-04-01 14:15:04 +02:00
Matteo Piovanelli
a5f657540a Fixed bug with medialibrary plugin where I had forgotten to replace an instance (#8547)
of the previous way to compute the admin url
2022-04-01 14:14:49 +02:00
Andrea Piovanelli
863d4a92a6 Layout elements cloning (#8538)
* Created a new element when session widget has a different container than the widget in the import context (to ensure actual cloning of the elements and not just adding a reference to the old element from the original container).

* Some comment has been rewritten for clarity
2022-03-18 12:27:11 +01:00
ElenaRepository
ab7c0f242e checked null part (#8543)
Co-authored-by: elena.lampugnani <elena.lampugnani@laser-group.com>
2022-03-18 12:26:49 +01:00
Andrea Piovanelli
ffb56e684c 8541 password history (#8542)
* Added password history management to back office user password edit and made it working via IUserEventHandler calls.

* Added "password" parameter to "ChangedPassword" call.
2022-03-18 12:26:19 +01:00
Matteo Piovanelli
5b0c82d1ad Added specific permission to change owner of content item (#8539) 2022-03-18 12:26:06 +01:00
Matteo Piovanelli
ebfd03df0e Use a variable with an actual path to a base url to find the actual path to (#8546)
the medialibrary
2022-03-17 10:06:46 -07:00
Matteo Piovanelli
f2a8450d90 Roles management (#8535)
* Started adding roles that will be used to to allow users the ability to assign
specific roles to others.

* small refactor of the method to return dynamic AssignRole permissions

* Implemented permissions to limit the ability of a user to assign specific
roles

* controller action to assign roles

* Refactored Assign action in roles admin Controller
Fixed a bug in figuring out the id of roles to assign
Added provider to add action links to list of users in BO
Added "cancel" button to page to assign roles, based on returnUrl
2022-02-09 10:23:34 +01:00
Andrea Piovanelli
88a79cb768 Added LayoutSaving call to context in WidgetElementHarvester to properly update the container of widgets. (#8534) 2022-02-09 10:20:30 +01:00
dependabot[bot]
0d410d5ec6 Bump SharpZipLib from 1.3.1 to 1.3.3 in /src/Orchard.Web/Modules/Lucene (#8536) 2022-02-03 10:07:17 -08:00
Matteo Piovanelli
e9244980a4 Upgrade nhibernate (#8528)
* Upgraded NHibernate to version 5.3.10. Solution builds with no warnings.

* fixed most issues

* Added source code for NHibernate.Linq library from
http://sourceforge.net/projects/nhcontrib/files/NHibernate.Linq/1.0/NHibernate.Linq-1.0.0.GA-src.zip
With the modified DetachedCriteriaAdapter.cs for Orchard.
Started upgrading that library to NHibernate 5.3.10.

* Finished updating NHibernate.Linq to work with NHibernate 5.3.10.

* Removed NHibernate.Linq from lib folder

* Updated code generation templates to use the correct version of nhibernate
2022-01-21 08:47:00 +01:00
Matteo Piovanelli
a5c28edb44 Added two constructors to CreateUserParams. (#8530)
One is a restoration of the former constructor with 6 parameters.
The other is a 3 parameters constructor using common defaults for the other
properties.
2022-01-21 08:46:07 +01:00
Hermes Sbicego
412a21873a GetPhysicalPath returns error if url contains '?' (#8526)
* GetPhysicalPath returns error if url contains '?'

Fixes

* Update ResourceDefinition.cs

Co-authored-by: Sébastien Ros <sebastienros@gmail.com>
Co-authored-by: matteo.piovanelli <matteo.piovanelli@laser-group.com>
2022-01-14 10:53:43 +01:00
Matteo Piovanelli
b042873252 extend users and roles capabilities (#8523)
* Adds the capability to set a user to forcely change its own password at next LogOn

* Force user to not reuse last n passwords

* Moves IPasswordService implementation to Orchard Users
Creates Extensions to share management of Password operations across Services

* Some refactoring

* Password History Policy:
- New User Evente (ChangingPassword)
- Settings to enable the policy
- Security service interfaces to abstract history management
- User service implementations to concretely manage history

* PasswordHistoryPolicy:
- keep in count the password stored within the UserPart as a not reusable password

* WIP automated suspension of inactive users

* Disable users that have been inactive for longer than a specified number of
days, except when they are SiteOwner, or they have a specific flag set to
prevent their suspension.

* Provider to prevent suspension of users based on assigned roles

* cleanup. Refactor of migrations.

* Added action to ask for the challenge email to be resent.
Challenge email is sent again if a user tries to register anew with an email
address they had used to create an account earlier if the email address isn't
validated yet.

* During registration, if a user inserts the information of an existing account
and that account should still validate its email address, the user is presented
a link to request a new challenge email to be sent.

* Added a link to the action to request a new challenge email in the case when
the nonce fails to validate.

* Renamed part and corresponding record.
Added ability to "protect" specific users from having to change password when
it is expired / too old.

Co-authored-by: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
2022-01-14 10:32:07 +01:00
Matteo Piovanelli
1e1668fdc2 Abstracted account validation (#7944)
* Added a service to abstract some account validation away from the AccountController, so it's easier to upgrade it and use the same validation elsewhere.

* Added a validation context to carry information used for validation of account
information.

* Refactored password validation in the AccountController

* Updated tests

* fixed value read from context.ValidationSuccessful
2022-01-14 09:36:26 +01:00
Matteo Piovanelli
91a82535a2 1.10.x into dev (#8521)
* Added tokenizable default value to ContentPickerFields (#8351)

* Fixes errors during Indexing (#8349)

* Added admin search permissions (#8346)

* Reuse Settings_ShellDescriptorRecord during an http request (#8355)

* Added a new index to CommonPartRecord (#8362)

* Attempted AutoroutePart improvement (#8360)

This should ease Database issues, because it short circuits some code paths
through aliases.

* Save MemberBindingRecords in memory (#8371)

Prevent fetching the same table from the database 5+ times per request by
loading it and saving it in a private property for a request.

* Cache list of configured layers (#8373)

On every page load on frontend we were querying for all existing layers to test
for the ones that are currently active. Since that information is not bound to
change often, we added a cache layer to prevent querying every time. The cache
is evicted whenever a Layer gets updated.

* Memorize query results in blog service (#8374)

The query for all published blogs is being called twice while building the admin menu,
so we are memorizing its results.

* Updated UI for projections (#8380)

Some textboxes were too small for the actual text users would generally write in them.
Those meant to hold HTML have been converted to textareas.

* Process ignored paths while being aware of RequestUrlPrefix (#8384)

* Process ignored paths while being aware of RequestUrlPrefix

* Fix: I had moved a Trim to the wrong place

* Fixed issue with empty/uninitialized null set of ignored urls

* tokens sort criteria (#8382)

* Tokenized state for sort criteria

* Tokenized state also in the other place where sort criteria are used

* Remove lock from the dictionary when the task has completed. (#8395)

Fixes #8391

* Update DistributedLockService.cs (#8398)

* fix for CPF when other scripts are also adding to sessionStorage (#8404)

* Fixes Boolean Conversion error (#8393)

* Fix/8392 remeber me model state exception (#8410)

@sebastienros this fixes the possible NRE that would happen for absent models from merged #8393 
(see your comment there https://github.com/OrchardCMS/Orchard/pull/8393#issuecomment-686630198)

* Removed changes to model bindings (#8412)

This is the same as reverting 1.10.x to commit 868ce12ad6

* New version of Boolean Binder Provider (#8413)

* New version of Boolean Binder Provider
* Use Convert.ToBoolean(string) rather than ValueProviderResult.ConvertTo(bool)

* Upgrade host resolution (#8387)

* Reverted changes to RunningShellTable and then changed the way shells are sorted,
so we can correctly give "priority" to tenants based on their prefix.

Added test adapter reference to Orchard.Framework.Tests so tests can be run in
the latest VS 2017.

Fixed a test that was failing to account for the order the shells were being
processed.

* Removed some stuff from csproj that vs had added

* Handle the case where a form sends more than one attempted value for a boolean (#8416)

* fix record mapping nhibernate (#8415)

* Allow downstream methods to set default value (#8419)

Moreover, this won't try to set a default value to the bool when it's not sent.
This will allow calls with missing required parameters to fail as they should.

* Fixed Media Library Picker Style  (#8433)

* Removed check preventing reassignment of loader delegates (#8436)

* Added an event activity for workflows that activates on the first Upd… (#8438)

* target framework 4.8 to all projects (#8444)

* Feature/8445 libraries update (#8446)

* Fixed conflict with style for layouts (#8456)

the .overlay is used for different things in MediaLibraryPickerField and Layouts, and as it was the styles would conflict. This should fix it.

* Feature/upgradable libraries (#8457)

* Updated Migration for CommonPartRecord and IdentityPartRecord (#8459)

This orders the operations differently than what is in dev for retrocompatibility in both environments.

* Prevents throwing exception when Href is null (#8461)

* added culture in widgets page (#8466)

* added culture in widgets page
Co-authored-by: elena.lampugnani <elena.lampugnani@laser-group.com>
Co-authored-by: Hermes Sbicego <hermes.sbicego@laser-group.com>

* Show disable action for deprecated features even if they are categorized as "Core" (#8468)

* Upgrades YamlDotNet from 9.1.3 to 11.1.1 because 9.1.3 is not more available as nuget package (#8472)

* Bypass cache for XSRF Tokens (#8470)

Fixes #8469

* flag exclude children for taxonomies (#8481)

* Remove cache by tag on Unpublished (#8483)

As it was, cached lists/projections would not be evicted when a ContentItem they contained was unpublished.

* Cloning doesn't overwrite identity (#8487)

Fixes #8486

* Update nhibernate (#8488)

* Update nHibernate to version 4.1.2.4000

# Conflicts:
#	src/Orchard.Web/Modules/Orchard.ContentPicker/packages.config
#	src/Orchard.Web/Modules/Orchard.ImportExport/packages.config
#	src/Orchard.Web/Modules/Orchard.MessageBus/packages.config
#	src/Orchard.Web/Modules/Orchard.MultiTenancy/packages.config
#	src/Orchard.Web/Modules/Orchard.Projections/packages.config
#	src/Orchard.Web/Modules/Orchard.Tags/packages.config
#	src/Orchard.Web/Modules/Upgrade/packages.config
#	src/Orchard.Web/Web.config

* Update AssemblyBindings for NHibernate

* Fixes disposed LifetimeScope issue (#8490)

* fixed scope in in recomputing the context to figure out whether an antiforgery token needs replacing

* Revert "Cloning doesn't overwrite identity (#8487)" (#8495)

This reverts commit af42947c9c.

* Remove whitespace when importing list of permissions (#8499)

Similarly to what's already being done when we import features.
this allows to go to a new line in the xml that we import, and even tabulate for readability and maintenance.

* Force enumeration of list of permissions. 

Without this, imported permissions (#8492) would always replace existing ones: i.e. if an existing permission is not in
the list being imported it would be removed for the role.

* Projection default settings (#8497)

* added settings in projection part
* read settings into driver
* commit files setting
* add logic of filter query
* added logic of filter query setting
* managed import/export
* fixed migration
* added message information
Co-authored-by: elena.lampugnani <elena.lampugnani@laser-group.com>

* HtmlDecode token (#8501)

Added HtmlDecode token management.
Needed for #8500

* Sets SSL redirection as permanent for SEO reasons (#8503)

Fixes #8502

* Added null checks (#8511)

The added null checks manage properly importing definitions that do not contain the properties.

* Fix/editmenulink (#8515)

* Removed useless spaces

* Corrections on ProjectionPart query link (it didn't update the link when changing the selected query).
Added edit link for menu in MenuWidget.

* Added menuId parameter to menu edit link

* Fixed various typos: (#8512)

* Added descriptor to audit trail context (#8517)

Co-authored-by: Hermes Sbicego <hermes.sbicego@laser-group.com>
Co-authored-by: Imran Azad <imranazad@users.noreply.github.com>
Co-authored-by: LorenzoFrediani-Laser <lorenzo.frediani@laser-group.com>
Co-authored-by: ElenaRepository <50620495+ElenaRepository@users.noreply.github.com>
Co-authored-by: Andrea Piovanelli <83577153+AndreaPiovanelliLaser@users.noreply.github.com>
2022-01-14 09:11:12 +01:00
Matteo Piovanelli
ea3c7d89b1 Added descriptor to audit trail context (#8517) 2021-12-10 08:31:16 +01:00
ElenaRepository
5e5bf19863 Different cache key by role (#8510)
* feature: adds roles and permissions of the user in to cache key
2021-10-29 08:41:11 +02:00
Andrea Piovanelli
987291c3cf Fixed various typos: (#8512) 2021-10-29 08:39:38 +02:00
Andrea Piovanelli
be55aad08a Fixed various typos: (#8513) 2021-10-25 09:21:00 +02:00
Andrea Piovanelli
a8de3afc0f Fix/editmenulink (#8515)
* Removed useless spaces

* Corrections on ProjectionPart query link (it didn't update the link when changing the selected query).
Added edit link for menu in MenuWidget.

* Added menuId parameter to menu edit link
2021-10-25 09:19:50 +02:00
Matteo Piovanelli
3336be6c77 Cloning doesn't overwrite identity (#8496)
Fixes #8486
2021-09-24 08:38:01 +02:00
Matteo Piovanelli
e771a56c42 Added null checks (#8511)
The added null checks manage properly importing definitions that do not contain the properties.
2021-09-24 08:37:25 +02:00
Hermes Sbicego
d51418b2c1 Sets SSL redirection as permanent for SEO reasons (#8503)
Fixes #8502
2021-09-16 10:03:00 -07:00
Andrea Piovanelli
e447561cfe HtmlDecode token (#8501)
Added HtmlDecode token management.
Needed for #8500
2021-09-10 08:52:11 +02:00
Hermes Sbicego
4e69612d90 Projection default settings (#8497)
* added settings in projection part
* read settings into driver
* commit files setting
* add logic of filter query
* added logic of filter query setting
* managed import/export
* fixed migration
* added message information
Co-authored-by: elena.lampugnani <elena.lampugnani@laser-group.com>
2021-09-03 09:03:27 +02:00
Matteo Piovanelli
b00678abf4 Force enumeration of list of permissions.
Without this, imported permissions (#8492) would always replace existing ones: i.e. if an existing permission is not in
the list being imported it would be removed for the role.
2021-09-03 09:01:01 +02:00
Matteo Piovanelli
08597931e6 Remove whitespace when importing list of permissions (#8499)
Similarly to what's already being done when we import features.
this allows to go to a new line in the xml that we import, and even tabulate for readability and maintenance.
2021-09-03 08:58:01 +02:00
Matteo Piovanelli
d2e535fbc8 Revert "Cloning doesn't overwrite identity (#8487)" (#8495)
This reverts commit af42947c9c.
2021-08-05 17:52:13 +02:00
Matteo Piovanelli
074a0b140d Fixes disposed LifetimeScope issue (#8490)
* fixed scope in in recomputing the context to figure out whether an antiforgery token needs replacing
2021-07-30 08:42:13 +02:00
Matteo Piovanelli
b37256fc94 Update nhibernate (#8488)
* Update nHibernate to version 4.1.2.4000

# Conflicts:
#	src/Orchard.Web/Modules/Orchard.ContentPicker/packages.config
#	src/Orchard.Web/Modules/Orchard.ImportExport/packages.config
#	src/Orchard.Web/Modules/Orchard.MessageBus/packages.config
#	src/Orchard.Web/Modules/Orchard.MultiTenancy/packages.config
#	src/Orchard.Web/Modules/Orchard.Projections/packages.config
#	src/Orchard.Web/Modules/Orchard.Tags/packages.config
#	src/Orchard.Web/Modules/Upgrade/packages.config
#	src/Orchard.Web/Web.config

* Update AssemblyBindings for NHibernate
2021-07-30 08:41:53 +02:00
Matteo Piovanelli
af42947c9c Cloning doesn't overwrite identity (#8487)
Fixes #8486
2021-07-30 08:40:53 +02:00
Matteo Piovanelli
7131970e91 Remove cache by tag on Unpublished (#8483)
As it was, cached lists/projections would not be evicted when a ContentItem they contained was unpublished.
2021-06-25 10:35:13 +02:00