125 : void
126 {
127 $usr_ids = [];
128 if ($this->http_wrapper->post()->has('usr_id')) {
129 $usr_ids = $this->http_wrapper->post()->retrieve(
130 'usr_id',
131 $this->
refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())
132 );
133 }
134
135 if (!isset($usr_ids) || !is_array($usr_ids)) {
136 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'frm_moderators_select_at_least_one'));
137 $this->
ctrl->redirect($this,
'showModerators');
138 }
139
140 $entries = $this->oForumModerators->getCurrentModerators();
141 if (count($usr_ids) === count($entries)) {
142 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'frm_at_least_one_moderator'));
143 $this->
ctrl->redirect($this,
'showModerators');
144 }
145
147
149 $frm_noti_type = $objFrmProps->getNotificationType();
150
151 foreach ($usr_ids as $usr_id) {
152 $this->oForumModerators->detachModeratorRole((int) $usr_id);
153
156 $tmp_frm_noti->setUserId((int) $usr_id);
158
159 $tmp_frm_noti->deleteAdminForce();
160 }
161 }
162
163 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'frm_moderators_detached_role_successfully'),
true);
164 $this->
ctrl->redirect($this,
'showModerators');
165 }
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.