[- use Embperl::Form::Validate; use File::Basename ; $epf1 = new Embperl::Form::Validate([ -key => 'user_email', required => 1, -key => 'user_password', required => 1, length_min => 5], 'login'); $epf2 = new Embperl::Form::Validate([ -key => 'user_email', required => 1], 'newuser'); $r = shift ; $fdat{user_email} ||= $fdat{email} ; -] [$ if not $udat{user_id}$] [$ if ($fdat{-newuser} || $fdat{-newpassword}) && !$r -> {error}$]

[= loginnew =]

[$else$]

[= login1 =]

[$endif$]
[= user_email =]
[= user_password =]

[$ hidden $]

[= cookie_note =]

[$ if (!$fdat{-newuser} && !$dat{-newpassword}) ||$r -> {error} $]

[= login2 =]

[= login3 =]

[- $fdat{user_name} ||= "$fdat{firstname} $fdat{lastname}" -]
[= user_email =]
[= user_name =]

[$ hidden $]

[$ endif $] [$ else $]

[= already_logged_in_as =] [+ $udat{user_email} +] [$ if $udat{user_admin} $] [Admin] [$ endif $]

[= logoff =]

[$ hidden $]

[$ endif $]