Update enterIdentity handler to support passing and setting ticket options.
authorJustin Anderson <jander@mit.edu>
Wed, 1 Oct 2008 20:38:26 +0000 (20:38 +0000)
committerJustin Anderson <jander@mit.edu>
Wed, 1 Oct 2008 20:38:26 +0000 (20:38 +0000)
Readded ticket options sheet to Enter Identity dialog.
Added helper methods to convert between kim_option and NSDictionary.

ticket: 6055

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20797 dc483132-0cff-0310-8789-dd5450dbe970

src/kim/agent/mac/AuthenticationController.h
src/kim/agent/mac/AuthenticationController.m
src/kim/agent/mac/IPCClient.h
src/kim/agent/mac/IPCClient.m
src/kim/agent/mac/Identities.m
src/kim/agent/mac/KIMUtilities.h
src/kim/agent/mac/KIMUtilities.m
src/kim/agent/mac/KerberosAgentListener.h
src/kim/agent/mac/KerberosAgentListener.m
src/kim/agent/mac/ServerDemux.m
src/kim/agent/mac/resources/English.lproj/Authentication.xib

index 5fcb612c08bdedb42707672264150cc8f7eb61e9..ed5d9d79a17deb14cca93ce76712089853bf9616 100644 (file)
     IBOutlet NSButton *rememberPasswordInKeychainCheckBox;
     
     IBOutlet NSObjectController *glueController;
+
+    IBOutlet NSWindow *ticketOptionsSheet;
+    IBOutlet NSObjectController *ticketOptionsController;
+    
+    IBOutlet NSSlider *validLifetimeSlider;
+    IBOutlet NSSlider *renewableLifetimeSlider;
 }
 
 @property (readwrite, retain) IPCClient *associatedClient;
 - (IBAction) changePassword: (id) sender;
 - (IBAction) showedError: (id) sender;
 
+- (IBAction) sliderDidChange: (id) sender;
+
+- (IBAction) showTicketOptions: (id) sender;
+- (IBAction) cancelTicketOptions: (id) sender;
+- (IBAction) saveTicketOptions: (id) sender;
+
+- (void) sheetDidEnd: (NSWindow *) sheet 
+          returnCode: (int) returnCode 
+         contextInfo: (void *) contextInfo;
+
 @end
index 6a9b668bb38273afa4b0a753cf978b2e1d7b07bb..1756e5aabf242b14ff171f56a53f089fdad594ec 100644 (file)
 #define enable_prompt_ok_keypath     @"content.isPromptValid"
 #define change_password_ok_keypath   @"content.isChangePasswordValid"
 
+#define options_keypath              @"content.options"
+
 #define valid_lifetime_keypath       @"content.valid_lifetime"
 #define renewal_lifetime_keypath     @"content.renewal_lifetime"
 #define renewable_keypath            @"content.renewable"
 #define addressless_keypath          @"content.addressless"
 #define forwardable_keypath          @"content.forwardable"
 
-#define max_valid_lifetime_keypath   @"content.max_valid_lifetime"
-#define min_valid_lifetime_keypath   @"content.min_valid_lifetime"
-#define max_renewal_lifetime_keypath @"content.max_renewal_lifetime"
-#define min_renewal_lifetime_keypath @"content.min_renewal_lifetime"
-
+#define min_valid_keypath            @"content.minValidLifetime"
+#define max_valid_keypath            @"content.maxValidLifetime"
+#define min_renewable_keypath        @"content.minRenewableLifetime"
+#define max_renewable_keypath        @"content.maxRenewableLifetime"
 
 #define ACKVOContext                 @"authenticationController"
 
 
 - (void) awakeFromNib
 {
+    [[self window] center];
+    // We need to float over the loginwindow and SecurityAgent so use its hardcoded level.
+    [[self window] setLevel:2003];
+    
     [glueController addObserver:self 
                      forKeyPath:username_keypath 
                         options:NSKeyValueObservingOptionNew 
                         options:NSKeyValueObservingOptionNew
                         context:ACKVOContext];
     
-    [[self window] center];
-    // We need to float over the loginwindow and SecurityAgent so use its hardcoded level.
-    [[self window] setLevel:2003];
 }
 
 - (void) dealloc
     [self showWindow:nil];
 }
 
