Hi theLowlyContractor2
Your needs are pretty clear now.
Create a logic_hook after_retrieve into Users module:
1. Create the file custom/modules/Users/logic_hooks.php with this content:
PHP Code:
<?php
$hook_version = 1;
$hook_array = Array();
$hook_array['after_retrieve'] = Array();
$hook_array['after_retrieve'][] = Array(1, 'include_custom_functions', 'custom/modules/Users/UserHook.php','UserHook', 'include_custom_functions');
?>
2. Create the file custom/modules/Users/UserHook.php with this content:
PHP Code:
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class UserHook {
function include_custom_functions(&$focus, $event, $arguments) {
global $current_user;
if($focus->id == $current_user->id) {
$path = 'custom/include';
$dir = dir($path);
while($entry = $dir->read()){
if(is_file($path . '/' . $entry) && $entry != '.' && $entry != '..') {
if(substr($entry, strlen($entry) - 4, 4) == '.php') {
require_once($path . '/' . $entry);
}
}
}
}
}
}
?>
Cheers
Bookmarks