Skip to content

Commit

Permalink
Merge branch 'develop' into 1.1
Browse files Browse the repository at this point in the history
* develop: (95 commits)
  Fix unit tests
  Ensure route attributes from plugins are properly loaded
  Revert "Support ReportContainers that are aliases of real ReportContainers"
  Ensure all plugins are uninstalled when the system is uninstalled (#114)
  Add history of replacement plugins to the system_plugin_history table (#115)
  Warn when replaced plugins are still present (#109)
  Added plugin registration after loading (#113)
  Fixed issue with taglist when not readOnly but an array value
  Improve handling for null being passed to the ImageResizer
  Add discord badge
  Support ReportContainers that are aliases of real ReportContainers
  Fix registering of namespace aliases
  Use the database version of the plugin when determining database replacement actions
  Fix broken links
  Add support for plugin replacement / forking (#41)
  Add dependency required for the plugin replacement
  Bust the cache on the AJAX framework asset URLs
  Switch to actively maintained faker repository (#74)
  Improve display of changelog
  Improves Froala richeditor link insertion via the pagelinks plugin
  ...
  • Loading branch information
LukeTowers committed Apr 26, 2021
2 parents 9992db6 + 7d8117d commit 7e8b814
Show file tree
Hide file tree
Showing 195 changed files with 2,145 additions and 548 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ jobs:
- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --no-scripts

- name: Reset modules
run: git reset --hard

- name: Run post-update Composer scripts
run: php artisan package:discover

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/utilities/library-switcher
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env php
<?php
/**
* Storm library switch for CI
*
* Switches the version of the Storm library being required through Composer. The only argument is the branch or tag
* to switch to.
*/
if (empty($argv[1])) {
echo 'You must provide a version to switch the library dependency to.';
echo "\n";
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/utilities/phpcs-pr
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env php
<?php
/**
* Run PHPCS tests against a PR.
*
* The only argument is for the PR's base branch, which is then compared to the HEAD of the PR to retrieve the list
* of changed files. The PHPCS tests are only run against these changed files, to speed up the tests.
*/
if (empty($argv[1])) {
echo 'You must provide a base branch to check this PR against.';
echo "\n";
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/utilities/phpcs-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env php
<?php
/**
* Run PHPCS tests against a push.
*
* The only argument is for the commit, which a list of changed files is retrieved from. The PHPCS tests are only run
* against these changed files, to speed up the tests.
*/
if (empty($argv[1])) {
echo 'You must provide a commit SHA to check.';
echo "\n";
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://github.com/wintercms/winter/blob/develop/themes/demo/assets/images/winter.png?raw=true" alt="Winter CMS Logo" width="25%" height="25%" />
<img src="https://github.com/wintercms/winter/raw/develop/modules/backend/assets/images/wordmark.png?raw=true" alt="Winter CMS Logo" width="100%" />
</p>

[Winter](https://wintercms.com) is a Content Management System (CMS) and web platform whose sole purpose is to make your development workflow simple again. It was born out of frustration with existing systems. We feel building websites has become a convoluted and confusing process that leaves developers unsatisfied. We want to turn you around to the simpler side and get back to basics.
Expand All @@ -8,28 +8,29 @@ Winter's mission is to show the world that web development is not rocket science

![Stable Build](https://github.com/wintercms/winter/workflows/Tests/badge.svg?branch=develop)
[![License](https://poser.pugx.org/wintercms/winter/license.svg)](https://packagist.org/packages/wintercms/winter)
[![Discord](https://img.shields.io/discord/816852513684193281?label=discord&style=flat-square)](https://discord.gg/D5MFSPH6Ux)

## Installing Winter

Instructions on how to install Winter can be found at the [installation guide](https://wintercms.com/docs/setup/installation).

### Quick start installation
### Quick Start Installation

For advanced users, run this in your terminal to install Winter from command line:

```shell
composer create-project wintercms/winter example.com "dev-develop"
```

If you plan on using a database, run this command:
If you plan on using a database, run this command inside the application directory.

```shell
php artisan winter:install
```

## Learning Winter

The best place to learn Winter is by [reading the documentation](https://wintercms.com/docs), [watching some screencasts](https://wintercms.com/support/topic/screencast) or [following some tutorials](https://wintercms.com/support/articles/tutorials).
The best place to learn Winter is by [reading the documentation](https://wintercms.com/docs), [watching some screencasts](https://octobercms.com/support/topic/screencast) or [following some tutorials](https://octobercms.com/support/articles/tutorials).

You may also watch these introductory videos for [beginners](https://vimeo.com/79963873) and [advanced users](https://vimeo.com/172202661).

Expand All @@ -44,7 +45,7 @@ The development of Winter is lead by [Luke Towers](https://luketowers.ca/), alon
<td align="center"><a href="https://github.com/luketowers"><img src="https://avatars.githubusercontent.com/u/7253840?v=3" width="100px;" alt="Luke Towers"/><br /><sub><b>Luke Towers</b></sub></a></td>
<td align="center"><a href="https://github.com/bennothommo"><img src="https://avatars.githubusercontent.com/u/15900351?v=3" width="100px;" alt="Ben Thomson"/><br /><sub><b>Ben Thomson</b></sub></a></td>
<td align="center"><a href="https://github.com/mjauvin"><img src="https://avatars.githubusercontent.com/u/2013630?v=3" width="100px;" alt="Marc Jauvin"/><br /><sub><b>Marc Jauvin</b></sub></a></td>
<td align="center"><a href="https://github.com/jaxwilko"><img src="https://avatars.githubusercontent.com/u/31214002?v=4" width="100px;" alt="Jax Wilkinson"/><br /><sub><b>Jax Wilkinson</b></sub></a></td>
<td align="center"><a href="https://github.com/jaxwilko"><img src="https://avatars.githubusercontent.com/u/31214002?v=4" width="100px;" alt="Jack Wilkinson"/><br /><sub><b>Jack Wilkinson</b></sub></a></td>
</tr>
</table>

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"require-dev": {
"phpunit/phpunit": "^8.4|^9.3.3",
"mockery/mockery": "~1.3.3|^1.4.2",
"fzaninotto/faker": "~1.9",
"fakerphp/faker": "~1.9",
"squizlabs/php_codesniffer": "3.*",
"php-parallel-lint/php-parallel-lint": "^1.0",
"dms/phpunit-arraysubset-asserts": "^0.1.0|^0.2.1"
Expand Down
15 changes: 10 additions & 5 deletions config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| WARNING! Do not use anything that is used for other information in your
| application. Example: If you are using redis for managing queues and / or
| sessions, you should NOT be using the EXACT SAME redis connection for the
| Cache store, as calling Cache::flush() will flush the entire redis store.
|
*/

'default' => 'file',
Expand All @@ -29,16 +34,16 @@
'stores' => [

'apc' => [
'driver' => 'apc'
'driver' => 'apc',
],

'array' => [
'driver' => 'array'
'driver' => 'array',
],

'database' => [
'driver' => 'database',
'table' => 'cache',
'driver' => 'database',
'table' => 'cache',
'connection' => null,
],

Expand All @@ -59,7 +64,7 @@
],

'redis' => [
'driver' => 'redis',
'driver' => 'redis',
'connection' => 'default',
],

Expand Down
3 changes: 2 additions & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

'sqlite' => [
'driver' => 'sqlite',
'database' => 'storage/database.sqlite',
'database' => base_path('storage/database.sqlite'),
'prefix' => '',
],

Expand Down Expand Up @@ -144,4 +144,5 @@
*/

'useConfigForTesting' => false,

];
5 changes: 4 additions & 1 deletion config/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@
|
*/

'from' => ['address' => '[email protected]', 'name' => 'Winter CMS'],
'from' => [
'address' => '[email protected]',
'name' => 'Winter CMS',
],

/*
|--------------------------------------------------------------------------
Expand Down
23 changes: 12 additions & 11 deletions config/queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,31 @@

'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'ttr' => 60,
'host' => 'localhost',
'queue' => 'default',
'ttr' => 60,
],

'sqs' => [
'driver' => 'sqs',
'key' => 'your-public-key',
'key' => 'your-public-key',
'secret' => 'your-secret-key',
'queue' => 'your-queue-url',
'queue' => 'your-queue-url',
'region' => 'us-east-1',
],

'iron' => [
'driver' => 'iron',
'host' => 'mq-aws-us-east-1.iron.io',
'token' => 'your-token',
'driver' => 'iron',
'host' => 'mq-aws-us-east-1.iron.io',
'token' => 'your-token',
'project' => 'your-project-id',
'queue' => 'your-queue-name',
'queue' => 'your-queue-name',
'encrypt' => true,
],

'redis' => [
'driver' => 'redis',
'queue' => 'default',
'queue' => 'default',
'expire' => 60,
],

Expand All @@ -86,7 +86,8 @@
*/

'failed' => [
'database' => 'mysql', 'table' => 'failed_jobs',
'database' => 'mysql',
'table' => 'failed_jobs',
],

];
2 changes: 1 addition & 1 deletion config/testing/cms.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@
|
*/

'enableCsrfProtection' => false
'enableCsrfProtection' => false,

];
9 changes: 7 additions & 2 deletions modules/backend/behaviors/ReorderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,16 @@ protected function validateModel()

if (
isset($modelTraits[\Winter\Storm\Database\Traits\Sortable::class]) ||
$model->isClassExtendedWith(\Winter\Storm\Database\Behaviors\Sortable::class)
$model->isClassExtendedWith(\Winter\Storm\Database\Behaviors\Sortable::class) ||
isset($modelTraits[\October\Rain\Database\Traits\Sortable::class]) ||
$model->isClassExtendedWith(\October\Rain\Database\Behaviors\Sortable::class)
) {
$this->sortMode = 'simple';
}
elseif (isset($modelTraits[\Winter\Storm\Database\Traits\NestedTree::class])) {
elseif (
isset($modelTraits[\Winter\Storm\Database\Traits\NestedTree::class]) ||
isset($modelTraits[\October\Rain\Database\Traits\NestedTree::class])
) {
$this->sortMode = 'nested';
$this->showTree = true;
}
Expand Down
22 changes: 12 additions & 10 deletions modules/backend/classes/NavigationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
class NavigationManager
{
use \Winter\Storm\Support\Traits\Singleton;
use \System\Traits\LazyOwnerAlias;

/**
* @var array Cache of registration callbacks.
Expand Down Expand Up @@ -54,6 +55,9 @@ class NavigationManager
*/
protected function init()
{
foreach (static::$lazyAliases as $alias => $owner) {
$this->registerOwnerAlias($owner, $alias);
}
$this->pluginManager = PluginManager::instance();
}

Expand Down Expand Up @@ -237,7 +241,7 @@ public function registerMenuItems($owner, array $definitions)
*/
public function registerOwnerAlias(string $owner, string $alias)
{
$this->aliases[$alias] = $owner;
$this->aliases[strtoupper($alias)] = strtoupper($owner);
}

/**
Expand Down Expand Up @@ -632,7 +636,7 @@ public function setContext($owner, $mainMenuItemCode, $sideMenuItemCode = null)
*/
public function setContextOwner($owner)
{
$this->contextOwner = $owner;
$this->contextOwner = strtoupper($owner);
}

/**
Expand Down Expand Up @@ -685,7 +689,7 @@ public function setContextSideMenu($sideMenuItemCode)
*/
public function isMainMenuItemActive($item)
{
return $this->getContextOwner() === $item->owner && $this->contextMainMenuItemCode === $item->code;
return $this->getContextOwner() === strtoupper($item->owner) && $this->contextMainMenuItemCode === $item->code;
}

/**
Expand Down Expand Up @@ -716,7 +720,7 @@ public function isSideMenuItemActive($item)
return true;
}

return $this->getContextOwner() === $item->owner && $this->contextSideMenuItemCode === $item->code;
return $this->getContextOwner() === strtoupper($item->owner) && $this->contextSideMenuItemCode === $item->code;
}

/**
Expand All @@ -728,7 +732,7 @@ public function isSideMenuItemActive($item)
*/
public function registerContextSidenavPartial($owner, $mainMenuItemCode, $partial)
{
$this->contextSidenavPartials[$owner.$mainMenuItemCode] = $partial;
$this->contextSidenavPartials[$this->makeItemKey($owner, $mainMenuItemCode)] = $partial;
}

/**
Expand All @@ -741,10 +745,7 @@ public function registerContextSidenavPartial($owner, $mainMenuItemCode, $partia
*/
public function getContextSidenavPartial($owner, $mainMenuItemCode)
{
$owner = $this->aliases[$owner] ?? $owner;
$key = $owner.$mainMenuItemCode;

return $this->contextSidenavPartials[$key] ?? null;
return $this->contextSidenavPartials[$this->makeItemKey($owner, $mainMenuItemCode)] ?? null;
}

/**
Expand Down Expand Up @@ -778,6 +779,7 @@ protected function filterItemPermissions($user, array $items)
*/
protected function makeItemKey($owner, $code)
{
return strtoupper($this->aliases[$owner] ?? $owner).'.'.strtoupper($code);
$owner = strtoupper($owner);
return ($this->aliases[$owner] ?? $owner) . '.' . strtoupper($code);
}
}
27 changes: 12 additions & 15 deletions modules/backend/controllers/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,25 +172,22 @@ public function restore_onSubmit()
}

$user = BackendAuth::findUserByLogin(post('login'));
if (!$user) {
throw new ValidationException([
'login' => trans('backend::lang.account.restore_error', ['login' => post('login')])
]);
}

Flash::success(trans('backend::lang.account.restore_success'));
if ($user) {
$code = $user->getResetPasswordCode();
$link = Backend::url('backend/auth/reset/' . $user->id . '/' . $code);

$code = $user->getResetPasswordCode();
$link = Backend::url('backend/auth/reset/' . $user->id . '/' . $code);
$data = [
'name' => $user->full_name,
'link' => $link,
];

$data = [
'name' => $user->full_name,
'link' => $link,
];
Mail::send('backend::mail.restore', $data, function ($message) use ($user) {
$message->to($user->email, $user->full_name)->subject(trans('backend::lang.account.password_reset'));
});
}

Mail::send('backend::mail.restore', $data, function ($message) use ($user) {
$message->to($user->email, $user->full_name)->subject(trans('backend::lang.account.password_reset'));
});
Flash::success(trans('backend::lang.account.restore_success'));

return Backend::redirect('backend/auth/signin');
}
Expand Down
Loading

0 comments on commit 7e8b814

Please sign in to comment.