~ubuntu-branches/ubuntu/oneiric/kde-workspace/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/0023-fix-kiosk-restrictions-for-user-switching-and-logout.patch

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2011-09-25 00:42:41 UTC
  • Revision ID: package-import@ubuntu.com-20110925004241-c5ck55dokn3yt1kg
Tags: 4:4.7.1-0ubuntu3
* Update debian/kdm.upstart to match latest gdm.upstart improvements:
  - Also export LC_MESSAGES with the rest of locale information
  - When kdm is shut down by a runlevel call, emit an upstart event that can
    be caught by plymouth so it can distinguish between the DM shutting down
    for a runlevel change vs. other causes (LP: #854329)
* Update patches for post-4.7.1 changes.  Add to debian/patches:
    0001-SVN_SILENT-made-messages-.desktop-file.patch
    0003-SVN_SILENT-made-messages-.desktop-file.patch
    0004-SVN_SILENT-made-messages-.desktop-file.patch
    0005-SVN_SILENT-made-messages-.desktop-file.patch
    0006-preferred-app-launchers-need-to-use-the-type-of-the-.patch
    0007-SVN_SILENT-made-messages-.desktop-file.patch
    0009-SVN_SILENT-made-messages-.desktop-file.patch
    0010-add-some-missing-connects-for-the-ruleswidget.patch
    0011-fix-yet-another-fun-with-pointers-tabbing-segfault.patch
    0013-catch-changeMaximize-recursion-from-setNoBorder.patch
    0014-Clear-thumbnails-for-deleted-windows.patch
    0015-Fix-pointer-accesses-in-tiling-code.patch
    0016-SVN_SILENT-made-messages-.desktop-file.patch
    0017-SVN_SILENT-made-messages-.desktop-file.patch
    0018-SVN_SILENT-made-messages-.desktop-file.patch
    0019-Test-for-widget-creation-before-deleting-property-at.patch
    0020-SVN_SILENT-made-messages-.desktop-file.patch
    0023-fix-kiosk-restrictions-for-user-switching-and-logout.patch
    0024-Fix-typo-use-the-right-signal-signature.patch
    0025-Repaint-old-area-of-the-thumbnail.patch
    0026-Use-Client-layoutMetric-to-access-shadowSize-instead.patch
    0027-ShowCalendarPopup-false-suppresses-calendar-popup-an.patch
    0028-show-the-keyboard-on-immediately-entering-a-text-are.patch
    0029-Repaint-the-whole-window-in-the-taskbar-thumbnail.patch
    0030-SVN_SILENT-made-messages-.desktop-file.patch
    0031-Fix-wrong-inital-tab-in-keyboard-kcm.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 6747d98264646f123b6da33f36e063eeb5f1fe4a Mon Sep 17 00:00:00 2001
 
2
From: Aaron Seigo <aseigo@kde.org>
 
3
Date: Fri, 16 Sep 2011 13:29:00 +0200
 
4
Subject: [PATCH 23/31] fix kiosk restrictions for user switching and logout
 
5
 
 
6
it was using authorizeKAction, which means the keys would be "action/logout" while documentation
 
7
clearly states it is just "logout". that is now fixed, including keeping support for "action/logout"
 
8
so as not to break existing configurations.
 
9
 
 
10
switch_user simply wasn't being checked at all, now it is.
 
11
---
 
12
 plasma/desktop/applets/kickoff/core/leavemodel.cpp |   15 +++++++++------
 
13
 1 files changed, 9 insertions(+), 6 deletions(-)
 
14
 
 
15
diff --git a/plasma/desktop/applets/kickoff/core/leavemodel.cpp b/plasma/desktop/applets/kickoff/core/leavemodel.cpp
 
16
index bf89932..7a7e4c6 100644
 
17
--- a/plasma/desktop/applets/kickoff/core/leavemodel.cpp
 
18
+++ b/plasma/desktop/applets/kickoff/core/leavemodel.cpp
 
19
@@ -118,19 +118,20 @@ void LeaveModel::updateModel()
 
20
     QStandardItem *sessionOptions = new QStandardItem(i18n("Session"));
 
21
 
 
22
     // Logout
 
23
-    if ( KAuthorized::authorizeKAction( "logout" ) ) {
 
24
+    const bool canLogout = KAuthorized::authorizeKAction("logout") && KAuthorized::authorize("logout");
 
25
+    if (canLogout) {
 
26
         QStandardItem *logoutOption = createStandardItem("leave:/logoutonly");
 
27
         sessionOptions->appendRow(logoutOption);
 
28
     }
 
29
 
 
30
     // Lock
 
31
-    if ( KAuthorized::authorizeKAction( "lock_screen" ) ) {
 
32
+    if (KAuthorized::authorizeKAction("lock_screen") && KAuthorized::authorize("logout")) {
 
33
         QStandardItem *lockOption = createStandardItem("leave:/lock");
 
34
         sessionOptions->appendRow(lockOption);
 
35
     }
 
36
 
 
37
     // Save Session
 
38
-    if ( KAuthorized::authorizeKAction( "logout" ) ) {
 
39
+    if (canLogout) {
 
40
         KConfigGroup c(KSharedConfig::openConfig("ksmserverrc", KConfig::NoGlobals), "General");
 
41
         if (c.readEntry("loginMode") == "restoreSavedSession") {
 
42
             QStandardItem *saveSessionOption = createStandardItem("leave:/savesession");
 
43
@@ -139,8 +140,10 @@ void LeaveModel::updateModel()
 
44
     }
 
45
 
 
46
     // Switch User
 
47
-    QStandardItem *switchUserOption = createStandardItem("leave:/switch");
 
48
-    sessionOptions->appendRow(switchUserOption);
 
49
+    if (KAuthorized::authorize(QLatin1String("switch_user")))  {
 
50
+        QStandardItem *switchUserOption = createStandardItem("leave:/switch");
 
51
+        sessionOptions->appendRow(switchUserOption);
 
52
+    }
 
53
 
 
54
     // System Options
 
55
     QStandardItem *systemOptions = new QStandardItem(i18n("System"));
 
56
@@ -148,7 +151,7 @@ void LeaveModel::updateModel()
 
57
 
 
58
 //FIXME: the proper fix is to implement the KWorkSpace methods for Windows
 
59
 #ifndef Q_WS_WIN
 
60
-    if ( KAuthorized::authorizeKAction( "logout" ) ) {
 
61
+    if (canLogout) {
 
62
         QSet< Solid::PowerManagement::SleepState > spdMethods = Solid::PowerManagement::supportedSleepStates();
 
63
         if (spdMethods.contains(Solid::PowerManagement::StandbyState)) {
 
64
             QStandardItem *standbyOption = createStandardItem("leave:/standby");
 
65
-- 
 
66
1.7.4.1
 
67