+- (IBAction) sliderDidChange: (id) sender
+{
+    NSInteger increment = 0;
+    NSInteger newValue = 0;
+    NSString *keyPath = nil;
+    if ([sender isEqual:validLifetimeSlider]) {
+        increment = VALID_LIFETIME_INCREMENT;
+        keyPath = valid_lifetime_keypath;
+    }
+    else if ([sender isEqual:renewableLifetimeSlider]) {
+        increment = RENEWABLE_LIFETIME_INCREMENT;
+        keyPath = renewal_lifetime_keypath;
+    }
+    if (increment > 0) {
+        newValue = ([sender integerValue] / increment) * increment;
+        [ticketOptionsController setValue:[NSNumber numberWithInteger:newValue] 
+                               forKeyPath:keyPath];
+    }
+}
+
+- (IBAction) showTicketOptions: (id) sender
+{
+    // use a copy of the current options
+    [ticketOptionsController setContent:
+     [[[glueController valueForKeyPath:options_keypath] mutableCopy] autorelease]];
+    
+    [ticketOptionsController setValue:[NSNumber numberWithInteger:[KIMUtilities minValidLifetime]]
+                           forKeyPath:min_valid_keypath];
+    [ticketOptionsController setValue:[NSNumber numberWithInteger:[KIMUtilities maxValidLifetime]]
+                           forKeyPath:max_valid_keypath];
+    [ticketOptionsController setValue:[NSNumber numberWithInteger:[KIMUtilities minRenewableLifetime]]
+                           forKeyPath:min_renewable_keypath];
+    [ticketOptionsController setValue:[NSNumber numberWithInteger:[KIMUtilities maxRenewableLifetime]]
+                           forKeyPath:max_renewable_keypath];
+
+    [validLifetimeSlider setIntegerValue:
+     [[ticketOptionsController valueForKeyPath:valid_lifetime_keypath] integerValue]];
+    [renewableLifetimeSlider setIntegerValue:
+     [[ticketOptionsController valueForKeyPath:renewal_lifetime_keypath] integerValue]];
+    [self sliderDidChange:validLifetimeSlider];
+    [self sliderDidChange:renewableLifetimeSlider];
+    
+    [NSApp beginSheet:ticketOptionsSheet
+       modalForWindow:[self window]
+        modalDelegate:self 
+       didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
+          contextInfo:NULL];
+}
+
+- (IBAction) cancelTicketOptions: (id) sender
+{
+    [NSApp endSheet:ticketOptionsSheet returnCode:NSUserCancelledError];
+}
+
+- (IBAction) saveTicketOptions: (id) sender
+{
+    [NSApp endSheet:ticketOptionsSheet];
+}
+
+- (void) sheetDidEnd: (NSWindow *) sheet 
+          returnCode: (int) returnCode 
+         contextInfo: (void *) contextInfo
+{
+    if (returnCode == NSUserCancelledError) {
+        // discard new options
+        [ticketOptionsController setContent:nil];
+    } else {
+        // replace existing options with new
+        [glueController setValue:[ticketOptionsController content] forKeyPath:options_keypath];
+    }
+    [ticketOptionsSheet orderOut:nil];
+}
+
 - (IBAction) cancel: (id) sender
 {
     [associatedClient didCancel];
     NSString *usernameString = [glueController valueForKeyPath:username_keypath];
     NSString *realmString = [glueController valueForKeyPath:realm_keypath];
     NSString *identityString = [NSString stringWithFormat:@"%@@%@", usernameString, realmString];
+    NSDictionary *options = [glueController valueForKeyPath:options_keypath];
+    NSLog(@"%s options == %@", __FUNCTION__, options);
     
     // the principal must already be valid to get this far
-    [associatedClient didEnterIdentity:identityString];
+    [associatedClient didEnterIdentity:identityString options:options];
 }
 
 - (IBAction) answerAuthPrompt: (id) sender
index 531f7cbe4a4d40c0ba996bc0c14347d96ea362e7..6a0654e98548f4412f3ec1a8596008ea1983cc5d 100644 (file)
@@ -41,7 +41,7 @@
 
 - (void) didCancel;
 - (void) didSelectIdentity: (NSString *) identityString;
-- (void) didEnterIdentity: (NSString *) identityString;
+- (void) didEnterIdentity: (NSString *) identityString options: (NSDictionary *) options;
 - (void) didPromptForAuth: (NSString *) responseString saveResponse: (NSNumber *) saveResponse;
 - (void) didChangePassword: (NSString *) oldPassword
                newPassword: (NSString *) newPassword
index 4cb10fc2746b508bfa781ebdc92bdfcc1213d50a..c49e35d04affb01a1d6f5b15106481339e6d53ab 100644 (file)
@@ -124,9 +124,10 @@ enum krb_agent_client_state {
     return 0;
 }
 
-- (void) didEnterIdentity: (NSString *) identityString
+- (void) didEnterIdentity: (NSString *) identityString options: (NSDictionary *) options
 {
     [self.currentInfo setObject:identityString forKey:@"identity_string"];
+    [self.currentInfo setObject:options forKey:@"options"];
     [KerberosAgentListener didEnterIdentity:self.currentInfo error:0];
 }
 
index 5dcd32939cd2de4a467a06f15914b757346c8c45..2ead4e5e88842ea0278e8491465c40ac11df04ed 100644 (file)
@@ -25,9 +25,6 @@
 #import "Identities.h"
 #import <Kerberos/Kerberos.h>
 
-#define VALID_LIFETIME_INCREMENT (5 * 60)
-#define RENEWABLE_LIFETIME_INCREMENT (15 * 60)
-
 @interface Identity ()
 
 - (NSString *)stringForLifetime:(NSUInteger)lifetime;
index 9b735b3e22cae35df3ea6eb37081ac5f3b72d669..49871d9e6d2e155c2fe02aae246b875913038f45 100644 (file)
@@ -9,9 +9,12 @@
 #import <Cocoa/Cocoa.h>
 #import <Kerberos/kim.h>
 
+#define VALID_LIFETIME_INCREMENT (5 * 60)
+#define RENEWABLE_LIFETIME_INCREMENT (15 * 60)
+
 #define log_kim_error_to_console(err)\
 {\
-NSLog(@"%s got error %@", _cmd, [KIMUtilities stringForLastKIMError:err]);\
+NSLog(@"%s got error %@", __FUNCTION__, [KIMUtilities stringForLastKIMError:err]);\
 } while (0);
 
 @interface KIMUtilities : NSObject
@@ -21,4 +24,13 @@ NSLog(@"%s got error %@", _cmd, [KIMUtilities stringForLastKIMError:err]);\
 + (BOOL) validatePrincipalWithName: (NSString *) name
                              realm: (NSString *) realm;
 
