login.tt2 6.24 KB
Newer Older
1
<!-- login.tt2 -->
2
[% IF back_to_mom ~%]
Luc Didry's avatar
Luc Didry committed
3
4
5
    <p>
        [%|loc(user.email)%]You have logged in with email address %1.[%END%]
    </p>
6
[% ELSE ~%]
Luc Didry's avatar
Luc Didry committed
7
8
    <h2>
        <i class="fa fa-user"></i>
9
        [% IF sso.size && use_passwd && only_passwd ~%]
Luc Didry's avatar
Luc Didry committed
10
11
12
13
14
            [%|loc%]Login locally[%END%]
        [%~ ELSE ~%]
            [%|loc%]Login[%END%]
        [%~ END %]
    </h2>
salaun's avatar
salaun committed
15

Luc Didry's avatar
Luc Didry committed
16
17
18
    <p>
        [%|loc%]In order to perform a privileged operation (one that requires your email address), you need to login.[%END%]
    </p>
19

20
    [% IF sso.size && !only_passwd ~%]
Luc Didry's avatar
Luc Didry committed
21
22
23
24
25
26
27
28
29
        <div class="row">
            <div class="columns">
                <form id="use-sso" action="[% path_cgi %]" method="post">
                    <fieldset>
                        <input type="hidden" name="previous_action" value="[% previous_action %]" />
                        <input type="hidden" name="previous_list"   value="[% previous_list %]" />
                        <input type="hidden" name="list"            value="[% list %]" />
                        <input type="hidden" name="action"          value="sso_login" />
                        <input type="hidden" name="nomenu"          value="[% nomenu %]" />
30
                        [% IF sso.size == 1 ~%]
Luc Didry's avatar
Luc Didry committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
                            [% FOREACH server = sso ~%]
                                <input type="hidden" name="auth_service_name" value="[% server.key %]" />
                                <button type="submit" name="action_sso_login" value="[% server.value %]">
                                    <i class="fa fa-user"></i>
                                    [% server.value %]
                                </button>
                            [%~ END %]
                        [%~ ELSE ~%]
                            <label for="auth_service_name">
                                [%|loc%]To login, select your organization authentication server below:[%END%]
                            </label>
                            <select id="auth_service_name" name="auth_service_name" class="submitOnChange">
                                <option value="1" selected>---[%|loc%]Click to select[%END%]---</option>
                                [% FOREACH server = sso ~%]
                                    <option value="[% server.key %]">[% server.value %]</option>
                                [%~ END %]
                            </select>
                            <noscript>
                                <button type="submit" name="action_sso_login" value="[%|loc%]Go[%END%]">[%|loc%]Go[%END%]</button>
                            </noscript>
                        [%~ END %]
                    </fieldset>
                </form>
            </div>
        </div>
56
    [% END # IF sso.size && !only_passwd ~%]
57

58
    [% IF use_passwd && sso.size && !only_passwd ~%]
Luc Didry's avatar
Luc Didry committed
59
60
61
62
63
        <hr />
        <h3>
            <i class="fa fa-user"></i> [%|loc%]Login locally[%END%]
        </h3>
    [% END ~%]
64

Luc Didry's avatar
Luc Didry committed
65
    [% IF use_passwd ~%]
66
        <form action="[% path_cgi %]" method="post" autocomplete="on">
Luc Didry's avatar
Luc Didry committed
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
            <fieldset>
                <input type="hidden" name="previous_action" value="[% previous_action %]" />
                <input type="hidden" name="previous_list"   value="[% previous_list %]" />
                <input type="hidden" name="only_passwd"     value="[% only_passwd %]" />
                <input type="hidden" name="referer"         value="[% referer %]" />
                <input type="hidden" name="failure_referer" value="[% failure_referer %]" />
                <input type="hidden" name="list"            value="[% list %]" />
                <input type="hidden" name="action"          value="login" />
                <input type="hidden" name="nomenu"          value="[% nomenu %]" />
                <input type="hidden" name="submit"          value="submit" />
                <div class="row">
                    <div class="columns">
                        <label for="email_login">[%|loc%]email address:[%END%]</label>
                        <input type="text" name="email" id="email_login" size="28" value="[% email %]" />
                    </div>
                </div>
                <div class="row">
                    <div class="columns">
                        <label for="passwd" >[%|loc%]password:[%END%]</label>
                        <input type="password" name="passwd" id="passwd" size="8" />
                    </div>
                </div>
                <div class="row">
                    <div class="columns">
                        <span>
                            <button class="heavyWork" type="submit" name="action_login" value="[%|loc%]Login[%END%]">
                                <i class="fa fa-user"></i>
                                [%|loc%]Go[%END%]
                            </button>
                        </span>
                    </div>
                </div>
            </fieldset>
        </form>
101

Luc Didry's avatar
Luc Didry committed
102
103
104
        [% IF authentication_info_url || ! is_ldap_user ~%]
            <hr />
        [% END ~%]
105

Luc Didry's avatar
Luc Didry committed
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
        [% IF authentication_info_url ~%]
            <ul>
                <li>
                    <a class="menuLinks" href="[%authentication_info_url%]">
                        [%|loc%]Authentication help[% END %]
                    </a>
                </li>
            </ul>
        [%~ ELSIF is_ldap_user ~%]
            [%# No guides %]
        [%~ ELSIF email ~%]
            <ul>
                <li>
                    <a href="[% 'firstpasswd' | url_rel([],{email=>email}) %]">
                        [%|loc%]First login?[%END%]
                    </a>
                </li>
                <li>
                    <a href="[% 'renewpasswd' | url_rel([],{email=>email}) %]">
                        [%|loc%]Lost password?[%END%]
                    </a>
                </li>
            </ul>
        [%~ ELSE ~%]
            <ul>
                <li>
                    <a href="[% 'firstpasswd' | url_rel %]">
                        [%|loc%]First login?[%END%]
                    </a>
                </li>
                <li>
                    <a href="[% 'renewpasswd' | url_rel %]">
                        [%|loc%]Lost password?[%END%]
                    </a>
                </li>
            </ul>
        [%~ END %]
    [% END # IF use_passwd ~%]
144
[% END # IF back_to_mom ~%]
145
<!-- end login.tt2 -->