# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t


from SpecificEntry import SpecificEntry
from Entry import Entry
from wh import xlt
import wx, adm
# The Admin4 Project
# (c) 2013-2014 Andreas Pflug
#
# Licensed under the Apache License, 
# see LICENSE.TXT for conditions of usage


nodeinfo=[]


class UserAccount(SpecificEntry):
  name=xlt("Account")
  typename=xlt("LDAP User Account")
  shortname=xlt("User")
  icon="User"
  canClasses="inetorgperson"
  startClasses="inetOrgPerson"

  @classmethod
  def GetClassIconName(self, node):
    if node.HasObjectClass("sambaSAMAccount"):
      return "SamUser"
    elif node.HasObjectClass("posixAccount"):
      return "PosixUser"
    return self.icon

  @staticmethod
  def New(parentWin, parentNode):
    adm.DisplayDialog(Entry.Dlg, parentWin, None, parentNode, UserAccount)


# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t


# Path: modLdap/Posix.py
from SpecificEntry import SpecificEntry
from Entry import Entry
from wh import xlt
import wx, adm

# The Admin4 Project
# (c) 2013-2014 Andreas Pflug
#
# Licensed under the Apache License, 
# see LICENSE.TXT for conditions of usage


nodeinfo=[]


class UserAccount(SpecificEntry):
  name=xlt("Account")
  typename=xlt("LDAP User Account")
  shortname=xlt("User")
  icon="User"
  canClasses="inetorgperson"
  startClasses="inetOrgPerson"

  @classmethod
  def GetClassIconName(self, node):
    if node.HasObjectClass("sambaSAMAccount"):
      return "SamUser"
    elif node.HasObjectClass("posixAccount"):
      return "PosixUser"
    return self.icon

  @staticmethod
  def New(parentWin, parentNode):
    adm.DisplayDialog(Entry.Dlg, parentWin, None, parentNode, UserAccount)


SpecificEntry.AddClass(UserAccount)