[% META title = 'User » Register New User' -%] [% # PROCESS dumper.tt dump = errs %] [% # PROCESS dumper.tt dump = registered_users %] [% # PROCESS dumper.tt dump = user_details %]

Registration Details

[% IF errs %]

[% c.cfg('msg').dfv_errors %]

[% ELSE %]

Usage: preview message -> post message.

Paste Application Details:
[% END %]
[% IF user_groups AND NOT new_user_create_success %]

User group: « select one

[% END %]

[% IF new_user_create_success %] create new user » [% ELSE %] [% IF user_details AND NOT errs; class = has_role ? 'normal' : 'red' %] [% ELSE %] [% END %] [% IF user_details AND NOT has_role %] check spelling/case of 'position' entry [% END %] [% END %]

[% IF user_details; # PROCESS dumper.tt dump = preview %]

Preview:

[% IF registered_users.size; # have potential duplicates: cols = ['username' 'last_name' 'first_name' 'email']; BLOCK row; class = user_details.${col} == user.${col} ? 'red' : 'normal'; %] [% user.${col} %] [% END %]

Registered users with similar username:

[% FOREACH user IN registered_users %] [% FOREACH col IN cols; INCLUDE row; END %] [% END %]
username last name first name email location last login active
[% user.user_location.location_name %] [% user.last_login.strftime('%d.%b.%Y %H:%M') %] [% user.active %]
[% END %]
[% class = user_details.user_location_id ? 'normal' : 'red' %] [% class = has_role OR new_user_create_success ? 'normal' : 'red' %]
UserID: [% user_details.username | upper; IF user_details.username; IF user_details.username != user_details.last_name %] « LastName = Username already exists - check user details [% END; END; errs.error_username %]
LastName: [% user_details.last_name | ucfirst %] [% IF errs.error_last_name %] [% errs.error_last_name %] [% END %]
FirstName: [% user_details.first_name | ucfirst %] [% IF errs.error_first_name; IF user_details.first_name # fname + lname constraint; # would update existing entry: %] * combination of first & last name already exists [% ELSE; errs.error_first_name; END %] [% END %]
Email: [% user_details.email %] [% errs.error_email %]
Location: [% user_details.location %] [% IF errs.error_user_location_id.match('missing') %] « unknown user location [% END %]
Designation: [% user_details.designation %] [% UNLESS has_role OR new_user_create_success %] « does not exist [% END %]
[% UNLESS errs %]
[% INCLUDE admin/user/new_user_msg.tt | html %]
[% END %]
[% END %]