Let the platform do the work

after_load_user

Overview

The after_load_user hook executes after the current user is set for the current request. It handles actions that are dependent on the current user, such as setting ACLs or configuring user-dependent parameters.

Definition

  function after_load_user($event, $arguments){}

Arguments

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

Change Log

Version Note
6.6.0 Added after_load_user hook

Example

./custom/modules/logic_hooks.php

  <?php

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

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

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

        //tde PHP file where your class is located.
        'custom/modules/application_hooks_class.php',

        //tde class the method is in.
        'application_hooks_class', 

        //tde method to call.
        'after_load_user_method' 
    );

?>

./custom/modules/application_hooks_class.php

  <?php

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

    class application_hooks_class
    {
        function after_load_user_method($event, $arguments)
        {
            //logic
        }
    }

?>