idok-commit AT lists.psi.ch
Subject: Commit emails of the iDok project
List archive
[idok-commit] idok commit r360 - in trunk/java/ch/idok: qtgui service/server/admin
Chronological Thread
- From: "AFS account Florian Huebner" <huebner AT savannah.psi.ch>
- To: idok-commit AT lists.psi.ch
- Subject: [idok-commit] idok commit r360 - in trunk/java/ch/idok: qtgui service/server/admin
- Date: Wed, 29 Apr 2009 09:03:39 +0200
- List-archive: <https://lists.web.psi.ch/pipermail/idok-commit/>
- List-id: Commit emails of the iDok project <idok-commit.lists.psi.ch>
Author: huebner
Date: Wed Apr 29 09:03:38 2009
New Revision: 360
Log:
The administration menu "Create Group from LDAP" now shows a proposal in the
form: "project/@@ldapgroup" after selecting an LDAP group.
Modified:
trunk/java/ch/idok/qtgui/AuthorizationController.java
trunk/java/ch/idok/qtgui/Ldap.java
trunk/java/ch/idok/service/server/admin/Admin.java
Modified: trunk/java/ch/idok/qtgui/AuthorizationController.java
==============================================================================
--- trunk/java/ch/idok/qtgui/AuthorizationController.java (original)
+++ trunk/java/ch/idok/qtgui/AuthorizationController.java Wed Apr 29
09:03:38 2009
@@ -85,6 +85,8 @@
private final QDialog askForDialog_;
+ private final QDialog askForSuggestionDialog_;
+
private final QDialog askForCompleterDialog_;
private final QDialog askForChoiceDialog_;
@@ -95,6 +97,8 @@
private final QLabel askForLabel_;
+ private final QLabel askForSuggestionLabel_;
+
private final QLabel askForCompleterLabel_;
private final QLabel askForChoiceLabel_;
@@ -105,6 +109,8 @@
private final QLineEdit askForLine_;
+ private final QLineEdit askForSuggestionLine_;
+
private final QLineEdit askForCompleterLine_;
private final QComboBox askForChoice_;
@@ -147,15 +153,29 @@
okButton.setText("Ok");
QPushButton cancelButton = new QPushButton(askForDialog_);
cancelButton.setText("Cancel");
-
gridLayout.addWidget(askForLabel_, 0, 0, 1, 2);
gridLayout.addWidget(askForLine_, 1, 0, 1, 2);
gridLayout.addWidget(okButton, 2, 0);
gridLayout.addWidget(cancelButton, 2, 1);
-
okButton.clicked.connect(askForDialog_, "accept()");
cancelButton.clicked.connect(askForDialog_, "reject()");
+ // create simple dialog with a suggestion
+ askForSuggestionDialog_ = new QDialog(asd_);
+ QGridLayout gridLayout1 = new QGridLayout(askForSuggestionDialog_);
+ askForSuggestionLabel_ = new QLabel(askForSuggestionDialog_);
+ askForSuggestionLine_ = new QLineEdit(askForSuggestionDialog_);
+ QPushButton okButton1 = new QPushButton(askForSuggestionDialog_);
+ okButton1.setText("Ok");
+ QPushButton cancelButton1 = new QPushButton(askForSuggestionDialog_);
+ cancelButton1.setText("Cancel");
+ gridLayout1.addWidget(askForSuggestionLabel_, 0, 0, 1, 2);
+ gridLayout1.addWidget(askForSuggestionLine_, 1, 0, 1, 2);
+ gridLayout1.addWidget(okButton1, 2, 0);
+ gridLayout1.addWidget(cancelButton1, 2, 1);
+ okButton1.clicked.connect(askForSuggestionDialog_, "accept()");
+ cancelButton1.clicked.connect(askForSuggestionDialog_, "reject()");
+
// create a dialog
askForCompleterDialog_ = new QDialog(asd_);
QGridLayout gridLayout5 = new QGridLayout(askForCompleterDialog_);
@@ -181,12 +201,10 @@
okButton2.setText(tr("Ok"));
QPushButton cancelButton2 = new QPushButton(askForChoiceDialog_);
cancelButton2.setText(tr("Cancel"));
-
gridLayout2.addWidget(askForChoiceLabel_, 0, 0, 1, 2);
gridLayout2.addWidget(askForChoice_, 1, 0, 1, 2);
gridLayout2.addWidget(okButton2, 2, 0);
gridLayout2.addWidget(cancelButton2, 2, 1);
-
okButton2.clicked.connect(askForChoiceDialog_, "accept()");
cancelButton2.clicked.connect(askForChoiceDialog_, "reject()");
@@ -237,10 +255,10 @@
cancelButton3.clicked.connect(askForRadioDialog_, "reject()");
// askForButtonGroup_.buttonClicked.connect(askForRadioDialog_,
"accept()");
- gridLayout2.addWidget(askForChoiceLabel_, 0, 0, 1, 2);
- gridLayout2.addWidget(askForChoice_, 1, 0, 1, 2);
- gridLayout2.addWidget(okButton2, 2, 0);
- gridLayout2.addWidget(cancelButton2, 2, 1);
+// gridLayout2.addWidget(askForChoiceLabel_, 0, 0, 1, 2);
+// gridLayout2.addWidget(askForChoice_, 1, 0, 1, 2);
+// gridLayout2.addWidget(okButton2, 2, 0);
+// gridLayout2.addWidget(cancelButton2, 2, 1);
uasd_ = new Ui_AuthorizationSettingsDialog();
uasd_.setupUi(asd_);
@@ -499,6 +517,11 @@
if (group == null)
return;
+ String ldapProjectGroup = askForSuggestion("Enter name of new group
(project/[repo/]@@group)",project_+"/"+group);
+
+ if (ldapProjectGroup == null)
+ return;
+
ArrayList<String> ldapMember = Ldap.getGroupMembers(ldapGroup);
// Collections.sort(ldapMember);
// String member = askForChoice(tr("Enter first member"),ldapMember);
@@ -509,7 +532,7 @@
for (String member : ldapMember) {
ServiceProvider.getInstance().getAdminService().addToGroup(
GuiClientHandler.getInstance().getCredentials(),
member,
- group);
+ ldapProjectGroup);
defineAccessRights();
}
} catch (DmsException e) {
@@ -928,6 +951,18 @@
return null;
}
}
+
+ private final String askForSuggestion(String prompt,String suggestion) {
+
+ askForLabel_.setText(prompt);
+ askForLine_.setText(suggestion);
+
+ if (askForDialog_.exec() == QDialog.DialogCode.Accepted.value()) {
+ return askForLine_.text();
+ } else {
+ return null;
+ }
+ }
private final String askForChoice(String prompt, List<String> choices) {
Modified: trunk/java/ch/idok/qtgui/Ldap.java
==============================================================================
--- trunk/java/ch/idok/qtgui/Ldap.java (original)
+++ trunk/java/ch/idok/qtgui/Ldap.java Wed Apr 29 09:03:38 2009
@@ -292,8 +292,9 @@
NameClassPair nextEntry = null;
nextEntry = (NameClassPair) results.next();
if (nextEntry.toString().split(":")[1].contains(" null")) {
+
groupList.add(nextEntry.toString().split(":")[0]
- .substring(3));
+ .substring(3).replace(",OU=PSIweb", ""));
}
}
} catch (NamingException e) {
Modified: trunk/java/ch/idok/service/server/admin/Admin.java
==============================================================================
--- trunk/java/ch/idok/service/server/admin/Admin.java (original)
+++ trunk/java/ch/idok/service/server/admin/Admin.java Wed Apr 29 09:03:38
2009
@@ -63,11 +63,11 @@
.getProperty("ch.idok.server.httpdConfDir");
static private Pattern groupNamePattern = Pattern
-
.compile("^@@([0-9]*)|@@([a-zA-Z]\\w*[-]?\\w*)|(?:[a-zA-Z]\\w*[-]?\\w*/)*@[a-zA-Z]\\w*[-]?\\w*|"
+
.compile("^@@([0-9]*)|@@([a-zA-Z]\\w*[-]?\\w*)|(?:[a-zA-Z]\\w*[-]?\\w*/)*@[@]?[a-zA-Z]\\w*[-]?\\w*|"
+ AnybodyDmsCredentials.anybodyGroup);
static private Pattern userOrGroupNamePattern = Pattern
-
.compile("^@@([0-9]*)|@@([a-zA-Z]\\w*[-]?\\w*)|(?:[a-zA-Z]\\w*[-]?\\w*)|(?:[a-zA-Z]\\w*[-]?\\w*/){0,2}@[a-zA-Z]\\w*[-]?\\w*|"
+
.compile("^@@([0-9]*)|@@([a-zA-Z]\\w*[-]?\\w*)|(?:[a-zA-Z]\\w*[-]?\\w*)|(?:[a-zA-Z]\\w*[-]?\\w*/){0,2}@[@]?[a-zA-Z]\\w*[-]?\\w*|"
+ AnybodyDmsCredentials.anybodyGroup);
static private Pattern taskNamePattern = Pattern
- [idok-commit] idok commit r360 - in trunk/java/ch/idok: qtgui service/server/admin, AFS account Florian Huebner, 04/29/2009
Archive powered by MHonArc 2.6.19.