OpenCrypt - Membership Management
Username:
Password:
My Account / Forgotten Password?
 Home  my.OpenCrypt 
 Home  My Account  Helpdesk  FAQ and Documentation  Download OpenCrypt  Manage Licenses  OpenCrypt APIs  Upgrade Release Notes 

Frequently Asked Questions and Documentation
 
TopOpenCrypt DocumentationOpenCrypt System

OpenCrypt system documentation relating to more detailed aspects of the software.

Custom Functions

The OpenCrypt membership software offers a 'Custom Functions' feature which enables you to add your own Perl code to be run by OpenCrypt whenever an account is registered, updated, removed, renewed or expired. This enables you to integrate third-party software with OpenCrypt, or to extend the actions performed by OpenCrypt.

The file used to control this functionality in OpenCrypt is called 'custom_functions.pl', this is located in the /cgi-bin/oc/admin/includes directory.

Their are nine functions included in this file which are outlined below:

&custom_function_register
This function is run whenever an account is created. It is important to check an account is active if that is relevant to your process since the function isn't just run when an account is finally created.
This function is called with an array called @data containing the account details from the oc_users table. $data[0] would be the username, $data[2] the email address.

&custom_function_modify
This function is called when an account is modified/updated. This function is called with the $username variable so you must check the oc_users and oc_user_data tables for the updated data as you require.

&custom_function_remove
This function is called when an account is removed. This function is called with the $username variable.

&custom_function_expire
This function is called when an account is expired. This function is called with the $username variable.

&custom_function_renew
This function is called when an account is renewed. This function is called with the $username variable.

&custom_function_form_constraints
This function enables us to hide custom form fields. This function is called with the $field_id variable and returns the $hide_field variable. If $hide_field equals '1' then the field is hidden.

&custom_function_form_validation1, &custom_function_form_validation2, &custom_function_form_validation3
This function enables us to add our own custom field validation. When adding a custom form field you may select the 'Field Validation' as 'Custom Validation Function 1', '2' or '3', depending upon which is selected the appropriate function will be run. The function is called with the $field_value variable which contains the data entered into the field. If the function returns '1' the validation has been parsed successfully, if the function returns '0' then the validation has failed and the error message will be displayed.

Please note, we are happy to answer any questions regarding these functions but we cannot offer support for your Perl code.


 
Article Details

Last Updated: 08 October 2008 00:06:32
Revision Number: 1
Article viewed 18527 times.
FAQ Index
Pre-Sales Questions
OpenCrypt Documentation
OpenCrypt System
Communicate
Statistics
Administrators
Configuration
E-Commerce Configuration
User Management
Database Management
OpenCrypt Installation
Register.cgi
Manage.cgi
PHP Login Interface
OpenCrypt Plugins
OpenCrypt Add-Ons
Dictionary and Terms

Copyright © 1999 - 2016 ionix Limited. All Rights Reserved.

Powered by OpenCrypt