[5.x]: “Save and send activation email” doesn’t send the email for users with only “Moderate users”
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 84/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- php
調査の方向性
issue は src/controllers/UsersController.php の 1343 行目付近を示しています。アクティベーションメールの権限チェックを読み、「アクティベーションメールを送信」アクションと比較してください。このアクションでは、「ユーザーをモデレート」の権限を持つユーザーがすでに許可されています。期待される権限に一致するようチェックを更新し、記載された権限を持つユーザーがアクティベーションメールを保存して送信できることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
What happened?
Description
craftcms/cms#17362 (fixing craftcms/cms#17360) allowed users with the “Moderate users” permission to send activation emails. The button on a user’s Permissions screen is now shown with moderateUsers, but the code that sends the email still checks for administrateUsers:
https://github.com/craftcms/cms/blob/5.x/src/controllers/UsersController.php#L1343
if (
!$user->getIsCredentialed() &&
$currentUser->can('administrateUsers') &&
$this->request->getBodyParam('sendActivationEmail')
) {
So these users see the button, and clicking it saves the permissions and shows “Permissions saved.” No activation email is sent and no error is shown.
Steps to reproduce
- Sign in as a non-admin user with “Edit users”, “Moderate users” and “Assign user permissions”, but without “Administrate users”.
- Open the Permissions screen of a user who hasn’t set a password yet.
- Click “Save and send activation email”.
Expected behavior
The activation email is sent, the same as with the “Send activation email” action, which already only requires moderateUsers.
Actual behavior
Permissions are saved, but no activation email is sent.
Suggested fix
Change administrateUsers to moderateUsers on https://github.com/craftcms/cms/blob/dc4734d0a4ec3eef7cbf9379909048c46c74ea16/src/controllers/UsersController.php#L1343
Craft CMS version
5.11.4
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
- 主要言語
- PHP
- スター
- 3.6k
- フォーク
- 714
- 平均マージ
- 13時間 20分
- マージ済み PR(30日)
- 471
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
craftcms/cms のほかの issue
-
repo:cms
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
craftcms/cms#20613 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
repo:cms
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
craftcms/cms#20596 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug repo:cms
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
craftcms/cms#20595 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug repo:cms
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
craftcms/cms#20205 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug repo:cms
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
craftcms/cms#20203 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
[Sync EN] Formatting improvements to "Large Objects (LOBs)" docs (#6056)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンsync-en
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
Перевод устарел
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
项目日志弹出窗尺寸可拉伸功能オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
freescout-help-desk/freescout#5812 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信