Command Line Scripts

Last Modified: 07-March-2014

This document covers the installation and overview of the command line interface (CLI) scripts (cli_shmanic_ldap) included in Version 2. It is assumed the steps in Getting Started with Version 2 have been completed.

Jump to:
  1. LDAP Cron
  2. Clear DB Passwords

LDAP Cron

The LDAP Cron script can be used to synchronise all users from LDAP to the Joomla site. This is achieved by using the 'All User Filter' defined in each LDAP host configuration to retrieve each user. It makes full use of the user sync functions in each LDAP plug-in meaning Group Mapping and Profiles are also pulled. The script is designed to be used with Cron.

File Path: /cli/ldap_cron.php

Usage: php ldap_cron.php

Typical Output:

root@jmml:/var/www/jtests/31/cli# php ldap_cron.php
Started LDAP Cron Script for Joomla!
Found 1 LDAP configurations.

Attempting to synchronise user customer.one...
Successfully synchronised user customer.one.
Attempting to synchronise user customer.two...
Successfully synchronised user customer.two.
Attempting to synchronise user dev.person...
Successfully synchronised user dev.person.
Attempting to synchronise user finance.person...
Successfully synchronised user finance.person.
Attempting to synchronise user hr.person...
Successfully synchronised user hr.person.
Attempting to synchronise user management.person...
Successfully synchronised user management.person.
Attempting to synchronise user sales.person...
Successfully synchronised user sales.person.
Attempting to synchronise user shaun.maunder...
Successfully synchronised user shaun.maunder.
Attempting to synchronise user support.person...
Successfully synchronised user support.person.


======= LDAP Results =======

Error Messages:

Users Success: 9.
Users Failed:  0.

============================

Back to Top

Clear DB Passwords

The Clear DB Passwords script is used to null passwords in the Joomla users table. This clears only users that use LDAP to authenticate. This script is required due to Joomla storing the user password in its database. Therefore if the 'Authentication - Joomla' plug-in is enabled, Joomla would authenticate the user with that plug-in instead of LDAP which can lead to many security issues such as potentially having two passwords alive per user. This script is designed to be used with Cron.

File Path: /cli/clear_db_passwords.php

Usage: php clear_db_passwords.php

Typical Output:

root@jmml:/var/www/jtests/31/cli# php clear_db_passwords.php
Clearing Joomla passwords...
Successfully cleared 2 passwords.