#!/usr/bin/env python
# coding:utf-8

from .plugin import PluginAbstract, ModList
from .kadmin import KAdmin
from .userhome import UserHome

msg0101 = 'nothing to do for: \'{0}\''


class GosaPosixAccount(PluginAbstract, KAdmin, UserHome, metaclass=ModList):

	def __init__(self, postcmd):

		#super(GosaAccount, self).__init__(postcmd)
		super().__init__(postcmd)
		super(PluginAbstract, self).__init__(postcmd)
		super(KAdmin, self).__init__(postcmd)

	"""
		# get tasks configuration
		self.__getTasksConfig()


	def __getTasksConfig(self):

		cfg_def = {
			'somestuff' : True,
			}
		cfg_ver = {
			'somestuff' : ('bool', ),
			}
		self.getConfig('/Tasks', cfg_def, cfg_ver)
	"""


	def create(self):

		super().create()
		self.addKrbPrinc()
		self.createUserHome()


	def modify(self):

		super().modify()
		self.setKrbExpire()
		self.modifyUserHome()


	def preremove(self):

		super().remove()
		self.delKrbPrinc()
		self.removeUserHome()

