91 Commits

Author SHA1 Message Date
Samuel Georges
63f65a3f25 Add XSRF to backend, simplify CMS controller run() method
runInternal has been removed because we do not want to blanket our response logic over every single response, only the happy path. This is because it is impossible to remove. So it is better to take the inverted approach, where if you want the CMS' headers in your custom response, add them yourself. This becomes easy via the new makeResponse() method
2019-11-02 19:14:45 +11:00
Samuel Georges
9d120ad66b Add header and cookie support to ResponseMaker 2019-11-02 18:57:32 +11:00
Samuel Georges
ff8f899fbe Move response common functions to ResponseMaker trait 2019-11-02 18:21:22 +11:00
Samuel Georges
b1fa45ee3a Combine common CSRF logic to a trait 2019-11-02 15:15:18 +11:00
Luke Towers
e246427463 Provide system.assets.beforeAddAsset event to modify asset attributes
Fixes octobercms/october#4611 (when combined with a PR to https://github.com/heathdutton/cloudflare)
Related: octobercms/october#4092, octobercms/october#3841, octobercms/october#3839
2019-10-09 11:51:06 -06:00
Samuell
33d149fe1a Replace caching of Theme config with generic YAML caching (#4526)
Credit to @Samuell1. Fixes issues related to complexity of the existing approach / cache invalidation by just using the caching built in to YAML::parseFile().
2019-09-25 11:36:35 -06:00
Ben Thomson
a59d3b83eb Code quality clean up (#4449)
Credit to @bennothommo
2019-07-18 08:50:37 -06:00
Rachasak Ragkamnerd
70cd444f8a Added support for 'cache' attribute to addJs() to disable CF RocketLoader (#4092)
Credit to @itpcc 

Due to CloudFlare Rocket Loader, CF will automatically try to optimize page loading speed by changing script type attribute. This breaks the script execution order and makes the user unable to upload the file(s) in the backend using "FileUpload" widget.

However, [CloudFlare allows adding "data-cfasync"](https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-specific-JavaScripts-) to prevent this. And it was used in the [commit #3841](https://github.com/octobercms/october/pull/3841/files).
2019-04-16 20:27:13 -06:00
Luke Towers
639339d55e Stop automatically creating camel case versions of top level configuration keys
This would cause issues with repeaters in grouped mode that have an underscore in one of the groups as it would duplicate that group entry.
2019-03-18 14:08:47 -06:00
Nicolas Da Mutten
aeb7616d06 Automatically use local asset path when attempting to combine injected assets (#3802)
Credit to @cleverer. Fixes #3264.
2018-09-24 14:17:00 -06:00
Nathan van der Werf
0f0d108da0
Remove unused imports 2018-08-24 19:51:59 +02:00
Nathan van der Werf
66fa03f17e
Revert "Remove unused imports"
This reverts commit 742a5f415bc45819b11c77402efc114fa2f4451e.
2018-08-24 19:40:40 +02:00
Nathan van der Werf
8b6f11e6ac Extract child instructions 2018-08-15 19:25:42 +02:00
Nathan van der Werf
fbca3bea92 Remove redundant variables 2018-08-15 19:23:12 +02:00
Nathan van der Werf
62c59a4903 Refactor ternary operators to null coalescing operators 2018-08-15 19:15:13 +02:00
Nathan van der Werf
123145fd54 Remove unnecessary parentheses 2018-08-15 18:49:52 +02:00
Nathan van der Werf
742a5f415b Remove unused imports 2018-08-15 18:27:36 +02:00
Lucas Thurston
85dd0b9968 Add config flag for disabling basedir restrictions for local development only (#3626)
Fixes #3619. Credit to @lthurston
2018-07-05 17:07:38 -04:00
Samuel Georges
fb2aa1730c Fixes security issue
Refs #3604
2018-06-22 22:57:38 +10:00
Luke Towers
7d4912b80a Revert "Use fireCombinedEvent to handle fireSystemEvent."
This reverts commit eb5b568b6f4e29e0920c2fe107e8d7ba045fec1d.
2018-05-17 02:16:19 -06:00
Luke Towers
eb5b568b6f Use fireCombinedEvent to handle fireSystemEvent.
Refs: d0cdf0ae6e
2018-05-17 01:44:41 -06:00
Luke Towers
5acbdb12fe Compiled assets and whitespace cleanup 2018-04-17 13:43:51 -06:00
Vojta Svoboda
04cb4ddd2c Check if given partial name is also file or only folder (#3190)
Fixes #2383. Credit to @vojtasvoboda, reviewed by @CptMeatball
2017-10-23 08:48:34 -06:00
Samuel Georges
c0aa03a400 Create an error making trait
Widgets can throw fatal errors too
2017-06-11 22:38:03 +10:00
Samuel Georges
f3de51e992 Add backend and notifications settings category
URL -> url
Move mail settings below mail templates
2017-06-05 17:36:44 +10:00
Luke Towers
68e874dc97 AssetMaker Improvements (#2847)
* Check if asset file exists before symbolizing path

Adds a check to see if the asset file exists before attempting to symbolize it, this will allow the asset combiner to be passed assets with complete paths instead of only relative paths.

* Implement combiner business logic

* Improve handling of bad inputs
2017-04-27 00:17:05 -06:00
Quezler
cc17b679f1 Code dusting (#2826)
Code cleaning according to PSR-2 w/ exemptions (mostly dust).
2017-04-24 21:38:19 +10:00
Samuel Georges
96d0ce1c20 Add mergeConfig helper, useful for extension
Refs 8575ece07d
2017-04-17 09:55:50 +10:00
Samuel Georges
e54cf7133b Improve some inline docs in preparation for API docs 2017-03-14 19:36:17 +11:00
Samuel Georges
0162e99747 Minor fixes #2580 2017-01-08 10:26:06 +11:00
Samuel Georges
0a2b343047 Simplify system events
This pipes all event calls through a new EventEmitter trait, which substitutes the October Rain event emitter trait. The view event has been moved to this trait also.
Pass some variables by reference to allow multi-extension.
Fixes #2420
2016-12-10 09:02:06 +11:00
Samuel Georges
0aadcc6675 Merge paths and vars when calling widget handler
When an AJAX handler is called for a widget, the view paths and specified variables should be merged in to the controller. This sets the appropriate context:

1) Look at the widget first
2) Fall back to the controller

Fixes #2432
2016-11-02 08:50:15 +11:00
Samuel Georges
57b10704ce Support for overriding list views
For consistency, entry partial for controller behaviors should be called "container"
Added addViewPath() method to ViewMaker
Remove "fa" from icon docs (not necessary)
Fixes #2439
2016-10-29 14:10:21 +11:00
Samuel Georges
f74d95392f Fix instances where defineProperties returns nothing
addPurgeableAttribute -> addPurgeable
2016-10-19 07:21:09 +11:00
Samuel Georges
676196d304 Use starts_with instead of regex 2016-07-16 15:34:20 +10:00
Samuel Georges
74a6a71bcb Parameters -> Parameter
(Models should be singular)
2016-05-31 08:17:48 +10:00
Samuel Georges
ba57dd8993 clearAssetDefinitions -> flushAssets 2016-04-12 18:04:15 +10:00
Samuel Georges
54d749f034 Like setProperty(), this should not return a value 2016-02-17 17:49:52 +11:00
Samuel Georges
808c8f0ca4 Minor tidy and rollback from #1720 2016-02-13 14:41:17 +11:00
Joshua Wilson
6f3d7a58f2 Phpdoc cleanup for System\Traits
removed in WidgetMaker trait

phpdoc cleanup of backend traits and classes

Minor fix for cases when file is not found
2016-02-13 14:06:50 +11:00
Samuel Georges
b65a653176 Add ability to null asset broadcasting from AJAX 2016-01-16 17:12:54 +11:00
Samuel Georges
5f9a076025 Remove debug code 2016-01-02 16:19:13 +11:00
Samuel Georges
2213c6f28c Fix string comparison function
Flush stray output on view errors
2016-01-02 16:13:30 +11:00
Vojta Svoboda
16eb704793 Add missing PHPDoc @return tag 2015-10-17 09:17:37 +11:00
Samuel Georges
7f502768dc Adds new view event system, add event to sign in form 2015-08-28 04:31:41 +10:00
Samuel Georges
9ed73e0cba Updates for new symbolizePath API, requires latest rain lib code
Backend layouts can now be provided by plugins
2015-05-30 15:54:47 +10:00
Samuel Georges
8e69039c0d Adds folder support for making partials 2015-04-14 22:17:10 +10:00
Samuel Georges
a8389fb1aa Tooltip now auto initializes
initForm can now pass context
Various improvements and bug fixes
2015-03-12 20:50:16 +11:00
Samuel Georges
507bfab768 !!! *BREAKING*: Form widget base class no longer takes a model as the 2nd argument, it should be passed as model in the configuration instead. 2015-03-06 20:37:05 +11:00
Samuel Georges
7032e43b92 Fixes weird issue when a folder named '/files' in the base path kills the CMS 2015-02-26 23:14:08 +11:00