Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/Plugins/Manage/UserManage/UserManage.php
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,11 @@ public function update($request, $id = null)
$update_array['password'] = Hash::make($request->password);
}

// 状態が利用不可や仮削除の場合は強制ログアウトする。
if ($request->status == UserStatus::not_active || $request->status == UserStatus::temporary_delete) {
$update_array['is_force_logout'] = 1;
}
Comment on lines +968 to +970
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 一度「利用不可」にしてフラグを立てる
  • (ユーザーがまだログアウトしていない状態で)管理者が「利用可能」に戻す
  • 「利用可能に戻したのに強制ログアウトされた」と問い合わせが来る

起きうるケースとしてはかなり低めかと思いますが、下記のようなコードにしておくと、より文句は来ないかもしれません。

  if ((int)$request->status === UserStatus::not_active || (int)$request->status === UserStatus::temporary_delete) {
      $update_array['is_force_logout'] = 1;                                                                                                                      
  } else {
      $update_array['is_force_logout'] = 0;                                                                                                                      
  } 


// ユーザデータの更新
User::where('id', $id)->update($update_array);
// 更新後を再取得
Expand Down
Loading