<?xml version="1.0" encoding="UTF-8"?>

<list>
  <definition>
    <departmentBrowser>true</departmentBrowser>
    <departmentRootVisible>false</departmentRootVisible>
    <baseMode>true</baseMode>
    <multiSelect>true</multiSelect>
    <template>../../../ihtml/themes/default/list.tpl</template>
    <module>users</module>
    <label>List of users</label>
    <defaultSortColumn>1</defaultSortColumn>

    <objectType>
      <label>Template</label>
      <objectClass>gosaUserTemplate</objectClass>
      <category>users</category>
      <class>user</class>
      <image>badge</image>
    </objectType>

    <objectType>
      <label>User</label>
      <objectClass>gosaAccount</objectClass>
      <category>users</category>
      <class>user</class>
      <image>person</image>
    </objectType>

  </definition>

  <table>
    <layout>|20px;c||||150px|185px;r|</layout>

    <department>
      <value>%{filter:objectType(dn,objectClass)}</value>
    </department>

    <department>
      <value>%{filter:departmentLink(row,dn,description)}</value>
      <span>3</span>
    </department>

    <column>
      <value>%{filter:objectType(dn,objectClass)}</value>
    </column>

    <column>
      <label>Surname</label>
      <sortAttribute>sn</sortAttribute>
      <sortType>string</sortType>
      <value>%{filter:link(row,dn,"%s",sn)}</value>
      <export>true</export>
    </column>

    <column>
      <label>Given name</label>
      <sortAttribute>givenName</sortAttribute>
      <sortType>string</sortType>
      <value>%{filter:link(row,dn,"%s",givenName)}</value>
      <export>true</export>
    </column>

    <column>
      <label>Login</label>
      <sortAttribute>uid</sortAttribute>
      <sortType>string</sortType>
      <value>%{filter:link(row,dn,"%s",uid)}</value>
      <export>true</export>
    </column>

    <column>
      <label>Properties</label>
      <value>%{filter:filterProperties(row,objectClass)}</value>
    </column>

    <column>
      <label>Actions</label>
      <value>%{filter:actions(dn,row,objectClass)}</value>
    </column>

  </table>

  <actionmenu>

    <action>
      <type>sub</type>
      <image>badge</image>
      <label>Create</label>

      <action>
        <name>new</name>
        <type>entry</type>
        <image>person_add</image>
        <!-- <image>manage-accounts</image> -->
        <label>User</label>
      </action>

      <action>
        <name>new_template</name>
        <type>entry</type>
        <image>note_add</image>
        <!-- <image>person_add</image> -->
        <label>Template</label>
      </action>
    </action>

    <action>
      <type>sub</type>
      <image>settings</image>
      <label>Manage</label>

      <action>
        <name>edit</name>
        <type>entry</type>
        <image>edit</image>
        <label>Edit</label>
      </action>

      <action>
        <name>remove</name>
        <type>entry</type>
        <image>delete</image>
        <label>Remove</label>
      </action>

      <action>
        <name>password</name>
        <type>entry</type>
        <image>vpn_key</image>
        <label>Change password</label>
      </action>

      <action>
        <name>lockUsers</name>
        <type>entry</type>
        <image>lock</image>
        <acl>users/password[w]</acl>
        <label>Lock users</label>
      </action>

      <action>
        <name>unlockUsers</name>
        <type>entry</type>
        <image>lock_open</image>
        <acl>users/password[w]</acl>
        <label>Unlock users</label>
      </action>

      <action>
        <name>sendMessage</name>
        <type>entry</type>
        <depends>DaemonEvent_notify</depends>
        <image>notifications</image>
        <label>Send message</label>
      </action>

      <action>
        <name>templatize</name>
        <type>entry</type>
        <image>auto_fix_normal</image>
        <label>Apply template</label>
      </action>
    </action>

    <action>
      <type>exporter</type>
    </action>

    <action>
      <type>copypaste</type>
    </action>

    <action>
      <type>snapshot</type>
    </action>

  </actionmenu>

  <actiontriggers snapshot="true" copypaste="true">

    <action>
      <name>newfromtpl</name>
      <type>entry</type>
      <image>add</image>
      <objectclass>gosaUserTemplate</objectclass>
      <label>New user from template</label>
    </action>

    <action>
      <name>cp</name>
      <objectclass>!gosaUserTemplate</objectclass>
      <type>copypaste</type>
    </action>

    <action>
      <name>edit</name>
      <type>entry</type>
      <objectclass>gosaAccount</objectclass>
      <image>edit</image>
      <label>Edit user</label>
    </action>

    <action>
      <name>lock</name>
      <type>entry</type>
      <objectclass>!gosaUserTemplate</objectclass>
      <image>%{filter:lockImage(userPassword)}</image>
      <acl>users/password[w]</acl>
      <label>%{filter:lockLabel(userPassword)}</label>
    </action>

    <action>
      <name>password</name>
      <type>entry</type>
      <objectclass>!gosaUserTemplate</objectclass>
      <image>password</image>
      <label>Change password</label>
    </action>

    <action>
      <name>snapshot</name>
      <type>snapshot</type>
      <objectclass>!gosaUserTemplate</objectclass>
    </action>

    <action>
      <name>remove</name>
      <type>entry</type>
      <image>delete</image>
      <objectclass>gosaAccount</objectclass>
      <acl>users/user[d]</acl>
      <label>Remove user</label>
    </action>

  </actiontriggers>

</list>
