system-config-printer/system-config-printer-proxy-auth.patch
2009-08-28 15:46:25 +00:00

51 lines
2.7 KiB
Diff

diff -up system-config-printer-1.1.12/jobviewer.py.proxy-auth system-config-printer-1.1.12/jobviewer.py
--- system-config-printer-1.1.12/jobviewer.py.proxy-auth 2009-08-28 16:40:54.624947867 +0100
+++ system-config-printer-1.1.12/jobviewer.py 2009-08-28 16:42:01.430823181 +0100
@@ -604,10 +604,8 @@ class JobViewer (GtkGUI, monitor.Watcher
else:
(serverport, rest) = urllib.splithost (rest)
(server, port) = urllib.splitnport (serverport)
- username = pwd.getpwuid (os.getuid ())[0]
keyring_attrs.update ({ "server": str (server.lower ()),
- "protocol": str (scheme),
- "user": str (username)})
+ "protocol": str (scheme)})
if job in self.authenticated_jobs:
# We've already tried to authenticate this job before.
@@ -656,19 +654,9 @@ class JobViewer (GtkGUI, monitor.Watcher
c._end_operation ()
nonfatalException ()
- self.display_auth_info_dialog (job)
-
- def on_auth_notification_closed (self, notification, reason=None):
- job = notification.get_data ('job-id')
- debugprint ("auth notification closed for job %s" % job)
- self.auth_notifications[job].set_data ('closed', True)
- del self.auth_notifications[job]
-
- def on_auth_notification_authenticate (self, notification, action):
- job = notification.get_data ('job-id')
- keyring_attrs = notification.get_data ('keyring-attrs')
- debugprint ("auth notification authenticate for job %s" % job)
- self.display_auth_info_dialog (job, keyring_attrs)
+ username = pwd.getpwuid (os.getuid ())[0]
+ keyring_attrs["user"] = str (username)
+ self.display_auth_info_dialog (job, keyring_attrs)
def display_auth_info_dialog (self, job, keyring_attrs=None):
data = self.jobs[job]
@@ -759,8 +747,9 @@ class JobViewer (GtkGUI, monitor.Watcher
attrs.get ("protocol"))
ind = auth_info_required.index ('password')
secret = auth_info[ind]
- gnomekeyring.item_create_sync (keyring, type, name,
- attrs, secret, True)
+ id = gnomekeyring.item_create_sync (keyring, type, name,
+ attrs, secret, True)
+ debugprint ("keyring: created id %d for %s" % (id, name))
except:
nonfatalException ()