diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 99fbbc3..16622b9 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -13,12 +13,12 @@ jobs:
strategy:
max-parallel: 6
matrix:
- phpVersions: ['7.2', '7.3', '7.4']
+ phpVersions: ['7.2', '7.3', '7.4', '8.0']
fail-fast: false
env:
phpExtensions: mbstring, intl, gd, xml, sqlite
cacheKey: ext-cache-v1
- octoberCmsRelease: develop
+ winterCmsRelease: develop
steps:
- name: Checkout changes
uses: actions/checkout@v2
@@ -45,19 +45,21 @@ jobs:
with:
php-version: ${{ matrix.phpVersions }}
extensions: ${{ env.phpExtensions }}
- tools: composer:v1
+ tools: composer:v2
coverage: none
- - name: Install October CMS
+ - name: Install Winter CMS
run: |
- wget https://github.com/octobercms/october/archive/${{ env.octoberCmsRelease }}.zip
- unzip ${{ env.octoberCmsRelease }}.zip
+ wget https://github.com/wintercms/winter/archive/${{ env.winterCmsRelease }}.zip
+ unzip ${{ env.winterCmsRelease }}.zip
+ rm ${{ env.winterCmsRelease }}.zip
shopt -s dotglob
- mv october-${{ env.octoberCmsRelease }}/* ./
+ mv winter-${{ env.winterCmsRelease }}/* ./
+ rmdir winter-${{ env.winterCmsRelease }}
shopt -u dotglob
cp config/cms.php config/testing/cms.php
- mkdir -p plugins/rainlab
- mv user-plugin plugins/rainlab/user
+ mkdir -p plugins/winter
+ mv user-plugin plugins/winter/user
- name: Get Composer cache directory
id: composercache
@@ -71,12 +73,12 @@ jobs:
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
- run: composer install --no-interaction --no-progress --no-suggest
+ run: composer install --no-interaction --no-progress
- name: Run linting
- run: ./vendor/bin/parallel-lint plugins/rainlab/user
+ run: ./vendor/bin/parallel-lint plugins/winter/user
- name: Run unit tests
run: |
- cd plugins/rainlab/user
+ cd plugins/winter/user
../../../vendor/bin/phpunit
\ No newline at end of file
diff --git a/Plugin.php b/Plugin.php
index b781a62..c780328 100644
--- a/Plugin.php
+++ b/Plugin.php
@@ -1,4 +1,4 @@
- 'rainlab.user::lang.plugin.name',
- 'description' => 'rainlab.user::lang.plugin.description',
+ 'name' => 'winter.user::lang.plugin.name',
+ 'description' => 'winter.user::lang.plugin.description',
'author' => 'Alexey Bobkov, Samuel Georges',
'icon' => 'icon-user',
- 'homepage' => 'https://github.com/rainlab/user-plugin'
+ 'homepage' => 'https://github.com/wintercms/wn-user-plugin',
+ 'replaces' => 'RainLab.User'
];
}
public function register()
{
$alias = AliasLoader::getInstance();
- $alias->alias('Auth', 'RainLab\User\Facades\Auth');
+ $alias->alias('Auth', 'Winter\User\Facades\Auth');
App::singleton('user.auth', function () {
- return \RainLab\User\Classes\AuthManager::instance();
+ return \Winter\User\Classes\AuthManager::instance();
});
App::singleton('redirect', function ($app) {
@@ -61,7 +62,7 @@ public function register()
});
/*
- * Compatability with RainLab.Notify
+ * Compatability with Winter.Notify
*/
$this->bindNotificationEvents();
}
@@ -69,30 +70,30 @@ public function register()
public function registerComponents()
{
return [
- \RainLab\User\Components\Session::class => 'session',
- \RainLab\User\Components\Account::class => 'account',
- \RainLab\User\Components\ResetPassword::class => 'resetPassword'
+ \Winter\User\Components\Session::class => 'session',
+ \Winter\User\Components\Account::class => 'account',
+ \Winter\User\Components\ResetPassword::class => 'resetPassword'
];
}
public function registerPermissions()
{
return [
- 'rainlab.users.access_users' => [
- 'tab' => 'rainlab.user::lang.plugin.tab',
- 'label' => 'rainlab.user::lang.plugin.access_users'
+ 'winter.users.access_users' => [
+ 'tab' => 'winter.user::lang.plugin.tab',
+ 'label' => 'winter.user::lang.plugin.access_users'
],
- 'rainlab.users.access_groups' => [
- 'tab' => 'rainlab.user::lang.plugin.tab',
- 'label' => 'rainlab.user::lang.plugin.access_groups'
+ 'winter.users.access_groups' => [
+ 'tab' => 'winter.user::lang.plugin.tab',
+ 'label' => 'winter.user::lang.plugin.access_groups'
],
- 'rainlab.users.access_settings' => [
- 'tab' => 'rainlab.user::lang.plugin.tab',
- 'label' => 'rainlab.user::lang.plugin.access_settings'
+ 'winter.users.access_settings' => [
+ 'tab' => 'winter.user::lang.plugin.tab',
+ 'label' => 'winter.user::lang.plugin.access_settings'
],
- 'rainlab.users.impersonate_user' => [
- 'tab' => 'rainlab.user::lang.plugin.tab',
- 'label' => 'rainlab.user::lang.plugin.impersonate_user'
+ 'winter.users.impersonate_user' => [
+ 'tab' => 'winter.user::lang.plugin.tab',
+ 'label' => 'winter.user::lang.plugin.impersonate_user'
],
];
}
@@ -101,25 +102,25 @@ public function registerNavigation()
{
return [
'user' => [
- 'label' => 'rainlab.user::lang.users.menu_label',
- 'url' => Backend::url('rainlab/user/users'),
+ 'label' => 'winter.user::lang.users.menu_label',
+ 'url' => Backend::url('winter/user/users'),
'icon' => 'icon-user',
- 'iconSvg' => 'plugins/rainlab/user/assets/images/user-icon.svg',
- 'permissions' => ['rainlab.users.*'],
+ 'iconSvg' => 'plugins/winter/user/assets/images/user-icon.svg',
+ 'permissions' => ['winter.users.*'],
'order' => 500,
'sideMenu' => [
'users' => [
- 'label' => 'rainlab.user::lang.users.menu_label',
+ 'label' => 'winter.user::lang.users.menu_label',
'icon' => 'icon-user',
- 'url' => Backend::url('rainlab/user/users'),
- 'permissions' => ['rainlab.users.access_users']
+ 'url' => Backend::url('winter/user/users'),
+ 'permissions' => ['winter.users.access_users']
],
'usergroups' => [
- 'label' => 'rainlab.user::lang.groups.menu_label',
+ 'label' => 'winter.user::lang.groups.menu_label',
'icon' => 'icon-users',
- 'url' => Backend::url('rainlab/user/usergroups'),
- 'permissions' => ['rainlab.users.access_groups']
+ 'url' => Backend::url('winter/user/usergroups'),
+ 'permissions' => ['winter.users.access_groups']
]
]
]
@@ -130,13 +131,13 @@ public function registerSettings()
{
return [
'settings' => [
- 'label' => 'rainlab.user::lang.settings.menu_label',
- 'description' => 'rainlab.user::lang.settings.menu_description',
+ 'label' => 'winter.user::lang.settings.menu_label',
+ 'description' => 'winter.user::lang.settings.menu_description',
'category' => SettingsManager::CATEGORY_USERS,
'icon' => 'icon-cog',
- 'class' => 'RainLab\User\Models\Settings',
+ 'class' => 'Winter\User\Models\Settings',
'order' => 500,
- 'permissions' => ['rainlab.users.access_settings']
+ 'permissions' => ['winter.users.access_settings']
]
];
}
@@ -144,17 +145,21 @@ public function registerSettings()
public function registerMailTemplates()
{
return [
- 'rainlab.user::mail.activate',
- 'rainlab.user::mail.welcome',
- 'rainlab.user::mail.restore',
- 'rainlab.user::mail.new_user',
- 'rainlab.user::mail.reactivate',
- 'rainlab.user::mail.invite',
+ 'winter.user::mail.activate',
+ 'winter.user::mail.welcome',
+ 'winter.user::mail.restore',
+ 'winter.user::mail.new_user',
+ 'winter.user::mail.reactivate',
+ 'winter.user::mail.invite',
];
}
public function registerNotificationRules()
{
+ if (!class_exists(\Winter\Notify\Classes\Notifier::class)) {
+ return [];
+ }
+
return [
'groups' => [
'user' => [
@@ -163,25 +168,25 @@ public function registerNotificationRules()
],
],
'events' => [
- \RainLab\User\NotifyRules\UserActivatedEvent::class,
- \RainLab\User\NotifyRules\UserRegisteredEvent::class,
+ \Winter\User\NotifyRules\UserActivatedEvent::class,
+ \Winter\User\NotifyRules\UserRegisteredEvent::class,
],
'actions' => [],
'conditions' => [
- \RainLab\User\NotifyRules\UserAttributeCondition::class
+ 'Winter\User\NotifyRules\UserAttributeCondition',
],
];
}
protected function bindNotificationEvents()
{
- if (!class_exists(Notifier::class)) {
+ if (!class_exists(\Winter\Notify\Classes\Notifier::class)) {
return;
}
Notifier::bindEvents([
- 'rainlab.user.activate' => \RainLab\User\NotifyRules\UserActivatedEvent::class,
- 'rainlab.user.register' => \RainLab\User\NotifyRules\UserRegisteredEvent::class
+ 'winter.user.activate' => \Winter\User\NotifyRules\UserActivatedEvent::class,
+ 'winter.user.register' => \Winter\User\NotifyRules\UserRegisteredEvent::class,
]);
Notifier::instance()->registerCallback(function ($manager) {
diff --git a/README.md b/README.md
index 80d3596..7e575ad 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,13 @@
# Front-end user plugin
-[](https://github.com/rainlab/user-plugin/actions)
-[](https://github.com/rainlab/user-plugin/blob/master/LICENCE.md)
+[](https://github.com/wintercms/wn-user-plugin/actions)
+[](https://github.com/wintercms/wn-user-plugin/blob/master/LICENCE.md)
-Front-end user management for October CMS.
+Front-end user management for Winter CMS.
## Requirements
-This plugin requires the [Ajax Framework](https://octobercms.com/docs/cms/ajax) to be included in your layout/page in order to handle form requests.
+This plugin requires the [Ajax Framework](https://wintercms.com/docs/cms/ajax) to be included in your layout/page in order to handle form requests.
## Managing users
@@ -47,11 +47,7 @@ As a security precaution, you may restrict users from having sessions across mul
#### Notifications
-When a user is first activated -- either by registration, email confirmation or administrator approval -- they are sent a welcome email. To disable the welcome email, select "Do not send a notification" from the **Welcome mail template** dropdown. The default message template used is `rainlab.user::mail.welcome` and you can customize this by selecting **Mail > Mail Templates** from the settings menu.
-
-## Extended features
-
-For extra functionality, consider also installing the [User Plus+ plugin](http://octobercms.com/plugin/rainlab-userplus) (`RainLab.UserPlus`).
+When a user is first activated -- either by registration, email confirmation or administrator approval -- they are sent a welcome email. To disable the welcome email, select "Do not send a notification" from the **Welcome mail template** dropdown. The default message template used is `winter.user::mail.welcome` and you can customize this by selecting **Mail > Mail Templates** from the settings menu.
## Session component
@@ -90,7 +86,7 @@ The `security` property can be user, guest or all. The `redirect` property refer
Access to routes can be restricted by applying the `AuthMiddleware`.
- Route::group(['middleware' => 'RainLab\User\Classes\AuthMiddleware'], function () {
+ Route::group(['middleware' => 'Winter\User\Classes\AuthMiddleware'], function () {
// All routes here will require authentication
});
@@ -153,7 +149,7 @@ By default, the User plugin requires a minimum password length of 8 characters f
### Flash messages
-This plugin makes use of October's [`Flash API`](http://octobercms.com/docs/markup/tag-flash). In order to display the error messages, you need to place the following snippet in your layout or page.
+This plugin makes use of Winter CMS's [`Flash API`](https://wintercms.com/docs/markup/tag-flash). In order to display the error messages, you need to place the following snippet in your layout or page.
{% flash %}
{{ message }}
@@ -219,7 +215,7 @@ Here the local handler method will take priority over the **account** component'
## Auth facade
-There is an `Auth` facade you may use for common tasks, it primarily inherits the `October\Rain\Auth\Manager` class for functionality.
+There is an `Auth` facade you may use for common tasks, it primarily inherits the `Winter\Storm\Auth\Manager` class for functionality.
You may use `Auth::register` to register an account:
@@ -290,7 +286,7 @@ When a user registers with the same email address using the `Auth::register` met
> **Important**: If you are using guest accounts, it is important to disable sensitive functionality for user accounts that are not verified, since it may be possible for anyone to inherit a guest account.
-You may also convert a guest to a registered user with the `convertToRegistered` method. This will generate a random password and sends an invitation using the `rainlab.user::mail.invite` template.
+You may also convert a guest to a registered user with the `convertToRegistered` method. This will generate a random password and sends an invitation using the `winter.user::mail.invite` template.
$user->convertToRegistered();
@@ -302,26 +298,26 @@ To disable the notification and password reset, pass the first argument as false
This plugin will fire some global events that can be useful for interacting with other plugins.
-- **rainlab.user.beforeRegister**: Before the user's registration is processed. Passed the `$data` variable by reference to enable direct modifications to the `$data` provided to the `Auth::register()` method.
-- **rainlab.user.register**: The user has successfully registered. Passed the `$user` object and the submitted `$data` variable.
-- **rainlab.user.beforeAuthenticate**: Before the user is attempting to authenticate using the Account component.
-- **rainlab.user.login**: The user has successfully signed in.
-- **rainlab.user.logout**: The user has successfully signed out.
-- **rainlab.user.deactivate**: The user has opted-out of the site by deactivating their account. This should be used to disable any content the user may want removed.
-- **rainlab.user.reactivate**: The user has reactivated their own account by signing back in. This should revive the users content on the site.
-- **rainlab.user.getNotificationVars**: Fires when sending a user notification to enable passing more variables to the email templates. Passes the `$user` model the template will be for.
-- **rainlab.user.view.extendListToolbar**: Fires when the user listing page's toolbar is rendered.
-- **rainlab.user.view.extendPreviewToolbar**: Fires when the user preview page's toolbar is rendered.
+- **winter.user.beforeRegister**: Before the user's registration is processed. Passed the `$data` variable by reference to enable direct modifications to the `$data` provided to the `Auth::register()` method.
+- **winter.user.register**: The user has successfully registered. Passed the `$user` object and the submitted `$data` variable.
+- **winter.user.beforeAuthenticate**: Before the user is attempting to authenticate using the Account component.
+- **winter.user.login**: The user has successfully signed in.
+- **winter.user.logout**: The user has successfully signed out.
+- **winter.user.deactivate**: The user has opted-out of the site by deactivating their account. This should be used to disable any content the user may want removed.
+- **winter.user.reactivate**: The user has reactivated their own account by signing back in. This should revive the users content on the site.
+- **winter.user.getNotificationVars**: Fires when sending a user notification to enable passing more variables to the email templates. Passes the `$user` model the template will be for.
+- **winter.user.view.extendListToolbar**: Fires when the user listing page's toolbar is rendered.
+- **winter.user.view.extendPreviewToolbar**: Fires when the user preview page's toolbar is rendered.
Here is an example of hooking an event:
- Event::listen('rainlab.user.deactivate', function($user) {
+ Event::listen('winter.user.deactivate', function($user) {
// Hide all posts by the user
});
-A common requirement is to adapt another to a legacy authentication system. In the example below, the `WordPressLogin::check` method would check the user password using an alternative hashing method, and if successful, update to the new one used by October.
+A common requirement is to adapt another to a legacy authentication system. In the example below, the `WordPressLogin::check` method would check the user password using an alternative hashing method, and if successful, update to the new one used by Winter CMS.
- Event::listen('rainlab.user.beforeAuthenticate', function($component, $credentials) {
+ Event::listen('winter.user.beforeAuthenticate', function($component, $credentials) {
$login = array_get($credentials, 'login');
$password = array_get($credentials, 'password');
@@ -335,7 +331,7 @@ A common requirement is to adapt another to a legacy authentication system. In t
/*
* The user is logging in with their old WordPress account
* for the first time. Rehash their password using the new
- * October system.
+ * Winter CMS system.
*/
if (WordPressLogin::check($user->password, $password)) {
$user->password = $user->password_confirmation = $password;
diff --git a/UPGRADE.md b/UPGRADE.md
index 77782af..8425b34 100644
--- a/UPGRADE.md
+++ b/UPGRADE.md
@@ -8,19 +8,19 @@
The User plugin has been split apart in to smaller more manageable plugins. These fields are no longer provided by the User plugin: `company`, `phone`, `street_addr`, `city`, `zip`, `country`, `state`. This is a non-destructive upgrade so the columns will remain in the database untouched.
-Country and State models have been removed and can be replaced by installing the plugin **RainLab.Location**. The remaining profiles fields can be replaced by installing the plugin **RainLab.UserPlus**.
+Country and State models have been removed and can be replaced by installing the plugin **Winter.Location**. The remaining profiles fields can be replaced by installing the plugin **Winter.UserPlus**.
In short, to retain the old functionaliy simply install the following plugins:
-- RainLab.Location
-- RainLab.UserPlus
+- Winter.Location
+- Winter.UserPlus
## Upgrading To 1.4
-The Notifications tab in User settings has been removed. This feature has been replaced by the [Notify plugin](https://octobercms.com/plugin/rainlab-notify). How to replace this feature:
+The Notifications tab in User settings has been removed. This feature has been replaced by the [Notify plugin](https://github.com/wintercms/wn-notify-plugin). How to replace this feature:
-1. Install the `RainLab.Notify` plugin
+1. Install the `Winter.Notify` plugin
1. Navigate to Settings > Notification rules
1. Click **New notification** rule
1. Select User > **Activated**
diff --git a/aliases.php b/aliases.php
new file mode 100644
index 0000000..ef44874
--- /dev/null
+++ b/aliases.php
@@ -0,0 +1,28 @@
+ Winter\Notify\Classes\EventBase::class,
+ Winter\User\Plugin::class => 'RainLab\User\Plugin',
+ Winter\User\Classes\AuthManager::class => 'RainLab\User\Classes\AuthManager',
+ Winter\User\Classes\AuthMiddleware::class => 'RainLab\User\Classes\AuthMiddleware',
+ Winter\User\Classes\UserEventBase::class => 'RainLab\User\Classes\UserEventBase',
+ Winter\User\Classes\UserRedirector::class => 'RainLab\User\Classes\UserRedirector',
+ Winter\User\Components\Account::class => 'RainLab\User\Components\Account',
+ Winter\User\Components\ResetPassword::class => 'RainLab\User\Components\ResetPassword',
+ Winter\User\Components\Session::class => 'RainLab\User\Components\Session',
+ Winter\User\Controllers\Users::class => 'RainLab\User\Controllers\Users',
+ Winter\User\Controllers\UserGroups::class => 'RainLab\User\Controllers\UserGroups',
+ Winter\User\Models\User::class => 'RainLab\User\Models\User',
+ Winter\User\Models\MailBlocker::class => 'RainLab\User\Models\MailBlocker',
+ Winter\User\Models\Throttle::class => 'RainLab\User\Models\Throttle',
+ Winter\User\Models\Settings::class => 'RainLab\User\Models\Settings',
+];
+
+foreach ($aliases as $original => $alias) {
+ if (!class_exists($alias)) {
+ class_alias($original, $alias);
+ }
+}
\ No newline at end of file
diff --git a/classes/AuthManager.php b/classes/AuthManager.php
index 269955c..85a8533 100644
--- a/classes/AuthManager.php
+++ b/classes/AuthManager.php
@@ -1,8 +1,8 @@
- /*Account*/'rainlab.user::lang.account.account',
- 'description' => /*User management form.*/'rainlab.user::lang.account.account_desc'
+ 'name' => /*Account*/'winter.user::lang.account.account',
+ 'description' => /*User management form.*/'winter.user::lang.account.account_desc'
];
}
@@ -38,26 +38,26 @@ public function defineProperties()
{
return [
'redirect' => [
- 'title' => /*Redirect to*/'rainlab.user::lang.account.redirect_to',
- 'description' => /*Page name to redirect to after update, sign in or registration.*/'rainlab.user::lang.account.redirect_to_desc',
+ 'title' => /*Redirect to*/'winter.user::lang.account.redirect_to',
+ 'description' => /*Page name to redirect to after update, sign in or registration.*/'winter.user::lang.account.redirect_to_desc',
'type' => 'dropdown',
'default' => ''
],
'paramCode' => [
- 'title' => /*Activation Code Param*/'rainlab.user::lang.account.code_param',
- 'description' => /*The page URL parameter used for the registration activation code*/ 'rainlab.user::lang.account.code_param_desc',
+ 'title' => /*Activation Code Param*/'winter.user::lang.account.code_param',
+ 'description' => /*The page URL parameter used for the registration activation code*/ 'winter.user::lang.account.code_param_desc',
'type' => 'string',
'default' => 'code'
],
'forceSecure' => [
- 'title' => /*Force secure protocol*/'rainlab.user::lang.account.force_secure',
- 'description' => /*Always redirect the URL with the HTTPS schema.*/'rainlab.user::lang.account.force_secure_desc',
+ 'title' => /*Force secure protocol*/'winter.user::lang.account.force_secure',
+ 'description' => /*Always redirect the URL with the HTTPS schema.*/'winter.user::lang.account.force_secure_desc',
'type' => 'checkbox',
'default' => 0
],
'requirePassword' => [
- 'title' => /*Confirm password on update*/'rainlab.user::lang.account.update_requires_password',
- 'description' => /*Require the current password of the user when changing their profile.*/'rainlab.user::lang.account.update_requires_password_comment',
+ 'title' => /*Confirm password on update*/'winter.user::lang.account.update_requires_password',
+ 'description' => /*Require the current password of the user when changing their profile.*/'winter.user::lang.account.update_requires_password_comment',
'type' => 'checkbox',
'default' => 0
],
@@ -142,8 +142,8 @@ public function loginAttribute()
public function loginAttributeLabel()
{
return Lang::get($this->loginAttribute() == UserSettings::LOGIN_EMAIL
- ? /*Email*/'rainlab.user::lang.login.attribute_email'
- : /*Username*/'rainlab.user::lang.login.attribute_username'
+ ? /*Email*/'winter.user::lang.login.attribute_email'
+ : /*Username*/'winter.user::lang.login.attribute_username'
);
}
@@ -235,12 +235,12 @@ public function onSignin()
break;
}
- Event::fire('rainlab.user.beforeAuthenticate', [$this, $credentials]);
+ Event::fire('winter.user.beforeAuthenticate', [$this, $credentials]);
$user = Auth::authenticate($credentials, $remember);
if ($user->isBanned()) {
Auth::logout();
- throw new AuthException(/*Sorry, this user is currently not activated. Please contact us for further assistance.*/'rainlab.user::lang.account.banned');
+ throw new AuthException(/*Sorry, this user is currently not activated. Please contact us for further assistance.*/'winter.user::lang.account.banned');
}
/*
@@ -270,11 +270,11 @@ public function onRegister()
{
try {
if (!$this->canRegister()) {
- throw new ApplicationException(Lang::get(/*Registrations are currently disabled.*/'rainlab.user::lang.account.registration_disabled'));
+ throw new ApplicationException(Lang::get(/*Registrations are currently disabled.*/'winter.user::lang.account.registration_disabled'));
}
if ($this->isRegisterThrottled()) {
- throw new ApplicationException(Lang::get(/*Registration is throttled. Please try again later.*/'rainlab.user::lang.account.registration_throttled'));
+ throw new ApplicationException(Lang::get(/*Registration is throttled. Please try again later.*/'winter.user::lang.account.registration_throttled'));
}
/*
@@ -307,7 +307,7 @@ public function onRegister()
/*
* Register user
*/
- Event::fire('rainlab.user.beforeRegister', [&$data]);
+ Event::fire('winter.user.beforeRegister', [&$data]);
$requireActivation = UserSettings::get('require_activation', true);
$automaticActivation = UserSettings::get('activate_mode') == UserSettings::ACTIVATE_AUTO;
@@ -315,7 +315,7 @@ public function onRegister()
$adminActivation = UserSettings::get('activate_mode') == UserSettings::ACTIVATE_ADMIN;
$user = Auth::register($data, $automaticActivation);
- Event::fire('rainlab.user.register', [$user, $data]);
+ Event::fire('winter.user.register', [$user, $data]);
/*
* Activation is by the user, send the email
@@ -323,15 +323,15 @@ public function onRegister()
if ($userActivation) {
$this->sendActivationEmail($user);
- Flash::success(Lang::get(/*An activation email has been sent to your email address.*/'rainlab.user::lang.account.activation_email_sent'));
+ Flash::success(Lang::get(/*An activation email has been sent to your email address.*/'winter.user::lang.account.activation_email_sent'));
}
/*
* Activation is by the admin, show message
- * For automatic email on account activation RainLab.Notify plugin is needed
+ * For automatic email on account activation Winter.Notify plugin is needed
*/
if ($adminActivation) {
- Flash::success(Lang::get(/*You have successfully registered. Your account is not yet active and must be approved by an administrator.*/'rainlab.user::lang.account.activation_by_admin'));
+ Flash::success(Lang::get(/*You have successfully registered. Your account is not yet active and must be approved by an administrator.*/'winter.user::lang.account.activation_by_admin'));
}
/*
@@ -363,7 +363,7 @@ public function onActivate($code = null)
try {
$code = post('code', $code);
- $errorFields = ['code' => Lang::get(/*Invalid activation code supplied.*/'rainlab.user::lang.account.invalid_activation_code')];
+ $errorFields = ['code' => Lang::get(/*Invalid activation code supplied.*/'winter.user::lang.account.invalid_activation_code')];
/*
* Break up the code parts
@@ -387,7 +387,7 @@ public function onActivate($code = null)
throw new ValidationException($errorFields);
}
- Flash::success(Lang::get(/*Successfully activated your account.*/'rainlab.user::lang.account.success_activation'));
+ Flash::success(Lang::get(/*Successfully activated your account.*/'winter.user::lang.account.success_activation'));
/*
* Sign in the user
@@ -414,7 +414,7 @@ public function onUpdate()
if ($this->updateRequiresPassword()) {
if (!$user->checkHashValue('password', $data['password_current'])) {
- throw new ValidationException(['password_current' => Lang::get('rainlab.user::lang.account.invalid_current_pass')]);
+ throw new ValidationException(['password_current' => Lang::get('winter.user::lang.account.invalid_current_pass')]);
}
}
@@ -432,7 +432,7 @@ public function onUpdate()
Auth::login($user->reload(), true);
}
- Flash::success(post('flash', Lang::get(/*Settings successfully saved!*/'rainlab.user::lang.account.success_saved')));
+ Flash::success(post('flash', Lang::get(/*Settings successfully saved!*/'winter.user::lang.account.success_saved')));
/*
* Redirect
@@ -454,13 +454,13 @@ public function onDeactivate()
}
if (!$user->checkHashValue('password', post('password'))) {
- throw new ValidationException(['password' => Lang::get('rainlab.user::lang.account.invalid_deactivation_pass')]);
+ throw new ValidationException(['password' => Lang::get('winter.user::lang.account.invalid_deactivation_pass')]);
}
Auth::logout();
$user->delete();
- Flash::success(post('flash', Lang::get(/*Successfully deactivated your account. Sorry to see you go!*/'rainlab.user::lang.account.success_deactivation')));
+ Flash::success(post('flash', Lang::get(/*Successfully deactivated your account. Sorry to see you go!*/'winter.user::lang.account.success_deactivation')));
/*
* Redirect
@@ -477,14 +477,14 @@ public function onSendActivationEmail()
{
try {
if (!$user = $this->user()) {
- throw new ApplicationException(Lang::get(/*You must be logged in first!*/'rainlab.user::lang.account.login_first'));
+ throw new ApplicationException(Lang::get(/*You must be logged in first!*/'winter.user::lang.account.login_first'));
}
if ($user->is_activated) {
- throw new ApplicationException(Lang::get(/*Your account is already activated!*/'rainlab.user::lang.account.already_active'));
+ throw new ApplicationException(Lang::get(/*Your account is already activated!*/'winter.user::lang.account.already_active'));
}
- Flash::success(Lang::get(/*An activation email has been sent to your email address.*/'rainlab.user::lang.account.activation_email_sent'));
+ Flash::success(Lang::get(/*An activation email has been sent to your email address.*/'winter.user::lang.account.activation_email_sent'));
$this->sendActivationEmail($user);
@@ -547,7 +547,7 @@ protected function sendActivationEmail($user)
'code' => $code
];
- Mail::send('rainlab.user::mail.activate', $data, function($message) use ($user) {
+ Mail::send('winter.user::mail.activate', $data, function($message) use ($user) {
$message->to($user->email, $user->name);
});
}
diff --git a/components/ResetPassword.php b/components/ResetPassword.php
index 152218a..805aafe 100644
--- a/components/ResetPassword.php
+++ b/components/ResetPassword.php
@@ -1,4 +1,4 @@
- /*Reset Password*/'rainlab.user::lang.reset_password.reset_password',
- 'description' => /*Forgotten password form.*/'rainlab.user::lang.reset_password.reset_password_desc'
+ 'name' => /*Reset Password*/'winter.user::lang.reset_password.reset_password',
+ 'description' => /*Forgotten password form.*/'winter.user::lang.reset_password.reset_password_desc'
];
}
@@ -29,8 +29,8 @@ public function defineProperties()
{
return [
'paramCode' => [
- 'title' => /*Reset Code Param*/'rainlab.user::lang.reset_password.code_param',
- 'description' => /*The page URL parameter used for the reset code*/'rainlab.user::lang.reset_password.code_param_desc',
+ 'title' => /*Reset Code Param*/'winter.user::lang.reset_password.code_param',
+ 'description' => /*The page URL parameter used for the reset code*/'winter.user::lang.reset_password.code_param_desc',
'type' => 'string',
'default' => 'code'
]
@@ -76,7 +76,7 @@ public function onRestorePassword()
$user = UserModel::findByEmail(post('email'));
if (!$user || $user->is_guest) {
- throw new ApplicationException(Lang::get(/*A user was not found with the given credentials.*/'rainlab.user::lang.account.invalid_user'));
+ throw new ApplicationException(Lang::get(/*A user was not found with the given credentials.*/'winter.user::lang.account.invalid_user'));
}
$code = implode('!', [$user->id, $user->getResetPasswordCode()]);
@@ -90,7 +90,7 @@ public function onRestorePassword()
'code' => $code
];
- Mail::send('rainlab.user::mail.restore', $data, function($message) use ($user) {
+ Mail::send('winter.user::mail.restore', $data, function($message) use ($user) {
$message->to($user->email, $user->full_name);
});
}
@@ -110,7 +110,7 @@ public function onResetPassword()
throw new ValidationException($validation);
}
- $errorFields = ['code' => Lang::get(/*Invalid activation code supplied.*/'rainlab.user::lang.account.invalid_activation_code')];
+ $errorFields = ['code' => Lang::get(/*Invalid activation code supplied.*/'winter.user::lang.account.invalid_activation_code')];
/*
* Break up the code parts
diff --git a/components/Session.php b/components/Session.php
index 0236cfe..cd9f7e5 100644
--- a/components/Session.php
+++ b/components/Session.php
@@ -1,4 +1,4 @@
- 'rainlab.user::lang.session.session',
- 'description' => 'rainlab.user::lang.session.session_desc'
+ 'name' => 'winter.user::lang.session.session',
+ 'description' => 'winter.user::lang.session.session_desc'
];
}
@@ -36,26 +36,26 @@ public function defineProperties()
{
return [
'security' => [
- 'title' => 'rainlab.user::lang.session.security_title',
- 'description' => 'rainlab.user::lang.session.security_desc',
+ 'title' => 'winter.user::lang.session.security_title',
+ 'description' => 'winter.user::lang.session.security_desc',
'type' => 'dropdown',
'default' => 'all',
'options' => [
- 'all' => 'rainlab.user::lang.session.all',
- 'user' => 'rainlab.user::lang.session.users',
- 'guest' => 'rainlab.user::lang.session.guests'
+ 'all' => 'winter.user::lang.session.all',
+ 'user' => 'winter.user::lang.session.users',
+ 'guest' => 'winter.user::lang.session.guests'
]
],
'allowedUserGroups' => [
- 'title' => 'rainlab.user::lang.session.allowed_groups_title',
- 'description' => 'rainlab.user::lang.session.allowed_groups_description',
+ 'title' => 'winter.user::lang.session.allowed_groups_title',
+ 'description' => 'winter.user::lang.session.allowed_groups_description',
'placeholder' => '*',
'type' => 'set',
'default' => []
],
'redirect' => [
- 'title' => 'rainlab.user::lang.session.redirect_title',
- 'description' => 'rainlab.user::lang.session.redirect_desc',
+ 'title' => 'winter.user::lang.session.redirect_title',
+ 'description' => 'winter.user::lang.session.redirect_desc',
'type' => 'dropdown',
'default' => ''
]
@@ -102,7 +102,7 @@ public function onRun()
/**
* Returns the logged in user, if available, and touches
* the last seen timestamp.
- * @return RainLab\User\Models\User
+ * @return Winter\User\Models\User
*/
public function user()
{
@@ -142,12 +142,12 @@ public function onLogout()
Auth::logout();
if ($user) {
- Event::fire('rainlab.user.logout', [$user]);
+ Event::fire('winter.user.logout', [$user]);
}
$url = post('redirect', Request::fullUrl());
- Flash::success(Lang::get('rainlab.user::lang.session.logout'));
+ Flash::success(Lang::get('winter.user::lang.session.logout'));
return Redirect::to($url);
}
@@ -166,7 +166,7 @@ public function onStopImpersonating()
$url = post('redirect', Request::fullUrl());
- Flash::success(Lang::get('rainlab.user::lang.session.stop_impersonate_success'));
+ Flash::success(Lang::get('winter.user::lang.session.stop_impersonate_success'));
return Redirect::to($url);
}
diff --git a/composer.json b/composer.json
index 0b4f218..4726279 100644
--- a/composer.json
+++ b/composer.json
@@ -1,22 +1,32 @@
{
- "name": "rainlab/user-plugin",
- "type": "october-plugin",
- "description": "User plugin for October CMS",
- "homepage": "https://octobercms.com/plugin/rainlab-user",
- "keywords": ["october", "octobercms", "user"],
+ "name": "winter/wn-user-plugin",
+ "type": "winter-plugin",
+ "description": "User plugin for Winter CMS",
+ "homepage": "https://github.com/wintercms/wn-user-plugin",
+ "keywords": ["winter cms", "winter", "plugin", "user", "authentication"],
"license": "MIT",
"authors": [
{
"name": "Alexey Bobkov",
"email": "aleksey.bobkov@gmail.com",
- "role": "Co-founder"
+ "role": "Original Author"
},
{
"name": "Samuel Georges",
"email": "daftspunky@gmail.com",
- "role": "Co-founder"
+ "role": "Original Author"
+ },
+ {
+ "name": "Winter CMS Maintainers",
+ "homepage": "https://wintercms.com",
+ "role": "Maintainer"
}
],
+ "support": {
+ "issues": "https://github.com/wintercms/wn-user-plugin/issues",
+ "discord": "https://discord.gg/D5MFSPH6Ux",
+ "source": "https://github.com/wintercms/wn-user-plugin"
+ },
"require": {
"php": ">=5.5.9",
"composer/installers": "~1.0"
diff --git a/config/config.php b/config/config.php
index 2fef283..eac7624 100644
--- a/config/config.php
+++ b/config/config.php
@@ -1,6 +1,6 @@
addJs('/plugins/rainlab/user/assets/js/bulk-actions.js');
+ $this->addJs('/plugins/winter/user/assets/js/bulk-actions.js');
$this->asExtension('ListController')->index();
}
@@ -143,7 +143,7 @@ public function preview_onActivate($recordId = null)
$model->attemptActivation($model->activation_code);
- Flash::success(Lang::get('rainlab.user::lang.users.activated_success'));
+ Flash::success(Lang::get('winter.user::lang.users.activated_success'));
if ($redirect = $this->makeRedirect('update-close', $model)) {
return $redirect;
@@ -159,7 +159,7 @@ public function preview_onUnban($recordId = null)
$model->unban();
- Flash::success(Lang::get('rainlab.user::lang.users.unbanned_success'));
+ Flash::success(Lang::get('winter.user::lang.users.unbanned_success'));
if ($redirect = $this->makeRedirect('update-close', $model)) {
return $redirect;
@@ -199,7 +199,7 @@ public function preview_onConvertGuest($recordId)
$model->groups()->add($group);
}
- Flash::success(Lang::get('rainlab.user::lang.users.convert_guest_success'));
+ Flash::success(Lang::get('winter.user::lang.users.convert_guest_success'));
if ($redirect = $this->makeRedirect('update-close', $model)) {
return $redirect;
@@ -211,7 +211,7 @@ public function preview_onConvertGuest($recordId)
*/
public function preview_onImpersonateUser($recordId)
{
- if (!$this->user->hasAccess('rainlab.users.impersonate_user')) {
+ if (!$this->user->hasAccess('winter.users.impersonate_user')) {
return Response::make(Lang::get('backend::lang.page.access_denied.label'), 403);
}
@@ -219,7 +219,7 @@ public function preview_onImpersonateUser($recordId)
Auth::impersonate($model);
- Flash::success(Lang::get('rainlab.user::lang.users.impersonate_success'));
+ Flash::success(Lang::get('winter.user::lang.users.impersonate_success'));
}
/**
@@ -231,7 +231,7 @@ public function preview_onUnsuspendUser($recordId)
$model->unsuspend();
- Flash::success(Lang::get('rainlab.user::lang.users.unsuspend_success'));
+ Flash::success(Lang::get('winter.user::lang.users.unsuspend_success'));
return Redirect::refresh();
}
@@ -296,10 +296,10 @@ public function index_onBulkAction()
}
}
- Flash::success(Lang::get('rainlab.user::lang.users.'.$bulkAction.'_selected_success'));
+ Flash::success(Lang::get('winter.user::lang.users.'.$bulkAction.'_selected_success'));
}
else {
- Flash::error(Lang::get('rainlab.user::lang.users.'.$bulkAction.'_selected_empty'));
+ Flash::error(Lang::get('winter.user::lang.users.'.$bulkAction.'_selected_empty'));
}
return $this->listRefresh();
diff --git a/controllers/usergroups/_list_toolbar.htm b/controllers/usergroups/_list_toolbar.htm
index 8ab7b77..da81c82 100644
--- a/controllers/usergroups/_list_toolbar.htm
+++ b/controllers/usergroups/_list_toolbar.htm
@@ -1,7 +1,7 @@
\ No newline at end of file
diff --git a/controllers/usergroups/update.htm b/controllers/usergroups/update.htm
index 6d81742..7032faf 100644
--- a/controllers/usergroups/update.htm
+++ b/controllers/usergroups/update.htm
@@ -1,6 +1,6 @@