login_menu.tt2 2.71 KB
Newer Older
1
<!-- login_menu.tt2 -->
2
[% IF sso.size ~%]
Luc Didry's avatar
Luc Didry committed
3
4
5
    <li>
        <form id="use-sso" action="[% path_cgi %]" method="post">
            <fieldset>
6
7
                <input type="hidden" name="list" value="[% list %]" />
                <input type="hidden" name="action" value="sso_login" />
8
                [% IF sso.size == 1 ~%]
Luc Didry's avatar
Luc Didry committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
                    [% FOREACH server = sso ~%]
                        <input type="hidden" name="auth_service_name" value="[% server.key %]" />
                        <span>
                            <button type="submit" name="action_sso_login" value="[% server.value %]">
                                <i class="fa fa-user"></i>
                                [% server.value %]
                            </button>
                        </span>
                    [%~ END %]
                [%~ ELSE ~%]
                    <span>
                        <select id="auth_service_name" name="auth_service_name"
                                class="submitOnChange"
                                title="[%|loc%]To login, select your organization authentication server below:[%END%]"
                                data-tooltip>
                            <option value="1" selected>---[%|loc%]Click to select[%END%]---</option>
                            [% FOREACH server = sso ~%]
                                <option value="[% server.key %]">[% server.value %]</option>
                            [%~ END %]
                        </select>
                    </span>
                    <noscript>
                        <button type="submit" name="action_sso_login" value="[%|loc%]Go[%END%]">[%|loc%]Go[%END%]</button>
                    </noscript>
                [%~ END %]
            </fieldset>
        </form>
    </li>
IKEDA Soji's avatar
IKEDA Soji committed
37
[%~ END %]
38

39
[% IF use_passwd AND sso.size ~%]
Luc Didry's avatar
Luc Didry committed
40
    <li class="divider show-for-small" role="separator"></li>
IKEDA Soji's avatar
IKEDA Soji committed
41
[%~ END %]
serge.aumont's avatar
 
serge.aumont committed
42

43
[% IF use_passwd ~%]
Luc Didry's avatar
Luc Didry committed
44
45
46
47
    [% IF action == 'login'; SET class = 'active'; END ~%]
    <li class="[% class %]">
        <form action="[% path_cgi %]" method="POST">
            <fieldset>
48
                [% IF sso.size ~%]
Luc Didry's avatar
Luc Didry committed
49
50
51
52
53
                    <input type="hidden" name="only_passwd" value="1" />
                [%~ END %]
                <span>
                    <button type="submit" name="action_login" value="[%|loc%]Login[%END%]">
                        <i class="fa fa-user"></i>
54
                        [% IF sso.size ~%]
Luc Didry's avatar
Luc Didry committed
55
56
57
58
59
60
61
62
63
                            [%|loc%]Login locally[%END%]
                        [%~ ELSE ~%]
                            [%|loc%]Login[%END%]
                        [%~ END %]
                    </button>
                </span>
            </fieldset>
        </form>
    </li>
64
[%~ END # IF use_passwd %]
serge.aumont's avatar
 
serge.aumont committed
65
<!-- end login_menu.tt2 -->