Here is a good fix to "the headers already sent" problem caused by the redirection beeing called (in posting.php, privmsg.php, profile.php) after some output has been sent in module.php.
Set the redirection in the begining of the module.php
$file=$HTTP_GET_VARS['file'];
switch($file){
case"profile.php":
if ( !tep_session_is_registered('customer_id') )
{
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
case"privmsg.php":
if ( !tep_session_is_registered('customer_id') )
{
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
case"posting.php":
if ( !tep_session_is_registered('customer_id') )
{
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
}