%h1=t('Reset user\'s passwords')
%br

%form(method="POST")

  %input(type="hidden" name="action" value="doit")
  
  %h3=t('Settings')
  %table.table
    %tr
      %td
        %label(for="pwd_length")=t('Length')
      %td
        %label(for="pwd_upper")=t('Uppercase letters')
      %td
        %label(for="pwd_lower")=t('Lowercase letters')
      %td
        %label(for="pwd_digit")=t('Numbers')
      %td
        %label(for="pwd_symbols")=t('Symbols')
    %tr
      %td
        !=CHtml::dropDownList('pwd_length', 8, rangek(4,12))
      %td
        %input(type="checkbox" value="1" id="pwd_upper" name="pwd_upper" checked="checked")
      %td
        %input(type="checkbox" value="1" id="pwd_lower" name="pwd_lower" checked="checked")
      %td
        %input(type="checkbox" value="1" id="pwd_digit" name="pwd_digit" checked="checked")
      %td
        %input(type="checkbox" value="1" id="pwd_symbols" name="pwd_symbols" checked="checked")
  
  %input#checkAll(type="checkbox" checked="checked")=t('Select all')
  
  %script(type="text/javascript")!='$("#checkAll").change(function(){$("input:checkbox.usercheckbox").prop("checked", $(this).prop("checked"));});'
  
  %h3=t('Users')
  %table.table.table-condensed
    %thead
      %tr
        %th
        %th=t('Username')
        %th=t('First name')
        %th=t('Last name')
        %th=t('Email')
        %th
    %tbody
      - $users = User::getUsers()
      - foreach($users as $uid => $u)
        %tr(title="#{$uid}")
          %td
            -if(user()->checkAccess('user_view'))
              %a.icon-eye-open(href="#{url('user/view', array('id'=>$uid))}" target="_blank")
          %td=$u->username
          %td=$u->first_name
          %td=$u->last_name
          %td
            %a(href="mailto:#{$u->email}")=$u->email
          %td
            %input.usercheckbox(type="checkbox" name="userid[#{$uid}]" id="userid#{$uid}" value="1")
            
  %input(type="submit")
  