00001 /* 00002 * $Id$ 00003 * Kockpit - an Qt application for user/group management on unix based systems. 00004 * 00005 * Copyright (C) 2010 Julian Thome 00006 * 00007 * This program is free software; you can redistribute it and/or modify it under the terms of 00008 * the GNU General Public License as published by the Free Software Foundation; 00009 * either version 3 of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00012 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00013 * See the GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along with this program; 00016 * if not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #ifndef POSIX_H 00020 #define POSIX_H 00021 00022 #include <QWidget> 00023 #include <QListWidget> 00024 #include <QListWidgetItem> 00025 #include <QVariant> 00026 #include <QList> 00027 #include <iostream> 00028 #include <typeinfo> 00029 00030 #include "kockpitifaces.h" 00031 #include "ui_posix.h" 00032 #include "kockpituser.h" 00033 #include "kockpitaccount.h" 00034 #include "kockpitunit.h" 00035 #include "kockpitunitmap.h" 00036 #include "kockpitmap.h" 00037 #include "kockpitcontact.h" 00038 #include "kockpitgroup.h" 00039 #include "kockpitbackendentry.h" 00040 #include "kockpitaddress.h" 00041 #include "kockpithelpers.h" 00042 #include "kockpitunitmappings.h" 00043 #include "kockpitpam.h" 00044 00046 00049 class Posix: public QWidget, public KockpitIface, Ui::Posix { 00050 Q_OBJECT 00051 Q_INTERFACES(KockpitIface) 00052 00053 public: 00054 00055 Posix(QWidget *parent = 0); 00056 QString getName(); 00057 QWidget* getUserWidget(); 00058 QWidget* getGroupWidget(); 00059 00060 void showAttributes(KockpitUser *kuser); 00061 void assignAttributes(KockpitUser *kuser); 00062 void showAttributes(KockpitGroup *kgrp); 00063 void assignAttributes(KockpitGroup *kgrp); 00064 00065 void deleteEntry(KockpitUser */*kuser*/); 00066 void deleteEntry(KockpitGroup */*kgrp*/); 00067 00068 void writeAdditional(QList<KockpitGroup*> &kgrpl, wraddmod /*mod*/); 00069 void writeAdditional(QList<KockpitUser*> &kusr, wraddmod /*mod*/); 00070 00071 void init(const QList<KockpitUnitMap*> *kumap,const QList<KockpitUnitMap*> *kgmap,KockpitValidator *val); 00072 void update(const QList<KockpitUnitMap*> *kumap,const QList<KockpitUnitMap*> *kgmap); 00073 00074 private: 00075 00076 void resetListWidgetItems(QListWidget *list); 00077 00078 const QList<KockpitUnitMap*> *kumap; 00079 const QList<KockpitUnitMap*> *kgmap; 00080 00081 KockpitUser *selectedUser; 00082 KockpitGroup *selectedGroup; 00083 00084 KockpitValidator *val; 00085 00086 private slots: 00087 00088 void changeGroupMembershipForUser(QListWidgetItem *widget); 00089 void changeUserMembershipForGroup(QListWidgetItem *widget); 00090 void dateTimeEditShadowExpireActivation(bool state); 00091 void setPrimaryGroup(int index); 00092 void chAuthTok(); 00093 00094 }; 00095 00096 #endif // POSIX_H