{** * Registration and users profile form, content template * Date: 30.10.08 * * @package saurus4 * * @author Saurus * *}
{************ 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} {verify_form_token} {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} {$art->body}
{/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->buttons}{$art->title}

{/if}
{$art->lead} {$art->body}
{/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"}

{sysword word="profile" type="saurus4"}

{else} {init_profile name="register" profile="contact"}

{sysword word="register" type="saurus4"}

{/if}
{************ if password is expired *************} {if $userdata->user_id && $userdata->all.pass_expired}

{sysword word="Password expired message" type="users"}


{foreach from=$register->data item="profile_field"} {/foreach}
{sysword word="username" type="admin"} {$userdata->username}
{sysword word="password" type="users"} * {if $smarty.post.form_error.password}
{$smarty.post.form_error.password}{/if}
{sysword word="password confirmation" type="users"} *
{************ user profile form *************} {else} {foreach from=$register->data item="profile_field"} {* special fields after username for password and confirm password *} {if $profile_field->name == 'username'} {/if} {/foreach}
{$profile_field->label}{if $profile_field->is_required} *{/if} {$profile_field->html}
{sysword word="password" type="users"} * {if $smarty.post.form_error.password}
{$smarty.post.form_error.password}{/if}
{sysword word="password confirmation" type="users"} *
{*************** SSO APPLICATIONS ************} {init_sso name="sso_apps"} {if $sso_apps > 0} {********** TITLE **********}

{sysword word="applications login info" type="saurus4"}

{********** PRINT SSO NAMES **********} {foreach from=$sso_apps item=sso} {/foreach}
{sysword word="application name" type="saurus4"} {sysword word="username" type="saurus4"} {sysword word="password" type="editor"}
user_registered == 1} checked="checked"{/if}>{$sso->app_name}
{/if} {* SSO *} {*************** MAILINGLISTS ************} {init_mailinglist name="list"} {if $list_count > 0} {********** TITLE **********}

{sysword word="mailinglists" type="saurus4"}

{********** PRINT CHECKBOXES AND SECTION NAMES **********} {foreach from=$list item=section} {/foreach}
user_subscribed == 1} checked="checked"{/if}> {$section->title}
{/if} {/if} {create_form_token form_id="edit-profile"}
{/if} {/if}