Commit Graph
49 Commits
Author SHA1 Message Date
Matteo PiovanelliandAndrea Piovanelli e0f987951e Parameter validation for ChangeExpiredPassword action. (#8626)
* Parameter validation for ChangeExpiredPassword action. Centralized check for
password expiration.

* Added ForcePasswordChange flag check to redirect to the correct page when that flag is true.

Co-authored-by: Andrea Piovanelli <andrea.piovanelli@laser-group.com>
2022-10-07 10:09:36 +02:00
Matteo Piovanelli 526a652ab5 bump version for owin packages. (#8616) 2022-09-16 08:46:47 +02:00
Matteo Piovanelli 63cfe7babe Fix/cache by role exception (#8574) 2022-07-08 16:52:30 +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
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
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
Matteo PiovanelliandHermesSbicego-Laser 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
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 3336be6c77 Cloning doesn't overwrite identity (#8496)
Fixes #8486
2021-09-24 08:38:01 +02:00
Matteo Piovanelli 10963275c3 Actually signout user on change password. (#8478)
This is controlled by the existing setting that would invalidate all extant auth cookies on change password.
2021-05-28 08:45:14 +02:00
Matteo Piovanelli d2d77f78eb Added ability to log out missing translations (#8477) 2021-05-28 08:44:32 +02:00
Matteo Piovanelli 7f6ccaf240 Refactored method body to protected method (#8476) 2021-05-24 09:31:12 +02:00
Matteo Piovanelli ca86ec9831 merge 1.10.x into dev 2021-02-19 10:31:26 +01:00
Matteo Piovanelli 8badf8aaf6 Logs out disabled users (#8455)
#8454 invalidates auth cookie for users on disabling them
2021-02-11 19:25:48 +01:00
Matteo Piovanelli eebb22edbf Fix/8439 hql sort factory (#8440)
* Additional methods to extend the sort capabilities for projections

* Added some comments
2020-12-18 08:34:17 +01:00
Matteo Piovanelli 70c04a9a5f Prevent NREs for null text (#8418)
When the text we are localizing is null (which potentially happens when localizing dynamic content), it could result in a null parent translation, which would throw when used as "basis" for comparisons.
2020-09-21 12:10:31 +02:00
Matteo Piovanelli b82e232e38 Fix/8376 nolock subqueries (#8377)
* NolockInterceptor handles subqueries now
The parser as it was ignored subqueries completely. Now it treats them as queries
and places them back in their parent queries.
2020-05-15 08:36:52 +02:00
Matteo Piovanelli d85ff5fa37 Fix/8354 caching (#8364)
* Caching the ShellDescriptor
This avoids fetching all connected records on every request.
refreshed cache after an update
This is after having evicted it and having updated the database
2020-05-08 08:31:33 +02:00
Matteo Piovanelli e520a178aa Fix for TermContentItem deadlocks (#8368)
Now it should only fetch the id, which is what we need, rather than the
whole record, so it should be able to correctly take advantage of the indexes

Try to not fetch terms back from the database right as we do an update, by
using what is in the view model we just updated
2020-05-07 10:40:54 -07:00
Matteo Piovanelli 35738c1b58 Added indexes for common queries (#8369) 2020-05-07 10:39:35 -07:00
Matteo Piovanelli 9d1267a94c localizationpartdriver refactor (#8366)
* Performance on LocalizationPart
Prevent driver from repeating the same query several times in a request (it used
to try and fetch all of a part's localizations at least twice per request).
Changed query for a MasterContentItem's localizations so it should "hint" sql to
use different indexes.
2020-05-07 10:27:58 -07:00
Matteo Piovanelli 937702479c Tabs and Cards to better organize parts and fields (#8310) 2020-02-06 12:16:16 -08:00
Matteo Piovanelli 40eca06645 Rewritten the handler to avoid fetching stuff too often from the repository. Changed the MoveTerm method to handle the case where the term is being moved to a different taxonomy (e.g. when translating). (#8295) 2019-12-05 12:31:04 -08:00
Matteo Piovanelli abfe7a022e caching sitecultureselector and sslsettingspart (#8289) 2019-12-05 12:10:18 -08:00
Matteo Piovanelli 104d18aa06 ReCaptchaPartDriver always returns a shape (#8292)
* We changed when ReCaptchaPartDriver verifies whether it's being executed on the Admin side, moving the test from the driver's execution to the shape's, so that the ShapeType is available to other features and services that process the driver's output (e.g. for placement)

* store the first validation of recaptcha to avoid failing if the driver runs again in a single request
2019-12-05 12:06:53 -08:00
Matteo Piovanelli 21417a9768 Taxonomies: Refactoring Terms' FullWeight calculation including Upgrade path, fixes #8209 (#8214)
FullWeight is now correctly computed based on hierarchy, then Weight, then alphabetical order (in this order).
2019-08-08 13:42:15 +02:00
Matteo Piovanelli 4d04dcc5bb Provide source Url for OEmbedPart as MediaUrl (#8249)
Fixes #8242
2019-07-25 12:08:53 -07:00
Matteo Piovanelli bfc0c302f8 Fixes the bug by adding the correct binding source to the list (#8236) 2019-07-04 20:56:50 +02:00
Matteo Piovanelli 4eba79c66e Added a filter for projections over StringFields (#8213) 2019-05-30 12:08:54 -07:00
Matteo Piovanelli e19d835e5a DefaultContentManager performance upgrade (#8207) 2019-05-16 12:15:44 -07:00
Matteo Piovanelli 258a490536 fix NRE in DefaultHQLQuery (#8184)
In the InSubquery method Criterion was not being set. This caused NRE when processing a WHERE predicate that used that method.
2019-04-18 12:10:53 -07:00
Matteo Piovanelli d9f105a92e Added NOLOCK to the IndexingTaskRecord table (#8094) 2018-08-09 12:16:50 -07:00
Matteo Piovanelli 92ca4128e3 Fix List.cshtml with new permission (#8053) 2018-05-17 12:21:59 -07:00
Matteo Piovanelli 1f77745888 Concurrency fixes (#8054)
Fixes #7720
Fixes #8019
Fixes #7708
Fixes #8025
Fixes #8028
Fixes #8040
Fixes #8052
2018-05-17 12:17:44 -07:00
Matteo Piovanelli 91f0dac7dd Added Configuration to MembershipValidationService (#8029)
Fixes #8003
2018-04-19 12:10:00 -07:00
Matteo Piovanelli 6da6368bcc Removed LocalizationPart (#7911) 2018-04-05 12:24:34 -07:00
Matteo Piovanelli b0db0454a5 Fix/failed tests (#7993)
* Fixed 10 tests that failed because the constructor for a service had changed. 26 Failing tests to fix.

* Fixed 4 tests that failed because the constructor for a service had changed. 22 Failing tests to fix.

* Fixed 7 tests from Orchard.Specs that were failing because of the changes made to how the name property of the form components for fields were generated.

* Fixed 2 more tests from Orchard.Specs
2018-03-15 12:16:16 -07:00
Matteo Piovanelli 0754e7ba65 User data providers and cookie expiration setting (#7945)
* Added providers to compute and validate the userdata string for authentication cookies

* Added UserDataProvider based on the date when the password was changed last: this means that changing the password invalidates all extant authentication cookies

* Added a service that allows configuring the lifespan of auth cookies, rather than always using a constant. The default implementation returns the same constant.

* Added setting to control the life span of authentication cookies

* Added setting to control the behaviour on changing password: logout every client, or none.
Added code to prevent users that were authenticated with "old" cookies to be suddenly logged out when deploying this

* Removed ISecurityService implementation from Orchard.Users.
Changed FormsAuthenticationService and DefaultSecurityService so that property injection configured in sites.config still works the same as before, and takes priority over ISecurityService implementations.
Changed serialization of UserData dictionary to use Newtonsoft.Json.
Added check to upgrade the authentication cookie whenever an "old" one is received.

* On cookie upgrade we do not give a fresh new cookie, but rather we keep the same expiration
2018-02-05 09:29:26 -08:00
Matteo Piovanelli baac878337 Terms could not be saved (#7907)
Fixes #7676
2017-12-06 09:18:17 -08:00
Matteo Piovanelli 584ba97b27 Binding in ContentType editor (#7886)
Change the prefix so that binding does not care whether parts are in a different order in the type definition
2017-10-26 12:14:42 -07:00
Matteo Piovanelli f146b81f47 Rolls back previous change (#7882)
#7877 introduced more issues than it solved. I propose rolling it back, and test this deeper.
2017-10-13 12:31:06 -07:00
Matteo Piovanelli d6fa50aaee TaxonomyField was running Update when it should not (#7877) 2017-10-12 12:21:40 -07:00
Matteo Piovanelli 244ea89b27 Added join to order results of the query (#7860)
Fixes #7859
2017-09-21 12:09:42 -07:00
Matteo Piovanelli e407bb86aa Allow handling culture patterns more robustly (#7867)
Fixes #7866
2017-09-21 12:06:14 -07:00
Matteo Piovanelli a9261d879d Fix taxonomy localization issue with fields (#7808)
Fixes #7805
2017-08-10 12:13:49 -07:00
Matteo Piovanelli 4cb0b3b5c4 Localization improvements (#7596)
Updates to handling of MasterContentItem (as they are in 1.10.x)
Synchronization of CultureNeutral Fields and Parts (based on Cloning)
Support for multi-language Blogs (in its own feature in the Blogs module)
Support for multi-language Taxonomies (in its own feature in the Taxonomies module)
2017-04-03 10:33:14 -07:00
Matteo Piovanelli 86ec07007f Allows draft ContentItems in ContentPickerField (#7624)
Fixes #7623
2017-03-31 12:31:15 -07:00