summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clients/tde/configure.in1
-rw-r--r--clients/tde/src/part/adminusermgmt/Makefile.am10
-rw-r--r--clients/tde/src/part/adminusermgmt/layout.ui160
-rw-r--r--clients/tde/src/part/adminusermgmt/part.cpp463
-rw-r--r--clients/tde/src/part/adminusermgmt/part.h22
-rw-r--r--clients/tde/src/part/adminusermgmt/terminatedlg.cpp107
-rw-r--r--clients/tde/src/part/adminusermgmt/terminatedlg.h56
-rw-r--r--clients/tde/src/part/adminusermgmt/terminatedlgbase.ui43
-rw-r--r--database/mysql/remotelab.sql7
-rw-r--r--lib/libtqtrla/src/tqtrla.cpp144
-rw-r--r--lib/libtqtrla/src/tqtrla.h62
-rw-r--r--servers/admin_user_mgmt_server_lin/aclocal.m410
-rw-r--r--servers/admin_user_mgmt_server_lin/doc/Makefile.in35
-rw-r--r--servers/admin_user_mgmt_server_lin/doc/en/Makefile.in24
-rw-r--r--servers/admin_user_mgmt_server_lin/po/Makefile.in24
-rw-r--r--servers/admin_user_mgmt_server_lin/src/Makefile.am2
-rw-r--r--servers/admin_user_mgmt_server_lin/src/admin_user_mgmt.cpp (renamed from servers/admin_user_mgmt_server_lin/src/admin_sys_ctl.cpp)339
-rw-r--r--servers/admin_user_mgmt_server_lin/src/admin_user_mgmt.h (renamed from servers/admin_user_mgmt_server_lin/src/admin_sys_ctl.h)5
-rw-r--r--servers/admin_user_mgmt_server_lin/src/main.cpp4
-rw-r--r--servers/auth_server_lin/src/auth_conn.cpp40
20 files changed, 1102 insertions, 456 deletions
diff --git a/clients/tde/configure.in b/clients/tde/configure.in
index c317196..c8f9931 100644
--- a/clients/tde/configure.in
+++ b/clients/tde/configure.in
@@ -87,6 +87,7 @@ AC_CONFIG_FILES([ src/app/views/Makefile ])
AC_CONFIG_FILES([ src/dialogs/Makefile ])
AC_CONFIG_FILES([ src/part/Makefile ])
AC_CONFIG_FILES([ src/part/adminconsole/Makefile ])
+AC_CONFIG_FILES([ src/part/adminusermgmt/Makefile ])
AC_CONFIG_FILES([ src/part/commanalyzer/Makefile ])
AC_CONFIG_FILES([ src/part/fpgaprogram/Makefile ])
AC_CONFIG_FILES([ src/part/fpgaview/Makefile ])
diff --git a/clients/tde/src/part/adminusermgmt/Makefile.am b/clients/tde/src/part/adminusermgmt/Makefile.am
index 9db32f5..21dfe99 100644
--- a/clients/tde/src/part/adminusermgmt/Makefile.am
+++ b/clients/tde/src/part/adminusermgmt/Makefile.am
@@ -2,10 +2,10 @@ INCLUDES = $(all_includes) -I$(top_srcdir)/src -I$(top_srcdir)/src/widgets $
KDE_CXXFLAGS = $(USE_EXCEPTIONS)
METASOURCES = AUTO
-KDE_ICON = libremotelab_adminconsole
+KDE_ICON = libremotelab_adminusermgmt
# Part
-kde_module_LTLIBRARIES = libremotelab_adminconsole.la
-libremotelab_adminconsole_la_LIBADD = ../../widgets/libtracewidget.la ../../widgets/libfloatspinbox.la $(LIB_KFILE) $(LIB_KPARTS) $(LIB_TDEUI) $(LIB_QT) -ltdekrbsocket -ltqtrla
-libremotelab_adminconsole_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) $(LIB_TDECORE) $(LIB_TDEUI) -lkio -ltdefx
-libremotelab_adminconsole_la_SOURCES = part.cpp layout.ui terminatedlg.cpp terminatedlgbase.ui
+kde_module_LTLIBRARIES = libremotelab_adminusermgmt.la
+libremotelab_adminusermgmt_la_LIBADD = ../../widgets/libtracewidget.la ../../widgets/libfloatspinbox.la $(LIB_KFILE) $(LIB_KPARTS) $(LIB_TDEUI) $(LIB_QT) -ltdekrbsocket -ltqtrla
+libremotelab_adminusermgmt_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) $(LIB_TDECORE) $(LIB_TDEUI) -lkio -ltdefx
+libremotelab_adminusermgmt_la_SOURCES = part.cpp layout.ui terminatedlg.cpp terminatedlgbase.ui
diff --git a/clients/tde/src/part/adminusermgmt/layout.ui b/clients/tde/src/part/adminusermgmt/layout.ui
index 5a56809..bc11742 100644
--- a/clients/tde/src/part/adminusermgmt/layout.ui
+++ b/clients/tde/src/part/adminusermgmt/layout.ui
@@ -1,8 +1,8 @@
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
- <class>AdminConsoleBase</class>
+ <class>UserManagementBase</class>
<widget class="TQWidget">
<property name="name">
- <cstring>AdminConsoleBase</cstring>
+ <cstring>UserManagementBase</cstring>
</property>
<property name="geometry">
<rect>
@@ -37,7 +37,7 @@
<widget class="KListView" row="1" column="0" colspan="4">
<column>
<property name="text">
- <string>Session ID</string>
+ <string>Group Name</string>
</property>
<property name="clickable">
<bool>true</bool>
@@ -48,73 +48,7 @@
</column>
<column>
<property name="text">
- <string>User Name</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizeable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Server Name</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizeable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Control PID</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizeable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Window Manager PID</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizeable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>X11 Display Number</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizeable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Logon Date</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizeable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Last Session Management Activity</string>
+ <string>Allowed Servers</string>
</property>
<property name="clickable">
<bool>true</bool>
@@ -148,10 +82,26 @@
</property>
<widget class="TQPushButton" row="0" column="0" colspan="1">
<property name="name">
- <cstring>ts_buttonKill</cstring>
+ <cstring>ts_buttonAddGroup</cstring>
+ </property>
+ <property name="text">
+ <string>Add Group</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="0" column="1" colspan="1">
+ <property name="name">
+ <cstring>ts_buttonModifyGroup</cstring>
</property>
<property name="text">
- <string>Terminate Session</string>
+ <string>Modify Group</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="0" column="2" colspan="1">
+ <property name="name">
+ <cstring>ts_buttonDeleteGroup</cstring>
+ </property>
+ <property name="text">
+ <string>Delete Group</string>
</property>
</widget>
</grid>
@@ -199,29 +149,7 @@
<widget class="KListView" row="1" column="0" colspan="4">
<column>
<property name="text">
- <string>Session ID</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizeable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>User Name</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizeable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Realm Name</string>
+ <string>Group Name</string>
</property>
<property name="clickable">
<bool>true</bool>
@@ -232,29 +160,7 @@
</column>
<column>
<property name="text">
- <string>Server ID</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizeable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Logon Date</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizeable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Forced Logoff Date</string>
+ <string>Allowed Stations</string>
</property>
<property name="clickable">
<bool>true</bool>
@@ -288,18 +194,26 @@
</property>
<widget class="TQPushButton" row="0" column="0" colspan="1">
<property name="name">
- <cstring>workspace_buttonTerminate</cstring>
+ <cstring>workspace_buttonAddGroup</cstring>
</property>
<property name="text">
- <string>Terminate Workspace</string>
+ <string>Add Group</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="1" colspan="1">
<property name="name">
- <cstring>workspace_buttonCancelTermination</cstring>
+ <cstring>workspace_buttonModifyGroup</cstring>
+ </property>
+ <property name="text">
+ <string>Modify Group</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="0" column="2" colspan="1">
+ <property name="name">
+ <cstring>workspace_buttonDeleteGroup</cstring>
</property>
<property name="text">
- <string>Cancel Termination</string>
+ <string>Delete Group</string>
</property>
</widget>
</grid>
@@ -329,7 +243,7 @@
</grid>
</widget>
<includes>
- <include location="local" impldecl="in implementation">AdminConsoleBase.ui.h</include>
+ <include location="local" impldecl="in implementation">UserManagementBase.ui.h</include>
</includes>
<includes>
<include location="local" impldecl="in implementation">tracewidget.h</include>
diff --git a/clients/tde/src/part/adminusermgmt/part.cpp b/clients/tde/src/part/adminusermgmt/part.cpp
index b233e84..8426ca0 100644
--- a/clients/tde/src/part/adminusermgmt/part.cpp
+++ b/clients/tde/src/part/adminusermgmt/part.cpp
@@ -61,28 +61,35 @@
#define NETWORK_COMM_TIMEOUT_MS 2500
enum connectionModes {
- ModeIdle = 0,
- ModeTerminate = 1
+ ModeIdle = 0,
+ ModeUpdate = 1,
+ ModeDelete = 2
};
enum connectionStates {
- ModeIdle_None = 0,
- ModeIdle_StateTerminalListRequest = 1,
- ModeIdle_StateProcessTerminalList = 2,
- ModeIdle_StateWorkspaceListRequest = 3,
- ModeIdle_StateProcessWorkspaceList = 4,
- ModeIdle_StateDelay = 5,
- ModeTerminate_TerminalServices = 6,
- ModeTerminate_LaboratoryWorkspace = 7,
- ModeTerminate_CancelTerminationOfWorkspace = 8,
- ModeTerminate_ProcessResponse = 9
+ ModeIdle_None = 0,
+ ModeIdle_StateTerminalListRequest = 1,
+ ModeIdle_StateProcessTerminalList = 2,
+ ModeIdle_StateWorkspaceListRequest = 3,
+ ModeIdle_StateProcessWorkspaceList = 4,
+ ModeIdle_StateTerminalAuthGroupListRequest = 5,
+ ModeIdle_StateProcessTerminalAuthGroupList = 6,
+ ModeIdle_StateWorkspaceServiceAuthGroupListRequest = 7,
+ ModeIdle_StateProcessWorkspaceServiceAuthGroupList = 8,
+ ModeIdle_StateDelay = 9,
+ ModeUpdate_TerminalServices = 10,
+ ModeUpdate_LaboratoryWorkspace = 11,
+ ModeUpdate_ProcessResponse = 12,
+ ModeDelete_TerminalServices = 13,
+ ModeDelete_LaboratoryWorkspace = 14,
+ ModeDelete_ProcessResponse = 15
};
namespace RemoteLab {
typedef KParts::GenericFactory<RemoteLab::UserManagementPart> Factory;
-#define CLIENT_LIBRARY "libremotelab_adminconsole"
-K_EXPORT_COMPONENT_FACTORY(libremotelab_adminconsole, RemoteLab::Factory)
+#define CLIENT_LIBRARY "libremotelab_adminusermgmt"
+K_EXPORT_COMPONENT_FACTORY(libremotelab_adminusermgmt, RemoteLab::Factory)
UserManagementPart::UserManagementPart(TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, const TQStringList&)
: RemoteInstrumentPart( parent, name ), m_base(NULL), m_commHandlerState(0), m_connectionActiveAndValid(false), m_tickerState(0)
@@ -109,9 +116,14 @@ UserManagementPart::UserManagementPart(TQWidget *parentWidget, const char *widge
m_base = new UserManagementBase(widget());
// Initialize widgets
- connect(m_base->ts_buttonKill, SIGNAL(clicked()), this, SLOT(terminalServiceKillButtonClicked()));
- connect(m_base->workspace_buttonTerminate, SIGNAL(clicked()), this, SLOT(workspaceTerminateButtonClicked()));
- connect(m_base->workspace_buttonCancelTermination, SIGNAL(clicked()), this, SLOT(workspaceCancelTerminationButtonClicked()));
+ connect(m_base->ts_buttonAddGroup, SIGNAL(clicked()), this, SLOT(terminalServiceAddGroupButtonClicked()));
+ connect(m_base->ts_buttonModifyGroup, SIGNAL(clicked()), this, SLOT(terminalServiceModifyGroupButtonClicked()));
+ connect(m_base->ts_buttonDeleteGroup, SIGNAL(clicked()), this, SLOT(terminalServiceDeleteGroupButtonClicked()));
+ connect(m_base->workspace_buttonAddGroup, SIGNAL(clicked()), this, SLOT(workspaceAddGroupButtonClicked()));
+ connect(m_base->workspace_buttonModifyGroup, SIGNAL(clicked()), this, SLOT(workspaceModifyGroupButtonClicked()));
+ connect(m_base->workspace_buttonDeleteGroup, SIGNAL(clicked()), this, SLOT(workspaceDeleteGroupButtonClicked()));
+ connect(m_base->ts_list, SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), this, SLOT(terminalServiceModifyGroupButtonClicked()));
+ connect(m_base->workspace_list, SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), this, SLOT(workspaceModifyGroupButtonClicked()));
m_base->ts_list->setAllColumnsShowFocus(true);
connect(m_base->ts_list, SIGNAL(selectionChanged()), this, SLOT(terminalServiceListSelect()));
@@ -141,25 +153,31 @@ void UserManagementPart::processLockouts() {
}
}
- if ((m_connectionActiveAndValid == true) && (m_base->ts_list->selectedItem())) {
- m_base->ts_buttonKill->setEnabled(true);
+ if (m_connectionActiveAndValid == true) {
+ m_base->ts_buttonAddGroup->setEnabled(true);
+ m_base->workspace_buttonAddGroup->setEnabled(true);
}
else {
- m_base->ts_buttonKill->setEnabled(false);
+ m_base->ts_buttonAddGroup->setEnabled(false);
+ m_base->workspace_buttonAddGroup->setEnabled(false);
}
- if ((m_connectionActiveAndValid == true) && (m_base->workspace_list->selectedItem())) {
- m_base->workspace_buttonTerminate->setEnabled(true);
+ if ((m_connectionActiveAndValid == true) && (m_base->ts_list->selectedItem())) {
+ m_base->ts_buttonModifyGroup->setEnabled(true);
+ m_base->ts_buttonDeleteGroup->setEnabled(true);
}
else {
- m_base->workspace_buttonTerminate->setEnabled(false);
+ m_base->ts_buttonModifyGroup->setEnabled(false);
+ m_base->ts_buttonDeleteGroup->setEnabled(false);
}
if ((m_connectionActiveAndValid == true) && (m_base->workspace_list->selectedItem())) {
- m_base->workspace_buttonCancelTermination->setEnabled(true);
+ m_base->workspace_buttonModifyGroup->setEnabled(true);
+ m_base->workspace_buttonDeleteGroup->setEnabled(true);
}
else {
- m_base->workspace_buttonCancelTermination->setEnabled(false);
+ m_base->workspace_buttonModifyGroup->setEnabled(false);
+ m_base->workspace_buttonDeleteGroup->setEnabled(false);
}
}
@@ -213,44 +231,171 @@ void UserManagementPart::connectionStatusChangedCallback() {
processLockouts();
}
-void UserManagementPart::terminalServiceKillButtonClicked() {
+void UserManagementPart::terminalServiceAddGroupButtonClicked() {
+ GroupPermissionsDialog groupauthdlg(0);
+ groupauthdlg.setPermissionsSelectorLabel(i18n("Allowed Servers"));
+ {
+ TQKeyedStringList keyedServerList;
+ for (TQStringList::Iterator it2 = m_availableTerminalServersList.begin(); it2 != m_availableTerminalServersList.end(); ++it2) {
+ keyedServerList.append(TQKeyedStringPair(TQString("%1").arg(*it2), 0));
+ }
+ groupauthdlg.setAvailableServers(keyedServerList);
+ }
+ if (groupauthdlg.exec() == TQDialog::Accepted) {
+ m_updateTerminalServiceAuthGroupList.clear();
+ TerminalServiceAuthGroupType agt;
+ agt.groupName = groupauthdlg.groupName();
+
+ TQKeyedStringList selectedServers = groupauthdlg.selectedServers();
+ agt.allowedServerNames.clear();
+ for (TQKeyedStringList::Iterator it = selectedServers.begin(); it != selectedServers.end(); ++it) {
+ agt.allowedServerNames.append((*it).first);
+ }
+ m_updateTerminalServiceAuthGroupList.append(agt);
+ m_commHandlerNextState = ModeUpdate_TerminalServices;
+ m_commHandlerNextMode = ModeUpdate;
+ }
+
+ processLockouts();
+}
+
+void UserManagementPart::terminalServiceModifyGroupButtonClicked() {
+ TQListViewItem* item = m_base->ts_list->selectedItem();
+
+ GroupPermissionsDialog groupauthdlg(0);
+ groupauthdlg.setPermissionsSelectorLabel(i18n("Allowed Servers"));
+ {
+ TQKeyedStringList keyedServerList;
+ for (TQStringList::Iterator it2 = m_availableTerminalServersList.begin(); it2 != m_availableTerminalServersList.end(); ++it2) {
+ keyedServerList.append(TQKeyedStringPair(TQString("%1").arg(*it2), 0));
+ }
+ groupauthdlg.setAvailableServers(keyedServerList);
+ }
+ TerminalServiceAuthGroupList::iterator it = m_terminalServiceAuthGroupList.findByName(item->text(0));
+ if (it != m_terminalServiceAuthGroupList.end()) {
+ TQKeyedStringList keyedServerList;
+ for (TQStringList::Iterator it2 = (*it).allowedServerNames.begin(); it2 != (*it).allowedServerNames.end(); ++it2) {
+ keyedServerList.append(TQKeyedStringPair(TQString("%1").arg(*it2), 0));
+ }
+ groupauthdlg.setSelectedServers(keyedServerList);
+ }
+ groupauthdlg.setGroupName(item->text(0), false);
+ if (groupauthdlg.exec() == TQDialog::Accepted) {
+ m_updateTerminalServiceAuthGroupList.clear();
+ TerminalServiceAuthGroupType agt;
+ agt.groupName = groupauthdlg.groupName();
+ TQKeyedStringList selectedServers = groupauthdlg.selectedServers();
+ agt.allowedServerNames.clear();
+ for (TQKeyedStringList::Iterator it = selectedServers.begin(); it != selectedServers.end(); ++it) {
+ agt.allowedServerNames.append((*it).first);
+ }
+ m_updateTerminalServiceAuthGroupList.append(agt);
+ m_commHandlerNextState = ModeUpdate_TerminalServices;
+ m_commHandlerNextMode = ModeUpdate;
+ }
+
+ processLockouts();
+}
+
+void UserManagementPart::terminalServiceDeleteGroupButtonClicked() {
TQListViewItem* item = m_base->ts_list->selectedItem();
- TerminateDialog termdlg(0);
- termdlg.setWarningLabelText(i18n("Configure termination of Terminal Services for user %1").arg(item->text(1)));
- termdlg.enableDelayedTermination(false);
- if (termdlg.exec() == TQDialog::Accepted) {
- terminateSessionID = item->text(0);
- terminateSessionDelayMinutes = termdlg.minutes();
- m_commHandlerNextState = ModeTerminate_TerminalServices;
- m_commHandlerNextMode = ModeTerminate;
+ if (KMessageBox::warningYesNo(0, i18n("<qt><b>You are attempting to delete the group '%1'</b><br>You will not be able to undo this action<p>Do you wish to proceed?</qt>").arg(item->text(0)), i18n("Delete group?")) == KMessageBox::Yes) {
+ m_updateTerminalServiceAuthGroupList.clear();
+ TerminalServiceAuthGroupType agt;
+ agt.groupName = item->text(0);
+ m_updateTerminalServiceAuthGroupList.append(agt);
+ m_commHandlerNextState = ModeDelete_TerminalServices;
+ m_commHandlerNextMode = ModeDelete;
+ }
+
+ processLockouts();
+}
+
+void UserManagementPart::workspaceAddGroupButtonClicked() {
+ GroupPermissionsDialog groupauthdlg(0);
+ groupauthdlg.setPermissionsSelectorLabel(i18n("Allowed Stations"));
+ {
+ TQKeyedStringList friendlyStations;
+ for (StationList::iterator it = m_availableWorkspaceStationsList.begin(); it != m_availableWorkspaceStationsList.end(); ++it) {
+ friendlyStations.append(TQKeyedStringPair(TQString("%1").arg((*it).name), (*it).id));
+ }
+ groupauthdlg.setAvailableServers(friendlyStations);
+ }
+ if (groupauthdlg.exec() == TQDialog::Accepted) {
+ m_updateWorkspaceServiceAuthGroupList.clear();
+ WorkspaceServiceAuthGroupType agt;
+ agt.groupName = groupauthdlg.groupName();
+ TQKeyedStringList selectedStations = groupauthdlg.selectedServers();
+ agt.allowedStationIDs.clear();
+ for (TQKeyedStringList::Iterator it = selectedStations.begin(); it != selectedStations.end(); ++it) {
+ agt.allowedStationIDs.append((*it).second);
+ }
+ m_updateWorkspaceServiceAuthGroupList.append(agt);
+ m_commHandlerNextState = ModeUpdate_LaboratoryWorkspace;
+ m_commHandlerNextMode = ModeUpdate;
}
processLockouts();
}
-void UserManagementPart::workspaceTerminateButtonClicked() {
+void UserManagementPart::workspaceModifyGroupButtonClicked() {
TQListViewItem* item = m_base->workspace_list->selectedItem();
- TerminateDialog termdlg(0);
- termdlg.setWarningLabelText(i18n("Configure termination of Laboratory Workspace for user %1").arg(item->text(1)));
- termdlg.enableDelayedTermination(true);
- if (termdlg.exec() == TQDialog::Accepted) {
- terminateSessionID = item->text(0);
- terminateSessionDelayMinutes = termdlg.minutes();
- m_commHandlerNextState = ModeTerminate_LaboratoryWorkspace;
- m_commHandlerNextMode = ModeTerminate;
+ GroupPermissionsDialog groupauthdlg(0);
+ groupauthdlg.setPermissionsSelectorLabel(i18n("Allowed Stations"));
+ {
+ TQKeyedStringList friendlyStations;
+ for (StationList::iterator it = m_availableWorkspaceStationsList.begin(); it != m_availableWorkspaceStationsList.end(); ++it) {
+ friendlyStations.append(TQKeyedStringPair(TQString("%1").arg((*it).name), (*it).id));
+ }
+ groupauthdlg.setAvailableServers(friendlyStations);
+ }
+ WorkspaceServiceAuthGroupList::iterator it = m_workspaceAuthGroupList.findByName(item->text(0));
+ if (it != m_workspaceAuthGroupList.end()) {
+ TQKeyedStringList friendlyStations;
+ for (TQInt32List::Iterator it2 = (*it).allowedStationIDs.begin(); it2 != (*it).allowedStationIDs.end(); ++it2) {
+ int stationID = *it2;
+ StationList::iterator stationInfoIterator = m_availableWorkspaceStationsList.findByID(stationID);
+ if (stationInfoIterator != m_availableWorkspaceStationsList.end()) {
+ friendlyStations.append(TQKeyedStringPair(TQString("%1").arg((*stationInfoIterator).name), (*stationInfoIterator).id));
+ }
+ else {
+ friendlyStations.append(TQKeyedStringPair(TQString("<unknown>"), stationID));
+ }
+ }
+ groupauthdlg.setSelectedServers(friendlyStations);
+ }
+ groupauthdlg.setGroupName(item->text(0), false);
+ if (groupauthdlg.exec() == TQDialog::Accepted) {
+ m_updateWorkspaceServiceAuthGroupList.clear();
+ WorkspaceServiceAuthGroupType agt;
+ agt.groupName = groupauthdlg.groupName();
+ TQKeyedStringList selectedStations = groupauthdlg.selectedServers();
+ agt.allowedStationIDs.clear();
+ for (TQKeyedStringList::Iterator it = selectedStations.begin(); it != selectedStations.end(); ++it) {
+ agt.allowedStationIDs.append((*it).second);
+ }
+ m_updateWorkspaceServiceAuthGroupList.append(agt);
+ m_commHandlerNextState = ModeUpdate_LaboratoryWorkspace;
+ m_commHandlerNextMode = ModeUpdate;
}
processLockouts();
}
-void UserManagementPart::workspaceCancelTerminationButtonClicked() {
+void UserManagementPart::workspaceDeleteGroupButtonClicked() {
TQListViewItem* item = m_base->workspace_list->selectedItem();
- terminateSessionID = item->text(0);
- m_commHandlerNextState = ModeTerminate_CancelTerminationOfWorkspace;
- m_commHandlerNextMode = ModeTerminate;
+ if (KMessageBox::warningYesNo(0, i18n("<qt><b>You are attempting to delete the group '%1'</b><br>You will not be able to undo this action<p>Do you wish to proceed?</qt>").arg(item->text(0)), i18n("Delete group?")) == KMessageBox::Yes) {
+ m_updateWorkspaceServiceAuthGroupList.clear();
+ WorkspaceServiceAuthGroupType agt;
+ agt.groupName = item->text(0);
+ agt.allowedStationIDs.clear();
+ m_updateWorkspaceServiceAuthGroupList.append(agt);
+ m_commHandlerNextState = ModeDelete_LaboratoryWorkspace;
+ m_commHandlerNextMode = ModeDelete;
+ }
processLockouts();
}
@@ -383,7 +528,7 @@ void UserManagementPart::mainEventLoop() {
// Get status of remote system
// Clear buffers to synchronize frames in case of data corruption
m_socket->clearIncomingData();
- ds << TQString("USERS");
+ ds << TQString("LIST");
ds << TQString("TERMINALS");
m_socket->writeEndOfFrame();
@@ -395,23 +540,89 @@ void UserManagementPart::mainEventLoop() {
PAT_WATCHDOG_TIMER
TQString status;
- TerminalServiceStatusList list;
ds >> status;
if (status == "OK") {
- ds >> list;
+ ds >> m_availableTerminalServersList;
+ m_socket->clearFrameTail();
+
+ setTickerMessage(i18n("Connected"));
+ }
+
+ SET_NEXT_STATE(ModeIdle_StateWorkspaceListRequest);
+ EXEC_NEXT_STATE_IMMEDIATELY
+ }
+ else {
+ if (!m_updateTimeoutTimer->isActive()) {
+ UPDATEDISPLAY_TIMEOUT
+ }
+ }
+ break;
+ case ModeIdle_StateWorkspaceListRequest:
+ // Get status of remote system
+ // Clear buffers to synchronize frames in case of data corruption
+ m_socket->clearIncomingData();
+ ds << TQString("LIST");
+ ds << TQString("WORKSPACES");
+ m_socket->writeEndOfFrame();
+
+ SET_NEXT_STATE(ModeIdle_StateProcessWorkspaceList)
+ EXEC_NEXT_STATE_IMMEDIATELY
+ break;
+ case ModeIdle_StateProcessWorkspaceList:
+ // Get all data
+ if (m_socket->canReadFrame()) {
+ PAT_WATCHDOG_TIMER
+
+ TQString status;
+ ds >> status;
+ if (status == "OK") {
+ ds >> m_availableWorkspaceStationsList;
m_socket->clearFrameTail();
- TerminalServiceStatusList::iterator it;
+ setTickerMessage(i18n("Connected"));
+ }
+
+ SET_NEXT_STATE(ModeIdle_StateTerminalAuthGroupListRequest);
+ EXEC_NEXT_STATE_IMMEDIATELY
+ }
+ else {
+ if (!m_updateTimeoutTimer->isActive()) {
+ UPDATEDISPLAY_TIMEOUT
+ }
+ }
+ break;
+ case ModeIdle_StateTerminalAuthGroupListRequest:
+ // Get status of remote system
+ // Clear buffers to synchronize frames in case of data corruption
+ m_socket->clearIncomingData();
+ ds << TQString("LISTGROUPACCESS");
+ ds << TQString("TERMINALS");
+ m_socket->writeEndOfFrame();
+
+ SET_NEXT_STATE(ModeIdle_StateProcessTerminalAuthGroupList)
+ break;
+ case ModeIdle_StateProcessTerminalAuthGroupList:
+ // Get all data
+ if (m_socket->canReadFrame()) {
+ PAT_WATCHDOG_TIMER
+
+ TQString status;
+ ds >> status;
+ if (status == "OK") {
+ ds >> m_terminalServiceAuthGroupList;
+ m_socket->clearFrameTail();
+
+ TerminalServiceAuthGroupList::iterator it;
TQListViewItemIterator it2;
- for (it = list.begin(); it != list.end(); ++it) {
- TerminalServiceStatusType info = *it;
+ for (it = m_terminalServiceAuthGroupList.begin(); it != m_terminalServiceAuthGroupList.end(); ++it) {
+ TerminalServiceAuthGroupType info = *it;
it2 = TQListViewItemIterator(m_base->ts_list);
bool found = false;
TQListViewItem* item = NULL;
while (it2.current()) {
item = *it2;
- if (info.sessionID == item->text(0).toInt()) {
+ if (info.groupName == item->text(0)) {
found = true;
break;
}
@@ -420,22 +631,16 @@ void UserManagementPart::mainEventLoop() {
if (!found) {
item = new TQListViewItem(m_base->ts_list);
}
- item->setText(0, TQString("%1").arg(info.sessionID));
- item->setText(1, info.username);
- item->setText(2, info.serverName);
- item->setText(3, TQString("%1").arg(info.serverPID));
- item->setText(4, TQString("%1").arg(info.wmPID));
- item->setText(5, TQString(":%1").arg(info.display));
- item->setText(6, info.loginStamp.toString());
- item->setText(7, info.activityStamp.toString());
+ item->setText(0, TQString("%1").arg(info.groupName));
+ item->setText(1, info.allowedServerNames.join(", "));
}
it2 = TQListViewItemIterator(m_base->ts_list);
while (it2.current()) {
TQListViewItem* item = *it2;
bool found = false;
- for (it = list.begin(); it != list.end(); ++it) {
- TerminalServiceStatusType info = *it;
- if (info.sessionID == item->text(0).toInt()) {
+ for (it = m_terminalServiceAuthGroupList.begin(); it != m_terminalServiceAuthGroupList.end(); ++it) {
+ TerminalServiceAuthGroupType info = *it;
+ if (info.groupName == item->text(0)) {
found = true;
}
}
@@ -448,7 +653,7 @@ void UserManagementPart::mainEventLoop() {
setTickerMessage(i18n("Connected"));
}
- SET_NEXT_STATE(ModeIdle_StateWorkspaceListRequest);
+ SET_NEXT_STATE(ModeIdle_StateWorkspaceServiceAuthGroupListRequest);
EXEC_NEXT_STATE_IMMEDIATELY
}
else {
@@ -457,43 +662,39 @@ void UserManagementPart::mainEventLoop() {
}
}
break;
- case ModeIdle_StateWorkspaceListRequest:
+ case ModeIdle_StateWorkspaceServiceAuthGroupListRequest:
// Get status of remote system
// Clear buffers to synchronize frames in case of data corruption
m_socket->clearIncomingData();
- ds << TQString("USERS");
+ ds << TQString("LISTGROUPACCESS");
ds << TQString("WORKSPACES");
m_socket->writeEndOfFrame();
- SET_NEXT_STATE(ModeIdle_StateProcessWorkspaceList)
+ SET_NEXT_STATE(ModeIdle_StateProcessWorkspaceServiceAuthGroupList)
EXEC_NEXT_STATE_IMMEDIATELY
break;
- case ModeIdle_StateProcessWorkspaceList:
+ case ModeIdle_StateProcessWorkspaceServiceAuthGroupList:
// Get all data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
TQString status;
- WorkspaceServiceStatusList list;
ds >> status;
if (status == "OK") {
- ds >> list;
+ ds >> m_workspaceAuthGroupList;
m_socket->clearFrameTail();
- WorkspaceServiceStatusList::iterator it;
+ WorkspaceServiceAuthGroupList::iterator it;
TQListViewItemIterator it2;
- for (it = list.begin(); it != list.end(); ++it) {
- WorkspaceServiceStatusType info = *it;
- if (info.serviceID != 0) {
- continue;
- }
+ for (it = m_workspaceAuthGroupList.begin(); it != m_workspaceAuthGroupList.end(); ++it) {
+ WorkspaceServiceAuthGroupType info = *it;
it2 = TQListViewItemIterator(m_base->workspace_list);
bool found = false;
TQListViewItem* item = NULL;
while (it2.current()) {
item = *it2;
- if (info.sessionID == item->text(0).toInt()) {
+ if (info.groupName == item->text(0)) {
found = true;
break;
}
@@ -502,23 +703,27 @@ void UserManagementPart::mainEventLoop() {
if (!found) {
item = new TQListViewItem(m_base->workspace_list);
}
- item->setText(0, TQString("%1").arg(info.sessionID));
- item->setText(1, info.username);
- item->setText(2, info.realmname);
- item->setText(3, TQString("%1").arg(info.stationName));
- item->setText(4, info.loginStamp.toString());
- item->setText(5, (info.terminateStamp.toTime_t()==0)?i18n("Not Set"):info.terminateStamp.toString());
+ item->setText(0, TQString("%1").arg(info.groupName));
+ TQString allowedStationsText;
+ TQInt32List::iterator it3;
+ for (it3 = info.allowedStationIDs.begin(); it3 != info.allowedStationIDs.end(); ++it3) {
+ StationList::iterator stationInfoIterator = m_availableWorkspaceStationsList.findByID(*it3);
+ if (stationInfoIterator != m_availableWorkspaceStationsList.end()) {
+ if (allowedStationsText != "") {
+ allowedStationsText.append(", ");
+ }
+ allowedStationsText.append((*stationInfoIterator).name);
+ }
+ }
+ item->setText(1, allowedStationsText);
}
it2 = TQListViewItemIterator(m_base->workspace_list);
while (it2.current()) {
TQListViewItem* item = *it2;
bool found = false;
- for (it = list.begin(); it != list.end(); ++it) {
- WorkspaceServiceStatusType info = *it;
- if (info.serviceID != 0) {
- continue;
- }
- if (info.sessionID == item->text(0).toInt()) {
+ for (it = m_workspaceAuthGroupList.begin(); it != m_workspaceAuthGroupList.end(); ++it) {
+ WorkspaceServiceAuthGroupType info = *it;
+ if (info.groupName == item->text(0)) {
found = true;
}
}
@@ -527,11 +732,11 @@ void UserManagementPart::mainEventLoop() {
}
++it2;
}
-
+
setTickerMessage(i18n("Connected"));
}
- if (m_commHandlerState == ModeIdle_StateProcessWorkspaceList) {
+ if (m_commHandlerState == ModeIdle_StateProcessWorkspaceServiceAuthGroupList) {
m_pingDelayTimer->start(250, TRUE);
SET_NEXT_STATE(ModeIdle_StateDelay);
}
@@ -562,37 +767,73 @@ void UserManagementPart::mainEventLoop() {
break;
}
}
- else if (m_commHandlerMode == ModeTerminate) {
+ else if (m_commHandlerMode == ModeUpdate) {
switch (m_commHandlerState) {
- case ModeTerminate_TerminalServices:
- ds << TQString("SESSION");
- ds << TQString("KILL_TERMINAL");
- ds << terminateSessionID;
+ case ModeUpdate_TerminalServices:
+ ds << TQString("SETGROUPACCESS");
+ ds << TQString("TERMINALS");
+ ds << m_updateTerminalServiceAuthGroupList;
m_socket->writeEndOfFrame();
- SET_NEXT_STATE(ModeTerminate_ProcessResponse)
+ SET_NEXT_STATE(ModeUpdate_ProcessResponse)
EXEC_NEXT_STATE_IMMEDIATELY
break;
- case ModeTerminate_LaboratoryWorkspace:
- ds << TQString("SESSION");
- ds << TQString("KILL_WORKSPACE");
- ds << terminateSessionID;
- ds << terminateSessionDelayMinutes;
+ case ModeUpdate_LaboratoryWorkspace:
+ ds << TQString("SETGROUPACCESS");
+ ds << TQString("WORKSPACES");
+ ds << m_updateWorkspaceServiceAuthGroupList;
m_socket->writeEndOfFrame();
- SET_NEXT_STATE(ModeTerminate_ProcessResponse)
+ SET_NEXT_STATE(ModeUpdate_ProcessResponse)
EXEC_NEXT_STATE_IMMEDIATELY
break;
- case ModeTerminate_CancelTerminationOfWorkspace:
- ds << TQString("SESSION");
- ds << TQString("CANCEL_KILL_WORKSPACE");
- ds << terminateSessionID;
+ case ModeUpdate_ProcessResponse:
+ // Get all data
+ if (m_socket->canReadFrame()) {
+ PAT_WATCHDOG_TIMER
+
+ TQString status;
+ WorkspaceServiceStatusList list;
+ ds >> status;
+
+ if (status != "OK") {
+ // Command failed!
+ KMessageBox::error(0, i18n("Command Failure"), i18n("Unable to execute command!"));
+ }
+
+ m_commHandlerMode = ModeIdle;
+ SET_NEXT_STATE(ModeIdle_StateTerminalListRequest);
+ EXEC_NEXT_STATE_IMMEDIATELY
+ }
+ else {
+ if (!m_updateTimeoutTimer->isActive()) {
+ UPDATEDISPLAY_TIMEOUT
+ }
+ }
+ break;
+ }
+ }
+ else if (m_commHandlerMode == ModeDelete) {
+ switch (m_commHandlerState) {
+ case ModeDelete_TerminalServices:
+ ds << TQString("DELETEGROUPACCESS");
+ ds << TQString("TERMINALS");
+ ds << m_updateTerminalServiceAuthGroupList;
+ m_socket->writeEndOfFrame();
+
+ SET_NEXT_STATE(ModeDelete_ProcessResponse)
+ EXEC_NEXT_STATE_IMMEDIATELY
+ break;
+ case ModeDelete_LaboratoryWorkspace:
+ ds << TQString("DELETEGROUPACCESS");
+ ds << TQString("WORKSPACES");
+ ds << m_updateWorkspaceServiceAuthGroupList;
m_socket->writeEndOfFrame();
- SET_NEXT_STATE(ModeTerminate_ProcessResponse)
+ SET_NEXT_STATE(ModeDelete_ProcessResponse)
EXEC_NEXT_STATE_IMMEDIATELY
break;
- case ModeTerminate_ProcessResponse:
+ case ModeDelete_ProcessResponse:
// Get all data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
diff --git a/clients/tde/src/part/adminusermgmt/part.h b/clients/tde/src/part/adminusermgmt/part.h
index f65b5cc..00d4577 100644
--- a/clients/tde/src/part/adminusermgmt/part.h
+++ b/clients/tde/src/part/adminusermgmt/part.h
@@ -20,8 +20,8 @@
* http://www.raptorengineeringinc.com
*/
-#ifndef REMOTELAB_ADMINCONSOLEPART_H
-#define REMOTELAB_ADMINCONSOLEPART_H
+#ifndef REMOTELAB_USERMGMTPART_H
+#define REMOTELAB_USERMGMTPART_H
#include <tdekrbclientsocket.h>
@@ -74,9 +74,12 @@ namespace RemoteLab
void connectionStatusChangedCallback();
void setTickerMessage(TQString message);
- void terminalServiceKillButtonClicked();
- void workspaceTerminateButtonClicked();
- void workspaceCancelTerminationButtonClicked();
+ void terminalServiceAddGroupButtonClicked();
+ void terminalServiceModifyGroupButtonClicked();
+ void terminalServiceDeleteGroupButtonClicked();
+ void workspaceAddGroupButtonClicked();
+ void workspaceModifyGroupButtonClicked();
+ void workspaceDeleteGroupButtonClicked();
void terminalServiceListSelect();
void workspaceListSelect();
@@ -92,13 +95,18 @@ namespace RemoteLab
int m_commHandlerMode;
int m_commHandlerNextState;
int m_commHandlerNextMode;
- TQString terminateSessionID;
- TQ_INT32 terminateSessionDelayMinutes;
+ TerminalServiceAuthGroupList m_updateTerminalServiceAuthGroupList;
+ WorkspaceServiceAuthGroupList m_updateWorkspaceServiceAuthGroupList;
bool m_connectionActiveAndValid;
unsigned char m_tickerState;
TQByteArray m_programmingFileData;
TQ_ULONG m_programmingFileTotalSize;
TQ_ULONG m_programmingFileTransferredBytes;
+
+ TQStringList m_availableTerminalServersList;
+ StationList m_availableWorkspaceStationsList;
+ TerminalServiceAuthGroupList m_terminalServiceAuthGroupList;
+ WorkspaceServiceAuthGroupList m_workspaceAuthGroupList;
};
}
diff --git a/clients/tde/src/part/adminusermgmt/terminatedlg.cpp b/clients/tde/src/part/adminusermgmt/terminatedlg.cpp
index f87ae4b..ac1a43f 100644
--- a/clients/tde/src/part/adminusermgmt/terminatedlg.cpp
+++ b/clients/tde/src/part/adminusermgmt/terminatedlg.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2012 by Timothy Pearson *
+ * Copyright (C) 2013 by Timothy Pearson *
* kb9vqf@pearsoncomputing.net *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -28,6 +28,7 @@
#include <tqpixmap.h>
#include <tqiconset.h>
#include <tqlabel.h>
+#include <tqgroupbox.h>
#include <kconfig.h>
#include <tqcheckbox.h>
#include <tqradiobutton.h>
@@ -35,60 +36,100 @@
#include "terminatedlgbase.h"
#include "terminatedlg.h"
-TerminateDialog::TerminateDialog(TQWidget* parent, const char* name)
- : KDialogBase(parent, name, true, i18n("Terminate Session"), Ok|Cancel, Ok, true)
+TQListBoxKeyedText::TQListBoxKeyedText(TQListBox* listbox, const TQString & text, const TQ_UINT32 key) : TQListBoxText(listbox, text), m_key(key) {
+ //
+}
+
+TQListBoxKeyedText::TQListBoxKeyedText(const TQString & text, const TQ_UINT32 key) : TQListBoxText(text), m_key(key) {
+ //
+}
+
+TQListBoxKeyedText::TQListBoxKeyedText(TQListBox* listbox, const TQString & text, const TQ_UINT32 key, TQListBoxItem *after) : TQListBoxText(listbox, text, after), m_key(key) {
+ //
+}
+
+TQListBoxKeyedText::~TQListBoxKeyedText() {
+ //
+}
+
+TQ_UINT32 TQListBoxKeyedText::key() {
+ return m_key;
+}
+
+GroupPermissionsDialog::GroupPermissionsDialog(TQWidget* parent, const char* name)
+ : KDialogBase(parent, name, true, i18n("Manage Permissions"), Ok|Cancel, Ok, true)
{
- m_base = new TerminateDlgBase(this);
+ m_base = new GroupPermissionsDlgBase(this);
+ m_base->permissionsSelector->availableListBox()->setSelectionMode(TQListBox::Multi);
+ m_base->permissionsSelector->selectedListBox()->setSelectionMode(TQListBox::Multi);
setMainWidget(m_base);
- connect(m_base->m_btnImmediate, SIGNAL(clicked()), this, SLOT(processLockouts()));
- connect(m_base->m_btnDelayed, SIGNAL(clicked()), this, SLOT(processLockouts()));
+ connect(m_base->m_groupName, SIGNAL(textChanged(const TQString&)), this, SLOT(processLockouts()));
+ m_base->m_groupName->setFocus();
- m_base->m_btnDelayed->setChecked(false);
- m_base->m_btnImmediate->setChecked(true);
processLockouts();
}
-void TerminateDialog::processLockouts() {
- if (m_base->m_btnDelayed->isChecked()) {
- m_base->terminateMinutes->setEnabled(true);
+void GroupPermissionsDialog::processLockouts() {
+ if (m_base->m_groupName->text() != "") {
+ enableButtonOK(true);
}
- if (m_base->m_btnImmediate->isChecked()) {
- m_base->terminateMinutes->setEnabled(false);
+ else {
+ enableButtonOK(false);
}
}
-void TerminateDialog::setWarningLabelText(TQString text) {
- m_base->m_warningLabel->setText(text);
+void GroupPermissionsDialog::setGroupName(TQString name, bool editable) {
+ m_base->m_groupName->setText(name);
+ m_base->m_groupName->setEnabled(editable);
}
-void TerminateDialog::enableDelayedTermination(bool enabled) {
- if (enabled) {
- m_base->m_btnImmediate->setEnabled(true);
- m_base->m_btnDelayed->setEnabled(true);
- }
- else {
- m_base->m_btnImmediate->setChecked(true);
- m_base->m_btnImmediate->setEnabled(true);
- m_base->m_btnDelayed->setEnabled(false);
- }
+TQString GroupPermissionsDialog::groupName() {
+ return m_base->m_groupName->text();
}
-bool TerminateDialog::delayed() {
- return m_base->m_btnDelayed->isChecked();
+void GroupPermissionsDialog::setPermissionsSelectorLabel(TQString label) {
+ m_base->groupPermissionsSelector->setTitle(label);
}
-int TerminateDialog::minutes() {
- if (m_base->m_btnDelayed->isChecked()) {
- return m_base->terminateMinutes->value();
+void GroupPermissionsDialog::setAvailableServers(TQKeyedStringList list) {
+ TQListBox* availableListBox = m_base->permissionsSelector->availableListBox();
+ for (TQKeyedStringList::Iterator it = list.begin(); it != list.end(); ++it) {
+ new TQListBoxKeyedText(availableListBox, (*it).first, (*it).second);
}
- else {
- return -1;
+ availableListBox->sort(true);
+}
+
+void GroupPermissionsDialog::setSelectedServers(TQKeyedStringList list) {
+ TQListBox* availableListBox = m_base->permissionsSelector->availableListBox();
+ TQListBox* selectedListBox = m_base->permissionsSelector->selectedListBox();
+ for (TQKeyedStringList::Iterator it = list.begin(); it != list.end(); ++it) {
+ TQListBoxItem* item = availableListBox->findItem((*it).first, ExactMatch);
+ if (item) {
+ delete item;
+ }
+ new TQListBoxKeyedText(selectedListBox, (*it).first, (*it).second);
+ }
+ availableListBox->sort(true);
+ selectedListBox->sort(true);
+}
+
+TQKeyedStringList GroupPermissionsDialog::selectedServers() {
+ TQKeyedStringList list;
+ TQListBox* selectedListBox = m_base->permissionsSelector->selectedListBox();
+ TQListBoxItem* item = selectedListBox->firstItem();
+ while (item) {
+ TQListBoxKeyedText* item2 = dynamic_cast<TQListBoxKeyedText*>(item);
+ if (item2) {
+ list.append(TQKeyedStringPair(item2->text(), item2->key()));
+ }
+ item = item->next();
}
+ return list;
}
-void TerminateDialog::slotOk() {
+void GroupPermissionsDialog::slotOk() {
accept();
}
diff --git a/clients/tde/src/part/adminusermgmt/terminatedlg.h b/clients/tde/src/part/adminusermgmt/terminatedlg.h
index eff6080..df15265 100644
--- a/clients/tde/src/part/adminusermgmt/terminatedlg.h
+++ b/clients/tde/src/part/adminusermgmt/terminatedlg.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2012 by Timothy Pearson *
+ * Copyright (C) 2013 by Timothy Pearson *
* kb9vqf@pearsoncomputing.net *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -24,30 +24,50 @@
#include <kdialogbase.h>
#include <kcombobox.h>
-class TerminateDlgBase;
+class GroupPermissionsDlgBase;
class TopLevel;
-class TerminateDialog : public KDialogBase
-{
- Q_OBJECT
+typedef TQPair< TQString, TQ_UINT32 > TQKeyedStringPair;
+typedef TQValueList< TQKeyedStringPair > TQKeyedStringList;
-public:
- TerminateDialog(TQWidget* parent = 0, const char* name = 0);
+class TQListBoxKeyedText : public TQListBoxText
+{
+ public:
+ TQListBoxKeyedText(TQListBox* listbox, const TQString & text=TQString::null, const TQ_UINT32 key=0);
+ TQListBoxKeyedText(const TQString & text=TQString::null, const TQ_UINT32 key=0 );
+ TQListBoxKeyedText(TQListBox* listbox, const TQString & text, const TQ_UINT32 key, TQListBoxItem *after);
+ ~TQListBoxKeyedText();
-public slots:
- void slotOk();
+ public:
+ TQ_UINT32 key();
-public:
- void enableDelayedTermination(bool enabled);
- void setWarningLabelText(TQString text);
- bool delayed();
- int minutes();
+ private:
+ TQ_UINT32 m_key;
+};
-private slots:
- void processLockouts();
+class GroupPermissionsDialog : public KDialogBase
+{
+ Q_OBJECT
-private:
- TerminateDlgBase *m_base;
+ public:
+ GroupPermissionsDialog(TQWidget* parent = 0, const char* name = 0);
+
+ public:
+ void setGroupName(TQString name, bool editable);
+ TQString groupName();
+ void setPermissionsSelectorLabel(TQString label);
+ void setAvailableServers(TQKeyedStringList list);
+ void setSelectedServers(TQKeyedStringList list);
+ TQKeyedStringList selectedServers();
+
+ public slots:
+ void slotOk();
+
+ private slots:
+ void processLockouts();
+
+ private:
+ GroupPermissionsDlgBase *m_base;
};
#endif
diff --git a/clients/tde/src/part/adminusermgmt/terminatedlgbase.ui b/clients/tde/src/part/adminusermgmt/terminatedlgbase.ui
index 385f0b6..ced61a0 100644
--- a/clients/tde/src/part/adminusermgmt/terminatedlgbase.ui
+++ b/clients/tde/src/part/adminusermgmt/terminatedlgbase.ui
@@ -1,8 +1,8 @@
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
-<class>TerminateDlgBase</class>
+<class>GroupPermissionsDlgBase</class>
<widget class="TQWidget">
<property name="name">
- <cstring>TerminateDlgBase</cstring>
+ <cstring>GroupPermissionsDlgBase</cstring>
</property>
<grid>
<widget class="TQButtonGroup">
@@ -25,52 +25,33 @@
<property name="margin">
<number>0</number>
</property>
- <widget class="TQLabel" row="0" column="0" colspan="2">
+ <widget class="TQLabel" row="0" column="0" colspan="0">
<property name="name">
- <cstring>m_warningLabel</cstring>
+ <cstring>m_groupNameLabel</cstring>
</property>
<property name="text">
- <string></string>
+ <string>Group Name:</string>
</property>
</widget>
- <widget class="TQRadioButton" row="1" column="0">
+ <widget class="KLineEdit" row="0" column="1" colspan="0">
<property name="name">
- <cstring>m_btnImmediate</cstring>
- </property>
- <property name="focusPolicy">
- <enum>NoFocus</enum>
+ <cstring>m_groupName</cstring>
</property>
<property name="text">
- <string>Terminate Now</string>
+ <string></string>
</property>
</widget>
- <widget class="TQRadioButton" row="2" column="0">
+ <widget class="TQGroupBox" row="1" column="0" colspan="2">
<property name="name">
- <cstring>m_btnDelayed</cstring>
- </property>
- <property name="focusPolicy">
- <enum>NoFocus</enum>
- </property>
- <property name="text">
- <string>Terminate After</string>
+ <cstring>groupPermissionsSelector</cstring>
</property>
- </widget>
- <widget class="TQLayoutWidget" row="2" column="1">
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="KIntNumInput" row="0" column="1">
+ <widget class="KActionSelector" row="0" column="0">
<property name="name">
- <cstring>terminateMinutes</cstring>
- </property>
- </widget>
- <widget class="TQLabel" row="0" column="2">
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="text">
- <string>minutes</string>
+ <cstring>permissionsSelector</cstring>
</property>
</widget>
</grid>
diff --git a/database/mysql/remotelab.sql b/database/mysql/remotelab.sql
index ce3e8fe..107a6d2 100644
--- a/database/mysql/remotelab.sql
+++ b/database/mysql/remotelab.sql
@@ -2,7 +2,8 @@
SQLyog Community Edition- MySQL GUI v8.2
MySQL - 5.5.22-0ubuntu1 : Database - remotelab
*********************************************************************
-*/
+*/
+
/*!40101 SET NAMES utf8 */;
@@ -39,8 +40,8 @@ DROP TABLE IF EXISTS `permissions`;
CREATE TABLE `permissions` (
`pk` bigint(20) NOT NULL AUTO_INCREMENT,
`station` bigint(20) NOT NULL,
- `username` text NOT NULL,
- `userrealm` text,
+ `groupname` text NOT NULL,
+ `realm` text,
`restrictions` text,
PRIMARY KEY (`pk`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
diff --git a/lib/libtqtrla/src/tqtrla.cpp b/lib/libtqtrla/src/tqtrla.cpp
index 4434a3d..50cb025 100644
--- a/lib/libtqtrla/src/tqtrla.cpp
+++ b/lib/libtqtrla/src/tqtrla.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2012 by Timothy Pearson *
+ * Copyright (C) 2012-2013 by Timothy Pearson *
* kb9vqf@pearsoncomputing.net *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -463,6 +463,29 @@ TQDataStream &operator>>( TQDataStream &s, StationType &st )
return s;
}
+StationList::StationList() : TQValueList<StationType>() {
+ //
+}
+
+StationList::~StationList() {
+ //
+}
+
+/*!
+ \relates StationType
+
+ Finds a StationType with ID \a id in this list.
+*/
+StationList::iterator StationList::findByID(TQ_UINT32 id) {
+ StationList::iterator it;
+ for (it = begin(); it != end(); ++it) {
+ if ((*it).id == id) {
+ break;
+ }
+ }
+ return it;
+}
+
/*!
\relates SensorType
@@ -508,7 +531,7 @@ TQDataStream &operator>>( TQDataStream &s, SensorType &st )
/*!
\relates TerminalServiceStatusType
- Writes the TerminalServiceStatusType \a str to the stream \a s.
+ Writes the TerminalServiceStatusType \a st to the stream \a s.
See also \link datastreamformat.html Format of the TQDataStream operators \endlink
*/
@@ -531,7 +554,7 @@ TQDataStream &operator<<( TQDataStream &s, const TerminalServiceStatusType &st )
/*!
\relates SensorType
- Reads a SensorType from the stream \a s into SensorType \a str.
+ Reads a TerminalServiceStatusType from the stream \a s into TerminalServiceStatusType \a st.
See also \link datastreamformat.html Format of the TQDataStream operators \endlink
*/
@@ -554,7 +577,7 @@ TQDataStream &operator>>( TQDataStream &s, TerminalServiceStatusType &st )
/*!
\relates WorkspaceServiceStatusType
- Writes the WorkspaceServiceStatusType \a str to the stream \a s.
+ Writes the WorkspaceServiceStatusType \a st to the stream \a s.
See also \link datastreamformat.html Format of the TQDataStream operators \endlink
*/
@@ -575,9 +598,9 @@ TQDataStream &operator<<( TQDataStream &s, const WorkspaceServiceStatusType &st
}
/*!
- \relates SensorType
+ \relates WorkspaceServiceStatusType
- Reads a SensorType from the stream \a s into SensorType \a str.
+ Reads a WorkspaceServiceStatusType from the stream \a s into WorkspaceServiceStatusType \a st.
See also \link datastreamformat.html Format of the TQDataStream operators \endlink
*/
@@ -596,5 +619,114 @@ TQDataStream &operator>>( TQDataStream &s, WorkspaceServiceStatusType &st )
s >> st.terminateStamp;
return s;
}
+
+/*!
+ \relates TerminalServiceAuthGroupType
+
+ Writes the TerminalServiceAuthGroupType \a agt to the stream \a s.
+
+ See also \link datastreamformat.html Format of the TQDataStream operators \endlink
+*/
+
+TQDataStream &operator<<( TQDataStream &s, const TerminalServiceAuthGroupType &agt )
+{
+ s << agt.protocolVersion;
+ s << agt.groupName;
+ s << agt.allowedServerNames;
+ return s;
+}
+
+/*!
+ \relates TerminalServiceAuthGroupType
+
+ Reads a TerminalServiceAuthGroupType from the stream \a s into TerminalServiceAuthGroupType \a agt.
+
+ See also \link datastreamformat.html Format of the TQDataStream operators \endlink
+*/
+
+TQDataStream &operator>>( TQDataStream &s, TerminalServiceAuthGroupType &agt )
+{
+ s >> agt.protocolVersion;
+ s >> agt.groupName;
+ s >> agt.allowedServerNames;
+ return s;
+}
+
+/*!
+ \relates WorkspaceServiceAuthGroupType
+
+ Writes the WorkspaceServiceAuthGroupType \a agt to the stream \a s.
+
+ See also \link datastreamformat.html Format of the TQDataStream operators \endlink
+*/
+
+TQDataStream &operator<<( TQDataStream &s, const WorkspaceServiceAuthGroupType &agt )
+{
+ s << agt.protocolVersion;
+ s << agt.groupName;
+ s << agt.allowedStationIDs;
+ return s;
+}
+
+/*!
+ \relates WorkspaceServiceAuthGroupType
+
+ Reads a WorkspaceServiceAuthGroupType from the stream \a s into WorkspaceServiceAuthGroupType \a agt.
+
+ See also \link datastreamformat.html Format of the TQDataStream operators \endlink
+*/
+
+TQDataStream &operator>>( TQDataStream &s, WorkspaceServiceAuthGroupType &agt )
+{
+ s >> agt.protocolVersion;
+ s >> agt.groupName;
+ s >> agt.allowedStationIDs;
+ return s;
+}
#endif // QT_NO_DATASTREAM
+TerminalServiceAuthGroupList::TerminalServiceAuthGroupList() : TQValueList<TerminalServiceAuthGroupType>() {
+ //
+}
+
+TerminalServiceAuthGroupList::~TerminalServiceAuthGroupList() {
+ //
+}
+
+/*!
+ \relates WorkspaceServiceAuthGroupType
+
+ Finds a WorkspaceServiceAuthGroupType with group name \a name in this list.
+*/
+TerminalServiceAuthGroupList::iterator TerminalServiceAuthGroupList::findByName(TQString name) {
+ TerminalServiceAuthGroupList::iterator it;
+ for (it = begin(); it != end(); ++it) {
+ if ((*it).groupName == name) {
+ break;
+ }
+ }
+ return it;
+}
+
+WorkspaceServiceAuthGroupList::WorkspaceServiceAuthGroupList() : TQValueList<WorkspaceServiceAuthGroupType>() {
+ //
+}
+
+WorkspaceServiceAuthGroupList::~WorkspaceServiceAuthGroupList() {
+ //
+}
+
+/*!
+ \relates WorkspaceServiceAuthGroupType
+
+ Finds a WorkspaceServiceAuthGroupType with group name \a name in this list.
+*/
+WorkspaceServiceAuthGroupList::iterator WorkspaceServiceAuthGroupList::findByName(TQString name) {
+ WorkspaceServiceAuthGroupList::iterator it;
+ for (it = begin(); it != end(); ++it) {
+ if ((*it).groupName == name) {
+ break;
+ }
+ }
+ return it;
+} \ No newline at end of file
diff --git a/lib/libtqtrla/src/tqtrla.h b/lib/libtqtrla/src/tqtrla.h
index 64a8ef5..b649c4d 100644
--- a/lib/libtqtrla/src/tqtrla.h
+++ b/lib/libtqtrla/src/tqtrla.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2012 by Timothy Pearson *
+ * Copyright (C) 2012-2013 by Timothy Pearson *
* kb9vqf@pearsoncomputing.net *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -165,7 +165,15 @@ Q_EXPORT TQDataStream &operator<<(TQDataStream &, const StationType &);
Q_EXPORT TQDataStream &operator>>(TQDataStream &, StationType &);
#endif
-typedef TQValueList<StationType> StationList;
+class StationList : public TQValueList<StationType>
+{
+ public:
+ StationList();
+ virtual ~StationList();
+
+ public:
+ StationList::iterator findByID(TQ_UINT32 id);
+};
// =============================================================================
@@ -239,4 +247,54 @@ typedef TQValueList<WorkspaceServiceStatusType> WorkspaceServiceStatusList;
// =============================================================================
+class TerminalServiceAuthGroupType
+{
+ public:
+ TQ_UINT32 protocolVersion;
+ TQString groupName;
+ TQStringList allowedServerNames;
+};
+
+#ifndef QT_NO_DATASTREAM
+Q_EXPORT TQDataStream &operator<<(TQDataStream &, const TerminalServiceAuthGroupType &);
+Q_EXPORT TQDataStream &operator>>(TQDataStream &, TerminalServiceAuthGroupType &);
+#endif
+
+class TerminalServiceAuthGroupList : public TQValueList<TerminalServiceAuthGroupType>
+{
+ public:
+ TerminalServiceAuthGroupList();
+ virtual ~TerminalServiceAuthGroupList();
+
+ public:
+ TerminalServiceAuthGroupList::iterator findByName(TQString name);
+};
+
+// =============================================================================
+
+class WorkspaceServiceAuthGroupType
+{
+ public:
+ TQ_UINT32 protocolVersion;
+ TQString groupName;
+ TQInt32List allowedStationIDs;
+};
+
+#ifndef QT_NO_DATASTREAM
+Q_EXPORT TQDataStream &operator<<(TQDataStream &, const WorkspaceServiceAuthGroupType &);
+Q_EXPORT TQDataStream &operator>>(TQDataStream &, WorkspaceServiceAuthGroupType &);
+#endif
+
+class WorkspaceServiceAuthGroupList : public TQValueList<WorkspaceServiceAuthGroupType>
+{
+ public:
+ WorkspaceServiceAuthGroupList();
+ virtual ~WorkspaceServiceAuthGroupList();
+
+ public:
+ WorkspaceServiceAuthGroupList::iterator findByName(TQString name);
+};
+
+// =============================================================================
+
#endif // TQTRLA_H \ No newline at end of file
diff --git a/servers/admin_user_mgmt_server_lin/aclocal.m4 b/servers/admin_user_mgmt_server_lin/aclocal.m4
index a7f0dd4..6135e5b 100644
--- a/servers/admin_user_mgmt_server_lin/aclocal.m4
+++ b/servers/admin_user_mgmt_server_lin/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
@@ -14,8 +14,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
@@ -664,7 +664,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.3], [],
+m4_if([$1], [1.11.6], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -680,7 +680,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.3])dnl
+[AM_AUTOMAKE_VERSION([1.11.6])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
diff --git a/servers/admin_user_mgmt_server_lin/doc/Makefile.in b/servers/admin_user_mgmt_server_lin/doc/Makefile.in
index 9435987..fc4ffec 100644
--- a/servers/admin_user_mgmt_server_lin/doc/Makefile.in
+++ b/servers/admin_user_mgmt_server_lin/doc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# KDE tags expanded automatically by am_edit - $Revision$
# @configure_input@
@@ -19,6 +19,23 @@
# the SUBDIRS is filled automatically by am_edit. If files are
# in this directory they are installed into the english dir
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -66,6 +83,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive nmcheck-recursive bcheck-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -592,13 +614,10 @@ distdir: $(DISTFILES)
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
- test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
diff --git a/servers/admin_user_mgmt_server_lin/doc/en/Makefile.in b/servers/admin_user_mgmt_server_lin/doc/en/Makefile.in
index 586e134..5269784 100644
--- a/servers/admin_user_mgmt_server_lin/doc/en/Makefile.in
+++ b/servers/admin_user_mgmt_server_lin/doc/en/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# KDE tags expanded automatically by am_edit - $Revision$
# @configure_input@
@@ -16,6 +16,23 @@
@SET_MAKE@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -48,6 +65,11 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
#>+ 1
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
diff --git a/servers/admin_user_mgmt_server_lin/po/Makefile.in b/servers/admin_user_mgmt_server_lin/po/Makefile.in
index 3e4f5d3..1af59b1 100644
--- a/servers/admin_user_mgmt_server_lin/po/Makefile.in
+++ b/servers/admin_user_mgmt_server_lin/po/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# KDE tags expanded automatically by am_edit - $Revision$
# @configure_input@
@@ -16,6 +16,23 @@
@SET_MAKE@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -48,6 +65,11 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
#>+ 1
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
diff --git a/servers/admin_user_mgmt_server_lin/src/Makefile.am b/servers/admin_user_mgmt_server_lin/src/Makefile.am
index 6e2c003..481bdc2 100644
--- a/servers/admin_user_mgmt_server_lin/src/Makefile.am
+++ b/servers/admin_user_mgmt_server_lin/src/Makefile.am
@@ -3,7 +3,7 @@ KDE_CXXFLAGS = $(USE_EXCEPTIONS)
bin_PROGRAMS = remotefpga_adminsysctlserver
-remotefpga_adminsysctlserver_SOURCES = main.cpp admin_sys_ctl.cpp
+remotefpga_adminsysctlserver_SOURCES = main.cpp admin_user_mgmt.cpp
remotefpga_adminsysctlserver_METASOURCES = AUTO
remotefpga_adminsysctlserver_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -ltdekrbsocket -ltqtrla
diff --git a/servers/admin_user_mgmt_server_lin/src/admin_sys_ctl.cpp b/servers/admin_user_mgmt_server_lin/src/admin_user_mgmt.cpp
index bfb83bc..687a1e5 100644
--- a/servers/admin_user_mgmt_server_lin/src/admin_sys_ctl.cpp
+++ b/servers/admin_user_mgmt_server_lin/src/admin_user_mgmt.cpp
@@ -40,7 +40,7 @@
#include <klocale.h>
-#include "admin_sys_ctl.h"
+#include "admin_user_mgmt.h"
#define ABORT_SOCKET(s) s->close(); \
s->disconnect(); \
@@ -83,6 +83,9 @@ SysCtlSocket::SysCtlSocket(int sock, TQObject *parent, const char *name) :
if (connectToDatabase() != 0) {
exit(1);
}
+
+ m_minGID = m_config->readNumEntry("MinimumGID", 500);
+ m_maxGID = m_config->readNumEntry("MaximumGID", 65533);
}
SysCtlSocket::~SysCtlSocket() {
@@ -176,30 +179,17 @@ void SysCtlSocket::commandLoop() {
ds.setPrintableData(true);
TQString command;
ds >> command;
- if (command == "USERS") {
+ if (command == "LIST") {
TQString subCommand;
ds >> subCommand;
if (subCommand == "TERMINALS") {
clearFrameTail();
ds << TQString("OK");
- TerminalServiceStatusList list;
- TQSqlCursor databaseActivityCursor("sessions", TRUE, m_terminals_database);
- databaseActivityCursor.select();
- while (databaseActivityCursor.next()) {
- TerminalServiceStatusType status;
-
- status.protocolVersion = 1;
- status.sessionID = databaseActivityCursor.value("pk").toInt();
- status.username = databaseActivityCursor.value("username").toString();
- status.serverName = databaseActivityCursor.value("servername").toString();
- status.serverPID = databaseActivityCursor.value("server_pid").toInt();
- status.wmPID = databaseActivityCursor.value("wm_pid").toInt();
- status.state = databaseActivityCursor.value("state").toInt();
- status.display = databaseActivityCursor.value("display").toInt();
- status.loginStamp.setTime_t(databaseActivityCursor.value("stamp_start").toLongLong());
- status.activityStamp.setTime_t(databaseActivityCursor.value("stamp_statechange").toLongLong());
-
- list.append(status);
+ TQStringList list;
+ TQSqlCursor databaseServersCursor("servers", TRUE, m_terminals_database);
+ databaseServersCursor.select();
+ while (databaseServersCursor.next()) {
+ list.append(databaseServersCursor.value("name").toString());
}
ds << list;
writeEndOfFrame();
@@ -207,29 +197,41 @@ void SysCtlSocket::commandLoop() {
else if (subCommand == "WORKSPACES") {
clearFrameTail();
ds << TQString("OK");
- WorkspaceServiceStatusList list;
- TQSqlCursor databaseActivityCursor("activity", TRUE, m_workspaces_database);
- databaseActivityCursor.select();
- while (databaseActivityCursor.next()) {
- WorkspaceServiceStatusType status;
-
- status.protocolVersion = 1;
- status.sessionID = databaseActivityCursor.value("pk").toInt();
- status.stationID = databaseActivityCursor.value("station").toInt();
- status.username = databaseActivityCursor.value("username").toString();
- status.realmname = databaseActivityCursor.value("realmname").toString();
- status.serverID = databaseActivityCursor.value("serverid").toInt();
- status.serviceID = databaseActivityCursor.value("serviceid").toInt();
- status.stationID = databaseActivityCursor.value("station").toInt();
- TQSqlCursor databaseStationsCursor("stations", TRUE, m_workspaces_database);
- databaseStationsCursor.select(TQString("pk=%1").arg(status.stationID));
- if (databaseStationsCursor.next()) {
- status.stationName = databaseStationsCursor.value("name").toString();
- }
- status.loginStamp.setTime_t(databaseActivityCursor.value("logontime").toLongLong());
- status.terminateStamp.setTime_t(databaseActivityCursor.value("terminate").toLongLong());
- list.append(status);
+ StationList list;
+ TQSqlCursor databaseStationsCursor("stations", TRUE, m_workspaces_database);
+ TQSqlCursor databaseServicesCursor("services", TRUE, m_workspaces_database);
+ TQSqlCursor databaseServiceTypesCursor("servicetypes", TRUE, m_workspaces_database);
+ databaseStationsCursor.select();
+ while (databaseStationsCursor.next()) {
+ StationType st;
+ st.id = databaseStationsCursor.value("pk").toInt();
+ st.name = databaseStationsCursor.value("name").toString();
+ st.description = databaseStationsCursor.value("description").toString();
+ databaseServicesCursor.select(TQString("station=%1").arg(databaseStationsCursor.value("pk").toInt()));
+ while (databaseServicesCursor.next()) {
+ databaseServiceTypesCursor.select(TQString("serviceid=%1").arg(databaseServicesCursor.value("servicetype").toInt()));
+ ServiceType svt;
+ if (databaseServiceTypesCursor.next()) {
+ svt.type = databaseServiceTypesCursor.value("serviceid").toInt();
+ svt.name = databaseServiceTypesCursor.value("name").toString();
+ svt.description = databaseServiceTypesCursor.value("description").toString();
+ svt.clientLibrary = databaseServiceTypesCursor.value("client_library").toString();
+ svt.version = databaseServiceTypesCursor.value("version").toInt();
+ char tempchar;
+ tempchar = databaseServiceTypesCursor.value("single_instance").toInt();
+ svt.singleInstance = (tempchar != 0);
+ }
+ if (svt.name == "") {
+ svt.name = i18n("<unknown>");
+ }
+ if (svt.description == "") {
+ svt.description = i18n("<unknown>");
+ }
+ st.services.append(svt);
+ }
+
+ list.append(st);
}
ds << list;
writeEndOfFrame();
@@ -240,92 +242,237 @@ void SysCtlSocket::commandLoop() {
writeEndOfFrame();
}
}
- else if (command == "SESSION") {
+ else if (command == "LISTGROUPACCESS") {
TQString subCommand;
- TQString sessionID;
ds >> subCommand;
- ds >> sessionID;
- if (subCommand == "LOGOFF_TERMINAL") {
- TQ_UINT32 delay;
- ds >> delay;
+ if (subCommand == "TERMINALS") {
clearFrameTail();
- // FIXME UNIMPLEMENTED
- ds << TQString("ERRINVCMD");
+ ds << TQString("OK");
+ TerminalServiceAuthGroupList list;
+
+ // First search the database for groups...
+ TQSqlCursor databasePermissionsCursor("allowed_servers", TRUE, m_terminals_database);
+ databasePermissionsCursor.select();
+ while (databasePermissionsCursor.next()) {
+ TerminalServiceAuthGroupType agt;
+ TerminalServiceAuthGroupList::iterator it = list.findByName(databasePermissionsCursor.value("groupname").toString());
+ if (it != list.end()) {
+ agt = *it;
+ list.remove(it);
+ }
+ else {
+ agt.protocolVersion = 1;
+ agt.groupName = databasePermissionsCursor.value("groupname").toString();
+ }
+ agt.allowedServerNames.append(databasePermissionsCursor.value("server").toString());
+
+ list.append(agt);
+ }
+
+ // ...then search LDAP for groups that were not already in the database
+ struct group* group;
+ setgrent();
+ while ((group = getgrent())) {
+ if ((group->gr_gid >= m_minGID) && (group->gr_gid <= m_maxGID)) {
+ TerminalServiceAuthGroupType agt;
+ TerminalServiceAuthGroupList::iterator it = list.findByName(TQString(group->gr_name));
+ if (it == list.end()) {
+ agt.protocolVersion = 1;
+ agt.groupName = TQString(group->gr_name);
+ list.append(agt);
+ }
+ }
+ }
+ endgrent();
+
+ ds << list;
writeEndOfFrame();
}
- else if (subCommand == "CANCEL_LOGOFF_TERMINAL") {
+ else if (subCommand == "WORKSPACES") {
+ clearFrameTail();
+ ds << TQString("OK");
+
+ WorkspaceServiceAuthGroupList list;
+
+ // First search the database for groups...
+ TQSqlCursor databasePermissionsCursor("permissions", TRUE, m_workspaces_database);
+ databasePermissionsCursor.select();
+ while (databasePermissionsCursor.next()) {
+ WorkspaceServiceAuthGroupType agt;
+ WorkspaceServiceAuthGroupList::iterator it = list.findByName(databasePermissionsCursor.value("groupname").toString());
+ if (it != list.end()) {
+ agt = *it;
+ list.remove(it);
+ }
+ else {
+ agt.protocolVersion = 1;
+ agt.groupName = databasePermissionsCursor.value("groupname").toString();
+ }
+ agt.allowedStationIDs.append(databasePermissionsCursor.value("station").toUInt());
+
+ list.append(agt);
+ }
+
+ // ...then search LDAP for groups that were not already in the database
+ struct group* group;
+ setgrent();
+ while ((group = getgrent())) {
+ if ((group->gr_gid >= m_minGID) && (group->gr_gid <= m_maxGID)) {
+ WorkspaceServiceAuthGroupType agt;
+ WorkspaceServiceAuthGroupList::iterator it = list.findByName(TQString(group->gr_name));
+ if (it == list.end()) {
+ agt.protocolVersion = 1;
+ agt.groupName = TQString(group->gr_name);
+ list.append(agt);
+ }
+ }
+ }
+ endgrent();
+
+ ds << list;
+ writeEndOfFrame();
+ }
+ else {
clearFrameTail();
- // FIXME UNIMPLEMENTED
ds << TQString("ERRINVCMD");
writeEndOfFrame();
}
- else if (subCommand == "KILL_TERMINAL") {
+ }
+ else if (command == "SETGROUPACCESS") {
+ TQString subCommand;
+ ds >> subCommand;
+ if (subCommand == "TERMINALS") {
+ TerminalServiceAuthGroupList list;
+ ds >> list;
clearFrameTail();
- TQSqlCursor databaseActivityCursor("sessions", TRUE, m_terminals_database);
- databaseActivityCursor.select(TQString("pk=%1").arg(sessionID));
- if (databaseActivityCursor.next()) {
- // Gather server information
- TQString server_name = databaseActivityCursor.value("servername").toString();
- int server_pid = databaseActivityCursor.value("server_pid").toInt();
- // Kill server process
- TQString command = TQString("ssh root@%1 'kill -9 %2'").arg(server_name).arg(server_pid);
- if (system(command.ascii()) == 0) {
- // Remove database entry
- databaseActivityCursor.select(TQString("pk=%1").arg(sessionID));
- if (databaseActivityCursor.next()) {
- databaseActivityCursor.primeDelete();
- databaseActivityCursor.del(true);
- }
- ds << TQString("OK");
+
+ bool success = true;
+ TQSqlCursor databasePermissionsCursor("allowed_servers", TRUE, m_terminals_database);
+ TerminalServiceAuthGroupList::iterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ TerminalServiceAuthGroupType agt = *it;
+
+ // Delete all existing entries for this group in perparation for update
+ databasePermissionsCursor.select(TQString("groupname='%1'").arg(agt.groupName));
+ while (databasePermissionsCursor.next()) {
+ databasePermissionsCursor.primeDelete();
+ databasePermissionsCursor.del(false);
}
- else {
- ds << TQString("ERRFAILED");
+
+ // Insert all entries for this group from the information structure
+ TQStringList::iterator it2;
+ for (it2 = agt.allowedServerNames.begin(); it2 != agt.allowedServerNames.end(); ++it2) {
+ TQSqlRecord *buffer = databasePermissionsCursor.primeInsert();
+ buffer->setValue("groupname", agt.groupName);
+ buffer->setValue("server", *it2);
+ databasePermissionsCursor.insert();
}
- writeEndOfFrame();
+ }
+
+ if (success) {
+ ds << TQString("OK");
}
else {
- ds << TQString("ERRINVCMD");
+ ds << TQString("ERRFAILED");
}
writeEndOfFrame();
}
- else if (subCommand == "KILL_WORKSPACE") {
- TQ_INT32 terminationOffset;
- ds >> terminationOffset;
+ else if (subCommand == "WORKSPACES") {
+ WorkspaceServiceAuthGroupList list;
+ ds >> list;
clearFrameTail();
- TQDateTime terminationTime = TQDateTime::currentDateTime();
- terminationTime = terminationTime.addSecs(terminationOffset*60);
- TQSqlCursor databaseActivityCursor("activity", TRUE, m_workspaces_database);
- databaseActivityCursor.select(TQString("pk=%1").arg(sessionID));
- if (databaseActivityCursor.next()) {
- TQSqlRecord *buffer = databaseActivityCursor.primeUpdate();
- if (terminationOffset > -2) {
- buffer->setValue("terminate", terminationTime.toTime_t());
+
+ bool success = true;
+ TQSqlCursor databasePermissionsCursor("permissions", TRUE, m_workspaces_database);
+ WorkspaceServiceAuthGroupList::iterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ WorkspaceServiceAuthGroupType agt = *it;
+
+ // Delete all existing entries for this group in perparation for update
+ databasePermissionsCursor.select(TQString("groupname='%1'").arg(agt.groupName));
+ while (databasePermissionsCursor.next()) {
+ databasePermissionsCursor.primeDelete();
+ databasePermissionsCursor.del(false);
}
- else {
- buffer->setValue("terminate", 0);
+
+ // Insert all entries for this group from the information structure
+ TQInt32List::iterator it2;
+ for (it2 = agt.allowedStationIDs.begin(); it2 != agt.allowedStationIDs.end(); ++it2) {
+ TQSqlRecord *buffer = databasePermissionsCursor.primeInsert();
+ buffer->setValue("groupname", agt.groupName);
+ buffer->setValue("station", *it2);
+ databasePermissionsCursor.insert();
}
- databaseActivityCursor.update();
+ }
+ if (success) {
ds << TQString("OK");
}
else {
- ds << TQString("ERRINVCMD");
+ ds << TQString("ERRFAILED");
}
writeEndOfFrame();
}
- else if (subCommand == "CANCEL_KILL_WORKSPACE") {
+ else {
clearFrameTail();
- TQSqlCursor databaseActivityCursor("activity", TRUE, m_workspaces_database);
- databaseActivityCursor.select(TQString("pk=%1").arg(sessionID));
- if (databaseActivityCursor.next()) {
- TQSqlRecord *buffer = databaseActivityCursor.primeUpdate();
- buffer->setValue("terminate", 0);
- databaseActivityCursor.update();
+ ds << TQString("ERRINVCMD");
+ writeEndOfFrame();
+ }
+ }
+ else if (command == "DELETEGROUPACCESS") {
+ TQString subCommand;
+ ds >> subCommand;
+ if (subCommand == "TERMINALS") {
+ TerminalServiceAuthGroupList list;
+ ds >> list;
+ clearFrameTail();
+
+ bool success = true;
+ TQSqlCursor databasePermissionsCursor("allowed_servers", TRUE, m_terminals_database);
+ TerminalServiceAuthGroupList::iterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ TerminalServiceAuthGroupType agt = *it;
+
+ // Delete all existing entries for this group
+ databasePermissionsCursor.select(TQString("groupname='%1'").arg(agt.groupName));
+ while (databasePermissionsCursor.next()) {
+ databasePermissionsCursor.primeDelete();
+ databasePermissionsCursor.del(false);
+ }
+ }
+
+ if (success) {
+ ds << TQString("OK");
+ }
+ else {
+ ds << TQString("ERRFAILED");
+ }
+ writeEndOfFrame();
+ }
+ else if (subCommand == "WORKSPACES") {
+ WorkspaceServiceAuthGroupList list;
+ ds >> list;
+ clearFrameTail();
+
+ bool success = true;
+ TQSqlCursor databasePermissionsCursor("permissions", TRUE, m_workspaces_database);
+ WorkspaceServiceAuthGroupList::iterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ WorkspaceServiceAuthGroupType agt = *it;
+
+ // Delete all existing entries for this group
+ databasePermissionsCursor.select(TQString("groupname='%1'").arg(agt.groupName));
+ while (databasePermissionsCursor.next()) {
+ databasePermissionsCursor.primeDelete();
+ databasePermissionsCursor.del(false);
+ }
+ }
+ if (success) {
ds << TQString("OK");
}
else {
- ds << TQString("ERRINVCMD");
+ ds << TQString("ERRFAILED");
}
writeEndOfFrame();
}
diff --git a/servers/admin_user_mgmt_server_lin/src/admin_sys_ctl.h b/servers/admin_user_mgmt_server_lin/src/admin_user_mgmt.h
index 4812424..d0f75a2 100644
--- a/servers/admin_user_mgmt_server_lin/src/admin_sys_ctl.h
+++ b/servers/admin_user_mgmt_server_lin/src/admin_user_mgmt.h
@@ -20,6 +20,8 @@
* http://www.raptorengineeringinc.com
*/
+#include <grp.h>
+
#include <tqsocket.h>
#include <tqserversocket.h>
#include <tqapplication.h>
@@ -73,6 +75,9 @@ class SysCtlSocket : public TDEKerberosServerSocket
TQSqlDatabase* m_workspaces_database;
int m_commandLoopState;
+ gid_t m_minGID;
+ gid_t m_maxGID;
+
friend class UserMgmtServer;
};
diff --git a/servers/admin_user_mgmt_server_lin/src/main.cpp b/servers/admin_user_mgmt_server_lin/src/main.cpp
index b216a9b..d9aa95a 100644
--- a/servers/admin_user_mgmt_server_lin/src/main.cpp
+++ b/servers/admin_user_mgmt_server_lin/src/main.cpp
@@ -37,7 +37,7 @@
#include <kaboutdata.h>
#include <ksimpleconfig.h>
-#include "admin_sys_ctl.h"
+#include "admin_user_mgmt.h"
static const char description[] = I18N_NOOP("RemoteFPGA System Administration User Management Server");
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
KSimpleConfig config("remotefpga_adminusermgmtserver.conf", false);
config.setGroup("Server");
- SysCtlServer fpgasvr(0, config.readNumEntry("port", 4016), &config);
+ UserMgmtServer fpgasvr(0, config.readNumEntry("port", 4016), &config);
return app.exec();
}
diff --git a/servers/auth_server_lin/src/auth_conn.cpp b/servers/auth_server_lin/src/auth_conn.cpp
index 42b6d2a..2833fc6 100644
--- a/servers/auth_server_lin/src/auth_conn.cpp
+++ b/servers/auth_server_lin/src/auth_conn.cpp
@@ -22,6 +22,9 @@
#include <stdlib.h>
+#include <grp.h>
+#include <pwd.h>
+
#include <tqtimer.h>
#include <klocale.h>
@@ -414,11 +417,42 @@ void AuthSocket::commandLoop() {
while (m_databaseStationsCursor->next()) {
bool authorized = false;
bool in_use = false;
-
+
+ int ngroups = 0;
+ gid_t *groups;
+ struct passwd *pw;
+ struct group *gr;
+ groups = (gid_t*)malloc(ngroups*sizeof(gid_t));
+ if (groups == NULL) {
+ printf("[ERROR] Unable to allocate memory\n\r"); fflush(stdout);
+ exit(EXIT_FAILURE);
+ }
+
+ pw = getpwnam(m_authenticatedUserName.ascii());
+ if (pw == NULL) {
+ printf("[WARNING] Unable to get detailed information for user '%s', ignoring\n\r", m_authenticatedUserName.ascii()); fflush(stdout);
+ continue;
+ }
+
+ if (getgrouplist(m_authenticatedUserName.ascii(), pw->pw_gid, groups, &ngroups) == -1) {
+ free(groups);
+ groups = (gid_t*)malloc(ngroups*sizeof(gid_t));
+ if (getgrouplist(m_authenticatedUserName.ascii(), pw->pw_gid, groups, &ngroups) == -1) {
+ printf("[WARNING] Unable to get groups for user '%s', ignoring\n\r", m_authenticatedUserName.ascii()); fflush(stdout);
+ continue;
+ }
+ }
+
+ int i;
m_databasePermissionsCursor->select(TQString("station=%1").arg(m_databaseStationsCursor->value("pk").toInt()));
while (m_databasePermissionsCursor->next()) {
- if (m_databasePermissionsCursor->value("username").toString() == m_authenticatedUserName) {
- authorized = true;
+ for (i = 0; i < ngroups; i++) {
+ gr = getgrgid(groups[i]);
+ if (gr != NULL) {
+ if (m_databasePermissionsCursor->value("groupname").toString() == TQString(gr->gr_name)) {
+ authorized = true;
+ }
+ }
}
}
m_databaseActivityCursor->select(TQString("station=%1").arg(m_databaseStationsCursor->value("pk").toInt()));