|
{************ Check if site visitors are allowed to register? (site configuration) ********}
{* if user is not logged in and registering is not allowed then show error message for editors *}
{if !$user && !$conf.users_can_register}
Site visitors are not allowed to register by site's configuration.{else} {assign var="show_form" value=1} {if $smarty.post.save == 1} {if $userdata->user_id} {*************** UPDATE USER DATA ************} {save_profile name="user_id" profile_id=$userdata->profile_id id=$userdata->user_id fields=$smarty.post username=$userdata->all.username password=$smarty.post.password confirm_password=$smarty.post.confirm_password} {if $user_id} {save_sso user=$user_id fields=$smarty.post.sso} {save_mailinglist user=$user_id fields=$smarty.post.mailinglist_sections} {assign var="show_form" value=0} {init_article name="art" system_message="art_kasutaja_uuendatud_id"} {if $art->show_headline}{$art->buttons}{$art->title}{/if}
{$art->lead}
{/if}
{else}
{*************** SAVE NEW USER DATA ************}
{save_profile name="user_id" profile="contact" fields=$smarty.post password=$smarty.post.password confirm_password=$smarty.post.confirm_password}
{if $user_id}
{save_sso user=$user_id fields=$smarty.post.sso}
{save_mailinglist user=$user_id fields=$smarty.post.mailinglist_sections}
{assign var="show_form" value=0}
{init_article name="art" system_message="art_kasutaja_registreeritud_id"}
{if $art->show_headline}
{$art->body} {$art->buttons}{$art->title}{/if}
{$art->lead}
{/if}
{/if}
{/if}
{*************** THE USER FORM ************}
{if $show_form}
{if $userdata->user_id}
{init_profile name="register" profile_id=$userdata->profile_id id=$userdata->user_id readonly_fields="username"}
{$art->body} {sysword word="profile" type="saurus4"}{else} {init_profile name="register" profile="contact"}{sysword word="register" type="saurus4"}{/if} {/if} {/if} |