% # known user with profile
% if ($userid && $has_profile){
% $m->call_next(username=>$username, userid=>$userid);
% # known user, no profile
% }elsif ($username){
	
<& /login/servicos/registar/new_profile.html, username=>$username, realm=>'mensagens' &>	
	
% # unknown, user
% }else{
%#<& /login/default.html, realm=>'mensagens' &>	
<& /login/messages/clients_only.html, subsection=>'mensagens', bgcolor=>'#ecf3ef;' &>
% }	
<%shared>
my ($username, $userid) = $m->comp("/_shared/procs/users/login/user_check.m",  realm=>'mensagens');
my $has_profile = $m->comp("/_shared/procs/users/login/profile_check.m", username=>$username);
my $label = ($versao == 1) ? "utilizador":"user";
</%shared>
%#======================================================================================
<%method section_tabs>
%#--------------------------------------------------------------------------------------
<& PARENT:section_tabs, stab=>3 &>
</%method>
%#--------------------------------------------------------------------------------------
<%method main_ctrl>
%#--------------------------------------------------------------------------------------
<%ARGS>
$node => undef
</%ARGS>
<div align=left class=cnts style='padding:6px 12px 6px 12px; width: 444px; background-color: #01b6b4; border-top: solid 1px #4bcbca;'>
% if ($userid && $has_profile){
<span class='navpath'>
<a class='navpath' href="/mensagens/servicos/eliminar/default.html">mensagens colocadas</a>
|
<a class='navpath' href="/login/servicos/editar/default.html">dados registo</a>
</span>
% }	
</div>
</%method>
%#======================================================================================
<%method form_start>
%#--------------------------------------------------------------------------------------
<%ARGS>
$step => undef
</%ARGS>
% if ($userid && $has_profile){
%  	if ($step eq 'preview'){
<form action="/mensagens/servicos/colocar/preview.html" method="post" name="main">
%	}else{
	<form>
% 	}
% }elsif ($username){
<form action="/login/servicos/editar/edit.html" method='post'>
% }else{
<form action="/login/login.m" method="get" name='login'>
% }
<input type='hidden' name='stab' value=3>
</%method>
