function bakery_user_presave in Bakery Single Sign-On System 7.2
Same name and namespace in other branches
- 8.2 bakery.module \bakery_user_presave()
Implements hook_user_presave().
File
- ./
bakery.module, line 156 - Module file for the Bakery.
Code
function bakery_user_presave(&$edit, $account, $category) {
if (variable_get('bakery_is_master', 0)) {
// Invoke implementations of hook_bakery_transmit() for syncing arbitrary
// data.
$_SESSION['bakery']['data'] = module_invoke_all('bakery_transmit', $edit, $account, $category);
// We store email/name if they changed. We want to wait with doing
// anything else until the changes are saved locally.
foreach (variable_get('bakery_supported_fields', array(
'mail' => 'mail',
'name' => 'name',
)) as $type => $enabled) {
if ($enabled && isset($edit[$type]) && isset($account->{$type}) && $account->{$type} != $edit[$type]) {
$_SESSION['bakery'][$type] = $edit[$type];
}
}
}
}