I am not sure what might have caused it, but when new users log in (we are connected to an Active Directory setup with jmapmyldap), they are getting orphaned instead of associating to the default profile. Any suggestions on how to fix this?
/**
* Checks if the user has any profile upon saving
*
* @since 1.2
* @access public
* @param string
* @return
*/
public function onUserAfterSave( $user , $isnew , $success , $msg )
{
if( $isnew )
{
$model = Foundry::model( 'Profiles' );
$profile = $model->getDefaultProfile();
// Get the user object
$my = Foundry::user( $user->id );
if( !$my->profile_id )
{
$my->profile_id = $profile->id;
$profile->addUser( $my->id );
}
}
}