From fdd7fbae926821be7d5229d5cba04396e6f00f99 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 17 Jul 2009 19:00:40 +0200 Subject: =?UTF-8?q?UserBackendHome=20hinzugef=C3=BCgt=20Modul=20zur=20Erst?= =?UTF-8?q?ellung=20von=20Home-Verzeichnissen=20implementert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/UserBackendHome/UserBackendHome.h | 69 +++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/modules/UserBackendHome/UserBackendHome.h (limited to 'src/modules/UserBackendHome/UserBackendHome.h') diff --git a/src/modules/UserBackendHome/UserBackendHome.h b/src/modules/UserBackendHome/UserBackendHome.h new file mode 100644 index 0000000..1e2b0a3 --- /dev/null +++ b/src/modules/UserBackendHome/UserBackendHome.h @@ -0,0 +1,69 @@ +/* + * UserBackendMysql.h + * + * Copyright (C) 2008 Matthias Schiffer + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with this program. If not, see . + */ + +#ifndef MAD_MODULES_USERBACKENDHOME_USERBACKENDHOME_H_ +#define MAD_MODULES_USERBACKENDHOME_USERBACKENDHOME_H_ + +#include +#include + +#include +#include + +#include + +namespace Mad { +namespace Modules { +namespace UserBackendHome { + +class UserBackendHome : public Common::UserConfigBackend, private Core::Configurable, private boost::noncopyable { + private: + Common::Application *application; + + std::string skeleton; + std::string homeDir; + + boost::mutex mutex; + + void setOwnerAndCopyMode(const std::string &source, const std::string &dest, const Common::UserInfo &userInfo, bool isSymlink); + + void migrateOwner(const std::string &path, const Common::UserInfo &oldUserInfo, const Common::UserInfo &userInfo, bool isSymlink); + + protected: + virtual bool handleConfigEntry(const Core::ConfigEntry &entry, bool handled); + + virtual void addUser(const Common::UserInfo &userInfo) throw(Core::Exception); + virtual void updateUser(const Common::UserInfo &oldUserInfo, const Common::UserInfo &userInfo) throw(Core::Exception); + virtual void deleteUser(const Common::UserInfo &userInfo) throw(Core::Exception); + + public: + UserBackendHome(Common::Application *application0) : application(application0), homeDir("/home") { + application->getConfigManager()->registerConfigurable(this); + } + + virtual ~UserBackendHome() { + application->getConfigManager()->unregisterConfigurable(this); + } +}; + +} +} +} + +#endif /* MAD_MODULES_USERBACKENDHOME_USERBACKENDHOME_H_ */ -- cgit v1.2.3