summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/kerberostray.desktop2
-rw-r--r--src/toplevel.cpp29
-rw-r--r--src/toplevel.h2
3 files changed, 30 insertions, 3 deletions
diff --git a/src/kerberostray.desktop b/src/kerberostray.desktop
index 71827a0..f44e971 100644
--- a/src/kerberostray.desktop
+++ b/src/kerberostray.desktop
@@ -8,4 +8,4 @@ Terminal=false
DocPath=kerberostray/index.html
X-KDE-StartupNotify=true
X-DCOP-ServiceType=Multi
-Categories=Qt;KDE;Utilities;
+Categories=Qt;KDE;Utility;
diff --git a/src/toplevel.cpp b/src/toplevel.cpp
index ed58951..99cb1f7 100644
--- a/src/toplevel.cpp
+++ b/src/toplevel.cpp
@@ -51,6 +51,7 @@
#include <kdialogbase.h>
#include <kaction.h>
#include <knotifydialog.h>
+#include <klineeditdlg.h>
#include <libtdeldap.h>
#include "configdlg.h"
@@ -67,6 +68,7 @@ TopLevel::TopLevel() : KSystemTray(), ticketWatch(0), m_refreshTimer(0), notifyE
getNewTGTAct = new KAction(i18n("&Obtain New Ticket Granting Ticket"), "add_user", 0, TQT_TQOBJECT(this), TQT_SLOT(getNewTGT()), actionCollection(), "getnewtgt");
getNewSTAct = new KAction(i18n("&Obtain New Primary Service Ticket"), "add_user", 0, TQT_TQOBJECT(this), TQT_SLOT(getNewServiceTicket()), actionCollection(), "getnewserviceticket");
+ getNewStandardSTAct = new KAction(i18n("&Obtain Authenticated Service Ticket"), "add_user", 0, TQT_TQOBJECT(this), TQT_SLOT(getNewServiceTicketWithExistingCreds()), actionCollection(), "getstandardserviceticket");
destroyAllAct = new KAction(i18n("&Destroy All Tickets"), "delete_user", 0, TQT_TQOBJECT(this), TQT_SLOT(destroyAllTickets()), actionCollection(), "destroyall");
confAct = new KAction(i18n("&Configure..."), "configure", 0, TQT_TQOBJECT(this), TQT_SLOT(config()), actionCollection(), "configure");
@@ -80,6 +82,7 @@ TopLevel::TopLevel() : KSystemTray(), ticketWatch(0), m_refreshTimer(0), notifyE
menu->insertSeparator();
getNewTGTAct->plug(menu);
getNewSTAct->plug(menu);
+ getNewStandardSTAct->plug(menu);
destroyAllAct->plug(menu);
menu->insertSeparator();
confAct->plug(menu);
@@ -161,6 +164,15 @@ void TopLevel::updateTicketList() {
ticketWatch->startScan();
}
+ if (m_ticketList.count() > 0) {
+ getNewStandardSTAct->setEnabled(true);
+ destroyAllAct->setEnabled(true);
+ }
+ else {
+ getNewStandardSTAct->setEnabled(false);
+ destroyAllAct->setEnabled(false);
+ }
+
repaint();
}
@@ -231,6 +243,19 @@ void TopLevel::getNewServiceTicket() {
getNewTicket(true);
}
+void TopLevel::getNewServiceTicketWithExistingCreds() {
+ TQString errorstring;
+ TQString service;
+
+ bool ok;
+ service = KLineEditDlg::getText(i18n("Enter the name of the Kerberos service principal you wish to obtain"), TQString::null, &ok, this);
+ if (ok) {
+ if (LDAPManager::obtainKerberosServiceTicket(service, &errorstring) != 0) {
+ KMessageBox::error(this, i18n("<qt>Failed to obtain service ticket<p>%1</qt>").arg(errorstring), i18n("Failed to obtain Kerberos service ticket"));
+ }
+ }
+}
+
void TopLevel::destroyAllTickets() {
if (system("kdestroy --all") != 0) {
KMessageBox::error(this, i18n("Unable to destroy tickets!"), i18n("Internal Error"));
@@ -238,7 +263,7 @@ void TopLevel::destroyAllTickets() {
updateTicketList();
}
-void TopLevel::resizeEvent ( TQResizeEvent * )
+void TopLevel::resizeEvent (TQResizeEvent *)
{
activeTicketsPixmap = loadSizedIcon("kerberos_activetickets", width());
noTicketsPixmap = loadSizedIcon("kerberos_notickets", width());
@@ -357,7 +382,7 @@ void TopLevel::showTicketList() {
TQString listText = "<qt>";
updateTicketList();
if (m_ticketList.count() <= 0) {
- listText += "<i>No Kerberos tickets to display!</i>";
+ listText += "No Kerberos tickets available";
}
else {
i = 1;
diff --git a/src/toplevel.h b/src/toplevel.h
index aedd1c7..081adb6 100644
--- a/src/toplevel.h
+++ b/src/toplevel.h
@@ -68,6 +68,7 @@ private slots:
void updateMenu();
void getNewTGT();
void getNewServiceTicket();
+ void getNewServiceTicketWithExistingCreds();
void getNewTicket(bool requestServiceTicket=false);
void destroyAllTickets();
void showTicketList();
@@ -82,6 +83,7 @@ private:
KAction *confAct;
KAction *getNewTGTAct;
KAction *getNewSTAct;
+ KAction *getNewStandardSTAct;
KAction *destroyAllAct;
TQPopupMenu *menu;
TQString lastTip;