Let the platform do the work

before_logout

Overview

The before_logout hook executes before a user logs out of the system.

Definition

function before_logout($bean, $event, $arguments){}

Arguments

Name Type Description
bean Object The bean object
event String The current event
arguments Array Additional information related to the event (typically empty)

Change Log

Version Note
5.0.0a Added before_logout hook

Example

./custom/modules/Users/logic_hooks.php

<?php

    $hook_version = 1;
    $hook_array = Array();

    $hook_array['before_logout'] = Array();
    $hook_array['before_logout'][] = Array(
        //Processing index. For sorting the array.
        1,

        //Label. A string value to identify the hook.
        'before_logout example',

        //The PHP file where your class is located.
        'custom/modules/Users/logic_hooks_class.php',

        //The class the method is in.
        'logic_hooks_class',

        //The method to call.
        'before_logout_method'
    );

?>

./custom/modules/Users/logic_hooks_class.php

<?php

    if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    class logic_hooks_class
    {
        function before_logout_method($bean, $event, $arguments)
        {
            //logic
        }
    }

?>