<!-- $Id: loginbanner.tt2 12726 2016-03-09 04:01:24Z sikeda $ -->

[% IF user.email %]
			[% IF user.gecos %]
				<li><span>[% user.email %]</span></li>
			[% END %]

            [% IF top_menu %]
                [%# Note: When is_listmaster is set, is_privileged_owner is also set. %]
                [%~ SET owner_item = owner.item(user.email) %]
                [%~ SET editor_item = editor.item(user.email) %]
                [% IF is_listmaster || owner_item || is_editor || is_subscriber %]
                  <li class="nolink role"><span>
                  [%# Show picture and higher privilege of user on this list. %]
                  [%~ IF is_subscriber && pictures_display && pictures_url ~%]
                    <img class="Pictures" src="[% pictures_url %]"
                      alt="[%|loc%]Your picture[%END%]" />
                  [%~ ELSIF owner_item || is_editor || is_subscriber ~%]
                    <i class="fa fa-user"></i>
                  [%~ END %]
                  [%~ IF is_listmaster ~%]
                    <i class="fa fa-star" style="color: #669900;"
                    title="[%|loc%]You are listmaster.[%END%]"></i>
                  [%~ ELSIF owner_item ~%]
                    <i class="fa fa-star" title="[%|loc%]You are owner.[%END%]"></i>
                  [%~ ELSIF is_editor ~%]
                    <i class="fa fa-star-o" title="[%|loc%]You are editor.[%END%]"></i>
                  [%~ END %]

                  [%# Show roles on this list. %]
                  [%~ IF is_listmaster ~%]
                    [%|loc%]Listmaster[%END%]
                    [%~ IF owner_item || is_editor || is_subscriber %][%|loc%], [%END%][% END %]
                  [%~ END %]
                  [%~ IF owner_item || is_editor %]
                    [%~ IF is_privileged_owner ~%]
                      [%|loc%]Privileged owner[%END%]
                      [%~ IF is_subscriber %][%|loc%], [%END%][% END %]
                    [%~ ELSIF is_owner ~%]
                      [%|loc%]Owner[%END%]
                      [%~ IF is_subscriber %][%|loc%], [%END%][% END %]
                    [%~ ELSIF is_editor ~%]
                      [%|loc%]Editor[%END%]
                      [%~ IF is_subscriber %][%|loc%], [%END%][% END %]
                    [%~ END %]
                  [%~ END %]
                  [%~ IF is_subscriber ~%]
                    [%|loc%]Subscriber[%END%]
                  [%~ END %]
                  </span></li>
                [%~ END %]
            [% END %]

            [% IF restore_email %]
              <li>
                <form action="[% path_cgi %]" method="post">
                  <fieldset>
                    <span><button type="submit" name="action_restore_email" value="[%|loc%]Restore identity[%END%]" />[%|loc%]Restore identity[%END%]</button></span>
                  </fieldset>
                </form>
              </li>  
            [%END%]

            [% IF last_login_date %]
              <li><span>[%|loc(last_login_host)%]last login from %1[%END%] &nbsp;&nbsp; ([% last_login_date %])<span></li>
            [%END%]

            <li><a href="[% 'pref' | url_rel %]"><i class="fa fa-cog"></i> [%|loc%]My preferences[%END%]</a></li>
            <li><a href="[% 'my' | url_rel %]" onclick="show('loading'); hide('content-inner');"><i class="fa fa-envelope"></i> [%|loc%]My lists[%END%]</a></li>
            <li>
              [% IF auth_method == 'md5' %]
                <form action="[% path_cgi %]" method="post">
                  <fieldset>
                    <input type="hidden" name="action" value="logout" />
                  [% IF referer %]
                    <input type="hidden" name="referer" value="[% referer %]" />
                  [% ELSE %]
                    <input type="hidden" name="previous_action" value="[% home %]" />
                  [% END %]
                    <span><button class="MainMenuLinks" type="submit" name="action_logout" value="[%|loc%]Logout[%END%]"><i class="fa fa-power-off"></i> [%|loc%]Logout[%END%]</button></span>
                  </fieldset>
                </form>
              [% END %]
            </li>
[% ELSE %]
            <li>
              [% IF use_sso %]
            <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="referer" value="[% referer %]" />
              <input type="hidden" name="list" value="[% list %]" />
                <input type="hidden" name="action" value="sso_login" />
                [% IF sso_number == 1 %]
                  [% 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" onchange="this.form.submit();">
                 <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>
           [% END %] 
            </li>
           [% IF use_passwd == '1' AND use_sso %]
              <li class="divider hide-for-small"></li>
           [% END %] 
           [% IF use_passwd == '1' %]
          <li id="login-dropdown" class="has-dropdown">
            <a href="#"><i class="fa fa-user"></i> [%|loc%]Login[%END%]</a>
            <ul class="dropdown">
            <form 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="referer" value="[% referer %]" />
              <input type="hidden" name="list" value="[% list %]" />
              <input type="hidden" name="action" value="login" />
              <li><label for="email_login">[%|loc%]email address:[%END%]
              <input type="text" name="email" id="email_login" size="28" value="[% unauthenticated_email %]" /></label></li>
              <li><label for="passwd" >[%|loc%]password:[%END%]
              <input type="password" name="passwd" id="passwd" size="8" /></label></li>
              <li><span><button type="submit" name="action_login" value="[%|loc%]Login[%END%]" onclick="show('loading'); hide('content-inner');"><i class="fa fa-user"></i> [%|loc%]Go[%END%]</button></span></li>
              </fieldset>
            </form>
           [% IF not top_menu %]
            </ul>
           </li>
           [% END %]
           <li class="divider hide-for-small"></li>
            [% IF authentication_info_url %]
               <li><a class="menuLinks" href="[%authentication_info_url%]">[%|loc%]Authentication help[% END %]</a></li>
            [% ELSE %]
              <li><a href="[% 'firstpasswd' | url_rel([escaped_init_email]) %]">[%|loc%]First login?[%END%]</a></li>
              <li><a href="[% 'renewpasswd' | url_rel([escaped_init_email]) %]">[%|loc%]Lost password?[%END%]</a></li>
            [% END %]
           [% IF top_menu %]
            </ul>
           </li>
           [% END %]
            [% END %] 

[% END %]

<!-- end loginbanner.tt2 -->
