} } $SUCCESS++; $SUCCESSSTR[] = "You have successfully deactivated <strong>" . $total_updated . " administrator" . ($total_updated != 1 ? "s" : "") . "</strong> in the <strong>" . html_encode($community_details["community_title"]) . "</strong> community.<br /><br />You will now be redirected back to the Manage Members page; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . ENTRADA_URL . "/" . $MODULE . "?section=members&community=" . $COMMUNITY_ID . "\" style=\"font-weight: bold\">click here</a> to continue."; } else { $ERROR++; $ERRORSTR[] = "There was a problem deactivating these community administrators in the system; the MEdTech Unit has been informed of this error, please try again later."; application_log("error", "Unable to deactivate admins from community_id [" . $COMMUNITY_ID . "]. Database said: " . $db->ErrorMsg()); } break; case "demote": if ($db->AutoExecute("community_members", array("member_acl" => 0), "UPDATE", "`community_id` = " . $db->qstr($COMMUNITY_ID) . " AND `proxy_id` IN ('" . implode("', '", $PROXY_IDS) . "') AND `member_active` = '1' AND `member_acl` = '1'") && ($total_updated = $db->Affected_Rows())) { if ($MAILING_LISTS["active"]) { $mail_list = new MailingList($COMMUNITY_ID); foreach ($PROXY_IDS as $proxy_id) { $mail_list->demote_administrator($proxy_id); } } $SUCCESS++; $SUCCESSSTR[] = "You have successfully demoted <strong>" . $total_updated . " administrator" . ($total_updated != 1 ? "s" : "") . "</strong> to regular member status in the <strong>" . html_encode($community_details["community_title"]) . "</strong> community. They will no longer be able to perform administrative functions.<br /><br />You will now be redirected back to the Manage Members page; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . ENTRADA_URL . "/" . $MODULE . "?section=members&community=" . $COMMUNITY_ID . "\" style=\"font-weight: bold\">click here</a> to continue."; } else { $ERROR++; $ERRORSTR[] = "There was a problem demoting these community administrators; the MEdTech Unit has been informed of this error, please try again later."; application_log("error", "Unable to demote admins from community_id [" . $COMMUNITY_ID . "]. Database said: " . $db->ErrorMsg()); } break; default: /** * This should never happen, as I'm checking the member_action above. */ continue;