++ (NSDictionary *) dictionaryForKimOptions: (kim_options) options;
+
++ (kim_options) kimOptionsForDictionary: (NSDictionary *) aDict;
+
++ (NSUInteger)minValidLifetime;
++ (NSUInteger)maxValidLifetime;
++ (NSUInteger)minRenewableLifetime;
++ (NSUInteger)maxRenewableLifetime;
+
 @end
index 1326c137fa94adde87af4ce50eda66cd2dc7612c..9319e676ae021bcc64c70b670c1cd6208e4a807c 100644 (file)
     return (err == KIM_NO_ERROR);
 }
 
++ (NSDictionary *) dictionaryForKimOptions: (kim_options) options
+{
+    kim_error err = KIM_NO_ERROR;
+    NSMutableDictionary *newDict = [NSMutableDictionary dictionaryWithCapacity:8];
+    kim_boolean addressless = FALSE;
+    kim_boolean forwardable = FALSE;
+    kim_boolean proxiable = FALSE;
+    kim_boolean renewable = FALSE;
+    kim_lifetime valid_lifetime = 0;
+    kim_lifetime renewal_lifetime = 0;
+    kim_string service_name = NULL;
+    kim_time start_time = 0;
+    
+    if (!err) {
+        err = kim_options_get_addressless(options, &addressless);
+    }
+    if (!err) {
+        [newDict setValue:[NSNumber numberWithBool:addressless] 
+                                            forKey:@"addressless"];
+    }
+    if (!err) {
+        err = kim_options_get_forwardable(options, &forwardable);
+    }
+    if (!err) {
+        [newDict setValue:[NSNumber numberWithBool:forwardable] 
+                                            forKey:@"forwardable"];
+    }
+    if (!err) {
+        err = kim_options_get_proxiable(options, &proxiable);
+    }
+    if (!err) {
+        [newDict setValue:[NSNumber numberWithBool:proxiable] 
+                                            forKey:@"proxiable"];
+    }
+    if (!err) {
+        err = kim_options_get_renewable(options, &renewable);
+    }
+    if (!err) {
+        [newDict setValue:[NSNumber numberWithBool:renewable] 
+                                            forKey:@"renewable"];
+    }
+    if (!err) {
+        err = kim_options_get_lifetime(options, &valid_lifetime);
+    }
+    if (!err) {
+        [newDict setValue:[NSNumber numberWithInteger:valid_lifetime] 
+                                               forKey:@"valid_lifetime"];
+    }
+    if (!err) {
+        err = kim_options_get_renewal_lifetime(options, &renewal_lifetime);
+    }
+    if (!err) {
+        [newDict setValue:[NSNumber numberWithInteger:renewal_lifetime] 
+                                               forKey:@"renewal_lifetime"];
+    }
+    if (!err) {
+        err = kim_options_get_service_name(options, &service_name);
+    }
+    if (!err) {
+        [newDict setValue:(service_name) ? 
+         [NSString stringWithUTF8String:service_name] : @""
+                   forKey:@"service_name"];
+    }
+    if (!err) {
+        err = kim_options_get_start_time(options, &start_time);
+    }
+    if (!err) {
+        [newDict setValue:[NSNumber numberWithInteger:start_time] 
+                   forKey:@"start_time"];
+    }
+
+    return newDict;
+}
+
++ (kim_options) kimOptionsForDictionary: (NSDictionary *) aDict
+{
+    kim_error err = KIM_NO_ERROR;
+    kim_options options = NULL;
+    kim_boolean addressless = [[aDict valueForKey:@"addressless"] boolValue];
+    kim_boolean forwardable = [[aDict valueForKey:@"forwardable"] boolValue];
+    kim_boolean proxiable = [[aDict valueForKey:@"proxiable"] boolValue];
+    kim_boolean renewable = [[aDict valueForKey:@"renewable"] boolValue];
+    kim_lifetime valid_lifetime = [[aDict valueForKey:@"valid_lifetime"] integerValue];
+    kim_lifetime renewal_lifetime = [[aDict valueForKey:@"renewal_lifetime"] integerValue];
+    kim_string service_name = ([[aDict valueForKey:@"service_name"] length] > 0) ?
+                               [[aDict valueForKey:@"service_name"] UTF8String] : NULL;
+    kim_time start_time = [[aDict valueForKey:@"start_time"] integerValue];
+    
+    if (!err) {
+        err = kim_options_create (&options);
+    }
+    if (!err) {
+        err = kim_options_set_addressless(options, addressless);
+    }
+    if (!err) {
+        err = kim_options_set_forwardable(options, forwardable);
+    }
+    if (!err) {
+        err = kim_options_set_proxiable(options, proxiable);
+    }
+    if (!err) {
+        err = kim_options_set_renewable(options, renewable);
+    }
+    if (!err) {
+        err = kim_options_set_lifetime(options, valid_lifetime);
+    }
+    if (!err) {
+        err = kim_options_set_renewal_lifetime(options, renewal_lifetime);
+    }
+    if (!err) {
+        err = kim_options_set_service_name(options, service_name);
+    }
+    if (!err) {
+        err = kim_options_set_start_time(options, start_time);
+    }
+    
+    return options;
+}
+
++ (NSUInteger)minValidLifetime
+{
+    kim_error err = KIM_NO_ERROR;
+    kim_preferences prefs = NULL;
+    kim_lifetime value = 0;
+    
+    err = kim_preferences_create(&prefs);
+    
+    if (!err) {
+        kim_preferences_get_minimum_lifetime(prefs, &value);
+    }
+    
+    return (NSUInteger) value;
+}
+
++ (NSUInteger)maxValidLifetime
+{
+    kim_error err = KIM_NO_ERROR;
+    kim_preferences prefs = NULL;
+    kim_lifetime value = 0;
+    
+    err = kim_preferences_create(&prefs);
+    
+    if (!err) {
+        kim_preferences_get_maximum_lifetime(prefs, &value);
+    }
+    
+    return (NSUInteger) value;
+}
+
++ (NSUInteger)minRenewableLifetime
+{
+    kim_error err = KIM_NO_ERROR;
+    kim_preferences prefs = NULL;
+    kim_lifetime value = 0;
+    
+    err = kim_preferences_create(&prefs);
+    
+    if (!err) {
+        kim_preferences_get_minimum_renewal_lifetime(prefs, &value);
+    }
+    
+    return (NSUInteger) value;
+}
+
++ (NSUInteger)maxRenewableLifetime
+{
+    kim_error err = KIM_NO_ERROR;
+    kim_preferences prefs = NULL;
+    kim_lifetime value = 0;
+    
+    err = kim_preferences_create(&prefs);
+    
+    if (!err) {
+        kim_preferences_get_maximum_renewal_lifetime(prefs, &value);
+    }
+    
+    return (NSUInteger) value;
+}
+
 @end
