Monthly Archives: September 2020
filters | Buddypress | hookr.io | http://hookr.io/
The WordPress Hook/API Index
Private Messaging | Bp-rest-api Handbook Handbook | BuddyPress Developer Resources | https://developer.buddypress.org/
How to hide Send Private Message and Send Public Message – BuddyPress User | https://buddyuser.com/
How to Hide Send Private Message and Send Public Message from the members profile view
Sometimes it becomes prudent to make it more difficult for site members to email other members, for example where you are suffering from spammers.
Where to put code Snippets
Code Snippets for BuddyPress can typically be placed in two locations:
/wp-content/themes/yourchildtheme/functions.php/wp-content/plugins/bp-custom.phpThe preference is to create a bp-custom.php file, since this is independent of the theme you happen to be using.
The code snippet must be wrapped in <?php and ?> tags in order to tell you server that it is to run the code as PHP.
Remove “Send Private Message” from users who are not friends of the member whose profile they are viewing
1 2 3 4 5 6 7add_filter( 'bp_get_send_message_button', function( $array ) { if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) { return $array; } else { return ''; } } );Remove “Send Public Message” from users who are not friends of the member whose profile they are viewing
1 2 3 4 5 6 7 8add_filter( 'bp_get_send_public_message_button', function( $r ) { if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) { return $r; } else { $r['component'] = ''; return $r; } } );These code snippets were originally posted by Henry Wright in the BuddyPress Forums:
https://buddypress.org/support/topic/disable-or-hide-private-message-button/
Source: How to hide Send Private Message and Send Public Message – BuddyPress User | https://buddyuser.com/
Turn Off Updates • mozillaZine Forums
Here is the policies documentation.
Manage updates, policies & customization
http://support.mozilla.org/en-US/produc … enterpriseCustomizing Firefox Using policies.json
http://support.mozilla.org/en-US/kb/cus … liciesjsonCreate a folder called distribution where the firefox.exe is located and place the policies.json file there.
- CODE: SELECT ALL
{
"policies": {
"DisableAppUpdate": true
}
}Customizing Firefox Using Group Policy
http://support.mozilla.org/en-US/kb/cus … cy-windowsLocal Group Policy Editor (gpedit.msc) is not available in Home versions of Windows 7, 8 or 10.
How to stop Firefox from showing the update nag screen?
http://superuser.com/questions/1407844Enterprise Policies
http://klaus-hartnegg.de/gpo/2018-05-26-Firefox-Policies.htmlEnterprise Policy Generator
http://addons.mozilla.org/firefox/addon/976971I never tried the Enterprise Policy Generator addon.
policies.json being removed on browser updates via setup.exe (wontfix)
http://bugzilla.mozilla.org/show_bug.cgi?id=1502188P.S.
I got the DisableAppUpdate policy working with the policies.json file in Firefox Portable 71.0 32-bit.
* C:\FirefoxPortable\App\Firefox\distribution\policies.json
However, I had to remove the following registry keys before I got it working.
* HKEY_CURRENT_USER\Software\Policies\Mozilla
* HKEY_LOCAL_MACHINE\SOFTWARE\Policies\MozillaHere is how to test if the DisableAppUpdate policy is working.
Test DisableAppUpdate policy: viewtopic.php?p=14848020#p14848020
Mozilla Enterprise Policies for Firefox and Thunderbird
![]()
The Mozilla Enterprise Policies for Firefox (and Thunderbird)
This feature is meant to help enterprise admins, who deploy Firefox as software package to computers in their organization.
Versions
Policies were first added in Firefox 60, and back then were purely optional.
In Firefox 68 some settings from autoconfig stopped working (for example the option to disable automatic updates), thus it became necessary to at least partially switch to policies.
Thunderbird started to implement policies in version 68, and at the same time also stopped respecting some of the autoconfig options.
Overview
The Enterprise Policy feature provides two new ways to configure Firefox (besides the old autoconfig aka mozilla.cfg):
- Windows Group Policy Objects (GPO)
- A config file named policies.json
Interactions:
- If any policies are set with GPO, the json file is ignored.
- If autoconfig (old) and policies (new) provide conflicting settings, policies win.
Requirements:
- Firefox version 60 or later.
- Thunderbird version 68 or later.
- In Windows some policies work only if you have either Firefox ESR or domain-joined PCs.
(It is currently unclear how Firefox detects the domain membership, and whether it must be an Active Directory domain)Howto use the admx templates (for GPO)
Firefox
- Copy firefox.admx to C:\Windows\PolicyDefinitions
- Copy firefox.adml to C:\Windows\PolicyDefinitions\en-US
- Run <class=”tt”>gpedit.msc or <class=”tt”>RSAT (Remote Server Administration Tools), and open Computer Configuration, Administrative Templates, Firefox.</class=”tt”></class=”tt”>
Thunderbird
Some of the Firefox policies also work in Thunderbird.
There are official (but non-functioning) admx-templates on https://github.com/thundernest/policy-templates. They are just a clone of the templates for Firefox, and thus do not have an effect on Thunderbird.
Inofficial templates are on https://github.com/drlellinger/thunderbird-policies (announced here), and they acually work.
- Copy thunderbird.admx to C:\Windows\PolicyDefinitions
- Copy thunderbird.adml to C:\Windows\PolicyDefinitions\en-US
- Run <class=”tt”>gpedit.msc or <class=”tt”>RSAT (Remote Server Administration Tools), and open Computer Configuration, Administrative Templates, Thunderbird.</class=”tt”></class=”tt”>
You can also copy registry keys from Firefox and rename them. For example this one works:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Thunderbird] "DisableAppUpdate"=dword:00000001Howto use create the json file (alternative for GPO)
The currently supported policies are listed here. New policies are added with every version, and so far all new policies are available both in the latest RR (Rapid Release), and in the latest ESR (Extended Service Release).
Multiple policies must be separated with commas. Multiple options to one policy must be placed in curly brackets, and separated with commas.
A Generator addon was published (german). More info.
The json file must be placed in a subdirectory named distribution in the program directory. In Windows the path will be something like
C:\Program Files\Mozilla Firefox\distribution\policies.json
This directory does usually not yet exist, you must create it.Sample file:
{ "policies": { "DisableAppUpdate": true, "DisableBuiltinPDFViewer": true, "DisableFirefoxAccounts": true, "DisableFirefoxStudies": true, "DisablePocket": true, "DisableProfileRefresh": true, "DisableTelemetry": true, "DontCheckDefaultBrowser": true, "EnableTrackingProtection": { "Value": true, "Locked": false }, "Proxy": { "Mode": "none", "Locked": false }, "SearchBar": "separate" } }Errors in the file are reported on the page “about:policies”, but this feature needs at least Firefox version 63. This is the typical way how Mozilla develops new feature: publish it long before its ready.
Howto not document a feature
Mozilla has created this labyrinth:
- https://wiki.mozilla.org/Firefox/EnterprisePolicies
- https://support.mozilla.org/en-US/products/firefox-enterprise/policies-customization-enterprise/policies-overview-enterprise
- https://developer.mozilla.org/Firefox/Enterprise_deployment
- https://support.mozilla.org/products/firefox-enterprise
- https://support.mozilla.org/products/firefox-enterprise/policies-customization-enterprise
- https://support.mozilla.org/kb/customizing-firefox-using-policiesjson
- https://github.com/mozilla/policy-templates/blob/master/README.md
It seems that Github is now the official place for documentation. But even there a lot of info is missing. For example that this is supposed to replace autoconfig. And that in Windows several of these options only work if either the ESR version is used, or the PCs are members of a Windows Domain. Also how do the two methods relate to each other and to autoconfig: which one does take precedence?
Lets hope that eventually Mozilla will write some decent documentation for this new feature.
No, I’m not gonna read the source to extract infos from there.
Changelog:
- 2018-10-22 Thunderbird
- 2018-09-17 corrected directory, add interactions, add sample
- 2018-05-31 cleanup
- 2018-05-30 add howto use the admx templates, and links to generator and source.
- 2018-05-25 new
Source: Mozilla Enterprise Policies for Firefox and Thunderbird
mod_rewrite Cheat Sheet by DaveChild
A mod_rewrite Cheat Sheet – a quick reference guide for mod_rewrite, with rewrite flags, regular expression syntax and sample rules.
mod_rewrite Tutorialsmod_rewrite RewriteRule Flags
mod_rewrite RewriteCond Flags
Redirection Header Codes
mod_rewrite Directives
|
Regular Expressions Syntax
There’s an excellent regular expression tester at: http://regexpal.com/
mod_rewrite Server Variables: HTTP Headers
mod_rewrite Server Variables: Server Internals
|
mod_rewrite Sample Rule: Site Moved
Rewrites domain.com to domain2.com
mod_rewrite Sample Rule: Temporary Page Move
Rewrites domain.com/page.html to domain.com/new_page.html
mod_rewrite Sample Rule: Nice URLs
Rewrites domain.com/category-name-1/ to domain.com/categories.php?name=category-name-1
mod_rewrite Server Variables: Special
mod_rewrite Server Variables: Request
mod_rewrite Server Variables: Time
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
filtering spam with procmail | http://www.benya.com/
This is a collection of procmail recipes which I use to pre-filter the incoming mail before letting SpamBayes take a crack at it. This combination seems to provide a fairly decent level of protection. Naturally, your mileage may vary.
procmail is a mail processor installed on most Linux systems and used to by the mail server to deliver mail to your mailbox. If your mail server is hosted on linux you may use procmail to remove spam and sort messages before they are placed into your mailbox. If, like me, you prefer to use pine in a shell window to check your e-mail, this type of filtering may be your only defense against spam.
In order to understand these recipes, at least some knowledge of procmail and regular expressions syntax is required. The basics can be learned from procmail man pages and from links on procmail home page. Here is a great procmail documentation project and a library of recipes
Spam filters and other useful procmail recipes
Source: filtering spam with procmail | http://www.benya.com/