verifyPackage( 'boards' );
if( !$gBitUser->isAdmin() ){
$gBitSystem->fatalError('You do not have permission to tinker with mailing lists, so scram');
}
if( !empty( $_REQUEST['update'] ) ) {
// get all mailman lists
$query = "SELECT pref_value AS listname FROM `".BIT_DB_PREFIX."liberty_content_prefs` lcp WHERE lcp.`pref_name` = ?";
$lists = $gBitSystem->mDb->getArray( $query, ['boards_mailing_list'] );
foreach( $lists as $list ){
// update list configuration
if( $error = mailman_config_list( [ 'listname' => $list['listname'] ] ) ) {
echo $error."
";
}else{
echo "List: ".$list['listname']." has been updated.
";
}
}
}else{
echo "Include 'update=y' in the url to trigger the update process";
}