FusionDirectory is a versatile tool for managing users and resources via LDAP. Its flexible plugin system allows administrators and developers to extend functionality and tailor the interface to specific needs. In this guide, we’ll walk through the process of creating a custom plugin, from setting up the PHP files to integrating custom LDAP schemas.
1. Getting Started
Before diving in, ensure you have:
- A working FusionDirectory installation: Your system must already run FusionDirectory.
- Basic knowledge of LDAP and PHP: The guide assumes you’re comfortable with PHP and the fundamentals of LDAP.
- Root access to your server: You’ll need administrative rights to install files, update configurations, and modify schemas.
2. Understanding the Plugin Structure
A FusionDirectory plugin is essentially a PHP script that must be saved as an .inc file. Typically, your plugin should be stored in the following directory:
The <plugin_type> reflects the plugin’s role (e.g., admin, config, or personal), while <plugin_name> is the unique name for your plugin. This structure ensures FusionDirectory can locate and load your plugin correctly.
3. Writing Your Plugin Code
Let’s take a look at a sample plugin file, customplugin.inc. This example demonstrates how you can create a plugin that adds extra input fields for user information:
4. Integrating LDAP Schemas
In addition to your PHP file, you need to define an LDAP schema that complements your plugin. Here’s an example of a simple schema file (customplugin.schema):
Place this schema file in the following directory:
Then, run the command below to insert your schema into FusionDirectory’s LDAP system:
To verify that your schema has been successfully added, check the list of schemas:
5. Applying Changes
After creating your plugin and integrating the schema, it’s important to apply the changes so FusionDirectory recognizes them. Clear the FusionDirectory cache with:
Finally, log out and log back in to FusionDirectory to see your custom plugin in action.
Final Thoughts
Custom plugins are a powerful way to extend FusionDirectory to better suit your organization’s needs. This guide covered the essentials—from file placement and PHP scripting to LDAP schema integration and cache updates. With these steps, you should be well on your way to building plugins that can add new features or streamline existing processes.
For more detailed instructions and examples, refer to the complete documentation available in both English and French. Happy coding!
Made by h0ag