Simple plugin for verification of existing WordPress users with api.
Integration with the simple active directory api service (https://github.com/helsingborg-stad/active-directory-api). Simply define AD_INTEGRATION_URL with the url to the base directory of the api. The following functions will be enabled by default:, (*1)
This plugin will alter the index of the user table to require unique usernames. This is not a default behavior for WordPress and may break other plugins related to user management., (*2)
You can trigger a manual bulkimport. This will directly call the bulkimport function in your current call. Profile updates will be sheduled every minute following, until all WordPress users has been updated., (*3)
Import new users / remove old: https://site.dev/wp-admin/?adbulkimport Update registered profiles: https://site.dev/wp-admin/?adbulkprofile Propagate user roles to all sites: https://site.dev/wp-admin/?adbulkpropagate, (*4)
Cleaning actions to keep WordPress tables clean in some installations that are using bad object cache-engines., (*5)
Remove duplicate users: https://site.dev/wp-admin/?adcleanusers Remove orphan user meta: https://site.dev/wp-admin/?adcleanmeta Remove user capabilitys that are empty: https://site.dev/wp-admin/?adcleancap, (*6)
These options imports all users avabile in active directory nightly., (*7)
These options creates a user on the site if it exists in active directory on signon., (*8)
AD_AUTOCREATE_ROLE: Default role to assign new users (default to "subscriber"), (*9)
Be careful setting these options. All of them are not compatible. For instance: You cannot save the password, and generate a random password. ** Ad update meta should be set in order to enable ad_meta_prefix constant., (*10)
Filter the meta keys stored in the database., (*11)
add_filter('adApiWpIntegration/profile/metaKey', function($meta_key){ return $meta_key; });
Filter the default redirect to page, subscribers may not be affected to this (to homepage as default), (*12)
add_filter('adApiWpIntegration/login/defaultRedirect', function(){ return home_url(); });
define('AD_INTEGRATION_URL', 'https://internalproductionserver.com/ad-api/'); define('AD_UPDATE_NAME', true); define('AD_UPDATE_EMAIL', true); define('AD_SAVE_PASSWORD', false); define('AD_RANDOM_PASSWORD', true); define('AD_USER_DOMAIN', 'company.com'); define('AD_BULK_IMPORT', true); define('AD_BULK_IMPORT_USER', 'bulkimportaduser'); define('AD_BULK_IMPORT_PASSWORD', '*********'); define('AD_BULK_IMPORT_ROLE', 'subscriber'); define('AD_BULK_IMPORT_REASSIGN_USERNAME', 'administrator');