feat: full parity pass - suspend enforcement, report modal polish, wechat notify
- Restriction: add is_suspended/get_active_suspend; comment block now covers suspend (小黑屋) in addition to mute, with reason in the deny message - FrontSubmitSave::persist: block post/draft/edit submission for suspended users (reference-theme semantics: 小黑屋 loses all publishing rights) - report.js: close icon switched from fa-times to the SVG sprite ic-close (#icon-close), same as reference theme; textareas gain autoHeight growth (hidden 'other reason' box skips the first measurement) - WeChatNotify: NOTIFY_TYPES now includes report/system so report results and account restriction notices fan out to WeChat template messages; generic title/description fallback for template values - contract tests: +3 tests (suspend enforcement, modal polish, wechat types)
This commit is contained in:
@@ -43,6 +43,16 @@ trait FrontSubmitSave {
|
||||
}
|
||||
}
|
||||
|
||||
// 小黑屋(suspend):剥夺发布权限,发帖/草稿/编辑均拦截(对齐参考主题)。
|
||||
if (!$is_guest && \AKSRT\User\Restriction::get_instance()->is_suspended($user_id)) {
|
||||
$suspend = \AKSRT\User\Restriction::get_instance()->get_active_suspend($user_id);
|
||||
$message = __('您已被关入小黑屋,暂时无法发布内容', 'aksrt');
|
||||
if (!empty($suspend['reason'])) {
|
||||
$message .= ',原因:' . $suspend['reason'];
|
||||
}
|
||||
return ['success' => false, 'message' => $message];
|
||||
}
|
||||
|
||||
if ($is_edit) {
|
||||
if (!$this->can_edit_post($posts_id, $user_id)) {
|
||||
return ['success' => false, 'message' => __('没有编辑权限', 'aksrt')];
|
||||
|
||||
Reference in New Issue
Block a user