Compare commits

...

606 Commits

Author SHA1 Message Date
Warren bdaa70592f Adds in missing $scope dependency for Dynamic Dashboard Controller 2018-04-04 08:28:41 +01:00
Shannon 047a05cfb3 bumps version 2018-04-03 11:38:13 +10:00
Shannon e77ebc0c1c Fixes all references to assetsService.load* that do not pass in a required scope object and changes assets.service to always use the $rootScope of an explicit scope is not passed 2018-04-03 11:27:53 +10:00
Shannon a27ea994b7 updates the loadMomentLocaleForCurrentUser to always return a promise 2018-04-03 10:59:55 +10:00
Shannon e019c94207 changes back to correct version 2018-04-03 10:42:57 +10:00
Shannon 5b7193aa64 Merge branch 'temp-U4-11164' of https://github.com/dawoe/Umbraco-CMS into dawoe-temp-U4-11164 2018-04-03 10:41:01 +10:00
Dave Woestenborghs 28a0e30315 U4-11164 fixed blank screen for about 30 seconds after logging in. Because of q.all we don't need to wait until promise is resolved, because all promises are resolved when this is hit 2018-03-30 11:20:41 +02:00
Shannon 89c376f77a adds ValueTuple reference to nuspec 2018-03-26 20:08:11 +11:00
Claus 7c264b4da0 adding using statement to preview file to prevent missing htmlhelper error. 2018-03-23 11:57:29 +01:00
Claus 716020602d adding using statement to preview file to prevent missing htmlhelper error. 2018-03-23 11:55:23 +01:00
Sebastiaan Janssen 8c0ec489c2 Bump version to 7.11 2018-03-23 09:54:11 +01:00
Sebastiaan Janssen 81d380a47e Merge branch 'dev-v7' into master-v7 2018-03-22 14:55:52 +01:00
Sebastiaan Janssen 19e5715a84 Whoops, that was not supposed to say beta 2018-03-22 14:55:02 +01:00
Sebastiaan Janssen 2e2dce170a Merge branch 'dev-v7.10' into master-v7 2018-03-22 11:28:48 +01:00
Sebastiaan Janssen 59f9a64e81 Merge branch 'dev-v7' into dev-v7.10
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
2018-03-22 11:27:26 +01:00
Sebastiaan Janssen 98b7467306 Merge branch 'dev-v7' into master-v7 2018-03-22 10:53:24 +01:00
Sebastiaan Janssen 4bb75d73dd Bump version to 7.9.3 2018-03-22 10:50:12 +01:00
Shannon Deminick dd8e43d80a Fixes U4-10472 Cannot upgrade to 7.7+ when using MySql (#2493)
* Fixes U4-10472 Cannot upgrade to 7.7+ when using MySql

* Fixes dropping the FK for the AddUserGroupTables migration
2018-03-22 10:35:41 +01:00
Claus c9c9e8352a Merge pull request #2532 from umbraco/temp-U4-11134
redirects preview to login when not authorized
2018-03-22 10:22:32 +01:00
Shannon c4e5ab54d2 redirects preview to login when not authorized 2018-03-22 19:55:55 +11:00
Shannon 53bfec8a04 Merge branch 'dev-v7' into dev-v7.10 2018-03-22 19:22:34 +11:00
Sebastiaan Janssen b4a0dadee9 Re-apply the nice C# syntax James provided 2018-03-21 19:53:20 +01:00
Lee Kelleher 014ac98d0b U4-11052 - Enabled IntegerValueConverter to handle Int64 source values (#2500)
* Enabled IntegerValueConverter to handle `Int64` source values
2018-03-21 19:08:24 +01:00
Robert 35a79a8598 Merge pull request #2525 from umbraco/temp-U4-11020
U4-11020 Deleting a member group that is part of a Public Access feat…
2018-03-21 13:47:02 +01:00
Robert 3c4f052a27 Moved some code around based on feedback 2018-03-21 13:45:44 +01:00
Robert 97d7e3db84 Forgot add the new namespace 2018-03-21 10:46:42 +01:00
Robert 0d2df4de81 Some cleanup 2018-03-21 10:22:08 +01:00
Shannon b361cfebb7 updates npm build dependencies 2018-03-21 13:55:01 +11:00
Shannon ebea5e8170 fixes boolean pre-value editor Html Id 2018-03-21 13:53:54 +11:00
Shannon 995f3f38a3 Fixes upgrade issue with copying the preview.old directory and updates the link to the the correct public one 2018-03-21 12:52:17 +11:00
Shannon 2ad79956d9 Re-apply Drop Down Flexible "Merge pull request #2502 from umbraco/temp-U4-11032"" 2018-03-21 12:37:26 +11:00
Shannon 96c6a17d03 Merge branch 'dev-v7' into dev-v7.10 2018-03-21 12:36:55 +11:00
Shannon e2e0dd0c73 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2018-03-21 12:34:15 +11:00
Shannon 1a590664e7 Revert "Merge pull request #2502 from umbraco/temp-U4-11032"
This reverts commit 2aa0dfb2c5, reversing
changes made to 2c6e7e46c2.
2018-03-21 12:32:27 +11:00
Shannon Deminick 64fd6ee7c5 Merge pull request #2477 from Shazwazza/U4-10992
U4-10992 (UDUF) TourController Object reference not set to an instance of an…
2018-03-21 12:24:50 +11:00
Shannon Deminick 2ed5b6c1ee Merge pull request #2436 from umbraco/temp-U4-10957_2
U4-10957 If RequiredSection is not defined in a tour - backoffice wil…
2018-03-21 12:24:10 +11:00
Shannon Deminick 41c4e024de Merge pull request #2505 from umbraco/temp-u4-10756
U4-10756 - id/guid cache
2018-03-21 11:42:04 +11:00
Shannon b46add81f0 Merge branch 'dev-v7.10' into temp-u4-10756 2018-03-21 11:39:28 +11:00
Shannon ff31cd9f72 Changes Set to Populate, changes Fetch to Query and makes GetById public 2018-03-21 11:31:30 +11:00
Shannon 084af43dab Merge remote-tracking branch 'origin/dev-v7' into dev-v7.10 2018-03-21 10:20:20 +11:00
Sebastiaan Janssen edf7038848 U4-11020 Deleting a member group that is part of a Public Access feature, from the system, does not also remove the corresponding rows from the umbracoAccessRule table. 2018-03-20 15:00:09 +01:00
Niels Hartvig bcac02861d Merge pull request #2524 from davidwandar/patch-2
Fixed typo in Readme.
2018-03-20 11:18:57 +01:00
Sebastiaan Janssen 79ecaecc9e Merge pull request #2503 from umbraco/temp-U4-11070
Adds support for *not* closing an overlay on enter
2018-03-20 11:14:57 +01:00
Sebastiaan Janssen f604117c6d Merge pull request #2504 from umbraco/temp-U4-11071
U4-11071 Prevalue editor for multiple values TLC
2018-03-20 11:14:42 +01:00
David Wandar dcf7f35078 Fixed typo.
Xloud -> Cloud 

Xloud sounds awsome though :)
2018-03-20 10:00:53 +01:00
Robert 2aa0dfb2c5 Merge pull request #2502 from umbraco/temp-U4-11032
U4-11032 Consolidate the number of dropdown property editors into one
2018-03-19 14:37:47 +01:00
Robert e4b77416a6 Fixed typo 2018-03-19 14:28:24 +01:00
Robert 3aed889e2a Merge branch 'dev-v7' into temp-U4-11032 2018-03-19 14:14:51 +01:00
Robert 2c6e7e46c2 Merge pull request #2517 from dawoe/patch-1
Fixed documentation of umb-overlay directive
2018-03-19 08:58:23 +01:00
Mikulas Tomanka 0a71a09d21 Merge pull request #2518 from dawoe/patch-2
Remove console.log from slider property editor
2018-03-19 08:32:40 +01:00
Dave Woestenborghs 0c868fb72d Remove console.log from slider property editor
removed console.log statement from slider property editor controller
2018-03-16 18:43:54 +01:00
Dave Woestenborghs a96cbce9b1 Fixed documentation of umb-overlay directive
- Removed lorem ipsum text 
- Fixed casing of subtitle
2018-03-16 18:12:46 +01:00
Sebastiaan Janssen e3e425695f U4-8724 tinyMceConfig.config customConfig bool not correct deserialized 2018-03-16 16:34:58 +01:00
Sebastiaan Janssen b539c6ec27 Merge pull request #1445 from KevinJump/dev-v7-ConnectionStringConfigSource
U4-8890 - Honour ConfigSource when setting ConnectionString
2018-03-16 15:45:21 +01:00
Shannon 69f7623fb7 Doh! we had test code checked in .. oops! 2018-03-16 14:40:26 +11:00
Shannon 82820284f3 Merge remote-tracking branch 'origin/dev-v7' into dev-v7.10
# Conflicts:
#	src/Umbraco.Web/Features/DisabledFeatures.cs
#	src/Umbraco.Web/Features/EnabledFeatures.cs
2018-03-16 14:30:55 +11:00
Sebastiaan Janssen 5f3090c81e grunt was discontinued in 7.7 and shouldn't exist here any more to avoid confusion 2018-03-15 10:40:40 +01:00
Sebastiaan Janssen f66e239584 PhantomJs doesn't understand fancy ES6 notation 2018-03-15 10:32:25 +01:00
Sebastiaan Janssen a465ed415d Rename to javascriptLibraryService 2018-03-15 10:08:00 +01:00
Sebastiaan Janssen 5161fd0cef Remove trailing space from filename and clean up code a little 2018-03-15 10:07:04 +01:00
Sebastiaan Janssen eac9785c45 Apply PR #2507 2018-03-15 10:02:20 +01:00
Sebastiaan Janssen 054a8b48fa Revert PR #2507 - needs to go in 7.10 2018-03-15 09:59:04 +01:00
Stephan af0a03a3e0 U4-10756 - cleanup 2018-03-15 09:51:12 +01:00
Stephan fb5e6c22ce Merge remote-tracking branch 'origin/dev-v7' into temp-u4-10756 2018-03-15 09:46:52 +01:00
Stephan 6bc68005f4 U4-10756 - id/guid cache, new version 2018-03-15 09:46:39 +01:00
Sebastiaan Janssen dfbc3c477a Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into pr/2507 2018-03-15 09:38:44 +01:00
Niels Hartvig 57426ae895 Feedback from review. Makes the moment service more generic and changes promises chaining 2018-03-14 11:10:01 +01:00
Shannon 05c38db54c updates naming of the extending preview property and fixes the angular rendering on ng-init 2018-03-14 15:24:30 +11:00
Shannon 00fdace570 fixes preview view web.config and makes sure we pass the preview model to the view 2018-03-14 14:38:21 +11:00
Shannon 4e531976e9 missing file 2018-03-14 14:24:11 +11:00
Shannon 0feb1b6cc0 fixes build since we don't have preview files 2018-03-14 14:02:35 +11:00
Shannon 830f460b7e bumps version 2018-03-14 13:58:48 +11:00
Shannon 3e2fa64820 Changes the Preview Index.cshtml to use a real model instead of viewdata, adds the correct razor web.config for these preview views, changes the enabled feature to be able to inject a razor view instead of strings 2018-03-14 13:56:49 +11:00
Shannon Deminick 7db4f841e3 Merge pull request #2485 from umbraco/temp-UAASSCRUM-1405
UAASSCRUM-1405 Clean up preview for Headless
2018-03-14 13:39:28 +11:00
Shannon 509d27f93b Merge branch 'dev-v7.10' into temp-UAASSCRUM-1405
# Conflicts:
#	src/Umbraco.Web/Features/EnabledFeatures.cs
2018-03-14 13:38:25 +11:00
Shannon f42b122e73 adding missing files 2018-03-14 13:35:51 +11:00
Shannon b4aad19573 Revert "Merge pull request #2508 from umbraco/temp-U4-11076"
This reverts commit 4161d244c1, reversing
changes made to eea87e411f.
2018-03-14 13:23:33 +11:00
Shannon 1b6c070752 Merge remote-tracking branch 'origin/dev-v7' into temp-UAASSCRUM-1405 2018-03-14 12:56:07 +11:00
Shannon bedce100d2 Fixes merge and the preview views path 2018-03-14 12:55:34 +11:00
Shannon 0e08a56ada Merge branch 'dev-v7' into temp-UAASSCRUM-1405
# Conflicts:
#	src/Umbraco.Web/Features/DisabledFeatures.cs
#	src/Umbraco.Web/Features/EnabledFeatures.cs
2018-03-14 12:25:37 +11:00
Sebastiaan Janssen 03012cf54d Merge pull request #1435 from neilgaietto/U4-8822
U4-8822- Fixes Unpublish error with empty RTE
2018-03-14 00:10:49 +01:00
Sebastiaan Janssen 7ff339e18a Merge pull request #1306 from shiroganee/Fix-8533
removes a overflow: hidden which decrease update-tree-layer performance
2018-03-13 23:34:59 +01:00
Sebastiaan Janssen 0048b9c4c8 Merge pull request #2516 from bjarnef/dev-v7-U4-11093
U4-11093 - Update Danish translations
2018-03-13 23:03:48 +01:00
Bjarne Fyrstenborg 47f5e6bf17 Remove duplicate key in user area 2018-03-13 22:23:38 +01:00
Bjarne Fyrstenborg a8908c90bc Add better translations to Danish 2018-03-13 22:21:44 +01:00
Sebastiaan Janssen 9e5e8b539a Merge branch 'bjarnef-dev-v7-U4-6616' into dev-v7 2018-03-13 22:19:15 +01:00
Sebastiaan Janssen 45d292e196 Merge branch 'dev-v7-U4-6616' of https://github.com/bjarnef/Umbraco-CMS into bjarnef-dev-v7-U4-6616
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/less/variables.less
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.html
2018-03-13 22:18:28 +01:00
Niels Hartvig 6bafd3a254 Removes ugly non-existing comment :) 2018-03-13 16:39:01 +01:00
Niels Hartvig 564074a2bd Adds check for existing moment locales before attempting to download them 2018-03-13 16:19:51 +01:00
Shannon Deminick 4161d244c1 Merge pull request #2508 from umbraco/temp-U4-11076
Fix - U4-11076 Remove all references to templates from the backoffice
2018-03-12 20:32:29 -07:00
Shannon 171e0d87db Updates some of the variable names, removes the EnabledFeatures since we don't really need that 2018-03-13 14:31:30 +11:00
Shannon Deminick eea87e411f Merge pull request #2514 from umbraco/temp-U4-11065
Fix - U4-11065 Sensitive data is shown in listviews
2018-03-12 17:25:49 -07:00
Shannon 89edfe5782 refactors a bit - merges the 2 new resolvers into one and renames with code comments. Updates the ContentPropertyBasic to include a new IsSensitive property for mapping, updates the UI to check for this, updats the mapping to map with UmbracoContext, 2018-03-13 11:23:44 +11:00
Shannon Deminick cbd5071eed Merge pull request #2510 from umbraco/temp-UAASSCRUM-1441
fixes UAASSCRUM-1441: fix token identity breaking RestAPI and others
2018-03-12 06:27:50 -07:00
Robert 3dbc2944aa Translations 2018-03-12 12:06:57 +01:00
Robert 709dab6afd Hooked sensitive data checks on member list view 2018-03-12 12:06:23 +01:00
Robert 8749b030cf Added custom resolver to deal with sensitive values on member list view, some cleanup 2018-03-12 12:04:54 +01:00
Sebastiaan Janssen 62fd15d54b Update CONTRIBUTING.md 2018-03-10 12:24:13 +01:00
Sebastiaan Janssen 66e71db85c Update CONTRIBUTING.md 2018-03-10 12:20:56 +01:00
Sebastiaan Janssen 469527da0a Update CONTRIBUTING.md 2018-03-10 12:20:24 +01:00
Robert 304e574bbc Merge pull request #2509 from umbraco/temp-U4-11058
fixes: U4-11058 Add guidance to the multinode treepicker UI for min. …
2018-03-08 14:01:14 +01:00
Robert 723644ace5 Merge pull request #2475 from barryokane/U4-7484-markdown
(uDuf) Prevent "unsaved" warning when no changes on MarkDown Editor
2018-03-08 13:23:46 +01:00
Stephan 2b936a6d31 UAASSCRUM-1441 - fix token identity 2018-03-08 13:18:53 +01:00
Sebastiaan Jansssen 3121635e07 Clarify upgrade readme 2018-03-08 13:15:04 +01:00
Mads Rasmussen f2a3a269ba fixes: U4-11058 Add guidance to the multinode treepicker UI for min. and max. allowed items 2018-03-08 11:22:31 +01:00
Robert 557fc1bcdd Removed hardcoded value for disabletemplate 2018-03-07 21:43:19 +01:00
Kyle Weems 617bdb2bd1 Merge branch 'dev-v7' of git://github.com/umbraco/Umbraco-CMS into dev-v7 2018-03-07 10:21:11 -08:00
Kyle Weems 2c91f9bf14 Reduce the first load impact of Moment by moving from using moment-with-locales.js to moment.min.js and loading in the specific locale files when the app authorizes. http://issues.umbraco.org/issue/U4-11044 2018-03-07 10:19:11 -08:00
Robert 1a5fe63638 Switching to ng-if to hide the template dropdown in the info tab 2018-03-07 14:51:24 +01:00
Robert dfb0efbc98 Removed option to assign templates from the info tab 2018-03-07 14:43:30 +01:00
Robert d399ad6e51 Removed option to assign templates from the document type 2018-03-07 14:13:53 +01:00
Robert eb06e62937 Removing the option to create document type with a template 2018-03-07 14:10:25 +01:00
Robert 728bf8b52d Adding disableFeatures server variable and new DisableTemplate property in DisabledFeatures.cs 2018-03-07 14:03:35 +01:00
Niels Hartvig ca74100e12 TLC for multiple pre values editor 2018-03-06 16:11:44 +01:00
Stephan cd63806895 U4-10756 - id/guid cache 2018-03-06 16:11:27 +01:00
Niels Hartvig 3061dc4e6f Adds support for *not* closing an overlay on enter 2018-03-06 15:37:52 +01:00
Niels Hartvig 5166dc08d6 Missing null check 2018-03-06 12:44:39 +01:00
Niels Hartvig 05a9c44e9e Needs to check if single value is an array and then pick first value 2018-03-06 11:51:32 +01:00
Niels Hartvig 8e0565e030 Fixes spacing in description :) 2018-03-06 11:16:51 +01:00
Niels Hartvig ceb3ae361a Adds flexible dropdown editor to replace the four current ones 2018-03-06 11:07:08 +01:00
Niels Hartvig 4cee7b831a Merge branch 'dev-v7' into temp-U4-11032 2018-03-06 10:08:04 +01:00
Robert f146262031 Merge pull request #2476 from barryokane/U4-9996
(uDuf) Prevent unsaved dialogue appearing when no changes made on FileUpload
2018-03-06 09:17:17 +01:00
Robert ddae0d01e3 Merge pull request #2460 from mwanchap/U4-10821
Fix for U4-10821, render alt text attribute from grid image editor (uduf hackathon)
2018-03-05 14:35:23 +01:00
Robert b9ee85dabc String ->string 2018-03-05 14:34:36 +01:00
Sebastiaan Janssen 29fa6061a9 Merge pull request #2496 from soreng/temp-U4-9992
U4-9992: Added nuget config to restore command
2018-03-02 11:56:39 +01:00
Søren Gregersen 8ee61312b6 Added nuget config to restore command 2018-03-02 11:47:57 +01:00
Sebastiaan Janssen cfd4b8c7bf Merge pull request #2495 from soreng/temp-U4-9992
U4-9992: Added usage of nuget config in environment setup
2018-03-02 11:45:42 +01:00
Sebastiaan Janssen 7ce3b6046c Merge pull request #2494 from Mivaweb/patch-1
Update NL.xml rectify and permissionDenied
2018-03-02 11:43:20 +01:00
Søren Gregersen 43d98c9682 Added usage of nuget config in environment setup 2018-03-02 11:42:41 +01:00
Michaël Vanbrabandt 62e4825a5e Update NL.xml rectify and permissionDenied 2018-03-02 10:47:15 +01:00
Sebastiaan Janssen 81d35c6079 Merge pull request #2491 from mortenbock/temp-U4-5614
U4-5614 - Handle invalid urls in extension check
2018-03-01 20:49:09 +01:00
Morten Bock 7e15077f96 Handle invalid urls in extension check 2018-03-01 20:18:18 +01:00
Sebastiaan Janssen 6543e3c058 Merge pull request #2489 from mortenbock/temp-U4-288
U4-288 - Allow relative urls in sheduled tasks
2018-03-01 19:47:31 +01:00
Morten Bock 7c73c379cf Use the UmbracoApplicationUrl as the base for sheduled task urls, in case they are relative. 2018-03-01 19:11:37 +01:00
Sebastiaan Janssen 4bc9d96bce Merge pull request #2488 from hemraker/temp-U4-10993
Fixed open doc type button
2018-03-01 18:09:48 +01:00
Rune Hem Strand 45fd54d046 Fixed open doc type button 2018-03-01 18:06:46 +01:00
Sebastiaan Jansssen 4f062306a6 U4-10891 Color Picker Cannot read property 'hasOwnProperty' of null
(cherry picked from commit 4a8730b925)
2018-03-01 16:47:28 +01:00
Sebastiaan Jansssen 4a8730b925 U4-10891 Color Picker Cannot read property 'hasOwnProperty' of null 2018-03-01 16:45:38 +01:00
Sebastiaan Janssen 0beda4b790 Update CONTRIBUTING.md 2018-03-01 16:43:02 +01:00
Sebastiaan Jansssen d94e7cd906 Merge branch 'dev-v7' into master-v7 2018-03-01 15:09:45 +01:00
Sebastiaan Jansssen 213ea6470f Bump version to 7.9.2 2018-03-01 15:09:04 +01:00
Sebastiaan Jansssen dde8ba5617 Merge branch 'dev-v7' into master-v7 2018-03-01 14:57:11 +01:00
Sebastiaan Janssen e783308cf0 Merge pull request #2487 from umbraco/temp-hartvig-ocd
Aligns installer/login background photo
2018-03-01 14:54:56 +01:00
Sebastiaan Jansssen 01f49bb07e Revert "Merge pull request #2426 from JeffreyPerplex/U4-9991-KeyboardShortcuts"
This reverts commit 325cefa349, reversing
changes made to d4cf4cd700.
2018-03-01 14:52:17 +01:00
Niels Hartvig d06b7edd84 Change default value label to "true" 2018-03-01 14:46:36 +01:00
Niels Hartvig 466de5ee0b Adds a label to the boolean pre value editor 2018-03-01 14:41:44 +01:00
Niels Hartvig 976e1e8a35 Mark existing dropdown property editors as obsolete 2018-03-01 14:25:07 +01:00
Niels Hartvig a3d08c19c5 Aligns photo 2018-03-01 14:05:34 +01:00
Claus 23638702c8 adding missing views... 2018-03-01 12:57:43 +01:00
Mads Rasmussen 761804baf8 Merge pull request #2486 from umbraco/temp-U4-10876
Fixes "Content Picker 2 can search outside of it's selected start node"
2018-03-01 10:46:50 +01:00
Sebastiaan Jansssen a633e45b44 Merge branch 'dev-v7' into master-v7 2018-03-01 10:27:57 +01:00
Shannon 78489237d9 U4-11019- default isApproved to true 2018-03-01 18:21:14 +11:00
Shannon 8768947519 U4-11019 Member 'Locked out' marked as sensitive throws an error - fixes special values 2018-03-01 18:05:44 +11:00
Sebastiaan Jansssen 63b58dcd09 Merge remote-tracking branch 'origin/dev-v7' into master-v7 2018-03-01 07:51:07 +01:00
Shannon ccfb643055 U4-11019 Member 'Locked out' marked as sensitive throws an error 2018-03-01 17:15:47 +11:00
Robert 88e6e44f4e Fixes Content Picker 2 can search outside of it's selected start node 2018-02-28 15:54:13 +01:00
Claus 52684b6189 allowing to extend html used in preview view. 2018-02-28 13:41:49 +01:00
Sebastiaan Jansssen 76a0c6c39f Merge branch 'dev-v7' into master-v7 2018-02-28 13:28:39 +01:00
Sebastiaan Jansssen 86bc50c61d Bump version to 7.9.1 2018-02-28 13:27:53 +01:00
Claus 13c675d718 updating route to use the old url.
removing leftover index.html.
adding migration for renaming preview folder on disk.
2018-02-28 12:04:39 +01:00
Sebastiaan Janssen 924eab29af Merge pull request #2484 from umbraco/temp-U4-11021
U4-11021 No login form when trying to authorise 7.9 upgrade
2018-02-28 11:52:28 +01:00
Claus 0ee3ebd180 adding the preview controller to project.
removing old static html files from src (they're now cshtml files in Views).
copy task should not copy static canvasdesigner files anymore.
2018-02-28 08:58:16 +01:00
Matt Wanchap da0a1c808a Added fallback to caption if no altText, as suggested 2018-02-28 11:06:59 +10:00
Shannon 9504eddf7e Adds unit test to test mapping to a ContentItemDisplay when there are no property groups 2018-02-28 11:28:51 +11:00
Shannon e502db5f6f U4-11021 No login form when trying to authorise 7.9 upgrade 2018-02-28 09:33:47 +11:00
Sebastiaan Jansssen 22820ae5db Re-organize CONTRIBUTING.md 2018-02-27 22:06:47 +01:00
Sebastiaan Jansssen b65dc25193 More CONTRIBUTING.md 2018-02-27 22:03:33 +01:00
Sebastiaan Jansssen 99b5b0a396 CONTRIBUTING.md 🎉 2018-02-27 22:01:37 +01:00
Sebastiaan Janssen 7c33b5b69b Create PULL_REQUEST_TEMPLATE.md 2018-02-27 17:00:24 +01:00
Sebastiaan Janssen 2ec66bf6d7 Create CODE_OF_CONDUCT.md 2018-02-27 16:56:53 +01:00
Sebastiaan Janssen 9421a92610 Merge pull request #2482 from umbraco/temp-u4-11018
Fix tabs issue
2018-02-27 15:48:48 +01:00
Claus 9c8c9d8a39 UAASSCRUM-1405 Clean up preview for Headless 2018-02-27 15:47:47 +01:00
Sebastiaan Jansssen 37d2203de1 Merge branch 'dev-v7' into master-v7 2018-02-27 15:45:16 +01:00
Stephan cec71f5651 Fix tabs issue 2018-02-27 14:52:12 +01:00
Sebastiaan Jansssen 7ee510ed38 Fix formatting 2018-02-26 16:28:12 +01:00
Sebastiaan Jansssen 136e9e66d2 Merge remote-tracking branch 'origin/dev-v7.8' into dev-v7.9 2018-02-26 16:26:54 +01:00
Shannon 55a2eb5b6c Merge branch 'dev-v7.9' of https://github.com/umbraco/Umbraco-CMS into dev-v7.9 2018-02-27 01:39:05 +11:00
Shannon 0c2c12fdd9 ensures that the template cache is cleared on startup if it hasn't been tracked in local storage 2018-02-27 01:38:53 +11:00
Sebastiaan Jansssen ec427afe14 Spelling 2018-02-26 15:19:45 +01:00
Shannon 155a304ce3 Allows GUID to be passed to ContentTreeControllerBase 2018-02-27 01:17:21 +11:00
Shannon 161a19a82b Adds cache busting for TinyMCE 2018-02-27 01:12:17 +11:00
Shannon e40ed5e858 not full caps for col name 2018-02-27 00:47:03 +11:00
Shannon 1ffbd734c8 Changes column and model for auditing to EventDateUtc 2018-02-27 00:46:09 +11:00
Shannon fd5bc49c87 Audits the member being exported, moves the export method to the service (again) but returns a proper model this time and raises an event, adds error checking to the export http request 2018-02-27 00:40:43 +11:00
Shannon Deminick 2301a00cd1 Merge pull request #2480 from umbraco/temp-U4-10794-2
Makes methods on IConsentService more explicit to allow mo
2018-02-26 22:43:26 +10:00
Shannon Deminick 313f7967cb Merge pull request #2479 from umbraco/temp-U4-10900-2
Fixes for U4-10900 Individual member data export functionality
2018-02-26 22:41:03 +10:00
Shannon 6adaa1f70c adds a notification when the member gets exported 2018-02-26 23:37:20 +11:00
Shannon 8960b0828e simplifies the exporter even more, no more reflection, no more streams 2018-02-26 23:23:25 +11:00
Shannon 397ab0e979 Merge branch 'dev-v7.9' into temp-U4-10900-2
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/member/export.html
2018-02-26 23:13:58 +11:00
Shannon 15c803b975 Changes how the json response is created 2018-02-26 23:12:33 +11:00
Shannon d62b36ae5b Merge branch 'temp-U4-10900-2' of https://github.com/umbraco/Umbraco-CMS into temp-U4-10900-2 2018-02-26 23:09:48 +11:00
Shannon 34506664df Moves the member export to happen on action click, adds a helper method to download a file via XHR 2018-02-26 23:09:29 +11:00
Sebastiaan Jansssen 2557b9a7fb Cleanup and makes a nice JSON object out of members + properties 2018-02-26 13:07:32 +01:00
Sebastiaan Jansssen ac66dc9892 Fix member groups and don't add a line at the top 2018-02-26 12:39:02 +01:00
Robert 11e3d8c761 Merge pull request #2474 from umbraco/temp-u4-10688
U4-10688 Obsolete property editors showing
2018-02-26 12:37:53 +01:00
Shannon Deminick 22b9941822 rename to match file naming conventions 2018-02-26 22:28:41 +11:00
Sebastiaan Jansssen b5b17a466b Cleanup and moving data to json format 2018-02-26 12:03:46 +01:00
Shannon 2c5b37a842 CHanges back to IConsentService but keeps method name changes 2018-02-26 21:56:00 +11:00
Niels Hartvig ae864a3b19 Mark old package installed Nested Content obsolete so it doesn't come up in the list 2018-02-26 11:32:58 +01:00
Mads Rasmussen 449e464a14 Merge branch 'mathiasrando-U4-10883' into dev-v7.9 2018-02-26 09:47:13 +01:00
Mads Rasmussen 5f72eb74db use attr to control button size + remove disabled state 2018-02-26 09:26:14 +01:00
Niels Hartvig fa85ce39c7 Changes filter of deprecated property editors to be on controller level instead of resolver 2018-02-26 09:22:54 +01:00
Shannon bdea519770 Changes from IConsentService to ILawfulDataProcessService to allow more flexibility with GDPR data processing in the future 2018-02-26 17:07:06 +11:00
Shannon 78657f34d6 I have updated the Consent.HistoryInternal to internal 2018-02-26 16:51:34 +11:00
Shannon e8fd7e2373 Fixes for U4-10900 Individual member data export functionality 2018-02-26 15:02:47 +11:00
Barry 08965982fd Prevent unsaved dialogue appearing when no changes made on FileUpload property editor
Addresses this issue in media section (U4-9996) and content (U4-7484)
2018-02-25 05:50:10 +00:00
Barry 732d3ef326 Prevent "unsaved" warning when no changes on MarkDown Editor
http://issues.umbraco.org/issue/U4-7484#
2018-02-25 03:18:00 +00:00
Niels Hartvig 3da9fddd64 U4-10688 Obsolete property editors showing
Please be aware that if you do have obsolete property editors in use and set the setting "showDeprecatedPropertyEditors" to false you'll get an exception.
2018-02-24 21:31:10 +10:00
Sebastiaan Jansssen e1821697d4 Merge remote-tracking branch 'origin/dev-v7.8' into dev-v7.9
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
2018-02-24 11:53:28 +01:00
Sebastiaan Jansssen a7756afae6 Bump version to 7.8.2 2018-02-24 11:50:39 +01:00
Sebastiaan Jansssen fcd3bb2eee Merge remote-tracking branch 'origin/dev-v7' into dev-v7.8
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.html
2018-02-24 11:48:20 +01:00
Sebastiaan Jansssen 858156bab2 Merge branch 'dev-v7' into master-v7 2018-02-23 22:23:43 +01:00
mikkelhm cf5dac0ddd fix xml in spanish lang file
(cherry picked from commit 2281cd8291)
2018-02-23 22:23:07 +01:00
Sebastiaan Janssen 1cdf5c042e Merge pull request #2473 from umbraco/temp-fix-spanish-language-xml
fix xml in spanish lang file
2018-02-23 22:19:10 +01:00
mikkelhm 2281cd8291 fix xml in spanish lang file 2018-02-23 22:02:47 +01:00
Robert fa68f7fafe Merge pull request #2445 from bjarnef/dev-v7-U4-10966
U4-10966 -  Single/Multiple Media Picker is messed up when dragging images
2018-02-23 15:15:36 +01:00
Mads Rasmussen 898e39dac5 Merge branch 'U4-10883' of git://github.com/mathiasrando/Umbraco-CMS into mathiasrando-U4-10883 2018-02-23 14:49:50 +01:00
Sebastiaan Jansssen 2ae96f3810 Merge branch 'dev-v7' into master-v7 2018-02-23 14:23:49 +01:00
Sebastiaan Jansssen f6045a49b5 Bump version to 7.7.13 2018-02-23 14:22:53 +01:00
Sebastiaan Jansssen 849cd4d315 Merge remote-tracking branch 'origin/dev-v7.8' into dev-v7.9 2018-02-23 13:49:57 +01:00
Sebastiaan Jansssen 10141bf4f6 Merge remote-tracking branch 'origin/dev-v7' into dev-v7.8
# Conflicts:
#	src/Umbraco.Web/Mvc/RenderRouteHandler.cs
2018-02-23 13:49:20 +01:00
Sebastiaan Janssen 11fcc8cd65 Merge pull request #2469 from umbraco/temp-U4-10900
Export member data functionality
2018-02-23 13:44:01 +01:00
Sebastiaan Jansssen 95aaf40281 Some more code cleanup and making sure we pass in the current user so that we can't avoid the sensitivedata check easily 2018-02-23 13:38:21 +01:00
Robert e25a39ec5d Merge pull request #2472 from umbraco/temp-U4-10964
Temp u4 10964
2018-02-23 13:33:47 +01:00
Sebastiaan Jansssen c165a34ed7 U4-10964 Adding a new property to a MemberType if you are not in Sensitive Data group throws a 404 when saving 2018-02-23 13:17:24 +01:00
Sebastiaan Janssen dc616bb6bf Merge pull request #2471 from alanmac/U4-11007
change newsletter subscribe to default for installation process - GDPR Compliance
2018-02-23 12:48:26 +01:00
Robert cd6c7e51fd Merge branch 'temp-U4-10900' of https://github.com/umbraco/Umbraco-CMS into temp-U4-10900 2018-02-23 12:24:37 +01:00
Alan Mac Kenna 2caad3f2d0 change newsletter subscribe to default for installation process 2018-02-23 11:24:15 +00:00
Robert 4850b01097 Added checks in place to stop users that has no access to sensitive data to export member data, removed some unused usings 2018-02-23 12:23:23 +01:00
Sebastiaan Jansssen 92c0cfb9df Additional action needs to be counted in the test 2018-02-23 10:58:33 +01:00
Sebastiaan Jansssen 8c5ee547b1 Does v3 MyGet API work? 2018-02-23 10:32:49 +01:00
Sebastiaan Jansssen b9c9a232cd Style updates, and removes unused usings 2018-02-23 10:26:11 +01:00
Sebastiaan Jansssen b565513052 Merge branch 'dev-v7.9' into temp-U4-10900 2018-02-23 09:46:06 +01:00
Robert cff24e6ccf Added translation keys for en.xml and deleted duplicate anchorInsert key in en_us.xml 2018-02-23 09:44:32 +01:00
Robert 8ef3ecd714 Forgot to commit the translation keys :| 2018-02-23 09:11:42 +01:00
Shannon 7019c9433b U4-10991 TourController Object reference not set to an instance of an object - when loading an invalid tour 2018-02-23 16:40:29 +10:00
Sebastiaan Janssen 1f66ebff1f Merge pull request #2470 from MMasey/dev-v7
U4-11005 Examine Search tools form does not submit when pressing Enter key
2018-02-22 18:49:17 +01:00
Sebastiaan Janssen 47f8b483a9 Merge pull request #2467 from christophnz/U4-5366
Uduf-Hackathon U4-5366
2018-02-22 18:46:27 +01:00
Sebastiaan Janssen 1c56cd48ae Merge pull request #2468 from emmanueltissera/U4-11002
Fixed email address in invite email [UDUF 2018 Hackathon]
2018-02-22 18:29:48 +01:00
Sebastiaan Janssen 6e9a9d6444 Merge pull request #2464 from lukaaaaaaaay/dev-v7.8
Hackathon: U4-10941 Name should be before Label when adding grid row configurations
2018-02-22 18:17:18 +01:00
Migaroez c4850199f7 U4-10999 Fixed wrong description on mediaresource.search
(cherry picked from commit af476e1536)
2018-02-22 17:36:39 +01:00
Sebastiaan Janssen 679333b9c9 Merge pull request #2456 from Migaroez/U4-10999
U4-10999 Fixed wrong description on mediaresource.search
2018-02-22 17:33:37 +01:00
Sebastiaan Janssen 02c609747d Merge pull request #2455 from GertyEngrie/dev-v7
Typo fix for nullreference in RenderRouteHandler
2018-02-22 17:32:25 +01:00
Sebastiaan Janssen 413e70db7d Merge pull request #2450 from richarth/patch-1
Grammar improvement
2018-02-22 17:31:29 +01:00
Sebastiaan Janssen c2cbac7ef9 Merge pull request #2448 from madsoulswe/temp-U4-10969
U4-10969 - Removed legacy file MediaUploader.ashx
2018-02-22 17:30:14 +01:00
Mike Masey a4a079cd1b Merge remote-tracking branch 'upstream/dev-v7' into dev-v7 2018-02-22 16:24:15 +00:00
Mike Masey 22fc9c617c Upate search button in examin search tools to use type="submit" 2018-02-22 16:18:59 +00:00
Sebastiaan Jansssen 0bcdfc8820 Merge branch 'skartknet-spanish_translations' into dev-v7 2018-02-22 17:11:38 +01:00
Sebastiaan Jansssen b868c06e79 Merge branch 'spanish_translations' of https://github.com/skartknet/Umbraco-CMS into skartknet-spanish_translations
# Conflicts:
#	src/Umbraco.Web.UI/umbraco/config/lang/es.xml
2018-02-22 17:11:09 +01:00
Robert f0dd32ea19 Removed export placeholder button and added "Action" button instead. 2018-02-22 16:52:16 +01:00
Robert 97607bc83b Added front and back end logic to export member data 2018-02-22 15:32:33 +01:00
ChristophNZ 5b41262f41 rewrote if/else to remove code duplication 2018-02-22 16:35:18 +10:00
Emmanuel Tissera e8e1cd8323 Fixed email address in invite email
http://issues.umbraco.org/issue/U4-11002 - Corrected issue where email address was not linked correctly in the invite template
2018-02-22 16:30:41 +10:00
ChristophNZ 1e17d6a527 continue loop after logging warning when null 2018-02-22 16:19:21 +10:00
ChristophNZ 0d05d0bf34 Import Document Type: use ContentTypeService to search for allowed child nodes if they are not part of the imported type(s) 2018-02-22 15:53:11 +10:00
Shannon 94184238a2 removes uneeded file 2018-02-22 13:19:42 +10:00
Shannon Deminick f21d1f879e Merge pull request #2459 from dinc5150/U4-10702
U4-10702 - Update Umb-modal icon to be consistent with other icons
2018-02-22 14:16:25 +11:00
Luke Phelan 9c1b2499d5 swapped the name and label fields in grid row editor. 2018-02-22 14:14:35 +11:00
Shannon Deminick 60a315f964 Merge pull request #2458 from cpevans/U4-10116
Check if user is admin to show propertyAlias regardless of debug status
2018-02-22 14:07:13 +11:00
Matt Wanchap b37197f66a Fix for U4-10821, render alt text attribute from grid image editor, or empty string if null (for screen readers) 2018-02-22 11:46:23 +10:00
Chris Evans 1870d5444d check for user admin group membership to show propertyAlias regardless of debug status
use the getCurrentUser() method of the userService to query the userGroups property of the current user
2018-02-22 13:54:50 +13:00
David Sheiles a927d5fb84 U4-10702 - Update Umb-modal icons to be consistant 2018-02-22 11:41:57 +11:00
Sebastiaan Jansssen e433daf5ff Bump version to 7.9.0 2018-02-21 16:06:59 +01:00
Migaroez af476e1536 U4-10999 Fixed wrong description on mediaresource.search 2018-02-21 11:02:56 +01:00
Gerty Engrie fcfb9afc22 typo fix 2018-02-20 14:24:51 +01:00
Claus 05818f6262 Merge branch 'temp-U4-10915' into dev-v7 2018-02-20 13:39:03 +01:00
Mads Rasmussen accf8ba5f2 Merge pull request #2444 from bjarnef/dev-v7-U4-10965
U4-10965 - Add translations of "Save and schedule"
2018-02-20 09:26:37 +01:00
Shannon 1788682af9 U4-10915 Umbraco automapper configuration is not valid 2018-02-20 19:16:53 +11:00
Sebastiaan Jansssen a41833c137 Merge remote-tracking branch 'origin/dev-v7.8' into dev-v7.9 2018-02-19 17:26:14 +01:00
Sebastiaan Jansssen 7abc6d3d4f Merge remote-tracking branch 'origin/dev-v7' into dev-v7.8 2018-02-19 17:20:12 +01:00
Sebastiaan Jansssen a5f689385a Merge branch 'dev-v7' into master-v7 2018-02-19 17:13:35 +01:00
Sebastiaan Jansssen a551881ce2 TypedMember(object id) didn't know how to deal with UDI values coming in, breaking MNTP pickers 2018-02-19 17:13:03 +01:00
Sebastiaan Jansssen 4a5a8497b4 Merge remote-tracking branch 'origin/dev-v7.8' into dev-v7.9 2018-02-19 15:38:28 +01:00
Sebastiaan Jansssen 567c0977d0 Merge remote-tracking branch 'origin/dev-v7' into dev-v7.8
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
2018-02-19 15:37:50 +01:00
Sebastiaan Jansssen 9ec4247350 Sync en and en_us - normalize whitespace 2018-02-19 15:24:50 +01:00
Sebastiaan Jansssen 1607e51270 Merge branch 'dev-v7' into master-v7 2018-02-19 14:21:16 +01:00
Sebastiaan Jansssen 2f31175db5 Bump version to 7.7.12 2018-02-19 14:20:47 +01:00
Sebastiaan Jansssen 044b43f6e1 Merge branch 'dev-v7' into master-v7 2018-02-19 14:10:09 +01:00
Richard Thompson c2722d8120 Grammar improvement
Improved the grammar of an error message
2018-02-16 15:19:16 +00:00
Mikulas Tomanka 325cefa349 Merge pull request #2426 from JeffreyPerplex/U4-9991-KeyboardShortcuts
http://issues.umbraco.org/issue/U4-9991 - Adding extra shortcuts
2018-02-16 10:36:24 +01:00
Mikulas Tomanka e43ecfd42c Merge branch 'dev-v7.9' into U4-9991-KeyboardShortcuts 2018-02-16 10:35:41 +01:00
Dennis Öhman 76725aa0d8 U4-10969 - Removed legacy file MediaUploader.ashx 2018-02-15 16:12:49 +01:00
Sebastiaan Janssen d4cf4cd700 Merge pull request #2432 from umbraco/temp-u4-10795
U4-10795
2018-02-15 16:07:22 +01:00
Sebastiaan Jansssen 48c0b95707 Only do a length check if performingIp not null 2018-02-15 16:03:12 +01:00
Sebastiaan Jansssen a5caf361e0 Update DateTime.Now usages to be UtcNow to be independent of local datetime 2018-02-15 15:55:40 +01:00
Sebastiaan Jansssen 74c3aaade5 Merge branch 'dev-v7.9' into temp-u4-10795 2018-02-15 15:50:15 +01:00
Stephan cf94da2b8f refactor user and group logging 2018-02-15 14:01:04 +01:00
Sebastiaan Jansssen 826d6d5b15 Merge remote-tracking branch 'origin/dev-v7.8' into dev-v7.9 2018-02-14 12:15:56 +01:00
Sebastiaan Jansssen 56f4904fc0 Merge remote-tracking branch 'origin/dev-v7' into dev-v7.8 2018-02-14 12:15:18 +01:00
Sebastiaan Jansssen 9178e7afcf Whoops, no need to introduce a new method here, old method was still available 2018-02-14 12:13:01 +01:00
Stephan 7f3733d4b5 cleanup 2018-02-14 11:27:43 +01:00
Sebastiaan Jansssen 3df23c3a34 Merge remote-tracking branch 'origin/dev-v7.8' into dev-v7.9
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
2018-02-14 10:34:26 +01:00
Sebastiaan Jansssen 7746c4a014 Merge remote-tracking branch 'origin/dev-v7' into dev-v7.8
# Conflicts:
#	src/Umbraco.Web/PropertyEditors/ValueConverters/MultiNodeTreePickerPropertyConverter.cs
2018-02-14 10:28:51 +01:00
Sebastiaan Janssen b18945e630 Merge pull request #2447 from umbraco/temp-Fix-CDF-Version-Change
Updates the CDF version changer to to use a hash of the current versi…
2018-02-14 10:25:27 +01:00
Sebastiaan Jansssen 4640cf56d1 Make change non-breaking 2018-02-14 10:23:58 +01:00
Shannon eae1ce7012 fixes build 2018-02-14 12:05:05 +11:00
Shannon e900711180 Updates the CDF version changer to to use a hash of the current version and the date time so that it's not constantly updated if it's not changed. 2018-02-14 11:53:49 +11:00
Shannon 9f4875c8a7 removes SaveUserGroupWithUsersEventArgs and replaces with SaveEventArgs<UserGroupWithUsers> and changes the SavedUserGroupWithUsers to SavingUserGroup2 and SavedUserGroup2 2018-02-14 11:13:24 +11:00
Stephan 46902d4335 Merge branch 'temp-u4-10795' of https://github.com/umbraco/Umbraco-CMS into temp-u4-10795 2018-02-13 15:35:57 +01:00
Stephan 5eb22b0fd9 report added/removed users from groups 2018-02-13 15:30:58 +01:00
Stephan 6a18965946 Don't throw, DRY 2018-02-13 12:00:14 +01:00
Stephan be1ec05072 Use constants for field lengths 2018-02-13 11:32:21 +01:00
Stephan bb2caf85cb fix namespace 2018-02-13 09:47:23 +01:00
Shannon 8ee8bda953 fixes tests 2018-02-13 19:46:34 +11:00
Shannon b42f75df17 fixes tests 2018-02-13 19:29:19 +11:00
Shannon caa3a3319f Fixes issue with user groups being dirty and resetting dirty events 2018-02-13 18:54:13 +11:00
Shannon 5caf95331a Fixes PerformingUser for login/logout and actually logs the affected user 2018-02-13 18:29:39 +11:00
Bjarne Fyrstenborg 040e45ca70 Ensure move cursor is added the multiple media picker (sortable), but not on imagepicker prevalue editor, which not has ui-sortable 2018-02-12 22:27:23 +01:00
Bjarne Fyrstenborg bd3d626147 Add move cursor when media picker is multiple picker and thumbnails are sortable 2018-02-12 21:58:39 +01:00
Bjarne Fyrstenborg 47d08e69a4 Update comment 2018-02-12 21:56:48 +01:00
Bjarne Fyrstenborg df182674b4 Make thumbnail same size as add button 2018-02-12 21:37:22 +01:00
Bjarne Fyrstenborg 6ec9a2ae45 Add specific class for "add" list item 2018-02-12 21:01:08 +01:00
Bjarne Fyrstenborg bf00f7a663 Enable sortable option based on single or multiple media picker 2018-02-12 20:54:49 +01:00
Bjarne Fyrstenborg 74d8341620 Add bottom margin for multiple media picker 2018-02-12 20:46:48 +01:00
Bjarne Fyrstenborg 70207e5374 Fix issues with "add"-button in single and multiple media picker 2018-02-12 20:46:02 +01:00
Bjarne Fyrstenborg f4c038c64c Add translations of "Save and publish". 2018-02-12 18:04:46 +01:00
Shannon c4fa3aa649 Fixes issue with AffectedUser vs PerformingUser, updates the log formatting and uses the affectedDetails better, fixes the double event calling for auth stuff, fixes the change password event raising, fixes reporting the changed property values for members 2018-02-13 00:15:04 +11:00
Mikulas Tomanka d51cda7843 Merge pull request #2440 from ProNotion/patch-1
Fixed typo on user section of tour
2018-02-12 13:32:10 +01:00
Claus 372ffee42b Merge pull request #2437 from umbraco/temp-UAASSCRUM-1365
allowing to disable the template check when sending content through t…
2018-02-12 11:15:26 +01:00
Claus c1cfea7ebd removing constructor. 2018-02-12 11:12:46 +01:00
Shannon 3cdd8a0c43 removes methods from the interface we don't want to support 2018-02-12 20:48:42 +11:00
Shannon bf130584a6 updates docs 2018-02-12 18:28:51 +11:00
Shannon c3e67705ba updated some naming conventions for eventType 2018-02-12 18:24:07 +11:00
Shannon 7a80d689aa Fixes invalid login attempts being logged against the admin user, updates the audit handler to log unique keys for the eventType 2018-02-12 18:12:16 +11:00
Shannon eabc009f0c Adds validation to IAuditService.Write 2018-02-12 17:37:52 +11:00
ProNotion d3a2d88347 Fixed type on user section 2018-02-09 17:33:11 +00:00
Claus 93f4d65227 Merge pull request #2438 from umbraco/temp-U4-10958
Fixes broken MNTP by switching convert cases to the correct DataType
2018-02-09 14:42:08 +01:00
Robert a4c0342bda Fixes broken MNTP by switching convert cases to the correct DataType 2018-02-09 14:09:03 +01:00
Sebastiaan Janssen 6c328d729d Merge pull request #2435 from madsoulswe/temp-U4-10953
U4-10953- Help-drawer, (caption + h3 -> h5
2018-02-09 13:32:32 +01:00
Sebastiaan Jansssen 095633ba27 Test names were inverted 2018-02-09 13:27:25 +01:00
Claus 633d1bb0ae changing the template check to an enabled check instead. 2018-02-09 13:19:56 +01:00
Claus fb89c3da3c allowing to disable the template check when sending content through to render. 2018-02-09 12:58:50 +01:00
Claus b2004057a5 U4-10957 If RequiredSection is not defined in a tour - backoffice will throw errors 2018-02-09 11:55:34 +01:00
Sebastiaan Jansssen 3097a46ab3 Merge remote-tracking branch 'origin/dev-v7' into dev-v7.8
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
2018-02-09 09:57:00 +01:00
Sebastiaan Jansssen c63156fcd8 Bump version to 7.7.11
(cherry picked from commit 0c25c36af0)
2018-02-09 09:53:52 +01:00
Sebastiaan Jansssen c59a226d56 Merge remote-tracking branch 'origin/dev-v7' into master-v7 2018-02-09 09:51:39 +01:00
Sebastiaan Jansssen 0c25c36af0 Bump version to 7.7.11 2018-02-09 09:46:05 +01:00
Stephan 29690df567 U4-10795 - misc fixes 2018-02-09 09:33:24 +01:00
Stephan 84a90884e3 Merge pull request #2433 from umbraco/temp-U4-10947
Fix for not being able to save decimal value
2018-02-09 08:14:51 +01:00
Shannon d29b7311fa reverts the convertible2 back to what it was before 2018-02-09 10:08:25 +11:00
Shannon 17b59cc20f Updates the ObjectExtensions TryConvertTo code and moved all unit tests to ObjectExtensionsTests which now all pass 2018-02-09 10:02:51 +11:00
Robert 4423571eaa Added ConvertToNullableDecimalTest and check that fixes the decimal save issue 2018-02-08 16:21:09 +01:00
Dennis Öhman 750600b202 U4-10953
Populate Caption in dashboardhelper
h2 -> h5
2018-02-08 15:37:50 +01:00
Sebastiaan Jansssen 28eb4ff03a Bump version to 7.8.1 2018-02-08 14:08:38 +01:00
Sebastiaan Jansssen 79517f171c Update UI.xml when upgrading 2018-02-08 14:07:54 +01:00
Stephan e76c42f874 Merge pull request #2434 from umbraco/temp-U4-U4-10950
Fix checkbox in nested content
2018-02-08 13:42:42 +01:00
Robert 151c35bc47 Moving check to TryToConvertValueToCrlType 2018-02-08 13:15:43 +01:00
Robert 84265a9716 Fix checkbox in nested content 2018-02-08 12:18:51 +01:00
Robert 6618388973 Fix for not being able to save decimal value 2018-02-08 12:10:57 +01:00
Stephan 61ce533a08 U4-10795 - better performing user management, fix upgrades 2018-02-08 10:16:53 +01:00
Stephan 0a44ad3ab6 U4-10795 - granular logging - roles 2018-02-07 16:50:49 +01:00
Stephan 7c34255abe Merge branch origin/dev-v7.9 into temp-u4-10795 2018-02-07 15:55:41 +01:00
Stephan d52216103b U4-10795 - granular logging 2018-02-07 15:51:18 +01:00
Stephan a26cd625e7 U4-10795 - granular logging 2018-02-07 15:38:50 +01:00
Warren Buckley b280bf73aa Merge pull request #2429 from umbraco/temp-U4-10937
U4-10937 Datepicker on Info tabe and dates on audit trail do not work…
2018-02-07 12:13:19 +00:00
Shannon a6d57a5f6d Updates the dateHelper when converting to a local date, we need to check if the current string format is in UTC format and ensure that it's loaded that way 2018-02-07 12:51:15 +11:00
Mario Lopez 1f22191bbc fixed formatting 2018-02-07 11:35:39 +11:00
Mario Lopez 25088042a9 spanish translations 2018-02-07 11:28:11 +11:00
Shannon 6b7a83c6c9 Updates logic for setting the scheduled publishing date/times to ensure that the local date/time is displayed but the server time is persisted 2018-02-07 11:17:02 +11:00
Sebastiaan Jansssen eb5f2e29a3 U4-10937 Datepicker on Info tabe and dates on audit trail do not work if server time needs offsetting 2018-02-06 19:15:15 +01:00
Stephan 02397fd90c U4-10795 - granular logging 2018-02-06 19:07:54 +01:00
Mikkel Holck Madsen cf86409e3f Merge pull request #2427 from umbraco/temp-U4-10935
fixes: U4-10935 Intro tour doesn't start automatically on cloud
2018-02-06 11:04:02 +01:00
Mads Rasmussen 134f5e2601 fixes: U4-10935 Intro tour doesn't start automatically on cloud 2018-02-06 10:14:30 +01:00
Mathias Rando Juul e0ded863cc Changes revalidation of username and password.
Ensures that both inputs are revalidated on change(if the form is invalid) to avoid cases where changing your password doesn't reset $invalid and therefor doesn't allow you to resubmit the form without triggering a change in the username.
2018-02-06 06:35:41 +01:00
Mathias Rando Juul bd55594be1 Changes submit button to use umb-button directive. 2018-02-06 06:27:50 +01:00
Mathias Rando Juul 0e82696082 Updates formatting to match guidelines.
The guidelines for core contribution states that 4 spaces should be used for everything except XML.
2018-02-06 06:00:46 +01:00
Sebastiaan Jansssen 37ac524e8e Don't enable tours for upgraders 2018-02-05 22:37:47 +01:00
Sebastiaan Jansssen 43af2f8e55 Fix UI docs generator 2018-02-05 21:12:25 +01:00
Jeffrey - Perplex a7a6854f9b Adding extra shortcuts 2018-02-05 16:45:20 +01:00
Sebastiaan Jansssen a20584e3de Not beta009, Final! 2018-02-01 16:18:49 +01:00
Sebastiaan Jansssen 19ec26fef9 Merge remote-tracking branch 'origin/dev-v7' into dev-v7.8 2018-02-01 15:20:13 +01:00
Sebastiaan Janssen 23d225c14f Merge pull request #2424 from umbraco/temp-u4-10794
Temp u4 10794
2018-02-01 13:32:32 +01:00
Claus 527f98189a Merge pull request #2423 from umbraco/temp-u4-10897
temp U4-10897
2018-02-01 13:29:45 +01:00
Sebastiaan Jansssen 1a289be999 Whoops, I see what you did there, Consent can be internal indeed, cool! 2018-02-01 13:09:06 +01:00
Sebastiaan Jansssen 8a0485e093 Consent class really needs to be public 2018-02-01 13:07:02 +01:00
Sebastiaan Jansssen 647492fbfb Merge branch 'dev-v7.9' into temp-u4-10794 2018-02-01 12:55:53 +01:00
Sebastiaan Janssen 78c289a559 Merge pull request #2425 from umbraco/mittonp-dev-v7
Mittonp dev v7
2018-02-01 08:59:35 +01:00
Sebastiaan Jansssen 646abb3aea Merge branch 'dev-v7' of https://github.com/mittonp/Umbraco-CMS into mittonp-dev-v7
# Conflicts:
#	src/Umbraco.Web.UI/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/es.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/fr.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/nl.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/pl.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/ru.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/zh.xml
2018-02-01 08:57:47 +01:00
Sebastiaan Janssen 2af59471a2 Merge pull request #973 from mattbrailsford/dev-v7-insertmacrofix
Updated insert macro dialog to prevent closing on enter key
2018-02-01 08:28:59 +01:00
Sebastiaan Jansssen fc43d3cdee Merge branch 'dev-v7.8' into dev-v7.9 2018-01-31 17:03:19 +01:00
Sebastiaan Jansssen b76b09026b Merge branch 'dev-v7' into dev-v7.8
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Web.UI.Client/src/assets/img/installer.jpg
#	src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js
#	src/Umbraco.Web.UI.Client/src/common/services/tour.service.js
#	src/Umbraco.Web.UI.Client/src/controllers/search.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/tours/umbintrocreatedoctype/doctypename/doctypename.controller.js
#	src/Umbraco.Web.UI.Client/src/views/users/views/user/details.html
#	src/Umbraco.Web.UI/config/BackOfficeTours/getting-started.json
#	src/Umbraco.Web/Editors/TourController.cs
#	src/Umbraco.Web/Models/BackOfficeTour.cs
#	src/Umbraco.Web/Models/BackOfficeTourStep.cs
#	src/Umbraco.Web/Models/Mapping/UserModelMapper.cs
#	src/Umbraco.Web/TourFilterResolver.cs
#	src/Umbraco.Web/Trees/MacroTreeController.cs
#	src/Umbraco.Web/WebApi/Filters/FeatureAuthorizeAttribute.cs
#	src/umbraco.cms/businesslogic/Packager/Installer.cs
#	src/umbraco.cms/businesslogic/Packager/PackageInstance/utill.cs
2018-01-31 17:02:03 +01:00
Stephan 971d7cf933 U4-10794 - refactor 2018-01-31 15:20:03 +01:00
Sebastiaan Jansssen 118a83e56c Consent class should be public for 3rd parties to be able to register consents 2018-01-31 13:19:30 +01:00
Sebastiaan Jansssen 1f6dea7177 Adds migration to create constent table 2018-01-31 12:47:41 +01:00
Sebastiaan Jansssen f2667c3360 Bumps version to 7.9.0 2018-01-31 12:47:16 +01:00
Sebastiaan Janssen f331736384 Merge pull request #2421 from umbraco/temp-U4-10797
U4-10797 Sensitive values
2018-01-31 10:59:18 +01:00
Sebastiaan Janssen 090f89e5b6 Merge pull request #2223 from kgiszewski/fix/U4-6309
U4-6309: Fix black bars that appear on a RTE image resize
2018-01-31 10:43:29 +01:00
Shannon a6bc94185c Ensures that a user without access to sensitive values cannot change a member type's sensitive values, this also validates on the server side 2018-01-30 19:38:42 -06:00
Stephan 4870afd2d3 U4-10897 - change enlisting priorities 2018-01-30 14:27:58 +01:00
Stephan 80257b6684 Revert "U4-10897 - change enlisting priorities"
This reverts commit 8f3a0b6919.
2018-01-30 14:26:59 +01:00
Stephan 8f3a0b6919 U4-10897 - change enlisting priorities 2018-01-30 14:25:43 +01:00
Stephan 9fd2f34343 U4-10897 - defer Examine indexing until scope is all done 2018-01-30 13:53:37 +01:00
Stephan e774717346 U4-10897 - expose enlisted mutable Xml in events 2018-01-30 13:14:01 +01:00
Warren Buckley 5f5759c8a3 Merge pull request #2422 from umbraco/temp-U4-10869
U4-10869 Make sure the getting started tour is only shown to the right users
2018-01-30 09:10:12 +00:00
Robert 0b90097aad "requiredSections" tour property documentation
Added a few words about "requiredSections" tour property
2018-01-30 10:00:54 +01:00
Shannon 58533ca17e Validates sensitive properties during model binding to ensure that someone cannot hack a posted value for sensitive props if they don't have access to sensitive props. 2018-01-29 13:24:27 -06:00
Shannon 427e99dd29 WIP - need to validate sensitive properties for invalid posted data 2018-01-29 12:20:06 -06:00
Shannon 1ec09e15cf fixes tests 2018-01-29 12:02:20 -06:00
Shannon a48568d1ba Fixes problem where the sensitive value placeholder was being posted back to the server for saving, instead we don't post this value at all which means it will not be overwritten when it posts back. 2018-01-29 11:38:08 -06:00
Stephan 5aa1b81cd4 U4-10794 - revert PEtaPocoMapper changes 2018-01-29 16:27:16 +01:00
Sebastiaan Jansssen 7cd540c37e Remove additional premature uses of C#7 features 2018-01-29 14:35:30 +01:00
Sebastiaan Jansssen 83595ecaf5 Don't rely on C# 7 features 2018-01-29 14:06:25 +01:00
Robert e07c5e6ff8 Removed unused using directives 2018-01-29 13:18:11 +01:00
Robert 67ff827d67 Tours will only load if the current user has access to the same sections the tours has access to 2018-01-29 13:13:43 +01:00
Stephan e1208e5019 U4-10794 - use string ids, not udis 2018-01-29 11:30:01 +01:00
Sebastiaan Jansssen 3f7159797f U4-10880 Update install background 2018-01-29 09:49:16 +01:00
Shannon 995f644501 Adds upgrade logic, fixes tests, fixes model mappings to not do so much AfterMap 2018-01-26 17:27:35 -07:00
Shannon f7eec8dafb Allows editing the property metadata even if the property type is locked 2018-01-26 16:24:40 -07:00
Shannon e039265fab adds descriptions to the member type options 2018-01-26 16:11:14 -07:00
Shannon f08192a4ab Changes copy for hidden values and makes the rendering for hidden values it's own property editor view so we can more easily update it. 2018-01-26 15:52:12 -07:00
Stephan a16ac1f0ba U4-10794 - implement basic consent service 2018-01-26 10:57:12 +01:00
Shannon 469d6f9ca3 Now checks for the sensitiveData group to view sensitive data 2018-01-25 15:06:23 -07:00
Shannon 54cc80f4e8 Updates all required mappings to use AutoMapperExtensions.MapWithUmbracoContext where appropriate 2018-01-25 14:41:28 -07:00
Shannon 64628c0a9d Gets the IsSensitive property mapped to the display object and changes the property output to show that the field contains sensitive data. Refactors the TabsAndPropertiesResolver and simplifies it a lot which also allows us to pass in an UmbracoContext which we'll need in order to determine a user's rights, etc... Refactors how the TreeNodeUrls are mapped and they now use a proper mapper. This now means we do much less in AfterMap 2018-01-25 14:14:12 -07:00
Robert 6f81b7fe24 'getting-started' tour only available to admins 2018-01-25 12:10:34 +01:00
Stephan f2819f61e5 Merge pull request #2417 from umbraco/temp-u4-10846
U4-10846 - fix member group cache
2018-01-25 11:06:17 +01:00
Sebastiaan Janssen 2107e9d9e3 Merge pull request #2420 from PerplexDaniel/patch-1
Fix NullReferenceException when HttpContext is not available
2018-01-25 10:18:32 +01:00
Daniël Knippers c623b448ba Fix NullReferenceException when HttpContext is null
This method will throw a NullReferenceException in contexts without an HttpContext, like is the case in background threads. As HttpContext is only used to set an isDebug flag, it seems more sensible to not throw in cases without an HttpContext, but simply set isDebug to false instead. If this is not acceptable behavior, could we perhaps look at something other than HttpContext.Current.IsDebuggingEnabled to decide whether isDebug should be set?
2018-01-25 08:56:46 +01:00
Mario Lopez 1e8bdc8f0c no message 2018-01-25 10:18:06 +11:00
Sebastiaan Janssen 8bb49f57e8 Merge pull request #2419 from umbraco/redmorello-U4-10864_close_back_office_search_results
Redmorello u4 10864 close back office search results
2018-01-24 17:47:44 +01:00
Sebastiaan Jansssen da0b1c2f23 Merge branch 'U4-10864_close_back_office_search_results' of https://github.com/redmorello/Umbraco-CMS into redmorello-U4-10864_close_back_office_search_results
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/components/application/umb-navigation.html
2018-01-24 17:43:19 +01:00
Sebastiaan Jansssen a288fc62eb Workaround: keep the cache we used to have but clear all cache for membergroups when a member group changes 2018-01-24 17:26:21 +01:00
Sebastiaan Jansssen 82e50ccd3a Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2018-01-24 16:13:31 +01:00
Sebastiaan Jansssen 15b0dc9f29 Merge branch 'dev-v7.8' of https://github.com/kristoffer-tvera/Umbraco-CMS into kristoffer-tvera-dev-v7.8 2018-01-24 16:12:06 +01:00
Sebastiaan Janssen 8057d09fc2 Merge pull request #2416 from PeteDuncanson/patch-1
Prevent Pinterest messing with media in the back office
2018-01-24 15:53:40 +01:00
Sebastiaan Jansssen 8877100bf0 Merge branch 'dev-v7' into temp-u4-10846 2018-01-24 15:50:08 +01:00
Stephan 41c96e6e26 Merge pull request #2398 from leekelleher/issue/U4-10756
Proposed patch for U4-10756 - Guid TypedContent performance
2018-01-24 15:27:43 +01:00
Sebastiaan Jansssen abdd117264 Fixes bug in MB 3.0.9 2018-01-24 15:26:40 +01:00
Sebastiaan Jansssen 6272dac698 Use string.Format instead of interpolation 2018-01-24 14:34:21 +01:00
Sebastiaan Jansssen 7a4b5fa796 Bump version to 7.7.10 2018-01-24 14:34:03 +01:00
Sebastiaan Jansssen c962132ee0 Update to ModelsBuilder 3.0.9 2018-01-24 14:33:32 +01:00
leekelleher 0780979469 Eagerly populating the Guid lookup
as per @Shazwazza's comment: https://github.com/umbraco/Umbraco-CMS/pull/2398#issuecomment-358752346

Tested against 12,000 nodes (in the XML cache), profiling showed it took 55ms.
2018-01-24 11:53:52 +00:00
leekelleher a42e568fdf Initialized the ConcurrentDictionary statically
as per @JimBobSquarePants's comment: https://github.com/umbraco/Umbraco-CMS/pull/2398#discussion_r162799543
2018-01-24 11:51:53 +00:00
Robert e62661cc6a Merge pull request #2397 from leekelleher/issue/U4-10845
U4-10845 MNTP value-converter - trashed content causes database lookups
2018-01-24 12:48:29 +01:00
leekelleher 6841b2ac61 Amended the lookup dictionary setter,
as per @JimBobSquarePants's comment: https://github.com/umbraco/Umbraco-CMS/pull/2398#discussion_r162522998
2018-01-24 10:29:23 +00:00
leekelleher f7f4276485 Removed the need for the UseLegacyXmlSchema check
The enhancement in PR #2367 removed the `"@isDoc"` check,
which was the main difference between the legacy and current XML schema.

Reducing the XPath to `"//*[@key=$guid]"` will perform the same for both types of schema.
_(and saves on a couple of allocations)_
2018-01-24 10:29:23 +00:00
leekelleher bb9e23ca3e Proposed patch for U4-10756 - Guid TypedContent performance
This is a proposal for a temporary workaround to issue U4-10756.

It uses a local static ConcurrentDictionary to store a lookup of Guid/int values.
If the Guid isn't in the lookup, then the traditional XPath is used, which would add the resulting node ID (int) to the lookup.
If the lookup contains the Guid, then the returned int value will be used to perform a more efficient retrieval.

<http://issues.umbraco.org/issue/U4-10756>
2018-01-24 10:29:23 +00:00
Warren Buckley 10db9363f4 Merge pull request #2411 from umbraco/temp-U4-10757
Can navigate trough global search results
2018-01-24 09:35:07 +00:00
Sebastiaan Janssen 7d5d69e2e3 Merge pull request #2418 from abjerner/patch-36
Nested Content should use the new turquoise/purple colors as the rest of the backoffice
2018-01-23 22:02:16 +01:00
Sebastiaan Janssen 06897aa8c6 Merge pull request #2413 from umbraco/temp-u4-10853
U4-10853 - fix (scheduled) unpublishing issues
2018-01-23 21:55:53 +01:00
Anders Bjerner ee75158dd0 Nested Content should use the new turquoise/purple colors as the rest of the backoffice 2018-01-23 21:55:15 +01:00
Shannon b49db0e941 Initial commit for member type sensitive data, this adds the db and model requirements and updates the normal property editor for a member type which saves the isSensitive data to the db. 2018-01-23 13:01:31 -07:00
Stephan c022397d86 U4-10846 - fix member group cache 2018-01-23 20:54:47 +01:00
Shannon e25f6e82ed Merge branch 'dev-v7' into dev-v7.8
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Web/Models/Mapping/UserModelMapper.cs
2018-01-23 11:42:14 -07:00
Shannon d104525a50 Updates core to use latest CDF version 2018-01-23 11:15:37 -07:00
Sebastiaan Janssen b0a64aa4b5 Merge pull request #2384 from umbraco/temp-u4-10822
U4-10822 - refactor view models binding error handling
2018-01-23 16:24:08 +01:00
Pete Duncanson ca86385269 Prevent Pinterest messing with media in the back office
Fixes: http://issues.umbraco.org/issue/U4-10865
2018-01-23 15:10:09 +00:00
Robert fb8368267e Merge pull request #2410 from umbraco/temp-U4-10851
Fixes U4-10851 - Unzip Umbraco packages into a flat structure
2018-01-23 16:06:41 +01:00
Claus ef4322a9b3 Merge pull request #2414 from umbraco/temp-u4-10844
U4-10844 - delete blueprints with content types
2018-01-23 15:15:15 +01:00
Stephan 7032e137b8 U4-10853 - refactor 2018-01-23 15:02:12 +01:00
Warren Buckley e99643ecfd Merge pull request #2415 from umbraco/temp-U4-10847
Removed authorize attribute from TourControlle
2018-01-23 13:44:52 +00:00
Robert a325529eb8 Merge pull request #2412 from umbraco/temp-U4-10840
Added in the create XML for the legacy UserControl based Create Dialog
2018-01-23 14:38:25 +01:00
Robert c68f832be6 Fixed anoying lower case delete action on macro context tree 2018-01-23 14:34:03 +01:00
Sebastiaan Janssen 4ab1c51327 Merge pull request #2392 from umbraco/temp-u4-10829
U4-10829 - fix tree controller
2018-01-23 14:13:39 +01:00
Robert 6f39bac32a Removed authorize attribute from TourControlle 2018-01-23 13:47:57 +01:00
Stephan e007a37c36 U4-10844 - delete blueprints with content types 2018-01-23 13:41:36 +01:00
Stephan ab9e029525 U4-10853 - fix (scheduled) unpublishing issues 2018-01-23 13:04:57 +01:00
Warren Buckley d298388a7b Update the UI.Release XML too 2018-01-23 11:47:59 +00:00
Warren Buckley 4463abe9bb Added in the create XML for the legacy UserControl based Create Dialog 2018-01-23 11:39:12 +00:00
Warren Buckley d1db38182f Fixes U4-10851 - Unzip Umbraco packages into a flat structure, so it supports packages that have files at the root, along with some packages that have the files nested insider another guid folder 2018-01-23 10:38:41 +00:00
Robert e808360653 Can navigate trough global search results 2018-01-23 10:46:02 +01:00
Mads Rasmussen c5df712471 Merge pull request #2405 from umbraco/temp-U4-10852
Fixes U4-10852 Where the ZipArchive stream was closed
2018-01-23 09:50:29 +01:00
Sebastiaan Janssen 2f67008987 Merge pull request #2407 from abjerner/patch-34
Removed unnecessary &nbsp;
2018-01-23 09:42:30 +01:00
Sebastiaan Janssen 1672e284c5 Merge pull request #2406 from abjerner/patch-33
Minor casing change
2018-01-23 09:41:46 +01:00
Ian Houghton 60ce36a7f2 U4-10864 add button when search returns no results, to clear the search 2018-01-22 22:03:35 +00:00
Mads Rasmussen 05c12d1f27 Merge pull request #2404 from umbraco/temp-U4-10843
Fixes U4-10843 and allows user detail page to upload a new avatar
2018-01-22 20:21:57 +01:00
Anders Bjerner 72e2cacc87 Removed unnecessary &nbsp; 2018-01-22 18:16:42 +01:00
Anders Bjerner 4285102422 Minor casing change 2018-01-22 18:08:37 +01:00
Warren Buckley 5ffdf4dd60 Fixes U4-10852 Where the ZipArchive stream was closed - 'Cannot access a closed Stream' 2018-01-22 14:20:01 +00:00
Mads Rasmussen abbcf0e26b Merge pull request #2358 from abjerner/patch-28
Triggers the save button to momentarily show an error icon
2018-01-22 14:55:10 +01:00
Sebastiaan Janssen 347b25472f Merge pull request #2403 from JimBobSquarePants/housekeeping-gitattributes
Add default gitattributes and cleanup editorconfig
2018-01-22 14:38:40 +01:00
Mads Rasmussen b745948dc6 Merge pull request #2361 from bjarnef/dev-v7-U4-10791
U4-10791 - Fix collapsed columns listview settings
2018-01-22 13:48:58 +01:00
Mads Rasmussen 8007c8869f Merge pull request #2401 from umbraco/temp-U4-10835
U4-10835 Adds context menu items to the User tree
2018-01-22 13:25:59 +01:00
Stephan b51a328ead Merge pull request #2402 from JimBobSquarePants/perf-tryconvertto
Performance - 8x Faster TryConvertTo
2018-01-22 13:22:22 +01:00
Warren Buckley f61437cc7c Fixes U4-10843 and allows user detail page to upload a new avatar 2018-01-22 12:09:28 +00:00
James Jackson-South f3b8f2eb5f Add default gitattributes and cleanup editorconfig 2018-01-22 21:44:08 +11:00
James Jackson-South de4628f450 Add perf explanation 2018-01-22 20:58:15 +11:00
James Jackson-South b0a64655b4 Fastest dictionary lookups 2018-01-22 16:43:02 +11:00
Stephan 48d88ec8fa Deal fix FIXME 2018-01-21 10:29:06 +01:00
Stephan 7ca151a3fa Use concurrent dictionaries 2018-01-21 10:18:13 +01:00
Stephan 363c8fab2c Cleanup 2018-01-21 10:03:17 +01:00
Stephan 8d4fd9d1cf Merge branch 'perf-tryconvertto' of https://github.com/JimBobSquarePants/Umbraco-CMS into perf-tryconvertto 2018-01-21 10:01:12 +01:00
James Jackson-South 24071eb3b1 Faster TryConvertTo 2018-01-20 14:54:52 +11:00
James Jackson-South 62ffbe7cf0 Cleanup benchmarks and add TryCOnvertTo 2018-01-20 13:00:10 +11:00
Warren Buckley f2d6b47e47 Update labels for context menu items to be just 'Create' & 'Invite' to keep the same consistency throughout the UI as other context menu items do not include the verb 2018-01-19 14:24:57 +00:00
Warren Buckley f3541908c7 Update Users tree context menu to include two new items that navigate directly to an Angular Location/Path which loads the Invite or Create User views as needed 2018-01-19 14:07:23 +00:00
Sebastiaan Jansssen 4e57e1cc18 Nicer variable name, thank to Lee Kelleher! 2018-01-19 12:50:45 +01:00
Sebastiaan Jansssen 410afffaa9 Optimizing use of newlines array 2018-01-19 12:42:04 +01:00
Claus 936e94789d adding to tinyMceConfig.Release.config. 2018-01-19 12:21:57 +01:00
Claus 468a56e5de Merge branch 'karltynan-dev-v7' into dev-v7 2018-01-19 11:11:53 +01:00
Claus 468ec8824a Merge branch 'dev-v7' of git://github.com/karltynan/Umbraco-CMS into karltynan-dev-v7 2018-01-19 11:11:13 +01:00
Sebastiaan Jansssen cad913b7a1 U4-10857 Update to ClientDependency 1.9.5 2018-01-19 08:26:34 +01:00
Sebastiaan Jansssen 382103d99d Bump version to 7.7.9 2018-01-19 08:26:33 +01:00
Sebastiaan Janssen cbb6b9bca0 Merge pull request #2310 from matthew-darby/U4-10495
U4-10495 - Install and customize buttons disabled
2018-01-18 18:38:37 +01:00
Sebastiaan Janssen a1b90a50cd Merge pull request #2343 from soreng/patch-5
Fix for U4-10733
2018-01-18 18:28:34 +01:00
Sebastiaan Janssen 9ea5855073 Merge pull request #2360 from janvanhelvoort/U4-10785
U4-10785 - Filtering of Grid Editors
2018-01-18 18:20:11 +01:00
Sebastiaan Janssen 4a37433042 Merge pull request #2372 from bjarnef/dev-v7-U4-10809
Fix checkmark tree icon, when custom font icon is used for tree icon
2018-01-18 18:00:53 +01:00
Sebastiaan Janssen 91469812d3 Merge pull request #2383 from MMasey/U4-10727
U4 10727 - If nodes with an empty name exist, it's not possible to empty recycle bin
2018-01-18 17:54:40 +01:00
Sebastiaan Janssen 68a8eb7f3f Merge pull request #2375 from redmorello/U4-10762
U4-10762 Fix issue with empty name when registering new members from …
2018-01-18 17:40:05 +01:00
Sebastiaan Janssen 2e7baabb94 Merge pull request #2394 from umbraco/temp-u4-10813
U4-10813 - fix error with groups having a large number of permissions
2018-01-18 17:27:11 +01:00
Sebastiaan Janssen 57745fe71d Merge pull request #2396 from leekelleher/issue/U4-10842
U4-10842 LegacyMediaPickerPropertyConverter null-reference check
2018-01-18 17:17:45 +01:00
Sebastiaan Janssen de6f9236e7 Merge pull request #2399 from leekelleher/issue/U4-8712
U4-8712 MultipleTextstring value newline delimiter changes
2018-01-18 17:13:46 +01:00
Sebastiaan Janssen a00c59e8b5 Merge pull request #2393 from umbraco/temp-u4-10079
U4-10079 - remove default template
2018-01-18 16:54:22 +01:00
Stephan 05c2da807f U4-10079 - fix test 2018-01-18 15:58:51 +01:00
leekelleher 0fd8ca43d6 U4-8712 MultipleTextstring value newline delimiter changes
PR #2185 goes towards resolving this, but doesn't handle the impromptu switch between the `\r\n` and `\n` newline delimiters when republishing a content node.

Using an explicit array of newline chars will resolve this, e.g. `Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None)`

<http://issues.umbraco.org/issue/U4-8712>
2018-01-18 12:18:51 +00:00
leekelleher 87f09b2ee6 U4-10845 MultiNodeTreePickerPropertyConverter - trashed content causes database lookups
If the first ID in the MNTP value is a trashed content node, then the `ConvertSourceToObject` method would
check if the ID is a media or member node, both of these incur a database call.

This can cause a detrimental performance impact on the website.

This patch uses the `startNode.type` prevalue to detect the node type, (e.g. Content, Media or Member).
The prevalue is cached in a private `ConcurrentDictionary` and refreshed using the `DataTypeCacheRefresher` event.
> _Following the same caching-pattern as the Slider, Tags and MediaPicker value-converters._

<http://issues.umbraco.org/issue/U4-10845>
2018-01-18 10:49:18 +00:00
leekelleher e466878925 U4-10842 LegacyMediaPickerPropertyConverter ConvertDataToSource null-reference check
If a selected media node has been trashed on the source environment,
when Deploy comes to transfer the node ID, because it can't transfer the media dependency,
the node ID value is set to `null`.

This causes an issue for the `LegacyMediaPickerPropertyConverter`
and `ConvertDataToSource` throws a null-reference exception.

This patch adds in a null-reference check for the `source` value.

<http://issues.umbraco.org/issue/U4-10842>
2018-01-18 10:04:55 +00:00
Claus 7adf917570 Merge pull request #2395 from umbraco/temp-U4-10836
U4-10836 ContentService.GetPagedDescendants() is not returning any re…
2018-01-18 07:27:12 +01:00
Stephan 7c41db4bcc U4-10836 - fix a couple issues with the PR, and optimize 2018-01-17 17:14:26 +01:00
Stephan 5caaef7795 Merge branch origin/dev-v7.8 into temp-U4-10836 2018-01-17 16:54:28 +01:00
Claus 3b72945b1f applying path fix for MediaService. 2018-01-17 15:57:53 +01:00
Mads Rasmussen 71eb22d0e8 Merge branch 'dev-v7.8' of https://github.com/umbraco/Umbraco-CMS into dev-v7.8 2018-01-17 15:51:25 +01:00
Mads Rasmussen 9d780a2e8f fixes: U4-10837 CMS getting started tour can't create Home page 2018-01-17 15:50:01 +01:00
Claus 55b00069cb U4-10836 ContentService.GetPagedDescendants() is not returning any results 2018-01-17 15:40:25 +01:00
Robert b304728f4e Merge pull request #2390 from umbraco/temp-U4-10828
fixes: U4-10828 Add documentation to tour component and service
2018-01-17 14:27:01 +01:00
Mikulas Tomanka 319acc199e Merge pull request #2391 from matthew-darby/U4-10825
U4-10825 Search member by email in member section
2018-01-17 14:18:43 +01:00
Stephan 2a982f21a7 U4-10813 - fix error with groups having a large number of permissions 2018-01-17 13:07:03 +01:00
Stephan 3ff455f11d U4-10079 - remove default template 2018-01-17 11:36:08 +01:00
Stephan 41ad1bf27b U4-10829 - fix tree controller 2018-01-17 10:47:35 +01:00
Matt Darby f49d939a2d U4-10825 Search member by email in member section 2018-01-16 23:06:15 +08:00
Mads Rasmussen c7e80fc532 remove all client side code related to registering tours in the service. It should be done through .json files. 2018-01-16 13:40:57 +01:00
Mads Rasmussen b47d691841 add documentation to the tour component 2018-01-16 13:31:13 +01:00
Shannon 7e1e83b493 Fixes PackageInstaller event args to make sure the package metadata is passed through 2018-01-16 19:18:08 +11:00
Shannon f6971185f8 bumps version 2018-01-16 19:15:34 +11:00
Shannon 244429b972 Fixes PackageInstaller event args to make sure the package metadata is passed through 2018-01-16 19:15:01 +11:00
Shannon 80ceba36dc Merge branch 'dev-v7.8' of https://github.com/umbraco/Umbraco-CMS into dev-v7.8 2018-01-15 20:41:47 +11:00
Shannon d33b617851 bumps version, checks for feature resolver 2018-01-15 20:40:40 +11:00
Warren Buckley 2b5f370c92 Merge pull request #2351 from umbraco/temp-U4-9291
U4-9291 TypedSearch should have an overload specifying pager values, …
2018-01-15 09:38:51 +00:00
Shannon 4a0cf81d7d fixes test 2018-01-15 18:19:23 +11:00
Shannon fef743517f Allows for passing in an Unknown object type to the IEntityService.GetIdForKey and GetKeyForId methods 2018-01-15 18:05:52 +11:00
Shannon b3cbcebf5b Merge remote-tracking branch 'origin/dev-v7' into dev-v7.8
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/contenttypeeditor/editorpicker/editorpicker.html
#	src/Umbraco.Web.UI.Client/src/views/components/application/umb-navigation.html
2018-01-15 16:27:29 +11:00
Shannon 3d90c2b83f oops, fixed returned type not picked up by compiler due to dynamics 2018-01-15 16:11:56 +11:00
Shannon 3b8b5b6dfa Merge branch 'dev-v7.8' into temp-U4-9291 2018-01-15 15:51:40 +11:00
Shannon Deminick 85f95cf067 Merge pull request #2386 from umbraco/temp-U4-10824
U4-10824 Helper methods for adding filters to tours
2018-01-15 14:30:48 +11:00
Sebastiaan Janssen 23be0134e7 Merge pull request #1605 from jobf/dev-v7
fix U4-8792 override overflow
2018-01-13 17:57:49 +01:00
Sebastiaan Janssen 355fb64d8b Merge pull request #1573 from drbldgtl/dev-v7-U4-6415
Renamed SerializeToCropDataSet to DeserializeToCropDataSet
2018-01-13 17:33:44 +01:00
Stephan 42959a1db5 U4-10822 - fix breaking change 2018-01-12 13:51:06 +01:00
Mads Rasmussen 5b754b3958 adding missing fieds to tour step model 2018-01-12 13:33:46 +01:00
Claus cba31986fe adding dynamic customProperties field to steps. 2018-01-12 11:46:13 +01:00
Claus 07b0267668 Merge pull request #2385 from umbraco/temp-U4-10804
Removed unused tour code from tour.service.js
2018-01-12 10:54:27 +01:00
Claus a83291cc6e tabs-spaces and stuff. 2018-01-12 10:54:10 +01:00
Kristoffer Tverå a1cd22208b Extra check before assigning value to currentColor
In version 7.7.7 with the latest version of LeBlender (1.0.9.2), colorpickers will throw a javascript error in console. Applying this small check will resolve that issue.
ref: https://our.umbraco.org/forum/contributing-to-umbraco-cms/88890-color-picker-cannot-read-property-hasownproperty-of-null
2018-01-12 10:45:59 +01:00
Claus 59d75277c2 fixing up helpers to match exact strings as this is what people will be using. If they need more advanced regex matches they should register by a regex instead. 2018-01-12 09:52:52 +01:00
Claus 69e193e887 U4-10824 Helper methods for adding filters to tours 2018-01-12 09:23:40 +01:00
Mads Rasmussen c3116d5df7 remove moment resolution for bower.json 2018-01-12 08:52:13 +01:00
Shannon Deminick b0b874212e Merge pull request #2381 from umbraco/temp-U4-10803
U4-10803: remove dependency on angular-moment
2018-01-12 14:43:06 +11:00
Shannon 19086ab3a1 Merge remote-tracking branch 'origin/dev-v7.8' into temp-U4-10803
# Conflicts:
#	src/Umbraco.Web.UI.Client/bower.json
2018-01-12 14:32:54 +11:00
Shannon Deminick 069594c3ac Merge pull request #2380 from umbraco/U4-10815
U4-10815 Make DisposableObjectSlim
2018-01-12 12:43:47 +11:00
Stephan 0bc4c7e2aa U4-10822 - refactor view models binding error handling 2018-01-11 16:42:20 +01:00
Stephan 7f12cff3bd Minor build cleanup 2018-01-11 16:25:18 +01:00
Robert 56adab43d6 Removed unused tour code from tour.service.js 2018-01-11 15:03:55 +01:00
Shannon 83294b6594 bump version 2018-01-12 00:32:00 +11:00
Shannon e0c89eb1ea Merge branch 'dev-v7.8' of https://github.com/umbraco/Umbraco-CMS into dev-v7.8 2018-01-12 00:20:21 +11:00
Shannon 9ad8e6a876 fixes nuspec for tour files 2018-01-12 00:20:06 +11:00
Mads Rasmussen 14b58386e5 fix tour backdropOpacity 2018-01-11 14:14:03 +01:00
Robert e26cbccfe0 Reverted DisposableObject.cs to its original state 2018-01-11 13:22:23 +01:00
Robert fa058f348d Forgot to removed TODO 2018-01-11 11:02:05 +01:00
Mads Rasmussen 62d9a1a132 Merge pull request #2379 from umbraco/mzajkowski-U4-4902
U4-4902 Enable 'discard changes' alert throughout the UI
2018-01-11 10:59:22 +01:00
Robert 9284269428 TODO's for DisposableObject and DisposableObjectSlim done 2018-01-11 10:53:45 +01:00
Mads Rasmussen f8c4481eb1 Merge branch 'dev-v7' into mzajkowski-U4-4902 2018-01-11 10:28:28 +01:00
Mike 9f6e6e4701 Add tests to SimilarNodeNameTests to check for null and "" values. 2018-01-10 20:58:10 +00:00
Mike 34ba3f3351 Merge remote-tracking branch 'upstream/dev-v7' into U4-10727 2018-01-10 20:48:28 +00:00
Mike dcfb8b94d8 Refactor SimilarNodeName to account for null nodeName values. 2018-01-10 20:44:30 +00:00
Mads Rasmussen 0876004d9a U4-10803: remove dependency on angular-moment 2018-01-10 16:00:32 +01:00
Ilham Boulghallat 700b71f9fb Merge pull request #2377 from abjerner/patch-32
A few fixes for the Danish translation
2018-01-10 15:14:27 +01:00
Robert bba58ea0c0 Replaced all usages of DisposableObject with DisposableObjectSlim 2018-01-10 13:48:55 +01:00
Robert d0d4885812 Created slim version of DisposableObject and fixed some code indentation
DisposableObjectSlim has no finalizer
2018-01-10 13:36:53 +01:00
Robert 3642ff72a4 Removed console.log 2018-01-10 10:03:26 +01:00
Robert 6e830c1171 Wrapping the watch in the elm.focus
Seems to bring the watch calls way down.
2018-01-10 10:03:02 +01:00
Robert ab523baf4f Changed no-dirty-check directive to use scope.$watch to change $pristine to false 2018-01-10 09:24:42 +01:00
Claus 2dec03f441 Merge pull request #2374 from umbraco/temp-U4-10810
U4-10810 Update CDF to support storing TEMP files in environment %tem…
2018-01-10 09:04:58 +01:00
Claus 9ada0d9c97 reverting committed iis settings. 2018-01-10 09:03:35 +01:00
Shannon df553140e8 Updates to latest 1.9.4 of CDF and updates Nuspec 2018-01-10 12:25:24 +11:00
Anders Bjerner 0b898f2e32 A few fixes for the Danish translation 2018-01-09 22:54:48 +01:00
Ian Houghton f5f3676a56 U4-10762 Fix issue with empty name when registering new members from snippet 2018-01-09 15:51:32 +00:00
Shannon bc828fc6f3 U4-10810 Update CDF to support storing TEMP files in environment %temp% location 2018-01-09 13:52:52 +11:00
Mike dc7b83ca6c Add initial test fix for SimilarNodeName when a node has no name. 2018-01-08 17:30:11 +00:00
Robert 8188e4ff55 Merge branch 'U4-4902' of git://github.com/mzajkowski/Umbraco-CMS into mzajkowski-U4-4902 2018-01-08 15:39:29 +01:00
Bjarne Fyrstenborg fcf9dcd803 Fix checkmark tree icon, when custom font icon is used for tree icon, e.g. in UCommerce 2018-01-08 14:40:31 +01:00
Sebastiaan Jansssen 3556043b55 Update to latest modelsbuilder 2018-01-08 12:44:29 +01:00
Bjarne Fyrstenborg fef9e3fde0 Ensure placeholder is same height as original rows 2017-12-29 22:49:06 +01:00
Bjarne Fyrstenborg e849d2d0d0 Add required ng-model to ui-sortable 2017-12-29 22:48:14 +01:00
Bjarne Fyrstenborg 9a6123579f Fix collapsed columns in row when sorting 2017-12-29 22:47:29 +01:00
Jan van Helvoort 591a881283 Filtering of Grid Editors
If there are more than 15 items, 5 rows of 3, then show the filter.
2017-12-24 15:48:16 +01:00
Anders Bjerner 1554d52ea9 Triggers the save button to momentarily show an error icon 2017-12-20 21:51:59 +01:00
Shannon 60924d93fb U4-9291 TypedSearch should have an overload specifying pager values, page size, page index, and with an out param to return the total number of results 2017-12-15 17:24:54 +11:00
Søren Gregersen 50335723b0 Fix for U4-10733 2017-12-06 10:09:40 +01:00
Karl Tynan 58697eaa04 Merge pull request #1 from karltynan/karltynan-patch-1
Added small to allowed TinyMCE valid elements
2017-11-21 15:20:06 +00:00
Karl Tynan ce58ad91b5 Added `small` to allowed TinyMCE valid elements
We use ``small`` a lot in the RTE, and ``small`` is now considered a really useful tag in HTML5. I would like to see this in the default valid elements list for people to use out-of-the box.
2017-11-21 15:18:42 +00:00
Mario Lopez 5678be0db9 Merge remote-tracking branch 'Umbraco/dev-v7' into dev-v7 2017-11-10 09:37:00 +11:00
Marcin Zajkowski e14aba3875 More no-dirty-checks and code polishment 2017-11-07 23:21:50 +01:00
Matt Darby 77162e4b51 Move val-email attribute before required attribute 2017-11-07 19:17:42 +07:00
Marcin Zajkowski 0df7767f4a Added no-dirty-check to search fields in all dialogs 2017-11-02 17:32:20 +01:00
Mario Lopez 464a227af1 Merge pull request #1 from umbraco/dev-v7
Update from  original
2017-10-08 15:45:13 +11:00
Kevin Giszewski 6c172702be Fix for U4-6309 2017-09-27 11:32:36 -04:00
jf 7566546fd7 fix U4-8792 override overflow 2016-11-03 17:32:24 +00:00
Shane Marsden 59b8b397b7 Renamed SerializeToCropDataSet to DeserializeToCropDataSet 2016-11-03 11:33:00 +00:00
Kevin Jump ae110c1cae Honour ConfigSource when setting ConnectionString
Lets umbraco honour the configSource attribute on a connectionstrings
section, meaning you can install the connectionstring into a file other
than web.config.
2016-08-23 08:45:30 +01:00
Neil Gaietto 3f1f67e323 U4-8822- Fixes Unpublish error with empty RTE by passing an empty value instead of null 2016-08-16 09:30:05 -04:00
Kamil Jakubczak f1d37a5072 removes a overflow: hidden which decrease update-tree-layer performance
removes a overflow: hidden which decrease update-tree-layer performance.
If it is required it should be solved differently due to the possibility
of having plenty items in div that has this class.
2016-06-09 15:01:26 +02:00
Mitton 7c72e70967 Added grid editor names for localization. 2016-05-05 05:42:33 +02:00
Mitton 75b74a6687 Enabled localization of grid editor names 2016-05-05 05:12:33 +02:00
mattbrailsford 7dcb4435d8 Updated insert macro dialog to prevent closing on enter key 2015-12-22 11:18:32 +00:00
bjarnef 2dc6e395a8 Add more colors to icon-picker dialog 2015-11-16 01:15:51 +01:00
bjarnef eedeb90673 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7-U4-6616 2015-11-16 01:12:49 +01:00
bjarnef 977c390a95 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7-U4-6616 2015-11-09 23:52:00 +01:00
422 changed files with 13088 additions and 6611 deletions
+11 -5
View File
@@ -1,10 +1,16 @@
root=true
# editorconfig.org
# top-most EditorConfig file
root = true
# Default settings:
# A newline ending every file
# Use 4 spaces as indentation
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.{cs,cshtml,csx,vb,vbx,vbhtml,fs,fsx,txt,ps1,sql}]
indent_size = 4
# Trim trailing whitespace, limited support.
# https://github.com/editorconfig/editorconfig/wiki/Property-research:-Trim-trailing-spaces
trim_trailing_whitespace = true
+49
View File
@@ -0,0 +1,49 @@
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.jpg binary
*.png binary
*.gif binary
*.cs text=auto diff=csharp
*.vb text=auto
*.c text=auto
*.cpp text=auto
*.cxx text=auto
*.h text=auto
*.hxx text=auto
*.py text=auto
*.rb text=auto
*.java text=auto
*.html text=auto
*.htm text=auto
*.css text=auto
*.scss text=auto
*.sass text=auto
*.less text=auto
*.js text=auto
*.lisp text=auto
*.clj text=auto
*.sql text=auto
*.php text=auto
*.lua text=auto
*.m text=auto
*.asm text=auto
*.erl text=auto
*.fs text=auto
*.fsx text=auto
*.hs text=auto
*.csproj text=auto merge=union
*.vbproj text=auto merge=union
*.fsproj text=auto merge=union
*.dbproj text=auto merge=union
*.sln text=auto eol=crlf merge=union
+1
View File
@@ -113,6 +113,7 @@ build/ApiDocs/*
build/ApiDocs/Output/*
src/Umbraco.Web.UI.Client/bower_components/*
/src/Umbraco.Web.UI/Umbraco/preview
/src/Umbraco.Web.UI/Umbraco/preview.old
#Ignore Rule for output of generated documentation files from Grunt docserve
src/Umbraco.Web.UI.Client/docs/api
+80
View File
@@ -0,0 +1,80 @@
# Code of Conduct
## 1. Purpose
A primary goal of Umbraco CMS is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).
This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.
We invite all those who participate in Umbraco CMS to help us create safe and positive experiences for everyone.
## 2. Open Source Citizenship
A supplemental goal of this Code of Conduct is to increase open source citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community.
Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society.
If you see someone who is making an extra effort to ensure our community is welcoming, friendly, and encourages all participants to contribute to the fullest extent, we want to know.
## 3. Expected Behavior
The following behaviors are expected and requested of all community members:
* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community.
* Exercise consideration and respect in your speech and actions.
* Attempt collaboration before conflict.
* Refrain from demeaning, discriminatory, or harassing behavior and speech.
* Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential.
* Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations.
## 4. Unacceptable Behavior
The following behaviors are considered harassment and are unacceptable within our community:
* Violence, threats of violence or violent language directed against another person.
* Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language.
* Posting or displaying sexually explicit or violent material.
* Posting or threatening to post other peoples personally identifying information ("doxing").
* Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
* Inappropriate photography or recording.
* Inappropriate physical contact. You should have someones consent before touching them.
* Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances.
* Deliberate intimidation, stalking or following (online or in person).
* Advocating for, or encouraging, any of the above behavior.
* Sustained disruption of community events, including talks and presentations.
## 5. Consequences of Unacceptable Behavior
Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated.
Anyone asked to stop unacceptable behavior is expected to comply immediately.
If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event).
## 6. Reporting Guidelines
If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. Please contact Sebastiaan Janssen - [sj@umbraco.dk](mailto:sj@umbraco.dk).
Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress.
## 7. Addressing Grievances
If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify Umbraco with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.
## 8. Scope
We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venuesonline and in-personas well as in all one-on-one communications pertaining to community business.
This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members.
## 9. Contact info
Sebastiaan Janssen - [sj@umbraco.dk](mailto:sj@umbraco.dk)
## 10. License and attribution
This Code of Conduct is distributed under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).
Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).
Retrieved on November 22, 2016 from [http://citizencodeofconduct.org/](http://citizencodeofconduct.org/)
+207
View File
@@ -0,0 +1,207 @@
# Contributing to Umbraco CMS
👍🎉 First off, thanks for taking the time to contribute! 🎉👍
The following is a set of guidelines for contributing to Umbraco CMS.
These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
Remember, we're a friendly bunch and are happy with whatever contribution you might provide. Below are guidelines for success that we've gathered over the years. If you choose to ignore them then we still love you 💖.
#### Table Of Contents
[Code of Conduct](#code-of-conduct)
[How Can I Contribute?](#how-can-i-contribute)
* [Reporting Bugs](#reporting-bugs)
* [Suggesting Enhancements](#suggesting-enhancements)
* [Your First Code Contribution](#your-first-code-contribution)
* [Pull Requests](#pull-requests)
[Styleguides](#styleguides)
[What should I know before I get started?](#what-should-i-know-before-i-get-started)
* [Working with the source code](#working-with-the-source-code)
* [What branch should I target for my contributions?](#what-branch-should-i-target-for-my-contributions)
* [Building Umbraco from source code](#building-umbraco-from-source-code)
* [Keeping your Umbraco fork in sync with the main repository](#keeping-your-umbraco-fork-in-sync-with-the-main-repository)
[How do I even begin?](#how-do-i-even-begin)
[Problems?](#problems)
[Credits](#credits)
## Code of Conduct
This project and everyone participating in it is governed by the [our Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [Sebastiaan Janssen - sj@umbraco.dk](mailto:sj@umbraco.dk).
## How Can I Contribute?
### Reporting Bugs
This section guides you through submitting a bug report for Umbraco CMS. Following these guidelines helps maintainers and the community understand your report 📝, reproduce the behavior 💻 💻, and find related reports 🔎.
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](ISSUE_TEMPLATE.md), the information it asks for helps us resolve issues faster.
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
##### Before Submitting A Bug Report
* Most importantly, check **if you can reproduce the problem** in the [latest version of Umbraco](https://our.umbraco.org/download/). We might have already fixed your particular problem.
* It also helps tremendously to check if the issue you're experiencing is present in **a clean install** of the Umbraco version you're currently using. Custom code can have side-effects that don't occur in a clean install.
* **Use the Google**. Whatever you're experiencing, Google it plus "Umbraco" - usually you can get some pretty good hints from the search results, including open issues and further troubleshooting hints.
* If you do find and existing issue has **and the issue is still open**, add a comment to the existing issue if you have additional information. If you have the same problem and no new info to add, just "star" the issue.
Explain the problem and include additional details to help maintainers reproduce the problem. The following is a long description which we've boiled down into a few very simple question in the issue tracker when you create a new issue. We're listing the following hints to indicate that the most successful reports usually have a lot of this ground covered:
* **Use a clear and descriptive title** for the issue to identify the problem.
* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining which steps you took in the backoffice to get to a certain undesireable result, e.g. you created a document type, inherting 3 levels deep, added a certain datatype, tried to save it and you got an error.
* **Provide specific examples to demonstrate the steps**. If you wrote some code, try to provide a code sample as specific as possible to be able to reproduce the behavior.
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
* **Explain which behavior you expected to see instead and why.**
Provide more context by answering these questions:
* **Can you reproduce the problem** when `debug="false"` in your `web.config` file?
* **Did the problem start happening recently** (e.g. after updating to a new version of Umbraco) or was this always a problem?
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
Include details about your configuration and environment:
* **Which version of Umbraco are you using?**
* **What is the environment you're using Umbraco in?** Is this a problem on your local machine or on a server. Tell us about your configuration: Windows version, IIS/IISExpress, database type, etc.
* **Which packages do you have installed?**
### Suggesting Enhancements
This section guides you through submitting an enhancement suggestion for Atom, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion 📝 and find related suggestions 🔎.
Most of the suggestions in the [reporting bugs](#reporting-bugs) section also count for suggesting enhancements.
Some additional hints that may be helpful:
* **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of Umbraco which the suggestion is related to.
* **Explain why this enhancement would be useful to most Umbraco users** and isn't something that can or should be implemented as a [community package](https://our.umbraco.org/projects/).
### Your First Code Contribution
Unsure where to begin contributing to Umbraco? You can start by looking through [these `Up for grabs` and issues](http://issues.umbraco.org/issues/U4?q=%28project%3A+%7BU4%7D+Difficulty%3A+%7BVery+Easy%7D+%23Easy+%23Unresolved+Priority%3A+Normal+%23Major+%23Show-stopper+State%3A+-%7BIn+Progress%7D+sort+by%3A+votes+Affected+versions%3A+-6.*+Affected+versions%3A+-4.*%29+OR+%28tag%3A+%7BUp+For+Grabs%7D+%23Unresolved+%29).
The issue list is sorted by total number of upvotes. While not perfect, number of upvotes is a reasonable proxy for impact a given change will have.
### Pull Requests
The most successful pull requests usually look a like this:
* Fill in the required template
* Include screenshots and animated GIFs in your pull request whenever possible.
* Unit tests, while optional are awesome, thank you!
* New code is commented with documentation from which [the reference documentation](https://our.umbraco.org/documentation/Reference/) is generated
Again, these are guidelines, not strict requirements.
## Styleguides
To be honest, we don't like rules very much. We trust you have the best of intentions and we encourage you to create working code. If it doesn't look perfect then we'll happily help clean it up.
That said, the Umbraco development team likes to follow the hints that ReSharper gives us (no problem if you don't have this installed) and we've added a `.editorconfig` file so that Visual Studio knows what to do with whitespace, line endings, etc.
## What should I know before I get started?
### Working with the source code
Some parts of our source code is over 10 years old now. And when we say "old", we mean "mature" of course!
There's two big areas that you should know about:
1. The Umbraco backoffice is a extensible AngularJS app and requires you to run a `gulp dev` command while you're working with it, so changes are copied over to the appropriate directories and you can refresh your browser to view the results of your changes.
You may need to run the following commands to set up gulp properly:
```
npm cache clean
npm install -g bower
npm install -g gulp
npm install -g gulp-cli
npm install
gulp build
```
2. "The rest" is a C# based codebase, with some traces of our WebForms past but mostly ASP.NET MVC based these days. You can make changes, build them in Visual Studio, and hit `F5` to see the result.
To find the general areas of something you're looking to fix or improve, have a look at the following two parts of the API documentation.
* [The AngularJS based backoffice files](https://our.umbraco.org/apidocs/ui/#/api) (to be found in `src\Umbraco.Web.UI.Client\src`)
* [The rest](https://our.umbraco.org/apidocs/csharp/)
### What branch should I target for my contributions?
We like to use [Gitflow as much as possible](https://jeffkreeftmeijer.com/git-flow/), don't worry if you are not familiar with it. The most important thing you need to know is that when you fork the Umbraco repository, the default branch is set to something, usually `dev-v7`. Whatever the default is, that's where we'd like you to target your contributions.
![What branch do you want me to target?](tools/contributing/defaultbranch.png)
### Building Umbraco from source code
The easiest way to get started is to run `build.bat` which will build both the backoffice (also known as "Belle") and the Umbraco core. You can then easily start debugging from Visual Studio, or if you need to debug Belle you can run `gulp dev` in `src\Umbraco.Web.UI.Client`. See [this page](BUILD.md) for more details.
Alternatively, you can open `src\umbraco.sln` in Visual Studio 2017 ([the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects). In Visual Studio, find the Task Runner Explorer (in the View menu under Other Windows) and run the build task under the gulpfile.
![Gulp build in Visual Studio](tools/contributing/gulpbuild.png)
After this build completes, you should be able to hit `F5` in Visual Studio to build and run the project. A IISExpress webserver will start and the Umbraco installer will pop up in your browser, follow the directions there to get a working Umbraco install up and running.
### Keeping your Umbraco fork in sync with the main repository
We recommend you sync with our repository before you submit your pull request. That way, you can fix any potential merge conflicts and make our lives a little bit easier.
Also, if you've submitted a pull request three weeks ago and want to work on something new, you'll want to get the latest code to build against of course.
To sync your fork with this original one, you'll have to add the upstream url, you only have to do this once:
```
git remote add upstream https://github.com/umbraco/Umbraco-CMS.git
```
Then when you want to get the changes from the main repository:
```
git fetch upstream
git rebase upstream/dev-v7
```
In this command we're syncing with the `dev-v7` branch, but you can of course choose another one if needed.
(More info on how this works: [http://robots.thoughtbot.com/post/5133345960/keeping-a-git-fork-updated](http://robots.thoughtbot.com/post/5133345960/keeping-a-git-fork-updated))
## How do I even begin?
Great question! The short version goes like this:
* **Fork** - create a fork of [`Umbraco-CMS` on GitHub](https://github.com/umbraco/Umbraco-CMS)
![Fork the repository](tools/contributing/forkrepository.png)
* **Clone** - when GitHub has created your fork, you can clone it in your favorite Git tool
![Clone the fork](tools/contributing/clonefork.png)
* **Build** - build your fork of Umbraco locally as described in [building Umbraco from source code](#building-umbraco-from-source-code)
* **Change** - make your changes, experiment, have fun, explore and learn, and don't be afraid. We welcome all contributions and will happily give feedback
* **Commit** - done? Yay! 🎉 It is recommended to create a new branch now and name it after the issue you're fixing, we usually follow the format: `temp-U4-12345`. This means it's a temporary branch for the particular issue you're working on, in this case `U4-12345`
* **Push** - great, now you can push the changes up to your fork on GitHub
* **Create pull request** - exciting! You're ready to show us your changes (or not quite ready, you just need some feedback to progress). GitHub has picked up on the new branch you've pushed and will offer to create a Pull Request. Click that green button and away you go.
![Create a pull request](tools/contributing/createpullrequest.png)
The Umbraco development team can now start reviewing your proposed changes and give you feedback on them. If it's not perfect, we'll either fix up what we need or we can request you to make some additional changes.
If you make the corrections we ask for in the same branch and push them to your fork again, the pull request automatically updates with the additional commit(s) so we can review it again. If all is well, we'll merge the code and your commits are forever part of Umbraco!
Not all changes are wanted so on occassion we might close a PR without merging it. We will give you feedback why we can't accept your changes at this and we'll be nice about it, thanking you for spending your valueable time.
Remember, if an issue is in the `Up for grabs` list or you've asked for some feedback before you send us a PR, your PR will not be closed as unwanted.
## Problems?
Did something not work as expected? Try leaving a note in the ["Contributing to Umbraco"](https://our.umbraco.org/forum/contributing-to-umbraco-cms/) forum, the team monitors that one closely!
## Credits
This contribution guide borrows heavily from the excellent work on [the Atom contribution guide](https://github.com/atom/atom/blob/master/CONTRIBUTING.md). A big [#h5yr](http://h5yr.com/) to them!
+11
View File
@@ -0,0 +1,11 @@
### Prerequisites
- [ ] I have written a descriptive pull-request title
- [ ] I have linked this PR to an issue on the tracker at http://issues.umbraco.org
### Description
<!-- A description of the changes proposed in the pull-request -->
<!-- Thanks for contributing to Umbraco CMS! -->
+13 -18
View File
@@ -6,21 +6,14 @@ The friendliest, most flexible and fastest growing ASP.NET CMS used by more than
[![ScreenShot](vimeo.png)](https://vimeo.com/172382998/)
## Umbraco CMS ##
## Umbraco CMS
Umbraco is a free open source Content Management System built on the ASP.NET platform. Our mission is to help you deliver delightful digital experiences by making Umbraco friendly, simpler and social.
## Building Umbraco from source ##
The easiest way to get started is to run `build.bat` which will build both the backoffice (also known as "Belle") and the Umbraco core. You can then easily start debugging from Visual Studio, or if you need to debug Belle you can run `gulp dev` in `src\Umbraco.Web.UI.Client`. See [this page](BUILD.md) for more details.
Note that you can always [download a nightly build](http://nightly.umbraco.org/?container=umbraco-750) so you don't have to build the code yourself.
## Watch an introduction video ##
## Watch an introduction video
[![ScreenShot](http://umbraco.com/images/whatisumbraco.png)](https://umbraco.tv/videos/umbraco-v7/content-editor/basics/introduction/cms-explanation/)
## Umbraco - The Friendly CMS ##
## Umbraco - The Friendly CMS
For the first time on the Microsoft platform, there is a free user and developer friendly CMS that makes it quick and easy to create websites - or a breeze to build complex web applications. Umbraco has award-winning integration capabilities and supports ASP.NET MVC or Web Forms, including User and Custom Controls, out of the box.
@@ -30,22 +23,24 @@ Used by more than 443,000 active websites including Carlsberg, Segway, Amazon an
To view more examples, please visit [https://umbraco.com/why-umbraco/#caseStudies](https://umbraco.com/why-umbraco/#caseStudies)
## Why Open Source? ##
## Why Open Source?
As an Open Source platform, Umbraco is more than just a CMS. We are transparent with our roadmap for future versions, our incremental sprint planning notes are publicly accessible and community contributions and packages are available for all to use.
## Downloading ##
## Trying out Umbraco CMS
The downloadable Umbraco releases live at [https://our.umbraco.org/download](https://our.umbraco.org/download).
[Umbraco Cloud](https://umbraco.com) is the easiest and fastest way to use Umbraco yet with full support for all your custom .NET code and intergrations. You're up and running in less than a minute and your life will be made easier with automated upgrades and a built-in deployment engine. We offer a free 14 day trial, no credit card needed.
## Forums ##
If you want to DIY you can [download Umbraco](https://our.umbraco.org/download) either as a ZIP file or via NuGet. It's the same version of Umbraco CMS that powers Umbraco Cloud, but you'll need to find a place to host yourself and handling deployments and upgrades is all down to you.
Peer-to-peer support is available 24/7 at the community forum on [https://our.umbraco.org](https://our.umbraco.org).
## Community
## Contribute to Umbraco ##
Our friendly community is available 24/7 at the community hub we call ["Our Umbraco"](https://our.umbraco.org). Our Umbraco feature forums for questions and answers, documentation, downloadable plugins for Umbraco and a rich collection of community resources.
Umbraco is contribution focused and community driven. If you want to contribute back to Umbraco please check out our [guide to contributing](https://our.umbraco.org/contribute).
## Contribute to Umbraco
## Found a bug? ##
Umbraco is contribution focused and community driven. If you want to contribute back to Umbraco please check out our [guide to contributing](CONTRIBUTING.md).
## Found a bug?
Another way you can contribute to Umbraco is by providing issue reports. For information on how to submit an issue report refer to our [online guide for reporting issues](https://our.umbraco.org/contribute/report-an-issue-or-request-a-feature).
@@ -44,7 +44,7 @@ function Build-UmbracoDocs
# change baseUrl
$baseUrl = "https://our.umbraco.org/apidocs/ui/"
$indexPath = "$src/Umbraco.Web.UI.Client/docs/api/index.html"
(Get-Content $indexPath).Replace("location.href.replace(rUrl, indexFile)", "'$baseUrl'") `
(Get-Content $indexPath).Replace("origin + location.href.substr(origin.length).replace(rUrl, indexFile)", "'$baseUrl'") `
| Set-Content $indexPath
# restore
@@ -100,8 +100,9 @@ function Get-DocFx($uenv, $buildTemp)
$docFx = "$buildTemp\docfx"
if (-not (test-path $docFx))
{
Write-Host "Download DocFx..."
$source = "https://github.com/dotnet/docfx/releases/download/v2.19.2/docfx.zip"
Write-Host "Download DocFx from $source"
Invoke-WebRequest $source -OutFile "$buildTemp\docfx.zip"
&$uenv.Zip x "$buildTemp\docfx.zip" -o"$buildTemp\docfx" -aos > $nul
@@ -8,6 +8,7 @@ function Get-UmbracoBuildEnv
# store tools in the module's directory
# and cache them for two days
$path = "$PSScriptRoot\temp"
$src = "$PSScriptRoot\..\..\..\src"
$cache = 2
if (-not (test-path $path))
@@ -37,7 +38,7 @@ function Get-UmbracoBuildEnv
if (-not (test-path $sevenZip))
{
Write-Host "Download 7-Zip..."
&$nuget install 7-Zip.CommandLine -OutputDirectory $path -Verbosity quiet
&$nuget install 7-Zip.CommandLine -configFile "$src\NuGet.config" -OutputDirectory $path -Verbosity quiet
$dir = ls "$path\7-Zip.CommandLine.*" | sort -property Name -descending | select -first 1
$file = ls -path "$dir" -name 7za.exe -recurse
$file = ls -path "$dir" -name 7za.exe -recurse | select -first 1 #A select is because there is tools\7za.exe & tools\x64\7za.exe
@@ -54,7 +55,7 @@ function Get-UmbracoBuildEnv
if (-not (test-path $vswhere))
{
Write-Host "Download VsWhere..."
&$nuget install vswhere -OutputDirectory $path -Verbosity quiet
&$nuget install vswhere -configFile "$src\NuGet.config" -OutputDirectory $path -Verbosity quiet
$dir = ls "$path\vswhere.*" | sort -property Name -descending | select -first 1
$file = ls -path "$dir" -name vswhere.exe -recurse
mv "$dir\$file" $vswhere
@@ -70,7 +71,7 @@ function Get-UmbracoBuildEnv
if (-not (test-path $semver))
{
Write-Host "Download Semver..."
&$nuget install semver -OutputDirectory $path -Verbosity quiet
&$nuget install semver -configFile "$src\NuGet.config" -OutputDirectory $path -Verbosity quiet
$dir = ls "$path\semver.*" | sort -property Name -descending | select -first 1
$file = "$dir\lib\net452\Semver.dll"
if (-not (test-path $file))
@@ -239,18 +239,18 @@ function Prepare-Tests
# data
Write-Host "Copy data files"
if( -Not (Test-Path -Path "$tmp\tests\Packaging" ) )
if (-Not (Test-Path -Path "$tmp\tests\Packaging" ) )
{
Write-Host "Create packaging directory"
New-Item -ItemType directory -Path "$tmp\tests\Packaging"
mkdir "$tmp\tests\Packaging" > $null
}
Copy-Files "$src\Umbraco.Tests\Packaging\Packages" "*" "$tmp\tests\Packaging\Packages"
# required for package install tests
if( -Not (Test-Path -Path "$tmp\tests\bin" ) )
if (-Not (Test-Path -Path "$tmp\tests\bin" ) )
{
Write-Host "Create bin directory"
New-Item -ItemType directory -Path "$tmp\tests\bin"
mkdir "$tmp\tests\bin" > $null
}
}
@@ -376,7 +376,7 @@ function Prepare-Packages
Copy-Files "$src\Umbraco.Web.UI\umbraco\js" "*" "$tmp\WebApp\umbraco\js"
Copy-Files "$src\Umbraco.Web.UI\umbraco\lib" "*" "$tmp\WebApp\umbraco\lib"
Copy-Files "$src\Umbraco.Web.UI\umbraco\views" "*" "$tmp\WebApp\umbraco\views"
Copy-Files "$src\Umbraco.Web.UI\umbraco\preview" "*" "$tmp\WebApp\umbraco\preview"
}
#
@@ -445,7 +445,7 @@ function Restore-NuGet
Write-Host ">> Restore NuGet"
Write-Host "Logging to $tmp\nuget.restore.log"
&$uenv.NuGet restore "$src\Umbraco.sln" > "$tmp\nuget.restore.log"
&$uenv.NuGet restore "$src\Umbraco.sln" -configfile "$src\NuGet.config" > "$tmp\nuget.restore.log"
}
#
+2 -1
View File
@@ -28,7 +28,7 @@
<dependency id="HtmlAgilityPack" version="[1.4.9.5, 2.0.0)" />
<dependency id="Lucene.Net" version="[2.9.4.1, 3.0.0.0)" />
<dependency id="MySql.Data" version="[6.9.9, 7.0.0)" />
<dependency id="ClientDependency" version="[1.9.2, 2.0.0)" />
<dependency id="ClientDependency" version="[1.9.6, 2.0.0)" />
<dependency id="ClientDependency-Mvc5" version="[1.8.0.0, 2.0.0)" />
<dependency id="AutoMapper" version="[3.3.1, 4.0.0)" />
<dependency id="Newtonsoft.Json" version="[10.0.2, 11.0.0)" />
@@ -39,6 +39,7 @@
<!-- Markdown can not be updated due to: https://github.com/hey-red/markdownsharp/issues/71#issuecomment-233585487 -->
<dependency id="Markdown" version="[1.14.7, 2.0.0)" />
<dependency id="System.Threading.Tasks.Dataflow" version="[4.7.0, 5.0.0)" />
<dependency id="System.ValueTuple" version="[4.4.0, 5.0.0)" />
</dependencies>
</metadata>
<files>
+2 -2
View File
@@ -17,7 +17,7 @@
<dependencies>
<dependency id="UmbracoCms.Core" version="[$version$]" />
<dependency id="Newtonsoft.Json" version="[10.0.2, 11.0.0)" />
<dependency id="Umbraco.ModelsBuilder" version="[3.0.8, 4.0.0)" />
<dependency id="Umbraco.ModelsBuilder" version="[3.0.10, 4.0.0)" />
<dependency id="Microsoft.AspNet.SignalR.Core" version="[2.2.1, 3.0.0)" />
<dependency id="ImageProcessor.Web.Config" version="[2.3.1, 3.0.0)" />
</dependencies>
@@ -32,7 +32,7 @@
<file src="$BuildTmp$\WebApp\bin\amd64\**" target="UmbracoFiles\bin\amd64" />
<file src="$BuildTmp$\WebApp\bin\x86\**" target="UmbracoFiles\bin\x86" />
<file src="$BuildTmp$\WebApp\config\splashes\**" target="UmbracoFiles\Config\splashes" />
<file src="$BuildTmp$\WebApp\config\BackOfficeTours\**" target="UmbracoFiles\Config\BackOfficeTours" />
<file src="$BuildTmp$\WebApp\config\BackOfficeTours\**" target="Content\Config\BackOfficeTours" />
<file src="$BuildTmp$\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
<file src="$BuildTmp$\WebApp\umbraco_client\**" target="UmbracoFiles\umbraco_client" />
<file src="$BuildTmp$\WebApp\Media\Web.config" target="Content\Media\Web.config" />
+1 -1
View File
@@ -8,7 +8,7 @@
----------------------------------------------------
*** IMPORTANT NOTICE FOR 7.7 UPGRADES ***
*** IMPORTANT NOTICE FOR UPGRADES FROM VERSIONS BELOW 7.7.0 ***
Be sure to read the version specific upgrade information before proceeding:
https://our.umbraco.org/documentation/Getting-Started/Setup/Upgrading/version-specific#version-7-7-0
+41
View File
@@ -98,10 +98,51 @@ if ($project) {
$umbracoUIXMLDestination = Join-Path $projectPath "Umbraco\Config\Create\UI.xml"
Copy-Item $umbracoUIXMLSource $umbracoUIXMLDestination -Force
} else {
# This part only runs for upgrades
$upgradeViewSource = Join-Path $umbracoFolderSource "Views\install\*"
$upgradeView = Join-Path $umbracoFolder "Views\install\"
Write-Host "Copying2 ${upgradeViewSource} to ${upgradeView}"
Copy-Item $upgradeViewSource $upgradeView -Force
Try
{
# Disable tours for upgrades, presumably Umbraco experience is already available
$umbracoSettingsConfigPath = Join-Path $configFolder "umbracoSettings.config"
$content = (Get-Content $umbracoSettingsConfigPath).Replace('<tours enable="true">','<tours enable="false">')
# Saves with UTF-8 encoding without BOM which makes sure Umbraco can still read it
# Reference: https://stackoverflow.com/a/32951824/5018
[IO.File]::WriteAllLines($umbracoSettingsConfigPath, $content)
}
Catch
{
# Not a big problem if this fails, let it go
}
Try
{
$uiXmlConfigPath = Join-Path $umbracoFolder -ChildPath "Config" | Join-Path -ChildPath "create" | Join-Path -ChildPath "UI.xml"
$uiXmlFile = Join-Path $umbracoFolder -ChildPath "Config" | Join-Path -ChildPath "create" | Join-Path -ChildPath "UI.xml"
$uiXml = New-Object System.Xml.XmlDocument
$uiXml.PreserveWhitespace = $true
$uiXml.Load($uiXmlFile)
$createExists = $uiXml.SelectNodes("//nodeType[@alias='macros']/tasks/create")
if($createExists.Count -eq 0)
{
$macrosTasksNode = $uiXml.SelectNodes("//nodeType[@alias='macros']/tasks")
#Creating: <create assembly="umbraco" type="macroTasks" />
$createNode = $uiXml.CreateElement("create")
$createNode.SetAttribute("assembly", "umbraco")
$createNode.SetAttribute("type", "macroTasks")
$macrosTasksNode.AppendChild($createNode)
$uiXml.Save($uiXmlFile)
}
}
Catch { }
}
$installFolder = Join-Path $projectPath "Install"
+1 -1
View File
@@ -2,6 +2,6 @@
<configuration>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="umbracocore" value="http://www.myget.org/f/umbracocore/" />
<add key="umbracocore" value="https://www.myget.org/F/umbracocore/api/v3/index.json" />
</packageSources>
</configuration>
+2 -2
View File
@@ -11,5 +11,5 @@ using System.Resources;
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("7.8.0")]
[assembly: AssemblyInformationalVersion("7.8.0-beta004")]
[assembly: AssemblyFileVersion("7.10.1")]
[assembly: AssemblyInformationalVersion("7.10.1")]
@@ -0,0 +1,351 @@
using System;
using System.Linq;
using System.Text;
using System.Threading;
using System.Web;
using Umbraco.Core.Events;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Security;
using Umbraco.Core.Services;
namespace Umbraco.Core.Auditing
{
public sealed class AuditEventHandler : ApplicationEventHandler
{
private IAuditService _auditServiceInstance;
private IUserService _userServiceInstance;
private IEntityService _entityServiceInstance;
private IUser CurrentPerformingUser
{
get
{
var identity = Thread.CurrentPrincipal?.GetUmbracoIdentity();
return identity == null
? new User { Id = 0, Name = "SYSTEM", Email = "" }
: _userServiceInstance.GetUserById(Convert.ToInt32(identity.Id));
}
}
private IUser GetPerformingUser(int userId)
{
var found = userId >= 0 ? _userServiceInstance.GetUserById(userId) : null;
return found ?? new User {Id = 0, Name = "SYSTEM", Email = ""};
}
private string PerformingIp
{
get
{
var httpContext = HttpContext.Current == null ? (HttpContextBase) null : new HttpContextWrapper(HttpContext.Current);
var ip = httpContext.GetCurrentRequestIpAddress();
if (ip.ToLowerInvariant().StartsWith("unknown")) ip = "";
return ip;
}
}
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
_auditServiceInstance = applicationContext.Services.AuditService;
_userServiceInstance = applicationContext.Services.UserService;
_entityServiceInstance = applicationContext.Services.EntityService;
//BackOfficeUserManager.AccountLocked += ;
//BackOfficeUserManager.AccountUnlocked += ;
BackOfficeUserManager.ForgotPasswordRequested += OnForgotPasswordRequest;
BackOfficeUserManager.ForgotPasswordChangedSuccess += OnForgotPasswordChange;
BackOfficeUserManager.LoginFailed += OnLoginFailed;
//BackOfficeUserManager.LoginRequiresVerification += ;
BackOfficeUserManager.LoginSuccess += OnLoginSuccess;
BackOfficeUserManager.LogoutSuccess += OnLogoutSuccess;
BackOfficeUserManager.PasswordChanged += OnPasswordChanged;
BackOfficeUserManager.PasswordReset += OnPasswordReset;
//BackOfficeUserManager.ResetAccessFailedCount += ;
UserService.SavedUserGroup2 += OnSavedUserGroupWithUsers;
UserService.SavedUser += OnSavedUser;
UserService.DeletedUser += OnDeletedUser;
UserService.UserGroupPermissionsAssigned += UserGroupPermissionAssigned;
MemberService.Saved += OnSavedMember;
MemberService.Deleted += OnDeletedMember;
MemberService.AssignedRoles += OnAssignedRoles;
MemberService.RemovedRoles += OnRemovedRoles;
MemberService.Exported += OnMemberExported;
}
private string FormatEmail(IMember member)
{
return member == null ? string.Empty : member.Email.IsNullOrWhiteSpace() ? "" : $"<{member.Email}>";
}
private string FormatEmail(IUser user)
{
return user == null ? string.Empty : user.Email.IsNullOrWhiteSpace() ? "" : $"<{user.Email}>";
}
private void OnRemovedRoles(IMemberService sender, RolesEventArgs args)
{
var performingUser = CurrentPerformingUser;
var roles = string.Join(", ", args.Roles);
var members = sender.GetAllMembers(args.MemberIds).ToDictionary(x => x.Id, x => x);
foreach (var id in args.MemberIds)
{
members.TryGetValue(id, out var member);
_auditServiceInstance.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
DateTime.UtcNow,
-1, $"Member {id} \"{member?.Name ?? "(unknown)"}\" {FormatEmail(member)}",
"umbraco/member/roles/removed", $"roles modified, removed {roles}");
}
}
private void OnAssignedRoles(IMemberService sender, RolesEventArgs args)
{
var performingUser = CurrentPerformingUser;
var roles = string.Join(", ", args.Roles);
var members = sender.GetAllMembers(args.MemberIds).ToDictionary(x => x.Id, x => x);
foreach (var id in args.MemberIds)
{
members.TryGetValue(id, out var member);
_auditServiceInstance.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
DateTime.UtcNow,
-1, $"Member {id} \"{member?.Name ?? "(unknown)"}\" {FormatEmail(member)}",
"umbraco/member/roles/assigned", $"roles modified, assigned {roles}");
}
}
private void OnMemberExported(IMemberService sender, ExportedMemberEventArgs exportedMemberEventArgs)
{
var performingUser = CurrentPerformingUser;
var member = exportedMemberEventArgs.Member;
_auditServiceInstance.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
DateTime.UtcNow,
-1, $"Member {member.Id} \"{member.Name}\" {FormatEmail(member)}",
"umbraco/member/exported", "exported member data");
}
private void OnSavedUserGroupWithUsers(IUserService sender, SaveEventArgs<UserGroupWithUsers> saveEventArgs)
{
var performingUser = CurrentPerformingUser;
foreach (var groupWithUser in saveEventArgs.SavedEntities)
{
var group = groupWithUser.UserGroup;
var dp = string.Join(", ", ((UserGroup)group).GetPreviouslyDirtyProperties());
var sections = ((UserGroup)group).WasPropertyDirty("AllowedSections")
? string.Join(", ", group.AllowedSections)
: null;
var perms = ((UserGroup)group).WasPropertyDirty("Permissions")
? string.Join(", ", group.Permissions)
: null;
var sb = new StringBuilder();
sb.Append($"updating {(string.IsNullOrWhiteSpace(dp) ? "(nothing)" : dp)};");
if (sections != null)
sb.Append($", assigned sections: {sections}");
if (perms != null)
{
if (sections != null)
sb.Append(", ");
sb.Append($"default perms: {perms}");
}
_auditServiceInstance.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
DateTime.UtcNow,
-1, $"User Group {group.Id} \"{group.Name}\" ({group.Alias})",
"umbraco/user-group/save", $"{sb}");
// now audit the users that have changed
foreach (var user in groupWithUser.RemovedUsers)
{
_auditServiceInstance.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
DateTime.UtcNow,
user.Id, $"User \"{user.Name}\" {FormatEmail(user)}",
"umbraco/user-group/save", $"Removed user \"{user.Name}\" {FormatEmail(user)} from group {group.Id} \"{group.Name}\" ({group.Alias})");
}
foreach (var user in groupWithUser.AddedUsers)
{
_auditServiceInstance.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
DateTime.UtcNow,
user.Id, $"User \"{user.Name}\" {FormatEmail(user)}",
"umbraco/user-group/save", $"Added user \"{user.Name}\" {FormatEmail(user)} to group {group.Id} \"{group.Name}\" ({group.Alias})");
}
}
}
private void UserGroupPermissionAssigned(IUserService sender, SaveEventArgs<EntityPermission> saveEventArgs)
{
var performingUser = CurrentPerformingUser;
var perms = saveEventArgs.SavedEntities;
foreach (var perm in perms)
{
var group = sender.GetUserGroupById(perm.UserGroupId);
var assigned = string.Join(", ", perm.AssignedPermissions);
var entity = _entityServiceInstance.Get(perm.EntityId);
_auditServiceInstance.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
DateTime.UtcNow,
-1, $"User Group {group.Id} \"{group.Name}\" ({group.Alias})",
"umbraco/user-group/permissions-change", $"assigning {(string.IsNullOrWhiteSpace(assigned) ? "(nothing)" : assigned)} on id:{perm.EntityId} \"{entity.Name}\"");
}
}
private void OnSavedMember(IMemberService sender, SaveEventArgs<IMember> saveEventArgs)
{
var performingUser = CurrentPerformingUser;
var members = saveEventArgs.SavedEntities;
foreach (var member in members)
{
var dp = string.Join(", ", ((Member) member).GetPreviouslyDirtyProperties());
_auditServiceInstance.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
DateTime.UtcNow,
-1, $"Member {member.Id} \"{member.Name}\" {FormatEmail(member)}",
"umbraco/member/save", $"updating {(string.IsNullOrWhiteSpace(dp) ? "(nothing)" : dp)}");
}
}
private void OnDeletedMember(IMemberService sender, DeleteEventArgs<IMember> deleteEventArgs)
{
var performingUser = CurrentPerformingUser;
var members = deleteEventArgs.DeletedEntities;
foreach (var member in members)
{
_auditServiceInstance.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
DateTime.UtcNow,
-1, $"Member {member.Id} \"{member.Name}\" {FormatEmail(member)}",
"umbraco/member/delete", $"delete member id:{member.Id} \"{member.Name}\" {FormatEmail(member)}");
}
}
private void OnSavedUser(IUserService sender, SaveEventArgs<IUser> saveEventArgs)
{
var performingUser = CurrentPerformingUser;
var affectedUsers = saveEventArgs.SavedEntities;
foreach (var affectedUser in affectedUsers)
{
var groups = affectedUser.WasPropertyDirty("Groups")
? string.Join(", ", affectedUser.Groups.Select(x => x.Alias))
: null;
var dp = string.Join(", ", ((User)affectedUser).GetPreviouslyDirtyProperties());
_auditServiceInstance.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
DateTime.UtcNow,
affectedUser.Id, $"User \"{affectedUser.Name}\" {FormatEmail(affectedUser)}",
"umbraco/user/save", $"updating {(string.IsNullOrWhiteSpace(dp) ? "(nothing)" : dp)}{(groups == null ? "" : "; groups assigned: " + groups)}");
}
}
private void OnDeletedUser(IUserService sender, DeleteEventArgs<IUser> deleteEventArgs)
{
var performingUser = CurrentPerformingUser;
var affectedUsers = deleteEventArgs.DeletedEntities;
foreach (var affectedUser in affectedUsers)
_auditServiceInstance.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
DateTime.UtcNow,
affectedUser.Id, $"User \"{affectedUser.Name}\" {FormatEmail(affectedUser)}",
"umbraco/user/delete", "delete user");
}
private void OnLoginSuccess(object sender, EventArgs args)
{
if (args is IdentityAuditEventArgs identityArgs)
{
var performingUser = GetPerformingUser(identityArgs.PerformingUser);
WriteAudit(performingUser, identityArgs.AffectedUser, identityArgs.IpAddress, "umbraco/user/sign-in/login", "login success");
}
}
private void OnLogoutSuccess(object sender, EventArgs args)
{
if (args is IdentityAuditEventArgs identityArgs)
{
var performingUser = GetPerformingUser(identityArgs.PerformingUser);
WriteAudit(performingUser, identityArgs.AffectedUser, identityArgs.IpAddress, "umbraco/user/sign-in/logout", "logout success");
}
}
private void OnPasswordReset(object sender, EventArgs args)
{
if (args is IdentityAuditEventArgs identityArgs && identityArgs.PerformingUser >= 0)
{
WriteAudit(identityArgs.PerformingUser, identityArgs.AffectedUser, identityArgs.IpAddress, "umbraco/user/password/reset", "password reset");
}
}
private void OnPasswordChanged(object sender, EventArgs args)
{
if (args is IdentityAuditEventArgs identityArgs && identityArgs.PerformingUser >= 0)
{
WriteAudit(identityArgs.PerformingUser, identityArgs.AffectedUser, identityArgs.IpAddress, "umbraco/user/password/change", "password change");
}
}
private void OnLoginFailed(object sender, EventArgs args)
{
if (args is IdentityAuditEventArgs identityArgs && identityArgs.PerformingUser >= 0)
{
WriteAudit(identityArgs.PerformingUser, 0, identityArgs.IpAddress, "umbraco/user/sign-in/failed", "login failed", affectedDetails: "");
}
}
private void OnForgotPasswordChange(object sender, EventArgs args)
{
if (args is IdentityAuditEventArgs identityArgs && identityArgs.PerformingUser >= 0)
{
WriteAudit(identityArgs.PerformingUser, identityArgs.AffectedUser, identityArgs.IpAddress, "umbraco/user/password/forgot/change", "password forgot/change");
}
}
private void OnForgotPasswordRequest(object sender, EventArgs args)
{
if (args is IdentityAuditEventArgs identityArgs && identityArgs.PerformingUser >= 0)
{
WriteAudit(identityArgs.PerformingUser, identityArgs.AffectedUser, identityArgs.IpAddress, "umbraco/user/password/forgot/request", "password forgot/request");
}
}
private void WriteAudit(int performingId, int affectedId, string ipAddress, string eventType, string eventDetails, string affectedDetails = null)
{
var performingUser = _userServiceInstance.GetUserById(performingId);
var performingDetails = performingUser == null
? $"User UNKNOWN:{performingId}"
: $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}";
WriteAudit(performingId, performingDetails, affectedId, ipAddress, eventType, eventDetails, affectedDetails);
}
private void WriteAudit(IUser performingUser, int affectedId, string ipAddress, string eventType, string eventDetails)
{
var performingDetails = performingUser == null
? $"User UNKNOWN"
: $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}";
WriteAudit(performingUser?.Id ?? 0, performingDetails, affectedId, ipAddress, eventType, eventDetails);
}
private void WriteAudit(int performingId, string performingDetails, int affectedId, string ipAddress, string eventType, string eventDetails, string affectedDetails = null)
{
if (affectedDetails == null)
{
var affectedUser = _userServiceInstance.GetUserById(affectedId);
affectedDetails = affectedUser == null
? $"User UNKNOWN:{affectedId}"
: $"User \"{affectedUser.Name}\" {FormatEmail(affectedUser)}";
}
_auditServiceInstance.Write(performingId, performingDetails,
ipAddress,
DateTime.UtcNow,
affectedId, affectedDetails,
eventType, eventDetails);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.ComponentModel;
using System.Threading;
using System.Web;
using Umbraco.Core.Security;
@@ -45,12 +46,8 @@ namespace Umbraco.Core.Auditing
/// </summary>
public string Username { get; private set; }
/// <summary>
/// Sets the properties on the event being raised, all parameters are optional except for the action being performed
/// </summary>
/// <param name="action">An action based on the AuditEvent enum</param>
/// <param name="ipAddress">The client's IP address. This is usually automatically set but could be overridden if necessary</param>
/// <param name="performingUser">The Id of the user performing the action (if different from the user affected by the action)</param>
[Obsolete("Use the method that has the affectedUser parameter instead")]
[EditorBrowsable(EditorBrowsableState.Never)]
public IdentityAuditEventArgs(AuditEvent action, string ipAddress, int performingUser = -1)
{
DateTimeUtc = DateTime.UtcNow;
@@ -63,6 +60,35 @@ namespace Umbraco.Core.Auditing
: performingUser;
}
/// <summary>
/// Default constructor
/// </summary>
/// <param name="action"></param>
/// <param name="ipAddress"></param>
/// <param name="comment"></param>
/// <param name="performingUser"></param>
/// <param name="affectedUser"></param>
public IdentityAuditEventArgs(AuditEvent action, string ipAddress, string comment = null, int performingUser = -1, int affectedUser = -1)
{
DateTimeUtc = DateTime.UtcNow;
Action = action;
IpAddress = ipAddress;
Comment = comment;
AffectedUser = affectedUser;
PerformingUser = performingUser == -1
? GetCurrentRequestBackofficeUserId()
: performingUser;
}
/// <summary>
/// Creates an instance without a performing or affected user (the id will be set to -1)
/// </summary>
/// <param name="action"></param>
/// <param name="ipAddress"></param>
/// <param name="username"></param>
/// <param name="comment"></param>
public IdentityAuditEventArgs(AuditEvent action, string ipAddress, string username, string comment)
{
DateTimeUtc = DateTime.UtcNow;
@@ -71,6 +97,22 @@ namespace Umbraco.Core.Auditing
IpAddress = ipAddress;
Username = username;
Comment = comment;
PerformingUser = -1;
}
public IdentityAuditEventArgs(AuditEvent action, string ipAddress, string username, string comment, int performingUser)
{
DateTimeUtc = DateTime.UtcNow;
Action = action;
IpAddress = ipAddress;
Username = username;
Comment = comment;
PerformingUser = performingUser == -1
? GetCurrentRequestBackofficeUserId()
: performingUser;
}
/// <summary>
@@ -146,7 +146,7 @@ namespace Umbraco.Core.Cache
#region Insert
#endregion
private class NoopLocker : DisposableObject
private class NoopLocker : DisposableObjectSlim
{
protected override void DisposeResources()
{ }
@@ -0,0 +1,61 @@
using System;
namespace Umbraco.Core.Collections
{
/// <summary>
/// Represents a composite key of (Type, Type) for fast dictionaries.
/// </summary>
internal struct CompositeTypeTypeKey : IEquatable<CompositeTypeTypeKey>
{
/// <summary>
/// Initializes a new instance of the <see cref="CompositeTypeTypeKey"/> struct.
/// </summary>
public CompositeTypeTypeKey(Type type1, Type type2) : this()
{
Type1 = type1;
Type2 = type2;
}
/// <summary>
/// Gets the first type.
/// </summary>
public Type Type1 { get; private set; }
/// <summary>
/// Gets the second type.
/// </summary>
public Type Type2 { get; private set; }
/// <inheritdoc/>
public bool Equals(CompositeTypeTypeKey other)
{
return Type1 == other.Type1 && Type2 == other.Type2;
}
/// <inheritdoc/>
public override bool Equals(object obj)
{
var other = obj is CompositeTypeTypeKey ? (CompositeTypeTypeKey)obj : default(CompositeTypeTypeKey);
return Type1 == other.Type1 && Type2 == other.Type2;
}
public static bool operator ==(CompositeTypeTypeKey key1, CompositeTypeTypeKey key2)
{
return key1.Type1 == key2.Type1 && key1.Type2 == key2.Type2;
}
public static bool operator !=(CompositeTypeTypeKey key1, CompositeTypeTypeKey key2)
{
return key1.Type1 != key2.Type1 || key1.Type2 != key2.Type2;
}
/// <inheritdoc/>
public override int GetHashCode()
{
unchecked
{
return (Type1.GetHashCode() * 397) ^ Type2.GetHashCode();
}
}
}
}
@@ -1,10 +1,14 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Web;
using System.Xml.Linq;
using ClientDependency.Core.CompositeFiles.Providers;
using ClientDependency.Core.Config;
using Semver;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
@@ -24,10 +28,74 @@ namespace Umbraco.Core.Configuration
_logger = logger;
_fileName = IOHelper.MapPath(string.Format("{0}/ClientDependency.config", SystemDirectories.Config));
}
/// <summary>
/// Changes the version number in ClientDependency.config to a hashed value for the version and the DateTime.Day
/// </summary>
/// <param name="version">The <see cref="SemVersion">version</see> of Umbraco we're upgrading to</param>
/// <param name="date">A <see cref="DateTime">date</see> value to use in the hash to prevent this method from updating the version on each startup</param>
/// <param name="dateFormat">Allows the developer to specify the <see cref="string">date precision</see> for the hash (i.e. "yyyyMMdd" would be a precision for the day)</param>
/// <returns>Boolean to indicate succesful update of the ClientDependency.config file</returns>
public bool UpdateVersionNumber(SemVersion version, DateTime date, string dateFormat)
{
var byteContents = Encoding.Unicode.GetBytes(version + date.ToString(dateFormat));
//This is a way to convert a string to a long
//see https://www.codeproject.com/Articles/34309/Convert-String-to-bit-Integer
//We could much more easily use MD5 which would create us an INT but since that is not compliant with
//hashing standards we have to use SHA
int intHash;
using (var hash = SHA256.Create())
{
var bytes = hash.ComputeHash(byteContents);
var longResult = new[] { 0, 8, 16, 24 }
.Select(i => BitConverter.ToInt64(bytes, i))
.Aggregate((x, y) => x ^ y);
//CDF requires an INT, and although this isn't fail safe, it will work for our purposes. We are not hashing for crypto purposes
//so there could be some collisions with this conversion but it's not a problem for our purposes
//It's also important to note that the long.GetHashCode() implementation in .NET is this: return (int) this ^ (int) (this >> 32);
//which means that this value will not change per appdomain like some GetHashCode implementations.
intHash = longResult.GetHashCode();
}
try
{
var clientDependencyConfigXml = XDocument.Load(_fileName, LoadOptions.PreserveWhitespace);
if (clientDependencyConfigXml.Root != null)
{
var versionAttribute = clientDependencyConfigXml.Root.Attribute("version");
//Set the new version to the hashcode of now
var oldVersion = versionAttribute.Value;
var newVersion = Math.Abs(intHash).ToString();
//don't update if it's the same version
if (oldVersion == newVersion)
return false;
versionAttribute.SetValue(newVersion);
clientDependencyConfigXml.Save(_fileName, SaveOptions.DisableFormatting);
_logger.Info<ClientDependencyConfiguration>(string.Format("Updated version number from {0} to {1}", oldVersion, newVersion));
return true;
}
}
catch (Exception ex)
{
_logger.Error<ClientDependencyConfiguration>("Couldn't update ClientDependency version number", ex);
}
return false;
}
/// <summary>
/// Changes the version number in ClientDependency.config to a random value to avoid stale caches
/// </summary>
/// <seealso cref="UpdateVersionNumber(SemVersion, DateTime, string)" />
[Obsolete("Use the UpdateVersionNumber method specifying the version, date and dateFormat instead")]
public bool IncreaseVersionNumber()
{
try
@@ -107,4 +175,4 @@ namespace Umbraco.Core.Configuration
return success;
}
}
}
}
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration
{
public class UmbracoVersion
{
private static readonly Version Version = new Version("7.8.0");
private static readonly Version Version = new Version("7.10.1");
/// <summary>
/// Gets the current version of Umbraco.
@@ -122,6 +122,11 @@ namespace Umbraco.Core
/// Alias for the Dropdown list, publishing keys datatype.
/// </summary>
public const string DropdownlistPublishingKeysAlias = "Umbraco.DropdownlistPublishingKeys";
/// <summary>
/// Alias for the "new" Dropdown list, that replaces the old four deprecated ones and works as other list based property editors
/// </summary>
public const string DropDownListFlexibleAlias = "Umbraco.DropDown.Flexible";
/// <summary>
/// Guid for the Folder browser datatype.
@@ -452,4 +457,4 @@ namespace Umbraco.Core
}
}
}
}
}
+2 -1
View File
@@ -9,6 +9,7 @@ namespace Umbraco.Core
{
public const string AdminGroupAlias = "admin";
public const string SensitiveDataGroupAlias = "sensitiveData";
public const string TranslatorGroupAlias = "translator";
public const string BackOfficeAuthenticationType = "UmbracoBackOffice";
@@ -36,4 +37,4 @@ namespace Umbraco.Core
}
}
}
}
+37 -1
View File
@@ -11,17 +11,53 @@
/// The integer identifier for global system root node.
/// </summary>
public const int Root = -1;
/// <summary>
/// The string identifier for global system root node.
/// </summary>
/// <remarks>Use this instead of re-creating the string everywhere.</remarks>
public const string RootString = "-1";
/// <summary>
/// The integer identifier for content's recycle bin.
/// </summary>
public const int RecycleBinContent = -20;
/// <summary>
/// The string identifier for content's recycle bin.
/// </summary>
/// <remarks>Use this instead of re-creating the string everywhere.</remarks>
public const string RecycleBinContentString = "-20";
/// <summary>
/// The string path prefix of the content's recycle bin.
/// </summary>
/// <remarks>
/// <para>Everything that is in the content recycle bin, has a path that starts with the prefix.</para>
/// <para>Use this instead of re-creating the string everywhere.</para>
/// </remarks>
public const string RecycleBinContentPathPrefix = "-1,-20,";
/// <summary>
/// The integer identifier for media's recycle bin.
/// </summary>
public const int RecycleBinMedia = -21;
/// <summary>
/// The string identifier for media's recycle bin.
/// </summary>
/// <remarks>Use this instead of re-creating the string everywhere.</remarks>
public const string RecycleBinMediaString = "-21";
/// <summary>
/// The string path prefix of the media's recycle bin.
/// </summary>
/// <remarks>
/// <para>Everything that is in the media recycle bin, has a path that starts with the prefix.</para>
/// <para>Use this instead of re-creating the string everywhere.</para>
/// </remarks>
public const string RecycleBinMediaPathPrefix = "-1,-21,";
public const int DefaultContentListViewDataTypeId = -95;
public const int DefaultMediaListViewDataTypeId = -96;
public const int DefaultMembersListViewDataTypeId = -97;
@@ -29,6 +65,6 @@
public const string UmbracoConnectionName = "umbracoDbDSN";
public const string UmbracoMigrationName = "Umbraco";
}
}
}
+16
View File
@@ -459,6 +459,22 @@ namespace Umbraco.Core
var xml = XDocument.Load(fileName, LoadOptions.PreserveWhitespace);
var connectionstrings = xml.Root.DescendantsAndSelf("connectionStrings").Single();
// honour configSource, if its set, change the xml file we are saving the configuration
// to the one set in the configSource attribute
if (connectionstrings.Attribute("configSource") != null)
{
var source = connectionstrings.Attribute("configSource").Value;
var configFile = IOHelper.MapPath(string.Format("{0}/{1}", SystemDirectories.Root, source));
LogHelper.Info<DatabaseContext>("storing ConnectionString in {0}", () => configFile);
if (System.IO.File.Exists(configFile))
{
xml = XDocument.Load(fileName, LoadOptions.PreserveWhitespace);
fileName = configFile;
}
connectionstrings = xml.Root.DescendantsAndSelf("connectionStrings").Single();
}
// Update connectionString if it exists, or else create a new appSetting for the given key and value
var setting = connectionstrings.Descendants("add").FirstOrDefault(s => s.Attribute("name").Value == Constants.System.UmbracoConnectionName);
if (setting == null)
+34 -34
View File
@@ -21,9 +21,9 @@ namespace Umbraco.Core
public static DateTime TruncateTo(this DateTime dt, DateTruncate truncateTo)
{
if (truncateTo == DateTruncate.Year)
return new DateTime(dt.Year, 0, 0);
return new DateTime(dt.Year, 1, 1);
if (truncateTo == DateTruncate.Month)
return new DateTime(dt.Year, dt.Month, 0);
return new DateTime(dt.Year, dt.Month, 1);
if (truncateTo == DateTruncate.Day)
return new DateTime(dt.Year, dt.Month, dt.Day);
if (truncateTo == DateTruncate.Hour)
@@ -41,43 +41,43 @@ namespace Umbraco.Core
Hour,
Minute,
Second
}
}
/// <summary>
/// Calculates the number of minutes from a date time, on a rolling daily basis (so if
/// Calculates the number of minutes from a date time, on a rolling daily basis (so if
/// date time is before the time, calculate onto next day)
/// </summary>
/// <param name="fromDateTime">Date to start from</param>
/// <param name="scheduledTime">Time to compare against (in Hmm form, e.g. 330, 2200)</param>
/// <returns></returns>
public static int PeriodicMinutesFrom(this DateTime fromDateTime, string scheduledTime)
{
// Ensure time provided is 4 digits long
if (scheduledTime.Length == 3)
{
scheduledTime = "0" + scheduledTime;
}
var scheduledHour = int.Parse(scheduledTime.Substring(0, 2));
var scheduledMinute = int.Parse(scheduledTime.Substring(2));
DateTime scheduledDateTime;
if (IsScheduledInRemainingDay(fromDateTime, scheduledHour, scheduledMinute))
{
scheduledDateTime = new DateTime(fromDateTime.Year, fromDateTime.Month, fromDateTime.Day, scheduledHour, scheduledMinute, 0);
}
else
{
var nextDay = fromDateTime.AddDays(1);
scheduledDateTime = new DateTime(nextDay.Year, nextDay.Month, nextDay.Day, scheduledHour, scheduledMinute, 0);
}
return (int)(scheduledDateTime - fromDateTime).TotalMinutes;
}
private static bool IsScheduledInRemainingDay(DateTime fromDateTime, int scheduledHour, int scheduledMinute)
{
return scheduledHour > fromDateTime.Hour || (scheduledHour == fromDateTime.Hour && scheduledMinute >= fromDateTime.Minute);
/// <returns></returns>
public static int PeriodicMinutesFrom(this DateTime fromDateTime, string scheduledTime)
{
// Ensure time provided is 4 digits long
if (scheduledTime.Length == 3)
{
scheduledTime = "0" + scheduledTime;
}
var scheduledHour = int.Parse(scheduledTime.Substring(0, 2));
var scheduledMinute = int.Parse(scheduledTime.Substring(2));
DateTime scheduledDateTime;
if (IsScheduledInRemainingDay(fromDateTime, scheduledHour, scheduledMinute))
{
scheduledDateTime = new DateTime(fromDateTime.Year, fromDateTime.Month, fromDateTime.Day, scheduledHour, scheduledMinute, 0);
}
else
{
var nextDay = fromDateTime.AddDays(1);
scheduledDateTime = new DateTime(nextDay.Year, nextDay.Month, nextDay.Day, scheduledHour, scheduledMinute, 0);
}
return (int)(scheduledDateTime - fromDateTime).TotalMinutes;
}
private static bool IsScheduledInRemainingDay(DateTime fromDateTime, int scheduledHour, int scheduledMinute)
{
return scheduledHour > fromDateTime.Hour || (scheduledHour == fromDateTime.Hour && scheduledMinute >= fromDateTime.Minute);
}
}
}
+43 -43
View File
@@ -2,60 +2,60 @@ using System;
using System.Threading;
namespace Umbraco.Core
{
/// <summary>
/// Abstract implementation of IDisposable.
/// </summary>
/// <remarks>
/// Can also be used as a pattern for when inheriting is not possible.
///
{
/// <summary>
/// Abstract implementation of IDisposable.
/// </summary>
/// <remarks>
/// Can also be used as a pattern for when inheriting is not possible.
///
/// See also: https://msdn.microsoft.com/en-us/library/b1yfkh5e%28v=vs.110%29.aspx
/// See also: https://lostechies.com/chrispatterson/2012/11/29/idisposable-done-right/
///
/// Note: if an object's ctor throws, it will never be disposed, and so if that ctor
/// has allocated disposable objects, it should take care of disposing them.
/// </remarks>
public abstract class DisposableObject : IDisposable
{
private bool _disposed;
private readonly object _locko = new object();
// gets a value indicating whether this instance is disposed.
/// </remarks>
public abstract class DisposableObject : IDisposable
{
private bool _disposed;
private readonly object _locko = new object();
// gets a value indicating whether this instance is disposed.
// for internal tests only (not thread safe)
//TODO make this internal + rename "Disposed" when we can break compatibility
public bool IsDisposed { get { return _disposed; } }
// implements IDisposable
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
// finalizer
~DisposableObject()
{
Dispose(false);
}
public bool IsDisposed { get { return _disposed; } }
// implements IDisposable
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
// finalizer
~DisposableObject()
{
Dispose(false);
}
//TODO make this private, non-virtual when we can break compatibility
protected virtual void Dispose(bool disposing)
{
lock (_locko)
{
if (_disposed) return;
_disposed = true;
}
protected virtual void Dispose(bool disposing)
{
lock (_locko)
{
if (_disposed) return;
_disposed = true;
}
DisposeUnmanagedResources();
if (disposing)
DisposeResources();
}
protected abstract void DisposeResources();
protected virtual void DisposeUnmanagedResources()
{ }
}
DisposeResources();
}
protected abstract void DisposeResources();
protected virtual void DisposeUnmanagedResources()
{ }
}
}
+38
View File
@@ -0,0 +1,38 @@
using System;
namespace Umbraco.Core
{
/// <summary>
/// This should not be use if there are ubmanaged resources to be disposed, use DisposableObject instead
/// </summary>
public abstract class DisposableObjectSlim : IDisposable
{
private bool _disposed;
private readonly object _locko = new object();
// gets a value indicating whether this instance is disposed.
// for internal tests only (not thread safe)
internal bool Disposed { get { return _disposed; } }
// implements IDisposable
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
{
lock (_locko)
{
if (_disposed) return;
_disposed = true;
}
if (disposing)
DisposeResources();
}
protected abstract void DisposeResources();
}
}
+8 -8
View File
@@ -11,8 +11,8 @@ namespace Umbraco.Core
/// <summary>
/// Starts the timer and invokes a callback upon disposal. Provides a simple way of timing an operation by wrapping it in a <code>using</code> (C#) statement.
/// </summary>
public class DisposableTimer : DisposableObject
{
public class DisposableTimer : DisposableObjectSlim
{
private readonly ILogger _logger;
private readonly LogType? _logType;
private readonly IProfiler _profiler;
@@ -209,13 +209,13 @@ namespace Umbraco.Core
loggerType,
startMessage(),
completeMessage());
}
}
#endregion
/// <summary>
/// Handles the disposal of resources. Derived from abstract class <see cref="DisposableObject"/> which handles common required locking logic.
/// </summary>
protected override void DisposeResources()
/// <summary>
/// Handles the disposal of resources. Derived from abstract class <see cref="DisposableObjectSlim"/> which handles common required locking logic.
/// </summary>
protected override void DisposeResources()
{
if (_profiler != null)
{
+1 -1
View File
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Events
/// <summary>
/// Event messages collection
/// </summary>
public sealed class EventMessages : DisposableObject
public sealed class EventMessages : DisposableObjectSlim
{
private readonly List<EventMessage> _msgs = new List<EventMessage>();
@@ -0,0 +1,18 @@
using System;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
namespace Umbraco.Core.Events
{
internal class ExportedMemberEventArgs : EventArgs
{
public IMember Member { get; }
public MemberExportModel Exported { get; }
public ExportedMemberEventArgs(IMember member, MemberExportModel exported)
{
Member = member;
Exported = exported;
}
}
}
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Umbraco.Core.Packaging.Models;
namespace Umbraco.Core.Events
@@ -7,18 +8,27 @@ namespace Umbraco.Core.Events
public class ImportPackageEventArgs<TEntity> : CancellableEnumerableObjectEventArgs<TEntity>, IEquatable<ImportPackageEventArgs<TEntity>>
{
private readonly MetaData _packageMetaData;
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Use the overload specifying packageMetaData instead")]
public ImportPackageEventArgs(TEntity eventObject, bool canCancel)
: base(new[] { eventObject }, canCancel)
{
}
public ImportPackageEventArgs(TEntity eventObject, MetaData packageMetaData)
: base(new[] { eventObject })
public ImportPackageEventArgs(TEntity eventObject, MetaData packageMetaData, bool canCancel)
: base(new[] { eventObject }, canCancel)
{
if (packageMetaData == null) throw new ArgumentNullException("packageMetaData");
_packageMetaData = packageMetaData;
}
public ImportPackageEventArgs(TEntity eventObject, MetaData packageMetaData)
: this(eventObject, packageMetaData, true)
{
}
public MetaData PackageMetaData
{
get { return _packageMetaData; }
+16
View File
@@ -0,0 +1,16 @@
using System;
namespace Umbraco.Core.Events
{
public class RolesEventArgs : EventArgs
{
public RolesEventArgs(int[] memberIds, string[] roles)
{
MemberIds = memberIds;
Roles = roles;
}
public int[] MemberIds { get; set; }
public string[] Roles { get; set; }
}
}
@@ -0,0 +1,19 @@
using System;
using Umbraco.Core.Models.Membership;
namespace Umbraco.Core.Events
{
internal class UserGroupWithUsers
{
public UserGroupWithUsers(IUserGroup userGroup, IUser[] addedUsers, IUser[] removedUsers)
{
UserGroup = userGroup;
AddedUsers = addedUsers;
RemovedUsers = removedUsers;
}
public IUserGroup UserGroup { get; }
public IUser[] AddedUsers { get; }
public IUser[] RemovedUsers { get; }
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace Umbraco.Core
/// This will use the crypto libs to generate the hash and will try to ensure that
/// strings, etc... are not re-allocated so it's not consuming much memory.
/// </remarks>
internal class HashGenerator : DisposableObject
internal class HashGenerator : DisposableObjectSlim
{
public HashGenerator()
{
@@ -2,6 +2,7 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Reflection;
using Umbraco.Core.Configuration;
@@ -26,6 +27,7 @@ namespace Umbraco.Core.IO
private ShadowWrapper _xsltFileSystem;
private ShadowWrapper _masterPagesFileSystem;
private ShadowWrapper _mvcViewsFileSystem;
private ShadowWrapper _javaScriptLibraryFileSystem;
#region Singleton & Constructor
@@ -113,6 +115,7 @@ namespace Umbraco.Core.IO
var xsltFileSystem = new PhysicalFileSystem(SystemDirectories.Xslt);
var masterPagesFileSystem = new PhysicalFileSystem(SystemDirectories.Masterpages);
var mvcViewsFileSystem = new PhysicalFileSystem(SystemDirectories.MvcViews);
var javaScriptLibraryFileSystem = new PhysicalFileSystem(Path.Combine(SystemDirectories.Umbraco, "lib"));
_macroPartialFileSystem = new ShadowWrapper(macroPartialFileSystem, "Views/MacroPartials", ScopeProvider);
_partialViewsFileSystem = new ShadowWrapper(partialViewsFileSystem, "Views/Partials", ScopeProvider);
@@ -123,6 +126,7 @@ namespace Umbraco.Core.IO
_xsltFileSystem = new ShadowWrapper(xsltFileSystem, "xslt", ScopeProvider);
_masterPagesFileSystem = new ShadowWrapper(masterPagesFileSystem, "masterpages", ScopeProvider);
_mvcViewsFileSystem = new ShadowWrapper(mvcViewsFileSystem, "Views", ScopeProvider);
_javaScriptLibraryFileSystem = new ShadowWrapper(javaScriptLibraryFileSystem, "Lib", ScopeProvider);
// filesystems obtained from GetFileSystemProvider are already wrapped and do not need to be wrapped again
MediaFileSystem = GetFileSystemProvider<MediaFileSystem>();
@@ -143,6 +147,7 @@ namespace Umbraco.Core.IO
public IFileSystem2 XsltFileSystem { get { return _xsltFileSystem; } }
public IFileSystem2 MasterPagesFileSystem { get { return _mvcViewsFileSystem; } }
public IFileSystem2 MvcViewsFileSystem { get { return _mvcViewsFileSystem; } }
internal IFileSystem2 JavaScriptLibraryFileSystem { get { return _javaScriptLibraryFileSystem; } }
public MediaFileSystem MediaFileSystem { get; private set; }
#endregion
-1
View File
@@ -203,7 +203,6 @@ namespace Umbraco.Core.IO
{
get
{
//by default the packages folder should exist in the data folder
return IOHelper.ReturnPath("umbracoPreviewPath", Data + IOHelper.DirSepChar + "preview");
}
}
+1 -1
View File
@@ -6,7 +6,7 @@ using Umbraco.Core.Logging;
namespace Umbraco.Core.Manifest
{
internal class ManifestWatcher : DisposableObject
internal class ManifestWatcher : DisposableObjectSlim
{
private readonly ILogger _logger;
private readonly List<FileSystemWatcher> _fws = new List<FileSystemWatcher>();
+94
View File
@@ -0,0 +1,94 @@
using System;
using System.Reflection;
using System.Runtime.Serialization;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents an audited event.
/// </summary>
[Serializable]
[DataContract(IsReference = true)]
internal class AuditEntry : Entity, IAuditEntry
{
private static PropertySelectors _selectors;
private int _performingUserId;
private string _performingDetails;
private string _performingIp;
private int _affectedUserId;
private string _affectedDetails;
private string _eventType;
private string _eventDetails;
private static PropertySelectors Selectors => _selectors ?? (_selectors = new PropertySelectors());
private class PropertySelectors
{
public readonly PropertyInfo PerformingUserId = ExpressionHelper.GetPropertyInfo<AuditEntry, int>(x => x.PerformingUserId);
public readonly PropertyInfo PerformingDetails = ExpressionHelper.GetPropertyInfo<AuditEntry, string>(x => x.PerformingDetails);
public readonly PropertyInfo PerformingIp = ExpressionHelper.GetPropertyInfo<AuditEntry, string>(x => x.PerformingIp);
public readonly PropertyInfo AffectedUserId = ExpressionHelper.GetPropertyInfo<AuditEntry, int>(x => x.AffectedUserId);
public readonly PropertyInfo AffectedDetails = ExpressionHelper.GetPropertyInfo<AuditEntry, string>(x => x.AffectedDetails);
public readonly PropertyInfo EventType = ExpressionHelper.GetPropertyInfo<AuditEntry, string>(x => x.EventType);
public readonly PropertyInfo EventDetails = ExpressionHelper.GetPropertyInfo<AuditEntry, string>(x => x.EventDetails);
}
/// <inheritdoc />
public int PerformingUserId
{
get => _performingUserId;
set => SetPropertyValueAndDetectChanges(value, ref _performingUserId, Selectors.PerformingUserId);
}
/// <inheritdoc />
public string PerformingDetails
{
get => _performingDetails;
set => SetPropertyValueAndDetectChanges(value, ref _performingDetails, Selectors.PerformingDetails);
}
/// <inheritdoc />
public string PerformingIp
{
get => _performingIp;
set => SetPropertyValueAndDetectChanges(value, ref _performingIp, Selectors.PerformingIp);
}
/// <inheritdoc />
public DateTime EventDateUtc
{
get => CreateDate;
set => CreateDate = value;
}
/// <inheritdoc />
public int AffectedUserId
{
get => _affectedUserId;
set => SetPropertyValueAndDetectChanges(value, ref _affectedUserId, Selectors.AffectedUserId);
}
/// <inheritdoc />
public string AffectedDetails
{
get => _affectedDetails;
set => SetPropertyValueAndDetectChanges(value, ref _affectedDetails, Selectors.AffectedDetails);
}
/// <inheritdoc />
public string EventType
{
get => _eventType;
set => SetPropertyValueAndDetectChanges(value, ref _eventType, Selectors.EventType);
}
/// <inheritdoc />
public string EventDetails
{
get => _eventDetails;
set => SetPropertyValueAndDetectChanges(value, ref _eventDetails, Selectors.EventDetails);
}
}
}
+102
View File
@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Serialization;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents a consent.
/// </summary>
[Serializable]
[DataContract(IsReference = true)]
internal class Consent : Entity, IConsent
{
private static PropertySelectors _selector;
private bool _current;
private string _source;
private string _context;
private string _action;
private ConsentState _state;
private string _comment;
// ReSharper disable once ClassNeverInstantiated.Local
private class PropertySelectors
{
public readonly PropertyInfo Current = ExpressionHelper.GetPropertyInfo<Consent, bool>(x => x.Current);
public readonly PropertyInfo Source = ExpressionHelper.GetPropertyInfo<Consent, string>(x => x.Source);
public readonly PropertyInfo Context = ExpressionHelper.GetPropertyInfo<Consent, string>(x => x.Context);
public readonly PropertyInfo Action = ExpressionHelper.GetPropertyInfo<Consent, string>(x => x.Action);
public readonly PropertyInfo State = ExpressionHelper.GetPropertyInfo<Consent, ConsentState>(x => x.State);
public readonly PropertyInfo Comment = ExpressionHelper.GetPropertyInfo<Consent, string>(x => x.Comment);
}
private static PropertySelectors Selectors => _selector ?? (_selector = new PropertySelectors());
/// <inheritdoc />
public bool Current
{
get => _current;
set => SetPropertyValueAndDetectChanges(value, ref _current, Selectors.Current);
}
/// <inheritdoc />
public string Source
{
get => _source;
set
{
if (string.IsNullOrWhiteSpace(value)) throw new ArgumentException(nameof(value));
SetPropertyValueAndDetectChanges(value, ref _source, Selectors.Source);
}
}
/// <inheritdoc />
public string Context
{
get => _context;
set
{
if (string.IsNullOrWhiteSpace(value)) throw new ArgumentException(nameof(value));
SetPropertyValueAndDetectChanges(value, ref _context, Selectors.Context);
}
}
/// <inheritdoc />
public string Action
{
get => _action;
set
{
if (string.IsNullOrWhiteSpace(value)) throw new ArgumentException(nameof(value));
SetPropertyValueAndDetectChanges(value, ref _action, Selectors.Action);
}
}
/// <inheritdoc />
public ConsentState State
{
get => _state;
// note: we probably should validate the state here, but since the
// enum is [Flags] with many combinations, this could be expensive
set => SetPropertyValueAndDetectChanges(value, ref _state, Selectors.State);
}
/// <inheritdoc />
public string Comment
{
get => _comment;
set => SetPropertyValueAndDetectChanges(value, ref _comment, Selectors.Comment);
}
/// <inheritdoc />
public IEnumerable<IConsent> History => HistoryInternal;
/// <summary>
/// Gets the previous states of this consent.
/// </summary>
internal List<IConsent> HistoryInternal { get; set; }
}
}
@@ -0,0 +1,18 @@
namespace Umbraco.Core.Models
{
/// <summary>
/// Provides extension methods for the <see cref="IConsent"/> interface.
/// </summary>
public static class ConsentExtensions
{
/// <summary>
/// Determines whether the consent is granted.
/// </summary>
public static bool IsGranted(this IConsent consent) => (consent.State & ConsentState.Granted) > 0;
/// <summary>
/// Determines whether the consent is revoked.
/// </summary>
public static bool IsRevoked(this IConsent consent) => (consent.State & ConsentState.Revoked) > 0;
}
}
+38
View File
@@ -0,0 +1,38 @@
using System;
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents the state of a consent.
/// </summary>
[Flags]
public enum ConsentState // : int
{
// note - this is a [Flags] enumeration
// on can create detailed flags such as:
//GrantedOptIn = Granted | 0x0001
//GrandedByForce = Granted | 0x0002
//
// 16 situations for each Pending/Granted/Revoked should be ok
/// <summary>
/// There is no consent.
/// </summary>
None = 0,
/// <summary>
/// Consent is pending and has not been granted yet.
/// </summary>
Pending = 0x10000,
/// <summary>
/// Consent has been granted.
/// </summary>
Granted = 0x20000,
/// <summary>
/// Consent has been revoked.
/// </summary>
Revoked = 0x40000
}
}
+23 -1
View File
@@ -544,6 +544,28 @@ namespace Umbraco.Core.Models
return false;
}
/// <summary>
/// Returns both instance dirty properties and property type properties
/// </summary>
/// <returns></returns>
public override IEnumerable<string> GetDirtyProperties()
{
var instanceProperties = base.GetDirtyProperties();
var propertyTypes = Properties.Where(x => x.IsDirty()).Select(x => x.Alias);
return instanceProperties.Concat(propertyTypes);
}
/// <summary>
/// Returns both instance dirty properties and property type properties
/// </summary>
/// <returns></returns>
internal override IEnumerable<string> GetPreviouslyDirtyProperties()
{
var instanceProperties = base.GetPreviouslyDirtyProperties();
var propertyTypes = Properties.Where(x => x.WasDirty()).Select(x => x.Alias);
return instanceProperties.Concat(propertyTypes);
}
#endregion
}
}
}
+4 -2
View File
@@ -95,8 +95,10 @@ namespace Umbraco.Core.Models
get { return _allowedTemplates; }
set
{
SetPropertyValueAndDetectChanges(value, ref _allowedTemplates, Ps.Value.AllowedTemplatesSelector,
Ps.Value.TemplateComparer);
SetPropertyValueAndDetectChanges(value, ref _allowedTemplates, Ps.Value.AllowedTemplatesSelector, Ps.Value.TemplateComparer);
if (_allowedTemplates.Any(x => x.Id == _defaultTemplate) == false)
DefaultTemplateId = 0;
}
}
@@ -23,6 +23,13 @@ namespace Umbraco.Core.Models.EntityBase
: _propertyChangedInfo.Where(x => x.Value).Select(x => x.Key);
}
internal virtual IEnumerable<string> GetPreviouslyDirtyProperties()
{
return _lastPropertyChangedInfo == null
? Enumerable.Empty<string>()
: _lastPropertyChangedInfo.Where(x => x.Value).Select(x => x.Key);
}
private bool _changeTrackingEnabled = true;
/// <summary>
@@ -221,4 +228,4 @@ namespace Umbraco.Core.Models.EntityBase
}
}
}
}
}
+60
View File
@@ -0,0 +1,60 @@
using System;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents an audited event.
/// </summary>
/// <remarks>
/// <para>The free-form details properties can be used to capture relevant infos (for example,
/// a user email and identifier) at the time of the audited event, even though they may change
/// later on - but we want to keep a track of their value at that time.</para>
/// <para>Depending on audit loggers, these properties can be purely free-form text, or
/// contain json serialized objects.</para>
/// </remarks>
public interface IAuditEntry : IAggregateRoot, IRememberBeingDirty
{
/// <summary>
/// Gets or sets the identifier of the user triggering the audited event.
/// </summary>
int PerformingUserId { get; set; }
/// <summary>
/// Gets or sets free-form details about the user triggering the audited event.
/// </summary>
string PerformingDetails { get; set; }
/// <summary>
/// Gets or sets the IP address or the request triggering the audited event.
/// </summary>
string PerformingIp { get; set; }
/// <summary>
/// Gets or sets the date and time of the audited event.
/// </summary>
DateTime EventDateUtc { get; set; }
/// <summary>
/// Gets or sets the identifier of the user affected by the audited event.
/// </summary>
/// <remarks>Not used when no single user is affected by the event.</remarks>
int AffectedUserId { get; set; }
/// <summary>
/// Gets or sets free-form details about the entity affected by the audited event.
/// </summary>
/// <remarks>The entity affected by the event can be another user, a member...</remarks>
string AffectedDetails { get; set; }
/// <summary>
/// Gets or sets the type of the audited event.
/// </summary>
string EventType { get; set; }
/// <summary>
/// Gets or sets free-form details about the audited event.
/// </summary>
string EventDetails { get; set; }
}
}
+55
View File
@@ -0,0 +1,55 @@
using System.Collections.Generic;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents a consent state.
/// </summary>
/// <remarks>
/// <para>A consent is fully identified by a source (whoever is consenting), a context (for
/// example, an application), and an action (whatever is consented).</para>
/// <para>A consent state registers the state of the consent (granted, revoked...).</para>
/// </remarks>
public interface IConsent : IAggregateRoot, IRememberBeingDirty
{
/// <summary>
/// Determines whether the consent entity represents the current state.
/// </summary>
bool Current { get; }
/// <summary>
/// Gets the unique identifier of whoever is consenting.
/// </summary>
string Source { get; }
/// <summary>
/// Gets the unique identifier of the context of the consent.
/// </summary>
/// <remarks>
/// <para>Represents the domain, application, scope... of the action.</para>
/// <para>When the action is a Udi, this should be the Udi type.</para>
/// </remarks>
string Context { get; }
/// <summary>
/// Gets the unique identifier of the consented action.
/// </summary>
string Action { get; }
/// <summary>
/// Gets the state of the consent.
/// </summary>
ConsentState State { get; }
/// <summary>
/// Gets some additional free text.
/// </summary>
string Comment { get; }
/// <summary>
/// Gets the previous states of this consent.
/// </summary>
IEnumerable<IConsent> History { get; }
}
}
+15 -1
View File
@@ -19,6 +19,13 @@
/// <returns></returns>
bool MemberCanViewProperty(string propertyTypeAlias);
/// <summary>
/// Gets a boolean indicating whether a Property is marked as storing sensitive values on the Members profile.
/// </summary>
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to check</param>
/// <returns></returns>
bool IsSensitiveProperty(string propertyTypeAlias);
/// <summary>
/// Sets a boolean indicating whether a Property is editable by the Member.
/// </summary>
@@ -32,5 +39,12 @@
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to set</param>
/// <param name="value">Boolean value, true or false</param>
void SetMemberCanViewProperty(string propertyTypeAlias, bool value);
/// <summary>
/// Sets a boolean indicating whether a Property is a sensitive value on the Members profile.
/// </summary>
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to set</param>
/// <param name="value">Boolean value, true or false</param>
void SetIsSensitiveProperty(string propertyTypeAlias, bool value);
}
}
}
@@ -34,6 +34,15 @@ namespace Umbraco.Core.Models.Identity
.ForMember(user => user.CalculatedContentStartNodeIds, expression => expression.MapFrom(user => user.CalculateContentStartNodeIds(applicationContext.Services.EntityService)))
.ForMember(user => user.CalculatedMediaStartNodeIds, expression => expression.MapFrom(user => user.CalculateMediaStartNodeIds(applicationContext.Services.EntityService)))
.ForMember(user => user.AllowedSections, expression => expression.MapFrom(user => user.AllowedSections.ToArray()))
.ForMember(user => user.LockoutEnabled, expression => expression.Ignore())
.ForMember(user => user.Logins, expression => expression.Ignore())
.ForMember(user => user.Roles, expression => expression.Ignore())
.ForMember(user => user.PhoneNumber, expression => expression.Ignore())
.ForMember(user => user.PhoneNumberConfirmed, expression => expression.Ignore())
.ForMember(user => user.TwoFactorEnabled, expression => expression.Ignore())
.ForMember(user => user.Claims, expression => expression.Ignore())
.AfterMap((user, identityUser) =>
{
identityUser.ResetDirtyProperties(true);
@@ -47,4 +56,4 @@ namespace Umbraco.Core.Models.Identity
return storedPass.StartsWith(Constants.Security.EmptyPasswordPrefix) ? null : storedPass;
}
}
}
}
+14 -2
View File
@@ -170,7 +170,19 @@ namespace Umbraco.Core.Models
public string RawPasswordValue
{
get { return _rawPasswordValue; }
set { SetPropertyValueAndDetectChanges(value, ref _rawPasswordValue, Ps.Value.PasswordSelector); }
set
{
if (value == null)
{
//special case, this is used to ensure that the password is not updated when persisting, in this case
//we don't want to track changes either
_rawPasswordValue = null;
}
else
{
SetPropertyValueAndDetectChanges(value, ref _rawPasswordValue, Ps.Value.PasswordSelector);
}
}
}
/// <summary>
@@ -628,4 +640,4 @@ namespace Umbraco.Core.Models
}
}
}
}
+49 -13
View File
@@ -64,7 +64,7 @@ namespace Umbraco.Core.Models
}
/// <summary>
/// Gets or Sets a Dictionary of Tuples (MemberCanEdit, VisibleOnProfile) by the PropertyTypes' alias.
/// Gets or Sets a Dictionary of Tuples (MemberCanEdit, VisibleOnProfile, IsSensitive) by the PropertyTypes' alias.
/// </summary>
[DataMember]
internal IDictionary<string, MemberTypePropertyProfileAccess> MemberTypePropertyTypes { get; private set; }
@@ -76,11 +76,11 @@ namespace Umbraco.Core.Models
/// <returns></returns>
public bool MemberCanEditProperty(string propertyTypeAlias)
{
if (MemberTypePropertyTypes.ContainsKey(propertyTypeAlias))
MemberTypePropertyProfileAccess propertyProfile;
if (MemberTypePropertyTypes.TryGetValue(propertyTypeAlias, out propertyProfile))
{
return MemberTypePropertyTypes[propertyTypeAlias].IsEditable;
return propertyProfile.IsEditable;
}
return false;
}
@@ -91,11 +91,26 @@ namespace Umbraco.Core.Models
/// <returns></returns>
public bool MemberCanViewProperty(string propertyTypeAlias)
{
if (MemberTypePropertyTypes.ContainsKey(propertyTypeAlias))
MemberTypePropertyProfileAccess propertyProfile;
if (MemberTypePropertyTypes.TryGetValue(propertyTypeAlias, out propertyProfile))
{
return MemberTypePropertyTypes[propertyTypeAlias].IsVisible;
return propertyProfile.IsVisible;
}
return false;
}
/// <summary>
/// Gets a boolean indicating whether a Property is marked as storing sensitive values on the Members profile.
/// </summary>
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to check</param>
/// <returns></returns>
public bool IsSensitiveProperty(string propertyTypeAlias)
{
MemberTypePropertyProfileAccess propertyProfile;
if (MemberTypePropertyTypes.TryGetValue(propertyTypeAlias, out propertyProfile))
{
return propertyProfile.IsSensitive;
}
return false;
}
@@ -106,13 +121,14 @@ namespace Umbraco.Core.Models
/// <param name="value">Boolean value, true or false</param>
public void SetMemberCanEditProperty(string propertyTypeAlias, bool value)
{
if (MemberTypePropertyTypes.ContainsKey(propertyTypeAlias))
MemberTypePropertyProfileAccess propertyProfile;
if (MemberTypePropertyTypes.TryGetValue(propertyTypeAlias, out propertyProfile))
{
MemberTypePropertyTypes[propertyTypeAlias].IsEditable = value;
propertyProfile.IsEditable = value;
}
else
{
var tuple = new MemberTypePropertyProfileAccess(false, value);
var tuple = new MemberTypePropertyProfileAccess(false, value, false);
MemberTypePropertyTypes.Add(propertyTypeAlias, tuple);
}
}
@@ -124,15 +140,35 @@ namespace Umbraco.Core.Models
/// <param name="value">Boolean value, true or false</param>
public void SetMemberCanViewProperty(string propertyTypeAlias, bool value)
{
if (MemberTypePropertyTypes.ContainsKey(propertyTypeAlias))
MemberTypePropertyProfileAccess propertyProfile;
if (MemberTypePropertyTypes.TryGetValue(propertyTypeAlias, out propertyProfile))
{
MemberTypePropertyTypes[propertyTypeAlias].IsVisible = value;
propertyProfile.IsVisible = value;
}
else
{
var tuple = new MemberTypePropertyProfileAccess(value, false);
var tuple = new MemberTypePropertyProfileAccess(value, false, false);
MemberTypePropertyTypes.Add(propertyTypeAlias, tuple);
}
}
/// <summary>
/// Sets a boolean indicating whether a Property is a sensitive value on the Members profile.
/// </summary>
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to set</param>
/// <param name="value">Boolean value, true or false</param>
public void SetIsSensitiveProperty(string propertyTypeAlias, bool value)
{
MemberTypePropertyProfileAccess propertyProfile;
if (MemberTypePropertyTypes.TryGetValue(propertyTypeAlias, out propertyProfile))
{
propertyProfile.IsSensitive = value;
}
else
{
var tuple = new MemberTypePropertyProfileAccess(false, false, true);
MemberTypePropertyTypes.Add(propertyTypeAlias, tuple);
}
}
}
}
}
@@ -5,13 +5,15 @@ namespace Umbraco.Core.Models
/// </summary>
internal class MemberTypePropertyProfileAccess
{
public MemberTypePropertyProfileAccess(bool isVisible, bool isEditable)
public MemberTypePropertyProfileAccess(bool isVisible, bool isEditable, bool isSenstive)
{
IsVisible = isVisible;
IsEditable = isEditable;
IsSensitive = isSenstive;
}
public bool IsVisible { get; set; }
public bool IsEditable { get; set; }
public bool IsSensitive { get; set; }
}
}
}
@@ -63,4 +63,4 @@ namespace Umbraco.Core.Models.Membership
}
}
}
}
@@ -3,7 +3,7 @@ using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models.Membership
{
public interface IUserGroup : IAggregateRoot
public interface IUserGroup : IAggregateRoot, IRememberBeingDirty, ICanBeDirty
{
string Alias { get; set; }
@@ -41,4 +41,4 @@ namespace Umbraco.Core.Models.Membership
/// </summary>
int UserCount { get; }
}
}
}
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Umbraco.Core.Models.Membership
{
internal class MemberExportModel
{
public int Id { get; set; }
public Guid Key { get; set; }
public string Name { get; set; }
public string Username { get; set; }
public string Email { get; set; }
public List<string> Groups { get; set; }
public string ContentTypeAlias { get; set; }
public DateTime CreateDate { get; set; }
public DateTime UpdateDate { get; set; }
public List<MemberExportProperty> Properties { get; set; }
}
}
@@ -0,0 +1,14 @@
using System;
namespace Umbraco.Core.Models.Membership
{
internal class MemberExportProperty
{
public int Id { get; set; }
public string Alias { get; set; }
public string Name { get; set; }
public object Value { get; set; }
public DateTime? CreateDate { get; set; }
public DateTime? UpdateDate { get; set; }
}
}
+2 -1
View File
@@ -706,5 +706,6 @@ namespace Umbraco.Core.Models.Membership
return _user.GetHashCode();
}
}
}
}
}
@@ -152,4 +152,4 @@ namespace Umbraco.Core.Models.Membership
public int UserCount { get; private set; }
}
}
}
+1 -2
View File
@@ -1,6 +1,5 @@
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
@@ -436,4 +435,4 @@ namespace Umbraco.Core.Models
return clone;
}
}
}
}
@@ -42,7 +42,7 @@ namespace Umbraco.Core.Models.PublishedContent
var typeName = attribute == null ? type.Name : attribute.ContentTypeAlias;
if (constructors.ContainsKey(typeName))
throw new InvalidOperationException(string.Format("More that one type want to be a model for content type {0}.", typeName));
throw new InvalidOperationException(string.Format("More than one type wants to be a model for content type {0}.", typeName));
// should work everywhere, but slow
//_constructors[typeName] = constructor;
@@ -0,0 +1,60 @@
using System;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
namespace Umbraco.Core.Models.Rdbms
{
[TableName(TableName)]
[PrimaryKey("id")]
[ExplicitColumns]
internal class AuditEntryDto
{
public const string TableName = "umbracoAudit";
public const int IpLength = 64;
public const int EventTypeLength = 256;
public const int DetailsLength = 1024;
[Column("id")]
[PrimaryKeyColumn]
public int Id { get; set; }
// there is NO foreign key to the users table here, neither for performing user nor for
// affected user, so we can delete users and NOT delete the associated audit trails, and
// users can still be identified via the details free-form text fields.
[Column("performingUserId")]
public int PerformingUserId { get; set; }
[Column("performingDetails")]
[NullSetting(NullSetting = NullSettings.Null)]
[Length(DetailsLength)]
public string PerformingDetails { get; set; }
[Column("performingIp")]
[NullSetting(NullSetting = NullSettings.Null)]
[Length(IpLength)]
public string PerformingIp { get; set; }
[Column("eventDateUtc")]
[Constraint(Default = SystemMethods.CurrentDateTime)]
public DateTime EventDateUtc { get; set; }
[Column("affectedUserId")]
public int AffectedUserId { get; set; }
[Column("affectedDetails")]
[NullSetting(NullSetting = NullSettings.Null)]
[Length(DetailsLength)]
public string AffectedDetails { get; set; }
[Column("eventType")]
[Length(EventTypeLength)]
public string EventType { get; set; }
[Column("eventDetails")]
[NullSetting(NullSetting = NullSettings.Null)]
[Length(DetailsLength)]
public string EventDetails { get; set; }
}
}
@@ -0,0 +1,44 @@
using System;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
namespace Umbraco.Core.Models.Rdbms
{
[TableName(TableName)]
[PrimaryKey("id")]
[ExplicitColumns]
public class ConsentDto
{
internal const string TableName = "umbracoConsent";
[Column("id")]
[PrimaryKeyColumn]
public int Id { get; set; }
[Column("current")]
public bool Current { get; set; }
[Column("source")]
[Length(512)]
public string Source { get; set; }
[Column("context")]
[Length(128)]
public string Context { get; set; }
[Column("action")]
[Length(512)]
public string Action { get; set; }
[Column("createDate")]
[Constraint(Default = SystemMethods.CurrentDateTime)]
public DateTime CreateDate { get; set; }
[Column("state")]
public int State { get; set; }
[Column("comment")]
public string Comment { get; set; }
}
}
@@ -27,5 +27,9 @@ namespace Umbraco.Core.Models.Rdbms
[Column("viewOnProfile")]
[Constraint(Default = "0")]
public bool ViewOnProfile { get; set; }
[Column("isSensitive")]
[Constraint(Default = "0")]
public bool IsSensitive { get; set; }
}
}
}
@@ -45,6 +45,9 @@ namespace Umbraco.Core.Models.Rdbms
[Column("viewOnProfile")]
public bool ViewOnProfile { get; set; }
[Column("isSensitive")]
public bool IsSensitive { get; set; }
/* cmsDataType */
[Column("propertyEditorAlias")]
public string PropertyEditorAlias { get; set; }
@@ -52,7 +55,8 @@ namespace Umbraco.Core.Models.Rdbms
[Column("dbType")]
public string DbType { get; set; }
[Column("UniqueID")]
[Column("UniqueID")]
public Guid UniqueId { get; set; }
}
}
}
@@ -17,7 +17,7 @@ namespace Umbraco.Core.Models.Rdbms
}
[Column("id")]
[PrimaryKeyColumn(IdentitySeed = 5)]
[PrimaryKeyColumn(IdentitySeed = 6)]
public int Id { get; set; }
[Column("userGroupAlias")]
@@ -68,4 +68,4 @@ namespace Umbraco.Core.Models.Rdbms
[ResultColumn]
public int UserCount { get; set; }
}
}
}
+11 -1
View File
@@ -261,6 +261,16 @@ namespace Umbraco.Core.Models
return user.Groups != null && user.Groups.Any(x => x.Alias == Constants.Security.AdminGroupAlias);
}
/// <summary>
/// Determines whether this user has access to view sensitive data
/// </summary>
/// <param name="user"></param>
public static bool HasAccessToSensitiveData(this IUser user)
{
if (user == null) throw new ArgumentNullException("user");
return user.Groups != null && user.Groups.Any(x => x.Alias == Constants.Security.SensitiveDataGroupAlias);
}
// calc. start nodes, combining groups' and user's, and excluding what's in the bin
public static int[] CalculateContentStartNodeIds(this IUser user, IEntityService entityService)
{
@@ -413,4 +423,4 @@ namespace Umbraco.Core.Models
return lsn.ToArray();
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence
/// it will create one per context, otherwise it will be a global singleton object which is NOT thread safe
/// since we need (at least) a new instance of the database object per thread.
/// </remarks>
internal class DefaultDatabaseFactory : DisposableObject, IDatabaseFactory2
internal class DefaultDatabaseFactory : DisposableObjectSlim, IDatabaseFactory2
{
private readonly string _connectionStringName;
private readonly ILogger _logger;
@@ -0,0 +1,52 @@
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Rdbms;
namespace Umbraco.Core.Persistence.Factories
{
internal static class AuditEntryFactory
{
public static IEnumerable<IAuditEntry> BuildEntities(IEnumerable<AuditEntryDto> dtos)
{
return dtos.Select(BuildEntity).ToList();
}
public static IAuditEntry BuildEntity(AuditEntryDto dto)
{
var entity = new AuditEntry
{
Id = dto.Id,
PerformingUserId = dto.PerformingUserId,
PerformingDetails = dto.PerformingDetails,
PerformingIp = dto.PerformingIp,
EventDateUtc = dto.EventDateUtc,
AffectedUserId = dto.AffectedUserId,
AffectedDetails = dto.AffectedDetails,
EventType = dto.EventType,
EventDetails = dto.EventDetails
};
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
entity.ResetDirtyProperties(false);
return entity;
}
public static AuditEntryDto BuildDto(IAuditEntry entity)
{
return new AuditEntryDto
{
Id = entity.Id,
PerformingUserId = entity.PerformingUserId,
PerformingDetails = entity.PerformingDetails,
PerformingIp = entity.PerformingIp,
EventDateUtc = entity.EventDateUtc,
AffectedUserId = entity.AffectedUserId,
AffectedDetails = entity.AffectedDetails,
EventType = entity.EventType,
EventDetails = entity.EventDetails
};
}
}
}
@@ -0,0 +1,65 @@
using System.Collections.Generic;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Rdbms;
namespace Umbraco.Core.Persistence.Factories
{
internal static class ConsentFactory
{
public static IEnumerable<IConsent> BuildEntities(IEnumerable<ConsentDto> dtos)
{
var ix = new Dictionary<string, Consent>();
var output = new List<Consent>();
foreach (var dto in dtos)
{
var k = dto.Source + "::" + dto.Context + "::" + dto.Action;
var consent = new Consent
{
Id = dto.Id,
Current = dto.Current,
CreateDate = dto.CreateDate,
Source = dto.Source,
Context = dto.Context,
Action = dto.Action,
State = (ConsentState) dto.State, // assume value is valid
Comment = dto.Comment
};
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
consent.ResetDirtyProperties(false);
if (ix.TryGetValue(k, out var current))
{
if (current.HistoryInternal == null)
current.HistoryInternal = new List<IConsent>();
current.HistoryInternal.Add(consent);
}
else
{
ix[k] = consent;
output.Add(consent);
}
}
return output;
}
public static ConsentDto BuildDto(IConsent entity)
{
return new ConsentDto
{
Id = entity.Id,
Current = entity.Current,
CreateDate = entity.CreateDate,
Source = entity.Source,
Context = entity.Context,
Action = entity.Action,
State = (int) entity.State,
Comment = entity.Comment
};
}
}
}
@@ -84,7 +84,8 @@ namespace Umbraco.Core.Persistence.Factories
NodeId = entity.Id,
PropertyTypeId = x.Id,
CanEdit = memberType.MemberCanEditProperty(x.Alias),
ViewOnProfile = memberType.MemberCanViewProperty(x.Alias)
ViewOnProfile = memberType.MemberCanViewProperty(x.Alias),
IsSensitive = memberType.IsSensitiveProperty(x.Alias)
}).ToList();
return dtos;
}
@@ -159,4 +160,4 @@ namespace Umbraco.Core.Persistence.Factories
#endregion
}
}
}
@@ -56,10 +56,10 @@ namespace Umbraco.Core.Persistence.Factories
//Add the standard PropertyType to the current list
propertyTypes.Add(standardPropertyType.Value);
//Internal dictionary for adding "MemberCanEdit" and "VisibleOnProfile" properties to each PropertyType
//Internal dictionary for adding "MemberCanEdit", "VisibleOnProfile", "IsSensitive" properties to each PropertyType
memberType.MemberTypePropertyTypes.Add(standardPropertyType.Key,
new MemberTypePropertyProfileAccess(false, false));
new MemberTypePropertyProfileAccess(false, false, false));
}
memberType.NoGroupPropertyTypes = propertyTypes;
@@ -102,7 +102,7 @@ namespace Umbraco.Core.Persistence.Factories
{
//Internal dictionary for adding "MemberCanEdit" and "VisibleOnProfile" properties to each PropertyType
memberType.MemberTypePropertyTypes.Add(typeDto.Alias,
new MemberTypePropertyProfileAccess(typeDto.ViewOnProfile, typeDto.CanEdit));
new MemberTypePropertyProfileAccess(typeDto.ViewOnProfile, typeDto.CanEdit, typeDto.IsSensitive));
var tempGroupDto = groupDto;
@@ -157,7 +157,7 @@ namespace Umbraco.Core.Persistence.Factories
{
//Internal dictionary for adding "MemberCanEdit" and "VisibleOnProfile" properties to each PropertyType
memberType.MemberTypePropertyTypes.Add(typeDto.Alias,
new MemberTypePropertyProfileAccess(typeDto.ViewOnProfile, typeDto.CanEdit));
new MemberTypePropertyProfileAccess(typeDto.ViewOnProfile, typeDto.CanEdit, typeDto.IsSensitive));
//ensures that any built-in membership properties have their correct dbtype assigned no matter
//what the underlying data type is
@@ -198,4 +198,4 @@ namespace Umbraco.Core.Persistence.Factories
}
}
}
}
@@ -0,0 +1,41 @@
using System.Collections.Concurrent;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Rdbms;
namespace Umbraco.Core.Persistence.Mappers
{
/// <summary>
/// Represents a mapper for audit entry entities.
/// </summary>
[MapperFor(typeof(IAuditEntry))]
[MapperFor(typeof(AuditEntry))]
public sealed class AuditEntryMapper : BaseMapper
{
private static readonly ConcurrentDictionary<string, DtoMapModel> PropertyInfoCacheInstance
= new ConcurrentDictionary<string, DtoMapModel>();
/// <summary>
/// Initializes a new instance of the <see cref="AuditEntryMapper"/> class.
/// </summary>
public AuditEntryMapper()
{
// note: why the base ctor does not invoke BuildMap is a mystery to me
BuildMap();
}
internal override ConcurrentDictionary<string, DtoMapModel> PropertyInfoCache => PropertyInfoCacheInstance;
internal override void BuildMap()
{
CacheMap<AuditEntry, AuditEntryDto>(entity => entity.Id, dto => dto.Id);
CacheMap<AuditEntry, AuditEntryDto>(entity => entity.PerformingUserId, dto => dto.PerformingUserId);
CacheMap<AuditEntry, AuditEntryDto>(entity => entity.PerformingDetails, dto => dto.PerformingDetails);
CacheMap<AuditEntry, AuditEntryDto>(entity => entity.PerformingIp, dto => dto.PerformingIp);
CacheMap<AuditEntry, AuditEntryDto>(entity => entity.EventDateUtc, dto => dto.EventDateUtc);
CacheMap<AuditEntry, AuditEntryDto>(entity => entity.AffectedUserId, dto => dto.AffectedUserId);
CacheMap<AuditEntry, AuditEntryDto>(entity => entity.AffectedDetails, dto => dto.AffectedDetails);
CacheMap<AuditEntry, AuditEntryDto>(entity => entity.EventType, dto => dto.EventType);
CacheMap<AuditEntry, AuditEntryDto>(entity => entity.EventDetails, dto => dto.EventDetails);
}
}
}
@@ -0,0 +1,40 @@
using System.Collections.Concurrent;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Rdbms;
namespace Umbraco.Core.Persistence.Mappers
{
/// <summary>
/// Represents a mapper for consent entities.
/// </summary>
[MapperFor(typeof(IConsent))]
[MapperFor(typeof(Consent))]
public sealed class ConsentMapper : BaseMapper
{
private static readonly ConcurrentDictionary<string, DtoMapModel> PropertyInfoCacheInstance
= new ConcurrentDictionary<string, DtoMapModel>();
/// <summary>
/// Initializes a new instance of the <see cref="ConsentMapper"/> class.
/// </summary>
public ConsentMapper()
{
// note: why the base ctor does not invoke BuildMap is a mystery to me
BuildMap();
}
internal override ConcurrentDictionary<string, DtoMapModel> PropertyInfoCache => PropertyInfoCacheInstance;
internal override void BuildMap()
{
CacheMap<Consent, ConsentDto>(entity => entity.Id, dto => dto.Id);
CacheMap<Consent, ConsentDto>(entity => entity.Current, dto => dto.Current);
CacheMap<Consent, ConsentDto>(entity => entity.CreateDate, dto => dto.CreateDate);
CacheMap<Consent, ConsentDto>(entity => entity.Source, dto => dto.Source);
CacheMap<Consent, ConsentDto>(entity => entity.Context, dto => dto.Context);
CacheMap<Consent, ConsentDto>(entity => entity.Action, dto => dto.Action);
CacheMap<Consent, ConsentDto>(entity => entity.State, dto => dto.State);
CacheMap<Consent, ConsentDto>(entity => entity.Comment, dto => dto.Comment);
}
}
}
@@ -178,11 +178,13 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
_database.Insert("umbracoUserGroup", "id", false, new UserGroupDto { Id = 2, StartMediaId = -1, StartContentId = -1, Alias = "writer", Name = "Writers", DefaultPermissions = "CAH:F", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-edit" });
_database.Insert("umbracoUserGroup", "id", false, new UserGroupDto { Id = 3, StartMediaId = -1, StartContentId = -1, Alias = "editor", Name = "Editors", DefaultPermissions = "CADMOSKTPUZ:5Fï", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-tools" });
_database.Insert("umbracoUserGroup", "id", false, new UserGroupDto { Id = 4, StartMediaId = -1, StartContentId = -1, Alias = Constants.Security.TranslatorGroupAlias, Name = "Translators", DefaultPermissions = "AF", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-globe" });
_database.Insert("umbracoUserGroup", "id", false, new UserGroupDto { Id = 5, StartMediaId = -1, StartContentId = -1, Alias = Constants.Security.SensitiveDataGroupAlias, Name = "Sensitive data", DefaultPermissions = "", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-lock" });
}
private void CreateUmbracoUser2UserGroupData()
{
_database.Insert(new User2UserGroupDto { UserGroupId = 1, UserId = 0 });
_database.Insert(new User2UserGroupDto { UserGroupId = 1, UserId = 0 }); //add admin to admins
_database.Insert(new User2UserGroupDto { UserGroupId = 5, UserId = 0 }); //add admin to sensitive data
}
private void CreateUmbracoUserGroup2AppData()
@@ -337,4 +339,4 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
_database.Insert("umbracoMigration", "pk", false, dto);
}
}
}
}
@@ -92,7 +92,9 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
{52, typeof (UserGroup2NodePermissionDto) },
{53, typeof (UserGroup2AppDto) },
{54, typeof (UserStartNodeDto) },
{55, typeof (UserLoginDto)}
{55, typeof (UserLoginDto)},
{56, typeof (ConsentDto)},
{57, typeof (AuditEntryDto)}
};
#endregion
@@ -378,4 +380,4 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
#endregion
}
}
}
@@ -154,6 +154,12 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
return new Version(7, 7, 0);
}
//if the error is for isSensitive column it must be the previous version to 7.9 since that is when it is added
if (Errors.Any(x => x.Item1.Equals("Column") && (x.Item2.InvariantEquals("cmsMemberType,isSensitive"))))
{
return new Version(7, 8, 0);
}
return UmbracoVersion.Current;
}
@@ -214,4 +220,4 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
return sb.ToString();
}
}
}
}
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence.DatabaseAnnotations;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenEightZero
{
[Migration("7.9.0", 1, Constants.System.UmbracoMigrationName)]
public class AddIsSensitiveMemberTypeColumn : MigrationBase
{
public AddIsSensitiveMemberTypeColumn(ISqlSyntaxProvider sqlSyntax, ILogger logger)
: base(sqlSyntax, logger)
{
}
public override void Up()
{
//Don't exeucte if the column is already there
var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToArray();
if (columns.Any(x => x.TableName.InvariantEquals("cmsMemberType") && x.ColumnName.InvariantEquals("isSensitive")) == false)
{
Create.Column("isSensitive").OnTable("cmsMemberType").AsBoolean().WithDefaultValue(0).NotNullable();
}
}
public override void Down()
{
}
}
}
@@ -0,0 +1,29 @@
using System;
using System.Linq;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenNineZero
{
[Migration("7.9.0", 1, Constants.System.UmbracoMigrationName)]
public class AddUmbracoAuditTable : MigrationBase
{
public AddUmbracoAuditTable(ISqlSyntaxProvider sqlSyntax, ILogger logger)
: base(sqlSyntax, logger)
{ }
public override void Up()
{
var tables = SqlSyntax.GetTablesInSchema(Context.Database).ToArray();
if (tables.InvariantContains(AuditEntryDto.TableName))
return;
Create.Table<AuditEntryDto>();
}
public override void Down()
{
throw new NotSupportedException();
}
}
}
@@ -0,0 +1,29 @@
using System.Linq;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenNineZero
{
[Migration("7.9.0", 1, Constants.System.UmbracoMigrationName)]
public class AddUmbracoConsentTable : MigrationBase
{
public AddUmbracoConsentTable(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
{
}
public override void Up()
{
var tables = SqlSyntax.GetTablesInSchema(Context.Database).ToArray();
if (tables.InvariantContains(ConsentDto.TableName))
return;
Create.Table<ConsentDto>();
}
public override void Down()
{
}
}
}
@@ -0,0 +1,37 @@
using System;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenNineZero
{
[Migration("7.9.0", 2, Constants.System.UmbracoMigrationName)]
public class CreateSensitiveDataUserGroup : MigrationBase
{
public CreateSensitiveDataUserGroup(ISqlSyntaxProvider sqlSyntax, ILogger logger)
: base(sqlSyntax, logger)
{
}
public override void Up()
{
Execute.Code(database =>
{
//Don't exeucte if the group is already there
var exists = database.ExecuteScalar<int>("SELECT COUNT(*) FROM umbracoUserGroup WHERE userGroupAlias = @userGroupAlias",
new {userGroupAlias = Constants.Security.SensitiveDataGroupAlias });
if (exists == 0)
{
var resultId = database.Insert("umbracoUserGroup", "id", new UserGroupDto { StartMediaId = -1, StartContentId = -1, Alias = Constants.Security.SensitiveDataGroupAlias, Name = "Sensitive data", DefaultPermissions = "", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-lock" });
database.Insert(new User2UserGroupDto { UserGroupId = Convert.ToInt32(resultId), UserId = 0 }); //add admin to sensitive data
}
return string.Empty;
});
}
public override void Down()
{
}
}
}
@@ -6,6 +6,7 @@ using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZero
@@ -343,15 +344,24 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe
if (tables.InvariantContains("umbracoUserType") && tables.InvariantContains("umbracoUser"))
{
if (constraints.Any(x => x.Item1.InvariantEquals("umbracoUser") && x.Item3.InvariantEquals("FK_umbracoUser_umbracoUserType_id")))
if (Context.CurrentDatabaseProvider == DatabaseProviders.MySql)
{
Delete.ForeignKey("FK_umbracoUser_umbracoUserType_id").OnTable("umbracoUser");
//In MySql, this will drop the FK according to it's special naming rules
Delete.ForeignKey().FromTable("umbracoUser").ForeignColumn("userType").ToTable("umbracoUserType").PrimaryColumn("id");
}
//This is the super old constraint name of the FK for user type so check this one too
if (constraints.Any(x => x.Item1.InvariantEquals("umbracoUser") && x.Item3.InvariantEquals("FK_user_userType")))
else
{
Delete.ForeignKey("FK_user_userType").OnTable("umbracoUser");
}
//Delete the FK if it exists before dropping the column
if (constraints.Any(x => x.Item1.InvariantEquals("umbracoUser") && x.Item3.InvariantEquals("FK_umbracoUser_umbracoUserType_id")))
{
Delete.ForeignKey("FK_umbracoUser_umbracoUserType_id").OnTable("umbracoUser");
}
//This is the super old constraint name of the FK for user type so check this one too
if (constraints.Any(x => x.Item1.InvariantEquals("umbracoUser") && x.Item3.InvariantEquals("FK_user_userType")))
{
Delete.ForeignKey("FK_user_userType").OnTable("umbracoUser");
}
}
Delete.Column("userType").FromTable("umbracoUser");
Delete.Table("umbracoUserType");
@@ -361,4 +371,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSevenZe
public override void Down()
{ }
}
}
}
@@ -0,0 +1,44 @@
using System.IO;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence.SqlSyntax;
using File = System.IO.File;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTenZero
{
/// <summary>
/// Renames the preview folder containing static html files to ensure it does not interfere with the MVC route
/// that is now supposed to render these views dynamically. We don't want to delete as people may have made
/// customizations to these files that would need to be migrated to the new .cshtml view files.
/// </summary>
[Migration("7.10.0", 1, Constants.System.UmbracoMigrationName)]
public class RenamePreviewFolder : MigrationBase
{
public RenamePreviewFolder(ISqlSyntaxProvider sqlSyntax, ILogger logger)
: base(sqlSyntax, logger)
{
}
public override void Up()
{
var previewFolderPath = IOHelper.MapPath(SystemDirectories.Umbraco + "/preview");
if (Directory.Exists(previewFolderPath))
{
var newPath = previewFolderPath.Replace("preview", "preview.old");
if (Directory.Exists(newPath) == false)
{
Directory.Move(previewFolderPath, newPath);
var readmeText =
$"Static html files used for preview and canvas editing functionality no longer live in this directory.\r\n" +
$"Instead they have been recreated as MVC views and can now be found in '~/Umbraco/Views/Preview'.\r\n" +
$"See issue: http://issues.umbraco.org/issue/U4-11090";
File.WriteAllText(Path.Combine(newPath, "readme.txt"), readmeText);
}
}
}
public override void Down()
{
}
}
}
@@ -0,0 +1,131 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence.Factories;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Persistence.UnitOfWork;
namespace Umbraco.Core.Persistence.Repositories
{
/// <summary>
/// Represents the PetaPoco implementatino of <see cref="IAuditEntryRepository"/>.
/// </summary>
internal class AuditEntryRepository : PetaPocoRepositoryBase<int, IAuditEntry>, IAuditEntryRepository
{
/// <summary>
/// Initializes a new instance of the <see cref="AuditEntryRepository"/> class.
/// </summary>
public AuditEntryRepository(IScopeUnitOfWork work, CacheHelper cache, ILogger logger, ISqlSyntaxProvider sqlSyntax)
: base(work, cache, logger, sqlSyntax)
{ }
protected override Guid NodeObjectTypeId => throw new NotSupportedException();
/// <inheritdoc />
protected override IAuditEntry PerformGet(int id)
{
var sql = new Sql()
.Select("*")
.From<AuditEntryDto>(SqlSyntax)
.Where<AuditEntryDto>(x => x.Id == id, SqlSyntax);
var dto = Database.FirstOrDefault<AuditEntryDto>(sql);
return dto == null ? null : AuditEntryFactory.BuildEntity(dto); }
/// <inheritdoc />
protected override IEnumerable<IAuditEntry> PerformGetAll(params int[] ids)
{
if (ids.Length == 0)
{
var sql = new Sql()
.Select("*")
.From<AuditEntryDto>(SqlSyntax);
return Database.Fetch<AuditEntryDto>(sql).Select(AuditEntryFactory.BuildEntity);
}
var entries = new List<IAuditEntry>();
foreach (var group in ids.InGroupsOf(2000))
{
var sql = new Sql()
.Select("*")
.From<AuditEntryDto>(SqlSyntax)
.WhereIn<AuditEntryDto>(x => x.Id, group, SqlSyntax);
entries.AddRange(Database.Fetch<AuditEntryDto>(sql).Select(AuditEntryFactory.BuildEntity));
}
return entries;
}
/// <inheritdoc />
protected override IEnumerable<IAuditEntry> PerformGetByQuery(IQuery<IAuditEntry> query)
{
var sqlClause = GetBaseQuery(false);
var translator = new SqlTranslator<IAuditEntry>(sqlClause, query);
var sql = translator.Translate();
return Database.Fetch<AuditEntryDto>(sql).Select(AuditEntryFactory.BuildEntity);
}
/// <inheritdoc />
protected override Sql GetBaseQuery(bool isCount)
{
return new Sql().Select(isCount ? "COUNT(*)" : "*").From<AuditEntryDto>(SqlSyntax);
}
/// <inheritdoc />
protected override string GetBaseWhereClause()
{
return $"{AuditEntryDto.TableName}.id = @Id";
}
/// <inheritdoc />
protected override IEnumerable<string> GetDeleteClauses()
{
throw new NotSupportedException("Audit entries cannot be deleted.");
}
/// <inheritdoc />
protected override void PersistNewItem(IAuditEntry entity)
{
((Entity) entity).AddingEntity();
var dto = AuditEntryFactory.BuildDto(entity);
Database.Insert(dto);
entity.Id = dto.Id;
entity.ResetDirtyProperties();
}
/// <inheritdoc />
protected override void PersistUpdatedItem(IAuditEntry entity)
{
throw new NotSupportedException("Audit entries cannot be updated.");
}
/// <inheritdoc />
public IEnumerable<IAuditEntry> GetPage(long pageIndex, int pageCount, out long records)
{
var sql = new Sql()
.Select("*")
.From<AuditEntryDto>(SqlSyntax)
.OrderByDescending<AuditEntryDto>(x => x.EventDateUtc, SqlSyntax);
var page = Database.Page<AuditEntryDto>(pageIndex + 1, pageCount, sql);
records = page.TotalItems;
return page.Items.Select(AuditEntryFactory.BuildEntity);
}
/// <inheritdoc />
public bool IsAvailable()
{
var tables = SqlSyntax.GetTablesInSchema(Database).ToArray();
return tables.InvariantContains(AuditEntryDto.TableName);
}
}
}
@@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence.Factories;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Persistence.UnitOfWork;
namespace Umbraco.Core.Persistence.Repositories
{
/// <summary>
/// Represents the PetaPoco implementation of <see cref="IConsentRepository"/>.
/// </summary>
internal class ConsentRepository : PetaPocoRepositoryBase<int, IConsent>, IConsentRepository
{
/// <summary>
/// Initializes a new instance of the <see cref="ConsentRepository"/> class.
/// </summary>
public ConsentRepository(IScopeUnitOfWork work, CacheHelper cache, ILogger logger, ISqlSyntaxProvider sqlSyntax)
: base(work, cache, logger, sqlSyntax)
{ }
/// <inheritdoc />
protected override Guid NodeObjectTypeId => throw new NotSupportedException();
/// <inheritdoc />
public void ClearCurrent(string source, string context, string action)
{
var sql = new Sql($@"UPDATE {SqlSyntax.GetQuotedTableName(ConsentDto.TableName)}
SET {SqlSyntax.GetQuotedColumnName("current")} = @0
WHERE {SqlSyntax.GetQuotedColumnName("source")} = @1 AND {SqlSyntax.GetQuotedColumnName("context")} = @2 AND {SqlSyntax.GetQuotedColumnName("action")} = @3
AND {SqlSyntax.GetQuotedColumnName("current")} <> @0 ", false, source, context, action);
Database.Execute(sql);
}
/// <inheritdoc />
protected override IConsent PerformGet(int id)
{
throw new NotImplementedException();
}
/// <inheritdoc />
protected override IEnumerable<IConsent> PerformGetAll(params int[] ids)
{
throw new NotImplementedException();
}
/// <inheritdoc />
protected override IEnumerable<IConsent> PerformGetByQuery(IQuery<IConsent> query)
{
var sqlClause = new Sql().Select("*").From<ConsentDto>(SqlSyntax);
var translator = new SqlTranslator<IConsent>(sqlClause, query);
var sql = translator.Translate().OrderByDescending<ConsentDto>(x => x.CreateDate, SqlSyntax);
return ConsentFactory.BuildEntities(Database.Fetch<ConsentDto>(sql));
}
/// <inheritdoc />
protected override Sql GetBaseQuery(bool isCount)
{
throw new NotImplementedException();
}
/// <inheritdoc />
protected override string GetBaseWhereClause()
{
throw new NotImplementedException();
}
/// <inheritdoc />
protected override IEnumerable<string> GetDeleteClauses()
{
throw new NotImplementedException();
}
/// <inheritdoc />
protected override void PersistNewItem(IConsent entity)
{
((Entity) entity).AddingEntity();
var dto = ConsentFactory.BuildDto(entity);
Database.Insert(dto);
entity.Id = dto.Id;
entity.ResetDirtyProperties();
}
/// <inheritdoc />
protected override void PersistUpdatedItem(IConsent entity)
{
((Entity) entity).UpdatingEntity();
var dto = ConsentFactory.BuildDto(entity);
Database.Update(dto);
entity.ResetDirtyProperties();
IsolatedCache.ClearCacheItem(GetCacheIdKey<IConsent>(entity.Id));
}
}
}
@@ -18,7 +18,7 @@ namespace Umbraco.Core.Persistence.Repositories
/// <remarks>
/// This is limited to objects that are based in the umbracoNode-table.
/// </remarks>
internal class EntityRepository : DisposableObject, IEntityRepository
internal class EntityRepository : DisposableObjectSlim, IEntityRepository
{
private readonly IDatabaseUnitOfWork _work;
@@ -9,7 +9,7 @@ using Umbraco.Core.Persistence.UnitOfWork;
namespace Umbraco.Core.Persistence.Repositories
{
internal abstract class FileRepository<TId, TEntity> : DisposableObject, IUnitOfWorkRepository, IRepository<TId, TEntity>
internal abstract class FileRepository<TId, TEntity> : DisposableObjectSlim, IUnitOfWorkRepository, IRepository<TId, TEntity>
where TEntity : IFile
{
private IUnitOfWork _work;
@@ -0,0 +1,22 @@
using System.Collections.Generic;
using Umbraco.Core.Models;
namespace Umbraco.Core.Persistence.Repositories
{
/// <summary>
/// Represents a repository for <see cref="IAuditEntry"/> entities.
/// </summary>
public interface IAuditEntryRepository : IRepositoryQueryable<int, IAuditEntry>
{
/// <summary>
/// Gets a page of entries.
/// </summary>
IEnumerable<IAuditEntry> GetPage(long pageIndex, int pageCount, out long records);
/// <summary>
/// Determines whether the repository is available.
/// </summary>
/// <remarks>During an upgrade, the repository may not be available, until the table has been created.</remarks>
bool IsAvailable();
}
}
@@ -0,0 +1,15 @@
using Umbraco.Core.Models;
namespace Umbraco.Core.Persistence.Repositories
{
/// <summary>
/// Represents a repository for <see cref="IConsent"/> entities.
/// </summary>
public interface IConsentRepository : IRepositoryQueryable<int, IConsent>
{
/// <summary>
/// Clears the current flag.
/// </summary>
void ClearCurrent(string source, string context, string action);
}
}
@@ -39,5 +39,7 @@ namespace Umbraco.Core.Persistence.Repositories
void AssignRoles(int[] memberIds, string[] roleNames);
void DissociateRoles(int[] memberIds, string[] roleNames);
int[] GetMemberIds(string[] names);
}
}
}
@@ -183,7 +183,7 @@ namespace Umbraco.Core.Persistence.Repositories
}
public IEnumerable<IMemberGroup> GetMemberGroupsForMember(string username)
{
{
var sql = new Sql()
.Select("un.*")
.From("umbracoNode AS un")
@@ -192,16 +192,15 @@ namespace Umbraco.Core.Persistence.Repositories
.InnerJoin("cmsMember")
.On("cmsMember.nodeId = cmsMember2MemberGroup.Member")
.Where("un.nodeObjectType=@objectType", new { objectType = NodeObjectTypeId })
.Where("cmsMember.LoginName=@loginName", new { loginName = username });
.Where("cmsMember.LoginName=@loginName", new { loginName = username });
return Database.Fetch<NodeDto>(sql)
.DistinctBy(dto => dto.NodeId)
.Select(x => _modelFactory.BuildEntity(x));
}
public void AssignRoles(string[] usernames, string[] roleNames)
public int[] GetMemberIds(string[] names)
{
//first get the member ids based on the usernames
var memberSql = new Sql();
var memberObjectType = new Guid(Constants.ObjectTypes.Member);
memberSql.Select("umbracoNode.id")
@@ -209,25 +208,19 @@ namespace Umbraco.Core.Persistence.Repositories
.InnerJoin<MemberDto>()
.On<NodeDto, MemberDto>(dto => dto.NodeId, dto => dto.NodeId)
.Where<NodeDto>(x => x.NodeObjectType == memberObjectType)
.Where("cmsMember.LoginName in (@usernames)", new { usernames = usernames });
var memberIds = Database.Fetch<int>(memberSql).ToArray();
.Where("cmsMember.LoginName in (@names)", new { names });
return Database.Fetch<int>(memberSql).ToArray();
}
public void AssignRoles(string[] usernames, string[] roleNames)
{
var memberIds = GetMemberIds(usernames);
AssignRolesInternal(memberIds, roleNames);
}
public void DissociateRoles(string[] usernames, string[] roleNames)
{
//first get the member ids based on the usernames
var memberSql = new Sql();
var memberObjectType = new Guid(Constants.ObjectTypes.Member);
memberSql.Select("umbracoNode.id")
.From<NodeDto>()
.InnerJoin<MemberDto>()
.On<NodeDto, MemberDto>(dto => dto.NodeId, dto => dto.NodeId)
.Where<NodeDto>(x => x.NodeObjectType == memberObjectType)
.Where("cmsMember.LoginName in (@usernames)", new { usernames = usernames });
var memberIds = Database.Fetch<int>(memberSql).ToArray();
var memberIds = GetMemberIds(usernames);
DissociateRolesInternal(memberIds, roleNames);
}
@@ -337,4 +330,4 @@ namespace Umbraco.Core.Persistence.Repositories
/// </summary>
internal static event TypedEventHandler<IMemberGroupRepository, SaveEventArgs<IMemberGroup>> SavedMemberGroup;
}
}
}
@@ -90,7 +90,8 @@ namespace Umbraco.Core.Persistence.Repositories
sql.Select("umbracoNode.*", "cmsContentType.*", "cmsPropertyType.id AS PropertyTypeId", "cmsPropertyType.Alias",
"cmsPropertyType.Name", "cmsPropertyType.Description", "cmsPropertyType.mandatory", "cmsPropertyType.UniqueID",
"cmsPropertyType.validationRegExp", "cmsPropertyType.dataTypeId", "cmsPropertyType.sortOrder AS PropertyTypeSortOrder",
"cmsPropertyType.propertyTypeGroupId AS PropertyTypesGroupId", "cmsMemberType.memberCanEdit", "cmsMemberType.viewOnProfile",
"cmsPropertyType.propertyTypeGroupId AS PropertyTypesGroupId",
"cmsMemberType.memberCanEdit", "cmsMemberType.viewOnProfile", "cmsMemberType.isSensitive",
"cmsDataType.propertyEditorAlias", "cmsDataType.dbType", "cmsPropertyTypeGroup.id AS PropertyTypeGroupId",
"cmsPropertyTypeGroup.text AS PropertyGroupName", "cmsPropertyTypeGroup.uniqueID AS PropertyGroupUniqueID",
"cmsPropertyTypeGroup.sortorder AS PropertyGroupSortOrder", "cmsPropertyTypeGroup.contenttypeNodeId")
@@ -362,4 +363,4 @@ namespace Umbraco.Core.Persistence.Repositories
return Attempt<Guid>.Fail(propertyEditor);
}
}
}
}
@@ -10,7 +10,7 @@ using Umbraco.Core.Scoping;
namespace Umbraco.Core.Persistence.Repositories
{
internal abstract class RepositoryBase : DisposableObject
internal abstract class RepositoryBase : DisposableObjectSlim
{
private readonly IScopeUnitOfWork _work;
private readonly CacheHelper _globalCache;
@@ -308,6 +308,9 @@ namespace Umbraco.Core.Persistence.Repositories
public virtual void PersistNewItem(IEntity entity)
{
CachePolicy.Create((TEntity) entity, PersistNewItem);
//TODO: In v8 we should automatically reset dirty properties so they don't have to be manually reset in all of the implemented repositories
//if (entity is ICanBeDirty dirty) dirty.ResetDirtyProperties();
}
/// <summary>
@@ -317,6 +320,8 @@ namespace Umbraco.Core.Persistence.Repositories
public virtual void PersistUpdatedItem(IEntity entity)
{
CachePolicy.Update((TEntity) entity, PersistUpdatedItem);
//TODO: In v8 we should automatically reset dirty properties so they don't have to be manually reset in all of the implemented repositories
//if (entity is ICanBeDirty dirty) dirty.ResetDirtyProperties();
}
/// <summary>
@@ -343,4 +348,4 @@ namespace Umbraco.Core.Persistence.Repositories
UnitOfWork.DisposeIfDisposable();
}
}
}
}
@@ -20,6 +20,12 @@ namespace Umbraco.Core.Persistence.Repositories
var name = Name;
// cater for instances where node has no name.
if(string.IsNullOrWhiteSpace(name))
{
return _numPos;
}
if (name[name.Length - 1] != ')')
return _numPos = -1;
@@ -106,7 +112,7 @@ namespace Umbraco.Core.Persistence.Repositories
}
}
return uniqueing ? string.Concat(nodeName, " (", uniqueNumber.ToString(), ")") : nodeName;
return uniqueing || string.IsNullOrWhiteSpace(nodeName) ? string.Concat(nodeName, " (", uniqueNumber.ToString(), ")") : nodeName;
}
}
}
@@ -285,7 +285,7 @@ umbracoUserGroup.userGroupName, umbracoUserGroup2App.app, umbracoUserGroup2App.u
protected override void PersistNewItem(IUserGroup entity)
{
((UserGroup)entity).AddingEntity();
((UserGroup)entity).AddingEntity();
var userGroupDto = UserGroupFactory.BuildDto(entity);
@@ -293,6 +293,8 @@ umbracoUserGroup.userGroupName, umbracoUserGroup2App.app, umbracoUserGroup2App.u
entity.Id = id;
PersistAllowedSections(entity);
entity.ResetDirtyProperties();
}
protected override void PersistUpdatedItem(IUserGroup entity)
@@ -304,6 +306,8 @@ umbracoUserGroup.userGroupName, umbracoUserGroup2App.app, umbracoUserGroup2App.u
Database.Update(userGroupDto);
PersistAllowedSections(entity);
entity.ResetDirtyProperties();
}
private void PersistAllowedSections(IUserGroup entity)
@@ -456,4 +460,4 @@ umbracoUserGroup.userGroupName, umbracoUserGroup2App.app, umbracoUserGroup2App.u
}
}
}
}
}
@@ -54,8 +54,8 @@ namespace Umbraco.Core.Persistence
//if the result is already a DeepCloneRuntimeCacheProvider then return it, otherwise
//wrap the result with a DeepCloneRuntimeCacheProvider
return cache is DeepCloneRuntimeCacheProvider
? cache
return cache is DeepCloneRuntimeCacheProvider
? cache
: new DeepCloneRuntimeCacheProvider(cache);
};
}
@@ -158,11 +158,11 @@ namespace Umbraco.Core.Persistence
CreateTemplateRepository(uow),
CreateTagRepository(uow),
_settings.Content)
{
{
//duplicates are allowed
EnsureUniqueNaming = false
};
}
}
public virtual IContentTypeRepository CreateContentTypeRepository(IScopeUnitOfWork uow)
{
@@ -319,13 +319,13 @@ namespace Umbraco.Core.Persistence
var userMembershipProvider = MembershipProviderExtensions.GetUsersMembershipProvider();
var passwordConfig = userMembershipProvider == null || userMembershipProvider.PasswordFormat != MembershipPasswordFormat.Hashed
? null
: new System.Collections.Generic.Dictionary<string, string> {{"hashAlgorithm", Membership.HashAlgorithmType}};
: new System.Collections.Generic.Dictionary<string, string> {{"hashAlgorithm", Membership.HashAlgorithmType}};
return new UserRepository(
uow,
//Need to cache users - we look up user information more than anything in the back office!
_cacheHelper,
_logger,
_logger,
_sqlSyntax,
passwordConfig);
}
@@ -397,5 +397,15 @@ namespace Umbraco.Core.Persistence
_logger,
_sqlSyntax);
}
public IConsentRepository CreateConsentRepository(IScopeUnitOfWork uow)
{
return new ConsentRepository(uow, _cacheHelper, _logger, _sqlSyntax);
}
public IAuditEntryRepository CreateAuditEntryRepository(IScopeUnitOfWork uow)
{
return new AuditEntryRepository(uow, _cacheHelper, _logger, _sqlSyntax);
}
}
}
@@ -10,7 +10,7 @@ namespace Umbraco.Core.Persistence.UnitOfWork
/// <summary>
/// Represents a scoped unit of work.
/// </summary>
internal class ScopeUnitOfWork : DisposableObject, IScopeUnitOfWork
internal class ScopeUnitOfWork : DisposableObjectSlim, IScopeUnitOfWork
{
private readonly Queue<Operation> _operations = new Queue<Operation>();
private readonly IsolationLevel _isolationLevel;
@@ -21,7 +21,7 @@ namespace Umbraco.Core.PropertyEditors
public PropertyEditorResolver(IServiceProvider serviceProvider, ILogger logger, Func<IEnumerable<Type>> typeListProducerList, IRuntimeCacheProvider runtimeCache)
: base(serviceProvider, logger, typeListProducerList, ObjectLifetimeScope.Application)
{
var builder = new ManifestBuilder(
var builder = new ManifestBuilder(
runtimeCache,
new ManifestParser(new DirectoryInfo(IOHelper.MapPath("~/App_Plugins")), runtimeCache));
@@ -49,7 +49,10 @@ namespace Umbraco.Core.PropertyEditors
{
var nestedContentEditorFromPackage = editors.FirstOrDefault(x => x.Alias == "Our.Umbraco.NestedContent");
if (nestedContentEditorFromPackage != null)
{
nestedContentEditorFromPackage.Name = "(Obsolete) " + nestedContentEditorFromPackage.Name;
nestedContentEditorFromPackage.IsDeprecated = true;
}
return editors;
}
@@ -74,4 +77,4 @@ namespace Umbraco.Core.PropertyEditors
return PropertyEditors.SingleOrDefault(x => x.Alias == alias);
}
}
}
}
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Xml.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core.Logging;
using Umbraco.Core.Manifest;
using Umbraco.Core.Models;
@@ -176,6 +176,12 @@ namespace Umbraco.Core.PropertyEditors
/// <returns></returns>
internal Attempt<object> TryConvertValueToCrlType(object value)
{
var jv = value as JValue;
if (jv != null)
{
value = value.ToString();
}
//this is a custom check to avoid any errors, if it's a string and it's empty just make it null
var s = value as string;
if (s != null)
@@ -391,4 +397,4 @@ namespace Umbraco.Core.PropertyEditors
}
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More