Update LDAP Bridge References Script

Last Updated: 18 May 2018

The ldap_update_bridge_references.php script is used to update an LDAP bridge's references in the database as per the bridge's LDAP User Shadow ID setting. If there are no references outside of the bridge, then there is no need to run the script.

For each referenced LDAP user, the script will check if the shadow asset ID component of the reference matches the bridge's one, and updates it if required.

This script can be found in the /packages/ldap directory.

Usage

php ldap_update_bridge_references.php -s  <system_root> --bridge-id=<bridge_id> [--read-only] [--force-update]
  • <system_root> : The root directory of the Squiz Matrix instance.
  • <bridge_id> : The LDAP Bridge asset to update.
  • [--read-only] : Run the script in read-only mode.
  • [--force-update] : If the script has been successfully run since the last Use User ID as Shadow ID setting update, the script will say that the update is not required. Use this option to run the script anyway.

Examples

Running the script in read only mode

$ php packages/ldap/scripts/ldap_update_bridge_references.php -s $(pwd) --bridge-id=3282 --read-only
Getting the shadow asset ID references in the DB ... done. Updating the shadow asset ID references in the DB for LDAP Bridge #3282 .... LDAP bridge shadow ID references updating completed! Unique LDAP references updated: 2
Unknown LDAP references: 0 Total db rows updated: 32 NOTE: Script ran in read-only mode. No updates were made in the db.

Running the script in live mode

$ php packages/ldap/scripts/ldap_update_bridge_references.php -s $(pwd) --bridge-id=3282
Getting the shadow asset ID references in the DB ... done. Are you sure you want to update the bridge's references in the db as per bridge's current 'User Asset ID' setting [Y/n]: Y .... LDAP bridge shadow ID references updating completed! Unique LDAP references updated: 2
Unknown LDAP references: 0 Total db rows updated: 32

Running the script after the references have already been updated

$ php packages/ldap/scripts/ldap_update_bridge_references.php -s $(pwd) --bridge-id=3282
Bridge references seems to have been updated since the last 'User Asset ID' setting update. Use '--force-update' option to forcebly update the db references.

Running the script with the force update option

$ php packages/ldap/scripts/ldap_update_bridge_references.php -s $(pwd) --bridge-id=3282 --force-update
Getting the shadow asset ID references in the DB ... done. Are you sure you want to update the bridge's references in the db as per bridge's current 'User Asset ID' setting [Y/n]: Y .... LDAP bridge shadow ID references not found. Update not required.

Previous Chapter

The Latest

Let Us Know What You Think

Let us know if you spot any errors or if you have any ideas on how we can improve the Matrix Community Website.

Contact Squiz for Demo

Let us show you the true power of Squiz Matrix by giving you a personalised demonstration.