index f58ce3324d70697844df12698ab719ab7e480069..3c0fc8ee36b6a88bc226c1e1ea55e2c7590c2152 100644 (file)
@@ -33,7 +33,8 @@
                 error: (int32_t) error;
 
 + (void) enterIdentityWithClientPort: (mach_port_t) client_port
-                           replyPort: (mach_port_t) reply_port;
+                           replyPort: (mach_port_t) reply_port
+                             options: (kim_options) options;
 
 // contains reply_port, kim_identity
 + (void) didEnterIdentity: (NSDictionary *) info 
index cc634e2cffe74fc94a32bfd7b6ad290e8874e826..fb87c02c3583d24cb1ffac8486e618fb04746e92 100644 (file)
@@ -131,10 +131,12 @@ static KerberosAgentListener *sharedListener = nil;
 
 + (void) enterIdentityWithClientPort: (mach_port_t) client_port
                            replyPort: (mach_port_t) reply_port
+                             options: (kim_options) options
 {
     NSDictionary *info = [[NSDictionary alloc] initWithObjectsAndKeys:
                           [NSNumber numberWithInteger:client_port], @"client_port",
                           [NSNumber numberWithInteger:reply_port], @"reply_port",
+                          [KIMUtilities dictionaryForKimOptions:options], @"options",
                           nil];
     [[NSApp delegate] performSelectorOnMainThread:@selector(enterIdentity:) 
                                        withObject:info
@@ -149,16 +151,15 @@ static KerberosAgentListener *sharedListener = nil;
     mach_port_t reply_port = [[info objectForKey:@"reply_port"] integerValue];
     kim_identity identity = NULL;
     kim_options options = NULL;
+    NSString *identityString = [info objectForKey:@"identity_string"];
     
-    if (!err) {
-        err = kim_identity_create_from_string (&identity, [[info objectForKey:@"identity_string"] UTF8String]);
+    if (identityString) {
+        err = kim_identity_create_from_string (&identity, [identityString UTF8String]);
     }
     
     if (!err) {
-#warning Placeholder for returning options
-        err = kim_options_create (&options);
-    }
-    
+        options = [KIMUtilities kimOptionsForDictionary:[info objectForKey:@"options"]];
+    }    
     if (!err) {
         err = kim_handle_reply_enter_identity(reply_port, identity, options, error);
     }
@@ -198,13 +199,18 @@ static KerberosAgentListener *sharedListener = nil;
     mach_port_t reply_port = [portNumber integerValue];
     kim_identity identity = NULL;
     kim_options options = NULL;
-    
-    err = kim_identity_create_from_string(&identity, (identityString) ? [identityString UTF8String] : "");
+    NSLog(@"%s", __FUNCTION__);
+
+    if (identityString) {
+        err = kim_identity_create_from_string(&identity, [identityString UTF8String]);
+    }
 
     if (!err) {
-#warning Placeholder for returning options
-        err = kim_options_create (&options);
+        options = [KIMUtilities kimOptionsForDictionary:[info objectForKey:@"options"]];
     }
+
+    log_kim_error_to_console(err);
+    log_kim_error_to_console(error);
     
     if (!err) {
         err = kim_handle_reply_select_identity(reply_port, identity, options, error);
index 3cda9be64604e44309288e214c663bdf1c4a407c..00b13c9c533bbd668d82fcf67aa5c9c9fa0d1f75 100644 (file)
@@ -26,6 +26,7 @@
 #import "kim_selection_hints_private.h"
 #import "kim_options_private.h"
 #import "KerberosAgentListener.h"
+#import "KIMUtilities.h"
 
 // ---------------------------------------------------------------------------
 
@@ -149,7 +150,8 @@ static int32_t kim_handle_request_enter_identity (mach_port_t   in_client_port,
     if (!err) {
         // performs selector on main thread
         [KerberosAgentListener enterIdentityWithClientPort:in_client_port 
-                                                 replyPort:in_reply_port];
+                                                 replyPort:in_reply_port
+                                                   options:options];
     }
     
     return err;   
index 6b2aad9cd01d1075912b7727d45ef4818ef69e4a..06056ee68a60aaa8fd2fdab631260c8f886c1eb8 100644 (file)
@@ -8,11 +8,12 @@
                <string key="IBDocument.HIToolboxVersion">352.00</string>
                <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
                        <bool key="EncodedWithXMLCoder">YES</bool>
-                       <integer value="300157"/>
-                       <integer value="300274"/>
-                       <integer value="300193"/>
                        <integer value="20"/>
+                       <integer value="300314"/>
+                       <integer value="300193"/>
                        <integer value="300175"/>
+                       <integer value="300274"/>
+                       <integer value="300420"/>
                </object>
                <object class="NSArray" key="IBDocument.PluginDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
                                <bool key="NSEditable">YES</bool>
                                <object class="_NSManagedProxy" key="_NSManagedProxy"/>
                        </object>
+                       <object class="NSObjectController" id="633725892">
+                               <object class="NSMutableArray" key="NSDeclaredKeys">
+                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                       <string>maxValidLifetime</string>
+                                       <string>minValidLifetime</string>
+                                       <string>validLifetime</string>
+                                       <string>valid_lifetime</string>
+                                       <string>minRenewableLifetime</string>
+                                       <string>maxRenewableLifetime</string>
+                                       <string>renewa</string>
+                                       <string>renewal_lifetime</string>
+                               </object>
+                               <bool key="NSEditable">YES</bool>
+                               <object class="_NSManagedProxy" key="_NSManagedProxy"/>
+                       </object>
                        <object class="NSCustomView" id="92892041">
                                <reference key="NSNextResponder"/>
                                <int key="NSvFlags">274</int>
                                        </object>
                                        <object class="NSPopUpButton" id="1016187493">
                                                <reference key="NSNextResponder" ref="92892041"/>
-                                               <int key="NSvFlags">-2147483356</int>
+                                               <int key="NSvFlags">292</int>
                                                <string key="NSFrame">{{20, 17}, {38, 26}}</string>
                                                <reference key="NSSuperview" ref="92892041"/>
                                                <bool key="NSEnabled">YES</bool>
                                                                                <string key="NSAction">_popUpItemAction:</string>
                                                                                <reference key="NSTarget" ref="690863814"/>
                                                                        </object>
+                                                                       <object class="NSMenuItem" id="744766544">
+                                                                               <reference key="NSMenu" ref="594991555"/>
+                                                                               <string type="base64-UTF8" key="NSTitle">Q2hhbmdlIFBhc3N3b3Jk4oCmA</string>
+                                                                               <string key="NSKeyEquiv"/>
+                                                                               <int key="NSMnemonicLoc">2147483647</int>
+                                                                               <reference key="NSOnImage" ref="530784694"/>
+                                                                               <reference key="NSMixedImage" ref="790891323"/>
+                                                                               <string key="NSAction">_popUpItemAction:</string>
+                                                                               <reference key="NSTarget" ref="690863814"/>
+                                                                       </object>
                                                                        <object class="NSMenuItem" id="917012637">
                                                                                <reference key="NSMenu" ref="594991555"/>
                                                                                <bool key="NSIsDisabled">YES</bool>
                                <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
                                <string key="NSWindowContentMinSize">{430, 283}</string>
                                <object class="NSView" key="NSWindowView" id="389112266">
-                                       <nil key="NSNextResponder"/>
+                                       <reference key="NSNextResponder"/>
                                        <int key="NSvFlags">256</int>
                                        <object class="NSMutableArray" key="NSSubviews">
                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                </object>
                                        </object>
                                        <string key="NSFrameSize">{430, 283}</string>
+                                       <reference key="NSSuperview"/>
                                </object>
                                <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
                                <string key="NSMinSize">{430, 305}</string>
                                        <int key="connectionID">300417</int>
                                </object>
                                <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">takeObjectValueFrom:</string>
-                                               <reference key="source" ref="332956369"/>
-                                               <reference key="destination" ref="594182616"/>
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">ticketOptionsSheet</string>
+                                               <reference key="source" ref="262677138"/>
+                                               <reference key="destination" ref="102029948"/>
                                        </object>
-                                       <int key="connectionID">300441</int>
+                                       <int key="connectionID">300468</int>
                                </object>
                                <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">takeObjectValueFrom:</string>
-                                               <reference key="source" ref="523287828"/>
-                                               <reference key="destination" ref="486016405"/>
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">ticketOptionsController</string>
+                                               <reference key="source" ref="262677138"/>
+                                               <reference key="destination" ref="633725892"/>
                                        </object>
-                                       <int key="connectionID">300442</int>
+                                       <int key="connectionID">300470</int>
                                </object>
                                <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="523287828"/>
-                                               <reference key="destination" ref="486016405"/>
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">maxValue: selection.maxValidLifetime</string>
+                                               <reference key="source" ref="486016405"/>
+                                               <reference key="destination" ref="633725892"/>
+                                               <object class="NSNibBindingConnector" key="connector" id="132072575">
+                                                       <reference key="NSSource" ref="486016405"/>
+                                                       <reference key="NSDestination" ref="633725892"/>
+                                                       <string key="NSLabel">maxValue: selection.maxValidLifetime</string>
+                                                       <string key="NSBinding">maxValue</string>
+                                                       <string key="NSKeyPath">selection.maxValidLifetime</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
                                        </object>
-                                       <int key="connectionID">300443</int>
+                                       <int key="connectionID">300472</int>
                                </object>
                                <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="332956369"/>
-                                               <reference key="destination" ref="594182616"/>
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">minValue: selection.minValidLifetime</string>
+                                               <reference key="source" ref="486016405"/>
+                                               <reference key="destination" ref="633725892"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="486016405"/>
+                                                       <reference key="NSDestination" ref="633725892"/>
+                                                       <string key="NSLabel">minValue: selection.minValidLifetime</string>
+                                                       <string key="NSBinding">minValue</string>
+                                                       <string key="NSKeyPath">selection.minValidLifetime</string>
+                                                       <reference key="NSPreviousConnector" ref="132072575"/>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
                                        </object>
-                                       <int key="connectionID">300444</int>
+                                       <int key="connectionID">300478</int>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBBindingConnection" key="connection">
                                                <string key="label">value: selection.forwardable</string>
                                                <reference key="source" ref="964499406"/>
-                                               <reference key="destination" ref="57033499"/>
+                                               <reference key="destination" ref="633725892"/>
                                                <object class="NSNibBindingConnector" key="connector">
                                                        <reference key="NSSource" ref="964499406"/>
-                                                       <reference key="NSDestination" ref="57033499"/>
+                                                       <reference key="NSDestination" ref="633725892"/>
                                                        <string key="NSLabel">value: selection.forwardable</string>
                                                        <string key="NSBinding">value</string>
                                                        <string key="NSKeyPath">selection.forwardable</string>
                                                        <int key="NSNibBindingConnectorVersion">2</int>
                                                </object>
                                        </object>
-                                       <int key="connectionID">300445</int>
+                                       <int key="connectionID">300481</int>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBBindingConnection" key="connection">
                                                <string key="label">value: selection.addressless</string>
                                                <reference key="source" ref="198913348"/>
-                                               <reference key="destination" ref="57033499"/>
+                                               <reference key="destination" ref="633725892"/>
                                                <object class="NSNibBindingConnector" key="connector">
                                                        <reference key="NSSource" ref="198913348"/>
-                                                       <reference key="NSDestination" ref="57033499"/>
+                                                       <reference key="NSDestination" ref="633725892"/>
                                                        <string key="NSLabel">value: selection.addressless</string>
                                                        <string key="NSBinding">value</string>
                                                        <string key="NSKeyPath">selection.addressless</string>
                                                        <int key="NSNibBindingConnectorVersion">2</int>
                                                </object>
                                        </object>
-                                       <int key="connectionID">300446</int>
+                                       <int key="connectionID">300482</int>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBBindingConnection" key="connection">
                                                <string key="label">value: selection.renewable</string>
                                                <reference key="source" ref="368169141"/>
-                                               <reference key="destination" ref="57033499"/>
+                                               <reference key="destination" ref="633725892"/>
                                                <object class="NSNibBindingConnector" key="connector">
                                                        <reference key="NSSource" ref="368169141"/>
-                                                       <reference key="NSDestination" ref="57033499"/>
+                                                       <reference key="NSDestination" ref="633725892"/>
                                                        <string key="NSLabel">value: selection.renewable</string>
                                                        <string key="NSBinding">value</string>
                                                        <string key="NSKeyPath">selection.renewable</string>
                                                        <int key="NSNibBindingConnectorVersion">2</int>
                                                </object>
                                        </object>
-                                       <int key="connectionID">300447</int>
+                                       <int key="connectionID">300483</int>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBBindingConnection" key="connection">
-                                               <string key="label">enabled: selection.renewable</string>
+                                               <string key="label">maxValue: selection.maxRenewableLifetime</string>
                                                <reference key="source" ref="594182616"/>
-                                               <reference key="destination" ref="57033499"/>
-                                               <object class="NSNibBindingConnector" key="connector">
+                                               <reference key="destination" ref="633725892"/>
+                                               <object class="NSNibBindingConnector" key="connector" id="728670834">
                                                        <reference key="NSSource" ref="594182616"/>
-                                                       <reference key="NSDestination" ref="57033499"/>
-                                                       <string key="NSLabel">enabled: selection.renewable</string>
-                                                       <string key="NSBinding">enabled</string>
-                                                       <string key="NSKeyPath">selection.renewable</string>
+                                                       <reference key="NSDestination" ref="633725892"/>
+                                                       <string key="NSLabel">maxValue: selection.maxRenewableLifetime</string>
+                                                       <string key="NSBinding">maxValue</string>
+                                                       <string key="NSKeyPath">selection.maxRenewableLifetime</string>
                                                        <int key="NSNibBindingConnectorVersion">2</int>
                                                </object>
                                        </object>
-                                       <int key="connectionID">300450</int>
+                                       <int key="connectionID">300494</int>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBBindingConnection" key="connection">
-                                               <string key="label">maxValue: selection.max_renewal_lifetime</string>
+                                               <string key="label">minValue: selection.minRenewableLifetime</string>
                                                <reference key="source" ref="594182616"/>
-                                               <reference key="destination" ref="57033499"/>
-                                               <object class="NSNibBindingConnector" key="connector" id="970138044">
+                                               <reference key="destination" ref="633725892"/>
+                                               <object class="NSNibBindingConnector" key="connector">
                                                        <reference key="NSSource" ref="594182616"/>
-                                                       <reference key="NSDestination" ref="57033499"/>
-                                                       <string key="NSLabel">maxValue: selection.max_renewal_lifetime</string>
-                                                       <string key="NSBinding">maxValue</string>
-                                                       <string key="NSKeyPath">selection.max_renewal_lifetime</string>
+                                                       <reference key="NSDestination" ref="633725892"/>
+                                                       <string key="NSLabel">minValue: selection.minRenewableLifetime</string>
+                                                       <string key="NSBinding">minValue</string>
+                                                       <string key="NSKeyPath">selection.minRenewableLifetime</string>
+                                                       <reference key="NSPreviousConnector" ref="728670834"/>
                                                        <int key="NSNibBindingConnectorVersion">2</int>
                                                </object>
                                        </object>
-                                       <int key="connectionID">300453</int>
+                                       <int key="connectionID">300495</int>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBBindingConnection" key="connection">
-                                               <string key="label">minValue: selection.min_renewal_lifetime</string>
+                                               <string key="label">enabled: selection.renewable</string>
                                                <reference key="source" ref="594182616"/>
-                                               <reference key="destination" ref="57033499"/>
-                                               <object class="NSNibBindingConnector" key="connector" id="564091763">
+                                               <reference key="destination" ref="633725892"/>
+                                               <object class="NSNibBindingConnector" key="connector">
                                                        <reference key="NSSource" ref="594182616"/>
-                                                       <reference key="NSDestination" ref="57033499"/>
-                                                       <string key="NSLabel">minValue: selection.min_renewal_lifetime</string>
-                                                       <string key="NSBinding">minValue</string>
-                                                       <string key="NSKeyPath">selection.min_renewal_lifetime</string>
-                                                       <reference key="NSPreviousConnector" ref="970138044"/>
+                                                       <reference key="NSDestination" ref="633725892"/>
+                                                       <string key="NSLabel">enabled: selection.renewable</string>
+                                                       <string key="NSBinding">enabled</string>
+                                                       <string key="NSKeyPath">selection.renewable</string>
                                                        <int key="NSNibBindingConnectorVersion">2</int>
                                                </object>
                                        </object>
-                                       <int key="connectionID">300454</int>
+                                       <int key="connectionID">300497</int>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBBindingConnection" key="connection">
                                                <string key="label">value: selection.renewal_lifetime</string>
-                                               <reference key="source" ref="594182616"/>
-                                               <reference key="destination" ref="57033499"/>
+                                               <reference key="source" ref="332956369"/>
+                                               <reference key="destination" ref="633725892"/>
                                                <object class="NSNibBindingConnector" key="connector">
-                                                       <reference key="NSSource" ref="594182616"/>
-                                                       <reference key="NSDestination" ref="57033499"/>
+                                                       <reference key="NSSource" ref="332956369"/>
+                                                       <reference key="NSDestination" ref="633725892"/>
                                                        <string key="NSLabel">value: selection.renewal_lifetime</string>
                                                        <string key="NSBinding">value</string>
                                                        <string key="NSKeyPath">selection.renewal_lifetime</string>
-                                                       <reference key="NSPreviousConnector" ref="564091763"/>
                                                        <int key="NSNibBindingConnectorVersion">2</int>
                                                </object>
                                        </object>
-                                       <int key="connectionID">300455</int>
+                                       <int key="connectionID">300500</int>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBBindingConnection" key="connection">
-                                               <string key="label">maxValue: selection.max_valid_lifetime</string>
-                                               <reference key="source" ref="486016405"/>
-                                               <reference key="destination" ref="57033499"/>
-                                               <object class="NSNibBindingConnector" key="connector" id="72846604">
-                                                       <reference key="NSSource" ref="486016405"/>
-                                                       <reference key="NSDestination" ref="57033499"/>
-                                                       <string key="NSLabel">maxValue: selection.max_valid_lifetime</string>
-                                                       <string key="NSBinding">maxValue</string>
-                                                       <string key="NSKeyPath">selection.max_valid_lifetime</string>
+                                               <string key="label">value: selection.valid_lifetime</string>
+                                               <reference key="source" ref="523287828"/>
+                                               <reference key="destination" ref="633725892"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="523287828"/>
+                                                       <reference key="NSDestination" ref="633725892"/>
+                                                       <string key="NSLabel">value: selection.valid_lifetime</string>
+                                                       <string key="NSBinding">value</string>
+                                                       <string key="NSKeyPath">selection.valid_lifetime</string>
                                                        <int key="NSNibBindingConnectorVersion">2</int>
                                                </object>
                                        </object>
-                                       <int key="connectionID">300456</int>
+                                       <int key="connectionID">300501</int>
                                </object>
                                <object class="IBConnectionRecord">
-                                       <object class="IBBindingConnection" key="connection">
-                                               <string key="label">minValue: selection.min_valid_lifetime</string>
-                                               <reference key="source" ref="486016405"/>
-                                               <reference key="destination" ref="57033499"/>
-                                               <object class="NSNibBindingConnector" key="connector" id="337570750">
-                                                       <reference key="NSSource" ref="486016405"/>
-                                                       <reference key="NSDestination" ref="57033499"/>
-                                                       <string key="NSLabel">minValue: selection.min_valid_lifetime</string>
-                                                       <string key="NSBinding">minValue</string>
-                                                       <string key="NSKeyPath">selection.min_valid_lifetime</string>
-                                                       <reference key="NSPreviousConnector" ref="72846604"/>
-                                                       <int key="NSNibBindingConnectorVersion">2</int>
-                                               </object>
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">showTicketOptions:</string>
+                                               <reference key="source" ref="262677138"/>
+                                               <reference key="destination" ref="452996455"/>
                                        </object>
-                                       <int key="connectionID">300458</int>
+                                       <int key="connectionID">300503</int>
                                </object>
                                <object class="IBConnectionRecord">
-                                       <object class="IBBindingConnection" key="connection">
-                                               <string key="label">value: selection.valid_lifetime</string>
-                                               <reference key="source" ref="486016405"/>
-                                               <reference key="destination" ref="57033499"/>
-                                               <object class="NSNibBindingConnector" key="connector">
-                                                       <reference key="NSSource" ref="486016405"/>
-                                                       <reference key="NSDestination" ref="57033499"/>
-                                                       <string key="NSLabel">value: selection.valid_lifetime</string>
-                                                       <string key="NSBinding">value</string>
-                                                       <string key="NSKeyPath">selection.valid_lifetime</string>
-                                                       <reference key="NSPreviousConnector" ref="337570750"/>
-                                                       <int key="NSNibBindingConnectorVersion">2</int>
-                                               </object>
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">saveTicketOptions:</string>
+                                               <reference key="source" ref="262677138"/>
+                                               <reference key="destination" ref="681646907"/>
+                                       </object>
+                                       <int key="connectionID">300504</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">cancelTicketOptions:</string>
+                                               <reference key="source" ref="262677138"/>
+                                               <reference key="destination" ref="284195308"/>
+                                       </object>
+                                       <int key="connectionID">300505</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">validLifetimeSlider</string>
+                                               <reference key="source" ref="262677138"/>
+                                               <reference key="destination" ref="486016405"/>
+                                       </object>
+                                       <int key="connectionID">300506</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">renewableLifetimeSlider</string>
+                                               <reference key="source" ref="262677138"/>
+                                               <reference key="destination" ref="594182616"/>
+                                       </object>
+                                       <int key="connectionID">300507</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">sliderDidChange:</string>
+                                               <reference key="source" ref="262677138"/>
+                                               <reference key="destination" ref="594182616"/>
+                                       </object>
+                                       <int key="connectionID">300508</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">sliderDidChange:</string>
+                                               <reference key="source" ref="262677138"/>
+                                               <reference key="destination" ref="486016405"/>
                                        </object>
-                                       <int key="connectionID">300459</int>
+                                       <int key="connectionID">300509</int>
                                </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                                        <reference ref="8728780"/>
                                                        <reference ref="917012637"/>
                                                        <reference ref="452996455"/>
+                                                       <reference ref="744766544"/>
                                                </object>
                                                <reference key="parent" ref="690863814"/>
                                        </object>
                                                <reference key="object" ref="452996455"/>
                                                <reference key="parent" ref="594991555"/>
                                        </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">300469</int>
+                                               <reference key="object" ref="633725892"/>
+                                               <reference key="parent" ref="0"/>
+                                               <string key="objectName">Ticket Options Controller</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">300502</int>
+                                               <reference key="object" ref="744766544"/>
+                                               <reference key="parent" ref="594991555"/>
+                                       </object>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="flattenedProperties">
                                        <string>300430.IBPluginDependency</string>
                                        <string>300430.ImportedFromIB2</string>
                                        <string>300464.IBPluginDependency</string>
+                                       <string>300469.IBPluginDependency</string>
+                                       <string>300502.IBPluginDependency</string>
                                </object>
                                <object class="NSMutableArray" key="dict.values">
                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-                                       <string>{{611, 402}, {176, 73}}</string>
+                                       <string>{{611, 382}, {189, 93}}</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <reference ref="9"/>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <reference ref="9"/>
-                                       <string>{{579, 449}, {430, 283}}</string>
+                                       <string>{{979, 209}, {430, 283}}</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-                                       <string>{{579, 449}, {430, 283}}</string>
+                                       <string>{{979, 209}, {430, 283}}</string>
                                        <reference ref="9"/>
                                        <reference ref="8"/>
                                        <reference ref="9"/>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <reference ref="9"/>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="unlocalizedProperties">
                                </object>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">300467</int>
+                       <int key="maxID">300509</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <object class="NSMutableArray" key="referencedPartialClassDescriptions">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <string>answerAuthPrompt:</string>
                                                        <string>cancel:</string>
+                                                       <string>cancelTicketOptions:</string>
                                                        <string>changePassword:</string>
                                                        <string>enterIdentity:</string>
+                                                       <string>saveTicketOptions:</string>
+                                                       <string>showTicketOptions:</string>
                                                        <string>showedError:</string>
+                                                       <string>sliderDidChange:</string>
                                                </object>
                                                <object class="NSMutableArray" key="dict.values">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <string>id</string>
                                                        <string>id</string>
                                                        <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
                                                </object>
                                        </object>
                                        <object class="NSMutableDictionary" key="outlets">
                                                        <string>passwordField</string>
                                                        <string>passwordView</string>
                                                        <string>rememberPasswordInKeychainCheckBox</string>
+                                                       <string>renewableLifetimeSlider</string>
                                                        <string>samBadge</string>
                                                        <string>samPromptField</string>
                                                        <string>samView</string>
+                                                       <string>ticketOptionsController</string>
+                                                       <string>ticketOptionsSheet</string>
                                                        <string>usernameField</string>
+                                                       <string>validLifetimeSlider</string>
                                                </object>
                                                <object class="NSMutableArray" key="dict.values">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <string>NSTextField</string>
                                                        <string>NSView</string>
                                                        <string>NSButton</string>
+                                                       <string>NSSlider</string>
                                                        <string>BadgedImageView</string>
                                                        <string>NSTextField</string>
                                                        <string>NSView</string>
+                                                       <string>NSObjectController</string>
+                                                       <string>NSWindow</string>
                                                        <string>NSTextField</string>
+                                                       <string>NSSlider</string>
                                                </object>
                                        </object>
                                        <object class="IBClassDescriptionSource" key="sourceIdentifier">