macos: update AFS prefs pane
authorDerrick Brashear <shadow@dementix.org>
Wed, 18 Apr 2012 15:57:10 +0000 (11:57 -0400)
committerDerrick Brashear <shadow@dementix.org>
Sat, 12 May 2012 00:21:19 +0000 (17:21 -0700)
modify afshelper to just run what it's told instead
of offering fixed operations. this avoids having a setuid
tool around. in spite of apple's suggestion this is correct,
it's actually more dangerous. instead, elevate privilege only
to run a small set of commands, then drop. allow
unlocking of the prefs pane, but make the menu extra prompt
for authentication when needed.
deactivate controls in the prefs pane when locked.

Change-Id: I0e2510efc98605f464e04d26cc8f2ce2bfe116f4
Reviewed-on: http://gerrit.openafs.org/7196
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

16 files changed:
src/platform/DARWIN/AFSPreference/AFSBackgrounder/AFSBackgrounderDelegate.h
src/platform/DARWIN/AFSPreference/AFSBackgrounder/AFSBackgrounderDelegate.m
src/platform/DARWIN/AFSPreference/AFSBackgrounder/AFSMenuExtra.h
src/platform/DARWIN/AFSPreference/AFSBackgrounder/AFSMenuExtra.m
src/platform/DARWIN/AFSPreference/AFSBackgrounder/AFSMenuExtraView.h
src/platform/DARWIN/AFSPreference/AFSCommanderPref.h
src/platform/DARWIN/AFSPreference/AFSCommanderPref.m
src/platform/DARWIN/AFSPreference/AFSPropertyManager.h
src/platform/DARWIN/AFSPreference/AFSPropertyManager.m
src/platform/DARWIN/AFSPreference/English.lproj/OpenAFSPreference.xib
src/platform/DARWIN/AFSPreference/IpConfiguratorCommander.m
src/platform/DARWIN/AFSPreference/PListManager.h
src/platform/DARWIN/AFSPreference/PListManager.m
src/platform/DARWIN/AFSPreference/TaskUtil.h
src/platform/DARWIN/AFSPreference/TaskUtil.m
src/platform/DARWIN/AFSPreference/afshlp.m

index c4799c6..371ac82 100644 (file)
@@ -65,7 +65,6 @@
 - (NSImage*)getImageFromBundle:(NSString*)fileName fileExt:(NSString*)ext;
 - (NSImage*)imageToRender;
 - (void)menuNeedsUpdate:(NSMenu *)menu;
-- (void)repairHelperTool;
 - (void) afsVolumeMountChange:(NSNotification *)notification;
 - (void) updateLinkModeStatusWithpreferenceStatus:(BOOL)status;
 -(NSStatusItem*)statusItem;
index 94bef26..d2d81fa 100644 (file)
 - (void)startStopAfs:(id)sender
 {
        @try {
-               BOOL currentAfsState = NO;
+           BOOL currentAfsState = NO;
+           OSErr status = [[AuthUtil shared] autorize];
+           if(status == noErr){
                currentAfsState = [afsMngr checkAfsStatus];
                // make the parameter to call the root helper app
                if(currentAfsState){
-                       //shutdown afs
-                       NSLog(@"Shutting down afs");
-                       [afsMngr shutdown];
+                   //shutdown afs
+                   NSLog(@"Shutting down afs");
+                   [afsMngr shutdown];
                } else {
-                       //Start afs
-                       NSLog(@"Starting up afs");
-                       [afsMngr startup];
+                   //Start afs
+                   NSLog(@"Starting up afs");
+                   [afsMngr startup];
                }
+           }
        }@catch (NSException * e) {
                NSLog(@"error %@", [e reason]);
        }@finally {
                [self updateAfsStatus:nil];
+               [[AuthUtil shared] deautorize];
                //Send notification to preferencepane
                [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAfsCommanderID object:kMenuExtraEventOccured];
        }
        else return NSOffState;
 }
 
-// -------------------------------------------------------------------------------
-//  repairHelperTool:
-// -------------------------------------------------------------------------------
-- (void) repairHelperTool
-{
-       struct stat st;
-    int fdTool;
-       int status = 0; 
-       NSString *afshlpPath = [[NSBundle mainBundle] pathForResource:@"afshlp" ofType:nil];
-       
-       
-    
-    // Open tool exclusively, so nobody can change it while we bless it.
-    fdTool = open([afshlpPath UTF8String], O_NONBLOCK | O_RDONLY | O_EXLOCK, 0);
-    
-    if(fdTool == -1)
-    {
-        NSLog(@"Exclusive open while repairing tool failed: %d.", errno);
-        exit(-1);
-    }
-    
-    if(fstat(fdTool, &st))
-    {
-        NSLog(@"fstat failed.");
-        exit(-1);
-    }
-    
-    if(st.st_uid != 0)
-    {
-               status = [[AuthUtil shared] autorize];
-               if(status == noErr){
-                       fchown(fdTool, 0, st.st_gid);
-                       
-                       // Disable group and world writability and make setuid root.
-                       fchmod(fdTool, (st.st_mode & (~(S_IWGRP | S_IWOTH)))/* | S_ISUID*/);
-                       const char *args[] = {"root", [afshlpPath UTF8String],0L};
-                       [[AuthUtil shared] execUnixCommand:"/usr/sbin/chown" 
-                                                                                 args:args
-                                                                               output:nil];
-                       [[AuthUtil shared] deautorize];
-               }
-    } else  NSLog(@"st_uid = 0");
-    close(fdTool);
-    NSLog(@"Self-repair done.");
-       
-}
-
 #pragma mark accessor
 // -------------------------------------------------------------------------------
 //  statusItem
index 1c41e24..54487b3 100644 (file)
@@ -52,6 +52,5 @@
 - (NSImage*)getImageFromBundle:(NSString*)fileName fileExt:(NSString*)ext;
 - (NSImage*)imageToRender;
 - (void)updateMenu;
-- (void)repairHelperTool;
 - (void) afsVolumeMountChange:(NSNotification *)notification;
 @end
index 0073a31..3816862 100644 (file)
 }
 
 // -------------------------------------------------------------------------------
-//  -(void) readPreferenceFile
-// -------------------------------------------------------------------------------
-- (void)startStopAfs:(id)sender
-{
-       if(!afsSysPath) return;
-       
-       OSStatus status = noErr;
-       NSString *afsdPath = [TaskUtil searchExecutablePath:@"afsd"];
-       NSString *rootHelperApp = nil;
-       BOOL currentAfsState = NO;
-       
-       @try {
-               if(afsdPath == nil) return;
-               AFSPropertyManager *afsMngr = [[AFSPropertyManager alloc] initWithAfsPath:afsSysPath];
-               currentAfsState = [afsMngr checkAfsStatus];
-               [afsMngr release];
-               
-               rootHelperApp = [[self bundle] pathForResource:@"afshlp" ofType:@""];
-
-               //Check helper app
-               [self repairHelperTool];
-               
-               // make the parameter to call the root helper app
-               status = [[AuthUtil shared] autorize];
-               if(status == noErr){
-                       if(currentAfsState){
-                               //shutdown afs
-                               NSMutableString *afsKextPath = [[NSMutableString alloc] initWithCapacity:256];
-                               [afsKextPath setString:afsSysPath];
-                               [afsKextPath appendString:@"/etc/afs.kext"];
-                               
-                               const char *stopAfsArgs[] = {"stop_afs", [afsKextPath  UTF8String], [afsdPath UTF8String], 0L};
-                               [[AuthUtil shared] execUnixCommand:[rootHelperApp UTF8String] 
-                                                                                         args:stopAfsArgs
-                                                                                       output:nil];
-                       } else {
-                               const char *startAfsArgs[] = {[[[self bundle] pathForResource:@"start_afs" ofType:@"sh"]  UTF8String], [afsSysPath UTF8String], [afsdPath UTF8String], 0L};
-                               [[AuthUtil shared] execUnixCommand:[rootHelperApp UTF8String] 
-                                                                                         args:startAfsArgs
-                                                                                       output:nil];
-                       }
-               }
-       }
-       @catch (NSException * e) {
-               NSLog([e reason]);
-       }
-       @finally {
-               [[AuthUtil shared] deautorize];
-               [self updateAfsStatus:nil];
-               //Send notification to preferencepane
-               [[NSDistributedNotificationCenter defaultCenter] postNotificationName:afsCommanderID object:kMenuExtraEventOccured];
-       }
-       
-}
-
-// -------------------------------------------------------------------------------
 //  -(void) getToken
 // -------------------------------------------------------------------------------
 - (void)getToken:(id)sender
        if(useAklogPrefValue) return [useAklogPrefValue intValue] == NSOnState; 
        else return NSOffState;
 }
-
-// -------------------------------------------------------------------------------
-//  repairHelperTool:
-// -------------------------------------------------------------------------------
-- (void) repairHelperTool
-{
-       struct stat st;
-    int fdTool;
-       int status = 0; 
-       NSString *afshlpPath = [[self bundle] pathForResource:@"afshlp" ofType:nil];
-       
-       
-    
-    // Open tool exclusively, so nobody can change it while we bless it.
-    fdTool = open([afshlpPath UTF8String], O_NONBLOCK | O_RDONLY | O_EXLOCK, 0);
-    
-    if(fdTool == -1)
-    {
-        NSLog(@"Exclusive open while repairing tool failed: %d.", errno);
-        exit(-1);
-    }
-    
-    if(fstat(fdTool, &st))
-    {
-        NSLog(@"fstat failed.");
-        exit(-1);
-    }
-    
-    if(st.st_uid != 0)
-    {
-               status = [[AuthUtil shared] autorize];
-               if(status == noErr){
-                       fchown(fdTool, 0, st.st_gid);
-                       
-                       // Disable group and world writability and make setuid root.
-                       fchmod(fdTool, (st.st_mode & (~(S_IWGRP | S_IWOTH)))/* | S_ISUID*/);
-                       const char *args[] = {"root", [afshlpPath UTF8String],0L};
-                       [[AuthUtil shared] execUnixCommand:"/usr/sbin/chown" 
-                                                                                 args:args
-                                                                               output:nil];
-                       [[AuthUtil shared] deautorize];
-               }
-    } else  NSLog(@"st_uid = 0");
-    
-       
-    
-    close(fdTool);
-    NSLog(@"Self-repair done.");
-       
-}@end
+@end
index 915dc2f..6d1ce18 100644 (file)
@@ -9,7 +9,7 @@
 #import <Cocoa/Cocoa.h>
 #import "AFSBackgrounderDelegate.h"
 
-@interface AFSMenuExtraView : NSView {
+@interface AFSMenuExtraView : NSView <NSMenuDelegate> {
        AFSBackgrounderDelegate         *backgrounderDelegator;
        NSStatusItem    *statusItem;
        NSMenu  *statusItemMenu;
index a9f1cad..7666255 100644 (file)
@@ -7,6 +7,7 @@
 //
 
 #import <PreferencePanes/PreferencePanes.h>
+#import <SecurityInterface/SFAuthorizationView.h>
 #import "AFSPropertyManager.h"
 #import "global.h"
 #import "ViewUtility.h"
@@ -20,12 +21,13 @@ int CoreMenuExtraRemoveMenuExtra(void *menuExtra, int whoCares);
 
 
 
-@interface AFSCommanderPref : NSPreferencePane 
+@interface AFSCommanderPref : NSPreferencePane <NSTableViewDataSource, NSTableViewDelegate>
 {
        //for check system version
        int prefStartUp;
        // Main View
        BOOL startAFSAtLogin;
+    IBOutlet SFAuthorizationView *authView;
        IBOutlet NSView *afsCommanderView;
        IBOutlet NSSearchField *textSearchField;
        IBOutlet NSTextField *afsDefaultCellLabel;
@@ -104,6 +106,7 @@ int CoreMenuExtraRemoveMenuExtra(void *menuExtra, int whoCares);
        NSLock *tokensLock;
 }
 
+- (BOOL)isUnlocked;
 - (void) mainViewDidLoad;
 - (void) willUnselect;
 - (void) didSelect;
@@ -144,11 +147,8 @@ int CoreMenuExtraRemoveMenuExtra(void *menuExtra, int whoCares);
 - (void) modifyCell:(DBCellElement*) cellElement;
 - (void) modifyCellByIDX:(int) idx;
 - (void) showMessage:(NSString*) message;
-- (void) tableViewCellmanageButtonState:(int) rowSelected;
-- (void) tableViewLinkmanageButtonState:(NSIndexSet *) rowsSelectedIndex;
 - (void) setAfsStatus;
 - (void) refreshTokens:(NSTimer*)theTimer;
-- (void) repairHelperTool;
 - (void) writePreferenceFile;
 - (void) readPreferenceFile;
 - (void) refreshGui:(NSNotification *)notification;
@@ -157,8 +157,13 @@ int CoreMenuExtraRemoveMenuExtra(void *menuExtra, int whoCares);
 - (void)tabView:(NSTabView *)tabView willSelectTabViewItem: (NSTabViewItem *)tabViewItem;
 @end
 
+@interface AFSCommanderPref (TableDelegate)
+- (void) tableViewCellmanageButtonState:(int) rowSelected;
+- (void) tableViewLinkmanageButtonState:(NSIndexSet *) rowsSelectedIndex;
+@end;
+
 @interface AFSCommanderPref (NSTableDataSource)
 - (id) getTableTokensListValue:(int) colId row:(int)row;
 - (id) getTableCelListValue:(int) colId row:(int)row;
 - (id) getTableLinkValue:(int) colId row:(int)row;
-@end;
\ No newline at end of file
+@end;
index dcc7344..dd6d9bf 100644 (file)
@@ -58,7 +58,7 @@
 {
     if ( ( self = [super initWithBundle:bundle] ) != nil ) {
         //appID = kAfsCommanderID;
-               prefStartUp = 1;
+       prefStartUp = 1;
     }
     return self;
 }
 //  mainView:
 // -------------------------------------------------------------------------------
 - (NSView *) mainView {
-       if (prefStartUp == 1){
-               SInt32 osxMJVers = 0;
-               SInt32 osxMnVers = 0;
-               if (Gestalt(gestaltSystemVersionMajor, &osxMJVers) == noErr && Gestalt(gestaltSystemVersionMinor, &osxMnVers) == noErr) {
-                       if (osxMJVers == 10 && osxMnVers>= 5) {
-                               [afsCommanderView  setFrameSize:NSMakeSize(668, [afsCommanderView frame].size.height)];
+    if (prefStartUp == 1){
+       SInt32 osxMJVers = 0;
+       SInt32 osxMnVers = 0;
+       if (Gestalt(gestaltSystemVersionMajor, &osxMJVers) == noErr && Gestalt(gestaltSystemVersionMinor, &osxMnVers) == noErr) {
+           if (osxMJVers == 10 && osxMnVers>= 5) {
+               [afsCommanderView  setFrameSize:NSMakeSize(668, [afsCommanderView frame].size.height)];
                 prefStartUp = 0;
-                       }
-               }
+           }
        }
+    }
        
     return afsCommanderView;
 }
 // -------------------------------------------------------------------------------
 - (void) mainViewDidLoad
 {
-       //CellServDB Table
-       [((NSTableView*)cellList) setDelegate:self];
-       [((NSTableView*)cellList) setTarget:self];
-       [((NSTableView*)cellList) setDoubleAction:@selector(tableDoubleAction:)];
-       
-       
+    //CellServDB Table
+    [cellList setDelegate:self];
+    [cellList setTarget:self];
+    [cellList setDoubleAction:@selector(tableDoubleAction:)];
+
+    // Setup security.
+    AuthorizationItem items = {kAuthorizationRightExecute, 0, NULL, 0};
+    AuthorizationRights rights = {1, &items};
+    [authView setAuthorizationRights:&rights];
+    authView.delegate = self;
+    [authView updateStatus:nil];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (void) didSelect
 {
-       //try to install the launchd file for backgrounder
-       //Remove launchd ctrl file
-       @try {
-               [PListManager installBackgrounderLaunchdFile:YES 
-                                                                               resourcePath:[[self bundle] resourcePath]];
-       }
-       @catch (NSException * e) {
-               NSDictionary *excecptDic = [e userInfo];
-               NSNumber *keyNum = [excecptDic objectForKey:@"agent_folder_error"];
-               if(keyNum && [keyNum boolValue]) {
-                       // the dir HOME_LAUNCHD_AGENT_FOLDER (PListManager.h) must be created
-                       NSBeginAlertSheet([[NSString stringWithString:kDoYouWantCreateTheDirectory] stringByAppendingString:HOME_LAUNCHD_AGENT_FOLDER],
-                                                         @"Create", @"Cancel", nil,                                                                            
-                                                         [[self mainView] window],     self, @selector(credentialAtLoginTimeEventCreationLaunchAgentDir:returnCode:contextInfo:), NULL, 
-                                                         nil, @"", nil);
-               }
-       }
-       @finally {
-               
+    //try to install the launchd file for backgrounder
+    //Remove launchd ctrl file
+    @try {
+       [PListManager installBackgrounderLaunchdFile:YES
+                     resourcePath:[[self bundle] resourcePath]];
+    }
+    @catch (NSException * e) {
+       NSDictionary *excecptDic = [e userInfo];
+       NSNumber *keyNum = [excecptDic objectForKey:@"agent_folder_error"];
+       if(keyNum && [keyNum boolValue]) {
+           // the dir HOME_LAUNCHD_AGENT_FOLDER (PListManager.h) must be created
+           NSBeginAlertSheet([[NSString stringWithString:kDoYouWantCreateTheDirectory] stringByAppendingString:HOME_LAUNCHD_AGENT_FOLDER],
+                             @"Create", @"Cancel", nil,
+                             [[self mainView] window], self, @selector(credentialAtLoginTimeEventCreationLaunchAgentDir:returnCode:contextInfo:), NULL,
+                             nil, @"", nil);
        }
+    }
+    @finally {
        
-       
-       // Set Developer info
-       [textFieldDevInfoLabel setStringValue:kDevelopInfo];
-       // creating the lock
-       tokensLock = [[NSLock alloc] init];
-       
-       //Initialization cellservdb and token list
-       filteredCellDB = nil;
-       tokenList = nil;
-       
-       [self readPreferenceFile];
-                       
-       // alloc the afs property mananger
-       afsProperty = [[AFSPropertyManager alloc] init];
-       
-       // register preference pane to detect menuextra killed by user
-       [[NSDistributedNotificationCenter defaultCenter] addObserver:self
-                                                                                                               selector:@selector(refreshTokensNotify:)
-                                                                                                                       name:kAfsCommanderID
-                                                                                                                 object:kMExtraTokenOperation];
-        
-       [[NSDistributedNotificationCenter defaultCenter] addObserver:self 
-                                                                                                               selector:@selector(refreshGui:) 
-                                                                                                                       name:kAfsCommanderID 
-                                                                                                                 object:kMenuExtraEventOccured];
-       
-       //Register for mount/unmount afs volume
-       [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self 
-                                                                                                                  selector:@selector(afsVolumeMountChange:) 
-                                                                                                                          name:NSWorkspaceDidMountNotification object:nil];
-       
-       [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self 
-                                                                                                                  selector:@selector(afsVolumeMountChange:) 
-                                                                                                                          name:NSWorkspaceDidUnmountNotification object:nil];
-       
-       // set self as table data source
-       [cellList setDataSource:self];
-       [tokensTable setDataSource:self];
-       //[tableViewLink setDataSource:self];
-       //check the afs state
-       [self setAfsStatus];
-       
-       // let show the configuration after prefpane is open
-       [self refreshConfiguration:nil];
-       
-       // refresh the token list
-       //[self refreshTokens:nil];
-       
-       //refresh table to reflect the NSSearchField contained text
-       [self searchCellTextEvent:nil];
+    }
+
+
+    // Set Developer info
+    [textFieldDevInfoLabel setStringValue:kDevelopInfo];
+    // creating the lock
+    tokensLock = [[NSLock alloc] init];
+
+    //Initialization cellservdb and token list
+    filteredCellDB = nil;
+    tokenList = nil;
+
+    [self readPreferenceFile];
+
+    // alloc the afs property mananger
+    afsProperty = [[AFSPropertyManager alloc] init];
+
+    // register preference pane to detect menuextra killed by user
+    [[NSDistributedNotificationCenter defaultCenter] addObserver:self
+                                                    selector:@selector(refreshTokensNotify:)
+                                                    name:kAfsCommanderID
+                                                    object:kMExtraTokenOperation];
+
+    [[NSDistributedNotificationCenter defaultCenter] addObserver:self
+                                                    selector:@selector(refreshGui:)
+                                                    name:kAfsCommanderID
+                                                    object:kMenuExtraEventOccured];
+
+    //Register for mount/unmount afs volume
+    [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
+                                                       selector:@selector(afsVolumeMountChange:)
+                                                       name:NSWorkspaceDidMountNotification object:nil];
+
+    [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
+                                                       selector:@selector(afsVolumeMountChange:)
+                                                       name:NSWorkspaceDidUnmountNotification object:nil];
+
+    // set self as table data source
+    [cellList setDataSource:self];
+    [tokensTable setDataSource:self];
+    //[tableViewLink setDataSource:self];
+    //check the afs state
+    [self setAfsStatus];
+
+    // let show the configuration after prefpane is open
+    [self refreshConfiguration:nil];
+
+    // refresh the token list
+    //[self refreshTokens:nil];
+
+    //refresh table to reflect the NSSearchField contained text
+    [self searchCellTextEvent:nil];
 }
 
 // -------------------------------------------------------------------------------
 //  credentialAtLoginTimeEventCreationLaunchAgentDir:
 // -------------------------------------------------------------------------------
 - (void) credentialAtLoginTimeEventCreationLaunchAgentDir:(NSWindow*)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo {
-       [alert close];
-       switch (returnCode) {
-               case  1:
-                       if([[NSFileManager defaultManager] createDirectoryAtPath:[HOME_LAUNCHD_AGENT_FOLDER stringByExpandingTildeInPath] 
-                                                                                withIntermediateDirectories:NO
-                                                                                                                 attributes:nil
-                                                                                                                          error:nil]) {
-                               
-                               //Create the file
-                               [PListManager installBackgrounderLaunchdFile:YES
-                                                                                               resourcePath:[[self bundle] resourcePath]];
-                               [self showMessage:kDirectoryCreated];
-                       } else {
-                               [self showMessage:kErrorCreatingDirectory];
-                       }
-                       break;
-               case 0:
-                       break;
+    [alert close];
+    switch (returnCode) {
+    case  1:
+       if([[NSFileManager defaultManager] createDirectoryAtPath:[HOME_LAUNCHD_AGENT_FOLDER stringByExpandingTildeInPath]
+                                          withIntermediateDirectories:NO
+                                          attributes:nil
+                                          error:nil]) {
+
+           //Create the file
+           [PListManager installBackgrounderLaunchdFile:YES
+                         resourcePath:[[self bundle] resourcePath]];
+           [self showMessage:kDirectoryCreated];
+       } else {
+           [self showMessage:kErrorCreatingDirectory];
        }
+       break;
+    case 0:
+       break;
+    }
 }
 
 
 // -------------------------------------------------------------------------------
 - (void)willUnselect
 {
-       // remove self as datasource
-       [((NSTableView*)cellList) setDataSource:nil];
-       [((NSTableView*)tokensTable) setDataSource:nil];
-
-       //release the afs property manager
-       if(afsProperty) [afsProperty release];
-       //release tokens list
-       if(tokenList) [tokenList release];      
-       //Remove the cell temp array
-       if(filteredCellDB) [filteredCellDB release];
-       
-       [self writePreferenceFile];
-       
-       // unregister preference pane to detect menuextra killed by user
-       [[NSDistributedNotificationCenter defaultCenter] removeObserver:self
-                                                                                                                          name:kAfsCommanderID
-                                                                                                                        object:kMExtraClosedNotification];
-       [[NSDistributedNotificationCenter defaultCenter] removeObserver:self
-                                                                                                                          name:kAfsCommanderID
-                                                                                                                        object:kMExtraTokenOperation];
-       [[NSDistributedNotificationCenter defaultCenter] removeObserver:self
-                                                                                                                          name:kAfsCommanderID
-                                                                                                                        object:kMenuExtraEventOccured];
-       [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self 
-                                                                                                                                 name:NSWorkspaceDidMountNotification object:nil];
-       [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self 
-                                                                                                                                 name:NSWorkspaceDidUnmountNotification object:nil];
-       
-       [self stopTimer];
-       [tokensLock release];
+    // remove self as datasource
+    [cellList setDataSource:nil];
+    [tokensTable setDataSource:nil];
+
+    //release the afs property manager
+    if(afsProperty) [afsProperty release];
+    //release tokens list
+    if(tokenList) [tokenList release];
+    //Remove the cell temp array
+    if(filteredCellDB) [filteredCellDB release];
+
+    [self writePreferenceFile];
+
+    // unregister preference pane to detect menuextra killed by user
+    [[NSDistributedNotificationCenter defaultCenter] removeObserver:self
+                                                    name:kAfsCommanderID
+                                                    object:kMExtraClosedNotification];
+    [[NSDistributedNotificationCenter defaultCenter] removeObserver:self
+                                                    name:kAfsCommanderID
+                                                    object:kMExtraTokenOperation];
+    [[NSDistributedNotificationCenter defaultCenter] removeObserver:self
+                                                    name:kAfsCommanderID
+                                                    object:kMenuExtraEventOccured];
+    [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self
+                                                       name:NSWorkspaceDidMountNotification object:nil];
+    [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self
+                                                       name:NSWorkspaceDidUnmountNotification object:nil];
+
+    [self stopTimer];
+    [tokensLock release];
 }
 
 
 //  startTimer:
 // -------------------------------------------------------------------------------
 - (void)startTimer{
-       //start the time for check tokens validity
-       if(timerForCheckTokensList) return;
-       timerForCheckTokensList = [NSTimer scheduledTimerWithTimeInterval:TOKENS_REFRESH_TIME_IN_SEC 
-                                                                                                                          target:self 
-                                                                                                                        selector:@selector(refreshTokens:) 
-                                                                                                                        userInfo:nil 
-                                                                                                                         repeats:YES];
-       [timerForCheckTokensList fire]; 
+    //start the time for check tokens validity
+    if(timerForCheckTokensList) return;
+    timerForCheckTokensList = [NSTimer scheduledTimerWithTimeInterval:TOKENS_REFRESH_TIME_IN_SEC
+                                      target:self
+                                      selector:@selector(refreshTokens:)
+                                      userInfo:nil
+                                      repeats:YES];
+    [timerForCheckTokensList fire];
 }
 
 // -------------------------------------------------------------------------------
 //  stopTimer:
 // -------------------------------------------------------------------------------
 - (void)stopTimer{
-       if(!timerForCheckTokensList) return;
-       [timerForCheckTokensList invalidate];   
-       timerForCheckTokensList = nil;
+    if(!timerForCheckTokensList) return;
+    [timerForCheckTokensList invalidate];
+    timerForCheckTokensList = nil;
 }
 
 
 // -------------------------------------------------------------------------------
 - (void) readPreferenceFile
 {
-       // read the preference for aklog use
-       NSNumber *useAklogPrefValue = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_USE_AKLOG, (CFStringRef)kAfsCommanderID,  
-                                                                                                                                       kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       NSNumber *aklogTokenAtLogin = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_AKLOG_TOKEN_AT_LOGIN, (CFStringRef)kAfsCommanderID,  
-                                                                                                                                       kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       [useAklogCheck setState:[useAklogPrefValue intValue]];
-       [aklogCredentialAtLoginTime setEnabled:useAklogPrefValue && [useAklogPrefValue boolValue]];
-       [aklogCredentialAtLoginTime setState:aklogTokenAtLogin && [aklogTokenAtLogin boolValue]];
-
-       //check krb5 at login time
-       [installKRB5AuthAtLoginButton setState:[PListManager checkKrb5AtLoginTimeLaunchdEnable]];
-
-       //check for AFS enable at startup
-       NSNumber *afsEnableStartupTime = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_START_AFS_AT_STARTUP,
-                                                                                                                                          (CFStringRef)kAfsCommanderID,  kCFPreferencesAnyUser, kCFPreferencesAnyHost);
-       if(afsEnableStartupTime)
-               startAFSAtLogin = [afsEnableStartupTime boolValue];
-       else 
-               startAFSAtLogin = false;
-       //set the check button state
-       [checkButtonAfsAtBootTime setState:startAFSAtLogin];
-       
-       NSNumber *showStatusMenu =  (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_SHOW_STATUS_MENU,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       [(NSButton*)afsMenucheckBox setState: [showStatusMenu boolValue]];
-       
-       //backgrounder state
-       [backgrounderActivationCheck setState:[PListManager launchdJobState:BACKGROUNDER_P_FILE]];
-       
-       //link enabled status
-       NSNumber *linkEnabledStatus =  (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_USE_LINK,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       [checkEnableLink setState:[linkEnabledStatus boolValue]];
-       
-       //check the user preference for manage the renew
-       NSNumber *checkRenew =  (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_KRB5_CHECK_ENABLE,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       if(checkRenew)[nsButtonEnableDisableKrb5RenewCheck setState:[checkRenew intValue]];
-
-       NSNumber *renewTime = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_KRB5_RENEW_TIME,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       if(!renewTime) renewTime = [NSNumber numberWithInt:PREFERENCE_KRB5_RENEW_TIME_DEFAULT_VALUE];
-
-               //update gui
-       NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
-       NSDateComponents *weekdayComponents = [gregorian components:(NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit) 
-                                                                                                          fromDate:[NSDate dateWithTimeIntervalSince1970:[renewTime intValue]]];
-       [nsTextFieldKrb5RenewTimeD setIntValue:[weekdayComponents day]-1];
-       [nsTextFieldKrb5RenewTimeH setIntValue:[weekdayComponents hour]-1];
-       [nsTextFieldKrb5RenewTimeM setIntValue:[weekdayComponents minute]];
-       [nsTextFieldKrb5RenewTimeS setIntValue:[weekdayComponents second]];
-       [nsStepperKrb5RenewTimeD setIntValue:[weekdayComponents day]-1];
-       [nsStepperKrb5RenewTimeH setIntValue:[weekdayComponents hour]-1];
-       [nsStepperKrb5RenewTimeM setIntValue:[weekdayComponents minute]];
-       [nsStepperKrb5RenewTimeS setIntValue:[weekdayComponents second]];
-
-       NSNumber *renewCheckTimeInterval = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_KRB5_RENEW_CHECK_TIME_INTERVALL,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       if(renewCheckTimeInterval && [renewCheckTimeInterval intValue])[nsTextFieldKrb5RenewCheckIntervall setIntValue:[renewCheckTimeInterval intValue]];
-       else [nsTextFieldKrb5RenewCheckIntervall setIntValue:PREFERENCE_KRB5_RENEW_CHECK_TIME_INTERVALL_DEFAULT_VALUE];
-
-       NSNumber *expireTimeForRenew = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_KRB5_SEC_TO_EXPIRE_TIME_FOR_RENEW,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       if(expireTimeForRenew && [expireTimeForRenew intValue])[nsTextFieldKrb5SecToExpireDateForRenew setIntValue:[expireTimeForRenew intValue]];
-       else [nsTextFieldKrb5SecToExpireDateForRenew setIntValue:PREFERENCE_KRB5_SEC_TO_EXPIRE_TIME_FOR_RENEW_DEFAULT_VALUE];
-
-       //link configuration
-       NSData *prefData = (NSData*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_LINK_CONFIGURATION,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       linkConfiguration = (NSMutableDictionary*)[NSPropertyListSerialization propertyListFromData:prefData
-                                                                                                                                                          mutabilityOption:NSPropertyListMutableContainers
-                                                                                                                                                                                format:nil
-                                                                                                                                                          errorDescription:nil];
-       
+    // read the preference for aklog use
+    NSNumber *useAklogPrefValue = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_USE_AKLOG, (CFStringRef)kAfsCommanderID,
+                                                                   kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    NSNumber *aklogTokenAtLogin = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_AKLOG_TOKEN_AT_LOGIN, (CFStringRef)kAfsCommanderID,
+                                                                   kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    [useAklogCheck setState:[useAklogPrefValue intValue]];
+    [aklogCredentialAtLoginTime setEnabled:useAklogPrefValue && [useAklogPrefValue boolValue]];
+    [aklogCredentialAtLoginTime setState:aklogTokenAtLogin && [aklogTokenAtLogin boolValue]];
+
+    //check krb5 at login time
+    [installKRB5AuthAtLoginButton setState:[PListManager checkKrb5AtLoginTimeLaunchdEnable]];
+
+    //check for AFS enable at startup
+    NSNumber *afsEnableStartupTime = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_START_AFS_AT_STARTUP,
+                                                                      (CFStringRef)kAfsCommanderID,  kCFPreferencesAnyUser, kCFPreferencesAnyHost);
+    if(afsEnableStartupTime)
+       startAFSAtLogin = [afsEnableStartupTime boolValue];
+    else
+       startAFSAtLogin = false;
+    //set the check button state
+    [checkButtonAfsAtBootTime setState:startAFSAtLogin];
+
+    NSNumber *showStatusMenu =  (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_SHOW_STATUS_MENU,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    [(NSButton*)afsMenucheckBox setState: [showStatusMenu boolValue]];
+
+    //backgrounder state
+    [backgrounderActivationCheck setState:[PListManager launchdJobState:BACKGROUNDER_P_FILE]];
+
+    //link enabled status
+    NSNumber *linkEnabledStatus =  (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_USE_LINK,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    [checkEnableLink setState:[linkEnabledStatus boolValue]];
+
+    //check the user preference for manage the renew
+    NSNumber *checkRenew =  (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_KRB5_CHECK_ENABLE,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    if(checkRenew)[nsButtonEnableDisableKrb5RenewCheck setState:[checkRenew intValue]];
+
+    NSNumber *renewTime = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_KRB5_RENEW_TIME,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    if(!renewTime) renewTime = [NSNumber numberWithInt:PREFERENCE_KRB5_RENEW_TIME_DEFAULT_VALUE];
+
+    //update gui
+    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
+    NSDateComponents *weekdayComponents = [gregorian components:(NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit)
+                                                    fromDate:[NSDate dateWithTimeIntervalSince1970:[renewTime intValue]]];
+    [nsTextFieldKrb5RenewTimeD setIntValue:[weekdayComponents day]-1];
+    [nsTextFieldKrb5RenewTimeH setIntValue:[weekdayComponents hour]-1];
+    [nsTextFieldKrb5RenewTimeM setIntValue:[weekdayComponents minute]];
+    [nsTextFieldKrb5RenewTimeS setIntValue:[weekdayComponents second]];
+    [nsStepperKrb5RenewTimeD setIntValue:[weekdayComponents day]-1];
+    [nsStepperKrb5RenewTimeH setIntValue:[weekdayComponents hour]-1];
+    [nsStepperKrb5RenewTimeM setIntValue:[weekdayComponents minute]];
+    [nsStepperKrb5RenewTimeS setIntValue:[weekdayComponents second]];
+
+    NSNumber *renewCheckTimeInterval = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_KRB5_RENEW_CHECK_TIME_INTERVALL,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    if(renewCheckTimeInterval && [renewCheckTimeInterval intValue])[nsTextFieldKrb5RenewCheckIntervall setIntValue:[renewCheckTimeInterval intValue]];
+    else [nsTextFieldKrb5RenewCheckIntervall setIntValue:PREFERENCE_KRB5_RENEW_CHECK_TIME_INTERVALL_DEFAULT_VALUE];
+
+    NSNumber *expireTimeForRenew = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_KRB5_SEC_TO_EXPIRE_TIME_FOR_RENEW,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    if(expireTimeForRenew && [expireTimeForRenew intValue])[nsTextFieldKrb5SecToExpireDateForRenew setIntValue:[expireTimeForRenew intValue]];
+    else [nsTextFieldKrb5SecToExpireDateForRenew setIntValue:PREFERENCE_KRB5_SEC_TO_EXPIRE_TIME_FOR_RENEW_DEFAULT_VALUE];
+
+    //link configuration
+    NSData *prefData = (NSData*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_LINK_CONFIGURATION,  (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    linkConfiguration = (NSMutableDictionary*)[NSPropertyListSerialization propertyListFromData:prefData
+                                                                          mutabilityOption:NSPropertyListMutableContainers
+                                                                          format:nil
+                                                                          errorDescription:nil];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (void) writePreferenceFile
 {
-       //Set the preference for afs path
-       //Set the preference for aklog use
-       CFPreferencesSetValue((CFStringRef)PREFERENCE_USE_AKLOG, 
-                                                 (CFNumberRef)[NSNumber numberWithInt:[useAklogCheck state]], 
-                                                 (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-
-       //set AFS enable state at startup
-       CFPreferencesSetValue((CFStringRef)PREFERENCE_START_AFS_AT_STARTUP, 
-                                                 (CFNumberRef)[NSNumber numberWithBool:startAFSAtLogin], 
-                                                 (CFStringRef)kAfsCommanderID, kCFPreferencesAnyUser, kCFPreferencesAnyHost);
-       
-       //set aklog at login
-       CFPreferencesSetValue((CFStringRef)PREFERENCE_AKLOG_TOKEN_AT_LOGIN, 
-                                                 (CFNumberRef)[NSNumber numberWithBool:[aklogCredentialAtLoginTime state]], 
-                                                 (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       
-       //set aklog at login
-       CFPreferencesSetValue((CFStringRef)PREFERENCE_SHOW_STATUS_MENU, 
-                                                 (CFNumberRef)[NSNumber numberWithBool:[(NSButton*)afsMenucheckBox state]],
-                                                 (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       
-       //preference for link
-       CFPreferencesSetValue((CFStringRef)PREFERENCE_USE_LINK,
-                                                 (CFNumberRef)[NSNumber numberWithBool:[checkEnableLink state]], 
-                                                 (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       
-               //preference for renew time
-       NSLog(@"%d %d %d %d", [nsTextFieldKrb5RenewTimeD intValue],[nsTextFieldKrb5RenewTimeH intValue],[nsTextFieldKrb5RenewTimeM intValue],[nsTextFieldKrb5RenewTimeS intValue]);
-       NSInteger totalSeconds =        ([nsTextFieldKrb5RenewTimeD intValue]*24*60*60)+
-                                                               ([nsTextFieldKrb5RenewTimeH intValue]*60*60)+
-                                                               ([nsTextFieldKrb5RenewTimeM intValue]*60)+
-                                                               [nsTextFieldKrb5RenewTimeS intValue];
-
-       CFPreferencesSetValue((CFStringRef)PREFERENCE_KRB5_RENEW_TIME,
-                                                 (CFNumberRef)[NSNumber numberWithInt:totalSeconds],
-                                                 (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-
-               //expire time for renew
-       CFPreferencesSetValue((CFStringRef)PREFERENCE_KRB5_SEC_TO_EXPIRE_TIME_FOR_RENEW,
-                                                 (CFNumberRef)[NSNumber numberWithInt:[nsTextFieldKrb5SecToExpireDateForRenew intValue]],
-                                                 (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-
-               //sec to expiretime for renew job
-       CFPreferencesSetValue((CFStringRef)PREFERENCE_KRB5_RENEW_CHECK_TIME_INTERVALL,
-                                                 (CFNumberRef)[NSNumber numberWithInt:[nsTextFieldKrb5RenewCheckIntervall intValue]],
-                                                 (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-
-       CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesAnyUser, kCFPreferencesAnyHost);
-       CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kPrefChangeNotification];
+    //Set the preference for afs path
+    //Set the preference for aklog use
+    CFPreferencesSetValue((CFStringRef)PREFERENCE_USE_AKLOG,
+                         (CFNumberRef)[NSNumber numberWithInt:[useAklogCheck state]],
+                         (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+    //set AFS enable state at startup
+    CFPreferencesSetValue((CFStringRef)PREFERENCE_START_AFS_AT_STARTUP,
+                         (CFNumberRef)[NSNumber numberWithBool:startAFSAtLogin],
+                         (CFStringRef)kAfsCommanderID, kCFPreferencesAnyUser, kCFPreferencesAnyHost);
+
+    //set aklog at login
+    CFPreferencesSetValue((CFStringRef)PREFERENCE_AKLOG_TOKEN_AT_LOGIN,
+                         (CFNumberRef)[NSNumber numberWithBool:[aklogCredentialAtLoginTime state]],
+                         (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+    //set aklog at login
+    CFPreferencesSetValue((CFStringRef)PREFERENCE_SHOW_STATUS_MENU,
+                         (CFNumberRef)[NSNumber numberWithBool:[(NSButton*)afsMenucheckBox state]],
+                         (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+    //preference for link
+    CFPreferencesSetValue((CFStringRef)PREFERENCE_USE_LINK,
+                         (CFNumberRef)[NSNumber numberWithBool:[checkEnableLink state]],
+                         (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+    //preference for renew time
+    //NSLog(@"%d %d %d %d", [nsTextFieldKrb5RenewTimeD intValue],[nsTextFieldKrb5RenewTimeH intValue],[nsTextFieldKrb5RenewTimeM intValue],[nsTextFieldKrb5RenewTimeS intValue]);
+    NSInteger totalSeconds =   ([nsTextFieldKrb5RenewTimeD intValue]*24*60*60)+
+       ([nsTextFieldKrb5RenewTimeH intValue]*60*60)+
+       ([nsTextFieldKrb5RenewTimeM intValue]*60)+
+       [nsTextFieldKrb5RenewTimeS intValue];
+
+    CFPreferencesSetValue((CFStringRef)PREFERENCE_KRB5_RENEW_TIME,
+                         (CFNumberRef)[NSNumber numberWithInt:totalSeconds],
+                         (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+    //expire time for renew
+    CFPreferencesSetValue((CFStringRef)PREFERENCE_KRB5_SEC_TO_EXPIRE_TIME_FOR_RENEW,
+                         (CFNumberRef)[NSNumber numberWithInt:[nsTextFieldKrb5SecToExpireDateForRenew intValue]],
+                         (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+    //sec to expiretime for renew job
+    CFPreferencesSetValue((CFStringRef)PREFERENCE_KRB5_RENEW_CHECK_TIME_INTERVALL,
+                         (CFNumberRef)[NSNumber numberWithInt:[nsTextFieldKrb5RenewCheckIntervall intValue]],
+                         (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+    CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesAnyUser, kCFPreferencesAnyHost);
+    CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kPrefChangeNotification];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (IBAction) saveConfiguration:(id) sender
 {
-       @try{
-               
-               //[afsProperty setCellName:[cellNameTextEdit stringValue]];
-               [afsProperty setCellName:[afsProperty getDefaultCellName]];
-               
-               //save configurations
-               [afsProperty saveConfigurationFiles:YES];
-               
-               
-               //Reload all configuration
-               [self refreshConfiguration:nil];
-               
-               //refresh table to reflect the NSSearchField contained text
-               [self searchCellTextEvent:nil];
+    @try{
+       [afsProperty setCellName:[afsProperty getDefaultCellName]];
+
+       //save configurations
+       [afsProperty saveConfigurationFiles:YES];
                
-               //Show dialog for notifity al saving process ar gone ell
-               [self showMessage:kConfigurationSaved];
-       }@catch(NSException *e){
-               [self showMessage:[e reason]];
-       } @finally {
-               [((NSTableView*)cellList) reloadData];
-       }
+       //Reload all configuration
+       [self refreshConfiguration:nil];
+
+       //refresh table to reflect the NSSearchField contained text
+       [self searchCellTextEvent:nil];
        
+       //Show dialog for notifity al saving process ar gone ell
+       [self showMessage:kConfigurationSaved];
+    }@catch(NSException *e){
+       [self showMessage:[e reason]];
+    } @finally {
+       [cellList reloadData];
+    }
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (IBAction) saveCacheManagerParam:(id) sender
 {
-       @try{
-               //Update the value form view to afs property manager class
-               [self updateCacheParamFromView];
-               [afsProperty saveCacheConfigurationFiles:YES];
-               [self showMessage:kSavedCacheConfiguration];
-       }@catch(NSException *e){
-               [self showMessage:[e reason]];
-       } @finally {
-               [((NSTableView*)cellList) reloadData];
-       }
+    @try{
+       //Update the value form view to afs property manager class
+       [self updateCacheParamFromView];
+       [afsProperty saveCacheConfigurationFiles:YES];
+       [self showMessage:kSavedCacheConfiguration];
+    }@catch(NSException *e){
+       [self showMessage:[e reason]];
+    } @finally {
+       [cellList reloadData];
+    }
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (IBAction) refreshConfiguration:(id) sender
 {
-       NSString *afsBasePath = PREFERENCE_AFS_SYS_PAT_STATIC;
-       @try{
-               // set the afs path
-               [afsProperty setPath:afsBasePath];
-               
-               // load configuration
-               [afsProperty loadConfiguration];
-               
-               //set the afs version label
-               [afsVersionLabel setStringValue:[afsProperty getAfsVersion]];
-               
-               //set the current default cell
-               [afsDefaultCellLabel setStringValue:[afsProperty getDefaultCellName]];
-               
-               // Update cache view
-               [self fillCacheParamView];
-               
-               //Filter the cellServDb and allocate filtered array
-               [self filterCellServDB:nil];
-               
-       }@catch(NSException *e){
-               [self showMessage:[e reason]];
-       } @finally {
-               [((NSTableView*)cellList) reloadData];
-       }
+    NSString *afsBasePath = PREFERENCE_AFS_SYS_PAT_STATIC;
+    @try{
+       // set the afs path
+       [afsProperty setPath:afsBasePath];
+
+       // load configuration
+       [afsProperty loadConfiguration];
+
+       //set the afs version label
+       [afsVersionLabel setStringValue:[afsProperty getAfsVersion]];
+
+       //set the current default cell
+       [afsDefaultCellLabel setStringValue:[afsProperty getDefaultCellName]];
+
+       // Update cache view
+       [self fillCacheParamView];
+
+       //Filter the cellServDb and allocate filtered array
+       [self filterCellServDB:nil];
+
+    }@catch(NSException *e){
+       [self showMessage:[e reason]];
+    } @finally {
+       [cellList reloadData];
+    }
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 -(void) fillCacheParamView
 {
-       [dynRoot setState:[afsProperty dynRoot]?NSOnState:NSOffState];
-       [afsDB setState:[afsProperty afsDB]?NSOnState:NSOffState];
-       [statCacheEntry setIntValue:[afsProperty statCacheEntry]];
-       [dCacheDim setIntValue:[afsProperty dCacheDim]];
-       [cacheDimension setIntValue:[afsProperty cacheDimension]];
-       [daemonNumber setIntValue:[afsProperty daemonNumber]];
-       [afsRootMountPoint setStringValue:[afsProperty afsRootMountPoint]];
-       [nVolEntry setIntValue:[afsProperty nVolEntry]];
-       
-       //new version property
-       //[verbose setEnabled:[afsProperty useAfsdConfConfigFile]];
-       [verbose setState:[afsProperty verbose]?NSOnState:NSOffState];
-       
+    [dynRoot setState:[afsProperty dynRoot]?NSOnState:NSOffState];
+    [afsDB setState:[afsProperty afsDB]?NSOnState:NSOffState];
+    [statCacheEntry setIntValue:[afsProperty statCacheEntry]];
+    [dCacheDim setIntValue:[afsProperty dCacheDim]];
+    [cacheDimension setIntValue:[afsProperty cacheDimension]];
+    [daemonNumber setIntValue:[afsProperty daemonNumber]];
+    [afsRootMountPoint setStringValue:[afsProperty afsRootMountPoint]];
+    [nVolEntry setIntValue:[afsProperty nVolEntry]];
+
+    //new version property
+    //[verbose setEnabled:[afsProperty useAfsdConfConfigFile]];
+    [verbose setState:[afsProperty verbose]?NSOnState:NSOffState];
+
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 -(void) updateCacheParamFromView
 {
-       NSString *tmpAfsPath = [afsRootMountPoint stringValue];
-       if(!tmpAfsPath || ([tmpAfsPath length] == 0) || ([tmpAfsPath characterAtIndex:0] != '/')) 
-               @throw [NSException exceptionWithName:@"updateCacheParamFromView" 
-                                                                          reason:kBadAfsRootMountPoint
-                                                                        userInfo:nil];
+    NSString *tmpAfsPath = [afsRootMountPoint stringValue];
+    if(!tmpAfsPath || ([tmpAfsPath length] == 0) || ([tmpAfsPath characterAtIndex:0] != '/'))
+       @throw [NSException exceptionWithName:@"updateCacheParamFromView"
+                           reason:kBadAfsRootMountPoint
+                           userInfo:nil];
 
-       
-       [afsProperty setDynRoot:[dynRoot state]==NSOnState];
-       [afsProperty setAfsDB:[afsDB state]==NSOnState];
-       [afsProperty setStatCacheEntry:[statCacheEntry intValue]];
-       [afsProperty setDCacheDim:[dCacheDim intValue]]; 
-       [afsProperty setCacheDimension:[cacheDimension intValue]]; 
-       [afsProperty setDaemonNumber:[daemonNumber intValue]];
-       [afsProperty setAfsRootMountPoint:tmpAfsPath];
-       [afsProperty setNVolEntry:[nVolEntry intValue]];
-       [afsProperty setVerbose:[verbose state]==NSOnState];
+    [afsProperty setDynRoot:[dynRoot state]==NSOnState];
+    [afsProperty setAfsDB:[afsDB state]==NSOnState];
+    [afsProperty setStatCacheEntry:[statCacheEntry intValue]];
+    [afsProperty setDCacheDim:[dCacheDim intValue]];
+    [afsProperty setCacheDimension:[cacheDimension intValue]];
+    [afsProperty setDaemonNumber:[daemonNumber intValue]];
+    [afsProperty setAfsRootMountPoint:tmpAfsPath];
+    [afsProperty setNVolEntry:[nVolEntry intValue]];
+    [afsProperty setVerbose:[verbose state]==NSOnState];
 }
 
 
 // -------------------------------------------------------------------------------
 - (IBAction) showCellIP:(id) sender
 {
-       int rowSelected = [((NSTableView *) cellList) selectedRow];
-       [self modifyCellByIDX:rowSelected];
+    int rowSelected = [((NSTableView *) cellList) selectedRow];
+    [self modifyCellByIDX:rowSelected];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 -(void) modifyCellByIDX:(int) idx
 {
-       [self modifyCell:[self getCellByIDX:idx]];
+    [self modifyCell:[self getCellByIDX:idx]];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 -(void) modifyCell:(DBCellElement*) cellElement
 {
-       [NSBundle loadNibNamed:@"IpPanel" owner:self];
-       [((IpConfiguratorCommander*) ipConfControllerCommander) setWorkCell:cellElement];
-       [NSApp beginSheet: ipConfigurationSheet
+    [NSBundle loadNibNamed:@"IpPanel" owner:self];
+    [((IpConfiguratorCommander*) ipConfControllerCommander) setWorkCell:cellElement];
+    [NSApp beginSheet: ipConfigurationSheet
           modalForWindow: [[self mainView] window]
-               modalDelegate: self
+          modalDelegate: self
           didEndSelector: @selector(didEndSheet:returnCode:contextInfo:)
-                 contextInfo: nil];
+          contextInfo: nil];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (IBAction) addRemoveCell:(id) sender
 {
-       switch([((NSControl*) sender) tag]){
-               case ADD_CELL_CONTROL_TAG:
-               {
-                       DBCellElement *newCell = [[DBCellElement alloc] init];
-                       if(!newCell) break;
-                       
-                       [newCell setCellName:kNewCellName];
-                       [newCell setCellComment:kNewCellComment];
-                       //cellArray = ;
-                       [[afsProperty getCellList] addObject:newCell];
-                       [newCell release];
-                       
-                       //Modify new cell
-                       [self modifyCell:newCell];
-               }
-               break;
-                       
-               case REMOVE_CELL_CONTROL_TAG:
-               {
-                       int index = 0;
-                       NSIndexSet *selectedIndex = [(NSTableView*)cellList selectedRowIndexes];
-                       if( [selectedIndex count] > 0) {
-                               index = [selectedIndex firstIndex]; 
-                               do {
-                                       DBCellElement *cellElement =  (DBCellElement*)[filteredCellDB objectAtIndex:index];
-                                       [[afsProperty getCellList] removeObject:cellElement];
-                               } while ((index = [selectedIndex indexGreaterThanIndex:index]) != NSNotFound);
-                       }
-               }
-               break;
-       }
-       //Filter the cellServDb and allocate filtered array
-       [self searchCellTextEvent:nil];
-       [(NSTableView*)cellList deselectAll:nil];
-       [(NSTableView*)cellList reloadData];
-}
-
-// -------------------------------------------------------------------------------
-//  repairHelperTool:
-// -------------------------------------------------------------------------------
-- (void) repairHelperTool
-{
-       struct stat st;
-    int fdTool;
-       int status = 0;
-       NSLog(@"repairHelperTool"); 
-       NSString *afshlpPath = [[self bundle] pathForResource:@"afshlp" ofType:nil];
+    switch([((NSControl*) sender) tag]){
+    case ADD_CELL_CONTROL_TAG:
+    {
+       DBCellElement *newCell = [[DBCellElement alloc] init];
+       if(!newCell) break;
        
+       [newCell setCellName:kNewCellName];
+       [newCell setCellComment:kNewCellComment];
+       //cellArray = ;
+       [[afsProperty getCellList] addObject:newCell];
+       [newCell release];
        
-    
-    // Open tool exclusively, so nobody can change it while we bless it.
-    fdTool = open([afshlpPath UTF8String], O_NONBLOCK | O_RDONLY | O_EXLOCK, 0);
-    
-    if(fdTool == -1)
-    {
-        NSLog(@"Exclusive open while repairing tool failed: %d.", errno);
-        exit(-1);
+       //Modify new cell
+       [self modifyCell:newCell];
     }
+    break;
     
-    if(fstat(fdTool, &st))
+    case REMOVE_CELL_CONTROL_TAG:
     {
-        NSLog(@"fstat failed.");
-        exit(-1);
+       int index = 0;
+       NSIndexSet *selectedIndex = [(NSTableView*)cellList selectedRowIndexes];
+       if( [selectedIndex count] > 0) {
+           index = [selectedIndex firstIndex];
+           do {
+               DBCellElement *cellElement =  (DBCellElement*)[filteredCellDB objectAtIndex:index];
+               [[afsProperty getCellList] removeObject:cellElement];
+           } while ((index = [selectedIndex indexGreaterThanIndex:index]) != NSNotFound);
+       }
     }
-    
-    if(st.st_uid != 0)
-    {
-               status = [[AuthUtil shared] autorize];
-               if(status == noErr){
-                       fchown(fdTool, 0, st.st_gid);
-                       
-                       // Disable group and world writability and make setuid root.
-                       fchmod(fdTool, (st.st_mode & (~(S_IWGRP | S_IWOTH)))/* | S_ISUID*/);
-                       const char *args[] = {"root", [afshlpPath UTF8String],0L};
-                       [[AuthUtil shared] execUnixCommand:"/usr/sbin/chown" 
-                                                                                 args:args
-                                                                               output:nil];
-                       [[AuthUtil shared] deautorize];
-               }
-    } else  NSLog(@"st_uid = 0");
-    
-       
-    
-    close(fdTool);
-    
-    NSLog(@"Self-repair done.");
-       
+    break;
+    }
+    //Filter the cellServDb and allocate filtered array
+    [self searchCellTextEvent:nil];
+    [cellList deselectAll:nil];
+    [cellList reloadData];
 }
 
-
 // -------------------------------------------------------------------------------
 //  startStopAfs:
 // -------------------------------------------------------------------------------
 - (IBAction) startStopAfs:(id) sender
 {
-       BOOL currentAfsState = NO;
-       @try {
-               currentAfsState = [afsProperty checkAfsStatus];
-               // make the parameter to call the root helper app
-               if(currentAfsState){
-                       //shutdown afs
-                       NSLog(@"Shutting down afs");
-                       [afsProperty shutdown];
-               } else {
-                       //Start afs
-                       NSLog(@"Starting up afs");
-                       [afsProperty startup];
-               }
-               [self refreshGui:nil];
-       }
-       @catch (NSException * e) {
-               [self showMessage:[e reason]];
-       }
-       @finally {
-               [[AuthUtil shared] deautorize];
+    BOOL currentAfsState = NO;
+    @try {
+       currentAfsState = [afsProperty checkAfsStatus];
+       // make the parameter to call the root helper app
+       if(currentAfsState){
+           //shutdown afs
+           NSLog(@"Shutting down afs");
+           [afsProperty shutdown];
+       } else {
+           //Start afs
+           NSLog(@"Starting up afs");
+           [afsProperty startup];
        }
+       [self refreshGui:nil];
+    }
+    @catch (NSException * e) {
+       [self showMessage:[e reason]];
+    }
+    @finally {
+    }
 }
 
 // -------------------------------------------------------------------------------
 //  info:
 // -------------------------------------------------------------------------------
 - (void) refreshGui:(NSNotification *)notification{
-       BOOL afsIsUp = [afsProperty checkAfsStatus];
-       [self setAfsStatus];
-       [tokensButton setEnabled:afsIsUp];
-       [unlogButton setEnabled:afsIsUp];
+    BOOL afsIsUp = [afsProperty checkAfsStatus];
+    [self setAfsStatus];
+    [tokensButton setEnabled:afsIsUp];
+    [unlogButton setEnabled:afsIsUp];
 
 }
 
 //  -(void) refreshTokensNotify:(NSNotification*)notification
 // -------------------------------------------------------------------------------
 -(void) refreshTokensNotify:(NSNotification*)notification {
-       [self refreshTokens:nil];
+    [self refreshTokens:nil];
 }
 
 // -------------------------------------------------------------------------------
 //  afsVolumeMountChange: Track the afs volume state change
 // -------------------------------------------------------------------------------
+// XXX should use mountdir not /afs
 - (void) afsVolumeMountChange:(NSNotification *)notification{
-       // Cehck if is mounted or unmounted afs
-       if([[[notification userInfo] objectForKey:@"NSDevicePath"] isEqualToString:@"/afs"]){
-               [self setAfsStatus];
-               [self refreshTokens:nil];
-       }
+    // Check if is mounted or unmounted afs
+    if([[[notification userInfo] objectForKey:@"NSDevicePath"] isEqualToString:@"/afs"]){
+       [self setAfsStatus];
+       [self refreshTokens:nil];
+    }
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (IBAction) info:(id) sender
 {
-       [((InfoController*) infoController) showHtmlResource:[[self bundle] pathForResource:@"license" ofType:@"rtf"]];
+    [infoController showHtmlResource:[[self bundle] pathForResource:@"license" ofType:@"rtf"]];
 
-       [NSApp beginSheet: infoSheet
+    [NSApp beginSheet: infoSheet
           modalForWindow: [[self mainView] window]
-               modalDelegate: self
+          modalDelegate: self
           didEndSelector:  @selector(didEndInfoSheet:returnCode:contextInfo:)
-                 contextInfo: nil];
+          contextInfo: nil];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (IBAction) tableDoubleAction:(id) sender
 {
-       [self showCellIP:nil];
+    [self showCellIP:nil];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (IBAction) getNewToken:(id) sender
 {
-       BOOL useAklog = [useAklogCheck state] == NSOnState;
-       if(useAklog){
-               //[AFSPropertyManager aklog];
-               [afsProperty getTokens:false 
-                                                  usr:nil 
-                                                  pwd:nil];
-               [self refreshTokens:nil];
-               //Inform afs menuextra to updata afs status
-               [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kMExtraAFSStateChange];
+    BOOL useAklog = [useAklogCheck state] == NSOnState;
+    if(useAklog){
+       //[AFSPropertyManager aklog];
+       [afsProperty getTokens:false
+                    usr:nil
+                    pwd:nil];
+       [self refreshTokens:nil];
+       //Inform afs menuextra to updata afs status
+       [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kMExtraAFSStateChange];
 
-       } else {
-               [NSBundle loadNibNamed:@"CredentialPanel" owner:self];
-               [NSApp beginSheet: credentialSheet
-                  modalForWindow: [[self mainView] window]
-                       modalDelegate: self
-                  didEndSelector: @selector(didEndCredentialSheet:returnCode:contextInfo:)
-                         contextInfo: nil];
-       }
+    } else {
+       [NSBundle loadNibNamed:@"CredentialPanel" owner:self];
+       [NSApp beginSheet: credentialSheet
+              modalForWindow: [[self mainView] window]
+              modalDelegate: self
+              didEndSelector: @selector(didEndCredentialSheet:returnCode:contextInfo:)
+              contextInfo: nil];
+    }
 }
 
 
 // -------------------------------------------------------------------------------
 - (IBAction) unlog:(id) sender
 {
-       int index = -1;
-       NSIndexSet *selectedIndex = [(NSTableView*)tokensTable selectedRowIndexes];
-       if( [selectedIndex count] > 0) {
-               index = [selectedIndex firstIndex]; 
-               do {
-                       NSString *tokenDesc = [tokenList objectAtIndex:index];
-                       NSString *cellToUnlog = [tokenDesc estractTokenByDelimiter:@"afs@" 
-                                                                                                                         endToken:@" "];
-                       [afsProperty unlog:cellToUnlog];
-               } while ((index = [selectedIndex indexGreaterThanIndex: index]) != NSNotFound);
-       } else {
-               [afsProperty unlog:nil];
-       }
-       [self refreshTokens:nil];
-       //Inform afs menuextra to updata afs status
-       [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kMExtraAFSStateChange];
-
+    int index = -1;
+    NSIndexSet *selectedIndex = [tokensTable selectedRowIndexes];
+    if( [selectedIndex count] > 0) {
+       index = [selectedIndex firstIndex];
+       do {
+           NSString *tokenDesc = [tokenList objectAtIndex:index];
+           NSString *cellToUnlog = [tokenDesc estractTokenByDelimiter:@"afs@"
+                                              endToken:@" "];
+           [afsProperty unlog:cellToUnlog];
+       } while ((index = [selectedIndex indexGreaterThanIndex: index]) != NSNotFound);
+    } else {
+       [afsProperty unlog:nil];
+    }
+    [self refreshTokens:nil];
+    //Inform afs menuextra to updata afs status
+    [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kMExtraAFSStateChange];
 }
 
 
 // -------------------------------------------------------------------------------
 - (IBAction) aklogSwitchEvent:(id) sender
 {
-       //afs menu extra is loaded inform it to read preference
-       @try {
-               if(![useAklogCheck state]) {
-                       //deselect the checkbox
-                       [aklogCredentialAtLoginTime setState:NO];
-               }
-               
-               [self writePreferenceFile];
-               
-               //Enable disable aklog at login time checkbox according the useAklog checkbox
-               [aklogCredentialAtLoginTime setEnabled:[useAklogCheck state]];
-               
-       }
-       @catch (NSException * e) {
-               [self showMessage:[e reason]];
+    //afs menu extra is loaded inform it to read preference
+    @try {
+       if(![useAklogCheck state]) {
+           //deselect the checkbox
+           [aklogCredentialAtLoginTime setState:NO];
        }
        
-               
+       [self writePreferenceFile];
+
+       //Enable disable aklog at login time checkbox according the useAklog checkbox
+       [aklogCredentialAtLoginTime setEnabled:[useAklogCheck state]];
+
+    }
+    @catch (NSException * e) {
+       [self showMessage:[e reason]];
+    }
 }
 
 // -------------------------------------------------------------------------------
 //  credentialAtLoginTimeEvent:
 // -------------------------------------------------------------------------------
 - (IBAction) credentialAtLoginTimeEvent:(id) sender {
-       [self writePreferenceFile];
+    [self writePreferenceFile];
 }
 
 // -------------------------------------------------------------------------------
 //  afsStartupSwitchEvent:
 // -------------------------------------------------------------------------------
 - (IBAction) afsStartupSwitchEvent:(id) sender {
-       NSString *rootHelperApp = [[self bundle] pathForResource:@"afshlp" ofType:@""];
-       //get the new state
-       startAFSAtLogin = [checkButtonAfsAtBootTime state];
-       const char *startupConfigureOption[] = {"start_afs_at_startup", startAFSAtLogin?"enable":"disable", 0L};
-       if([[AuthUtil shared] autorize] == noErr) {
-                       //now disable the launchd configuration
-                       [[AuthUtil shared] execUnixCommand:[rootHelperApp UTF8String]
-                                                                                 args:startupConfigureOption
-                                                                               output:nil];
-       }
+    NSString *rootHelperApp = [[self bundle] pathForResource:@"afshlp" ofType:@""];
+    //get the new state
+    startAFSAtLogin = [checkButtonAfsAtBootTime state];
+    [PListManager launchctlStringCommandAuth:startAFSAtLogin?@"load":@"unload"
+                 option:[NSArray arrayWithObjects:@"-w", nil]
+                 plistName:@AFS_DAEMON_PATH
+                 helper:rootHelperApp
+                 withAuthRef:[[authView authorization] authorizationRef]];
 }
 
 
 //  afsMenuActivationEvent:
 // -------------------------------------------------------------------------------
 - (IBAction) krb5KredentialAtLoginTimeEvent:(id) sender {
-       //
-       NSString *rootHelperApp = [[self bundle] pathForResource:@"afshlp" ofType:@""];
-       const char *args[] = {"enable_krb5_startup", [[installKRB5AuthAtLoginButton stringValue] UTF8String], "", 0L};
-       
-       //Check helper app
-       [self repairHelperTool];
-       if([[AuthUtil shared] autorize] == noErr) {
-               [[AuthUtil shared] execUnixCommand:[rootHelperApp UTF8String] 
-                                                                         args:args
-                                                                       output:nil];
-               
-               //check if all is gone well
-               [installKRB5AuthAtLoginButton setState:[PListManager checkKrb5AtLoginTimeLaunchdEnable]];
-       }
+    NSString *rootHelperApp = [[self bundle] pathForResource:@"afshlp" ofType:@""];
+    [PListManager krb5TiketAtLoginTime:[installKRB5AuthAtLoginButton state] helper:rootHelperApp];
+
+    //check if all is gone well
+    [installKRB5AuthAtLoginButton setState:[PListManager checkKrb5AtLoginTimeLaunchdEnable]];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 -(IBAction) afsMenuActivationEvent:(id) sender
 {
-       CFPreferencesSetValue((CFStringRef)PREFERENCE_SHOW_STATUS_MENU, 
-                                                 (CFNumberRef)[NSNumber numberWithBool:[(NSButton*)afsMenucheckBox state]],
-                                                 (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       
-       CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesAnyUser, kCFPreferencesAnyHost);
-       CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       
-       //notify the backgrounder
-       [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kMExtraAFSMenuChangeState];
+    CFPreferencesSetValue((CFStringRef)PREFERENCE_SHOW_STATUS_MENU,
+                         (CFNumberRef)[NSNumber numberWithBool:[(NSButton*)afsMenucheckBox state]],
+                         (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+    CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesAnyUser, kCFPreferencesAnyHost);
+    CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+    //notify the backgrounder
+    [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kMExtraAFSMenuChangeState];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (IBAction) searchCellTextEvent:(id) sender
 {
-       
-       NSString *searchText = [[textSearchField stringValue] lowercaseString]; //filter string
-       [self filterCellServDB:searchText];
-       [((NSTableView*)cellList) reloadData];
+    NSString *searchText = [[textSearchField stringValue] lowercaseString]; //filter string
+    [self filterCellServDB:searchText];
+    [((NSTableView*)cellList) reloadData];
 }
 
 // -------------------------------------------------------------------------------
 //             clear the NSSearchField and showw all CellServDB table
 // -------------------------------------------------------------------------------
 - (void) clearCellServDBFiltering {
-       //Clear the text search
-       [textSearchField setStringValue:@""];
-       //load the temp array with all cell servdb
-       [self searchCellTextEvent:nil];
+    //Clear the text search
+    [textSearchField setStringValue:@""];
+    //load the temp array with all cell servdb
+    [self searchCellTextEvent:nil];
 }
 // --------------------------------------o-----------------------------------------
 //  filterCellServDB:
 //  make the NSMutableArray with all cellservdb or filtered element
 // -------------------------------------------------------------------------------
 - (void) filterCellServDB:(NSString*)textToFilter {
-       DBCellElement *cellElement; //Filtered element
-       BOOL doFilter = !(textToFilter == nil || ([textToFilter length] == 0));
-       
-       // We can do filtering and make the temp array
-       if(filteredCellDB){
-               [filteredCellDB release];
-       }
-       filteredCellDB = [[NSMutableArray alloc] init];
-       NSEnumerator *e = [[afsProperty getCellList] objectEnumerator];
-       while(cellElement = (DBCellElement*)[e nextObject]) {
-               // check if the element can be get
-               if(doFilter) {
-                       //Get the CellServDB array enumerator
-                       NSRange rsltRng = [[[cellElement getCellName] lowercaseString] rangeOfString:textToFilter];
-                  if(rsltRng.location != NSNotFound) {
-                       //we can add this cell to filtered
-                       [filteredCellDB addObject:[cellElement retain]];
-                  }
-               } else {
-                       [filteredCellDB addObject:[cellElement retain]];
-
-               }
+    DBCellElement *cellElement; //Filtered element
+    BOOL doFilter = !(textToFilter == nil || ([textToFilter length] == 0));
+
+    // We can do filtering and make the temp array
+    if(filteredCellDB){
+       [filteredCellDB release];
+    }
+    filteredCellDB = [[NSMutableArray alloc] init];
+    NSEnumerator *e = [[afsProperty getCellList] objectEnumerator];
+    while(cellElement = (DBCellElement*)[e nextObject]) {
+       // check if the element can be get
+       if(doFilter) {
+           //Get the CellServDB array enumerator
+           NSRange rsltRng = [[[cellElement getCellName] lowercaseString] rangeOfString:textToFilter];
+           if(rsltRng.location != NSNotFound) {
+               //we can add this cell to filtered
+               [filteredCellDB addObject:[cellElement retain]];
+           }
+       } else {
+           [filteredCellDB addObject:[cellElement retain]];
+
        }
+    }
 }
                   
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (DBCellElement*) getCurrentCellInDB
 {
-       int rowSelected = [((NSTableView *) cellList) selectedRow];
-       return [self getCellByIDX:rowSelected];
+    int rowSelected = [cellList selectedRow];
+    return [self getCellByIDX:rowSelected];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (DBCellElement*) getCellByIDX:(int) idx
 {
-       //NSMutableArray *cellArray = [afsProperty getCellList];
-       DBCellElement *cellElement =  (DBCellElement*)[filteredCellDB objectAtIndex:idx];
-       return cellElement;
+    DBCellElement *cellElement =  (DBCellElement*)[filteredCellDB objectAtIndex:idx];
+    return cellElement;
 }
 
 // -------------------------------------------------------------------------------
 //  showMessage:
 // -------------------------------------------------------------------------------
 -(void) showMessage:(NSString*) message{
-       NSAlert *alert = [[NSAlert alloc] init];
-       
-       [alert setMessageText:message];
-       [alert beginSheetModalForWindow:[[self mainView] window]
-                                         modalDelegate:nil 
-                                        didEndSelector:nil
-                                               contextInfo:nil];
-       [alert release];
+    NSAlert *alert = [[NSAlert alloc] init];
+
+    [alert setMessageText:message];
+    [alert beginSheetModalForWindow:[[self mainView] window]
+          modalDelegate:nil
+          didEndSelector:nil
+          contextInfo:nil];
+    [alert release];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 -(void) setAfsStatus
 {
-       
-       BOOL afsIsUp = [afsProperty checkAfsStatus];
-       BOOL afsEnabledAtStartup = NO;
-       
-       NSMutableString *commandOutput = [NSMutableString stringWithCapacity:20];
-       NSString *rootHelperApp = [[self bundle] pathForResource:@"afshlp" ofType:@""];
-               
-#if 0
-                       // make the parameter to call the root helper app
-       const char *checkAFSDaemonParam[] = {"check_afs_daemon",  0L};
-       if([[AuthUtil shared] autorize] == noErr) {
-                               //now disable the launchd configuration
-               [[AuthUtil shared] execUnixCommand:[rootHelperApp UTF8String]
-                                                                         args:checkAFSDaemonParam
-                                                                       output:commandOutput];
-               afsEnabledAtStartup = [commandOutput rangeOfString:@"afshlp:afs daemon registration result:1"].location!=NSNotFound;
-       }
-#else
-       afsEnabledAtStartup = 1;
-#endif
-       
-       
+    BOOL afsIsUp = [afsProperty checkAfsStatus];
+    BOOL afsEnabledAtStartup = NO;
+    NSString *rootHelperApp = [[self bundle] pathForResource:@"afshlp" ofType:@""];
+
+    if ([self isUnlocked]) {
+       afsEnabledAtStartup = (
+           [TaskUtil executeTaskWithAuth:@"/bin/launchctl"
+                     arguments:[NSArray arrayWithObjects:@"list",
+                                        @"org.openafs.filesystems.afs", nil]
+                     helper:rootHelperApp
+                     withAuthRef:[[authView authorization] authorizationRef]
+            ] == noErr)?YES:NO;
+       [checkButtonAfsAtBootTime setState:afsEnabledAtStartup];
+    }
 
+    [startStopButton setTitle: (afsIsUp?kAfsButtonShutdown:kAfsButtonStartup)];
 
-       [((NSButton *)startStopButton) setTitle: (afsIsUp?kAfsButtonShutdown:kAfsButtonStartup)];
-       
-       NSMutableAttributedString *colorTitle =[[NSMutableAttributedString alloc] initWithAttributedString:[((NSButton *)startStopButton) attributedTitle]];
+    NSMutableAttributedString *colorTitle =[[NSMutableAttributedString alloc] initWithAttributedString:[startStopButton attributedTitle]];
     NSRange titleRange = NSMakeRange(0, [colorTitle length]);
-       
+
     [colorTitle addAttribute:NSForegroundColorAttributeName
-                       value:(afsIsUp?[NSColor redColor]:[NSColor blackColor])
-                       range:titleRange];
-       
-    [((NSButton *)startStopButton) setAttributedTitle:colorTitle];
-       [checkButtonAfsAtBootTime setState:afsEnabledAtStartup];
-       if(afsIsUp) {
-               [self startTimer];
-       } else {
-               [self stopTimer];
-       }
+               value:(afsIsUp?[NSColor redColor]:[NSColor blackColor])
+               range:titleRange];
+
+    [startStopButton setAttributedTitle:colorTitle];
+    if(afsIsUp) {
+       [self startTimer];
+    } else {
+       [self stopTimer];
+    }
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (void) refreshTokens:(NSTimer*)theTimer;
 {
-       if(![tokensLock tryLock]) return;
-       if(tokenList){
-               [tokenList release];
-       }
-       
-       tokenList = [afsProperty getTokenList];
-       [((NSTableView*)tokensTable) reloadData];
-       [tokensLock unlock];
+    if(![tokensLock tryLock]) return;
+    if(tokenList){
+       [tokenList release];
+    }
+
+    tokenList = [afsProperty getTokenList];
+    [tokensTable reloadData];
+    [tokensLock unlock];
 }
 
 // -------------------------------------------------------------------------------
 //  removeExtra:
 // -------------------------------------------------------------------------------
 - (IBAction) addLink:(id) sender {
-       [NSBundle loadNibNamed:@"SymLinkEdit" owner:self];
-       
-       [NSApp beginSheet: lyncCreationSheet
+    [NSBundle loadNibNamed:@"SymLinkEdit" owner:self];
+
+    [NSApp beginSheet: lyncCreationSheet
           modalForWindow: [[self mainView] window]
-               modalDelegate: self
+          modalDelegate: self
           didEndSelector: @selector(didEndSymlinkSheet:returnCode:contextInfo:)
-                 contextInfo: nil];
-       
+          contextInfo: nil];
 }
 
 // -------------------------------------------------------------------------------
 //  removeExtra:
 // -------------------------------------------------------------------------------
 - (IBAction) removeLink:(id) sender {
-       if(!linkConfiguration) return;
-       int index = 0;
-       NSArray *keys = [linkConfiguration allKeys];
-       NSIndexSet *linkToRemove = [tableViewLink selectedRowIndexes];
-       if( [linkToRemove count] > 0) {
-               index = [linkToRemove firstIndex];
-               do {
-                       [linkConfiguration removeObjectForKey:[keys objectAtIndex:index]];
-               } while ((index = [linkToRemove indexGreaterThanIndex:index]) != -1);
-       }
-       
-       //write the new configuration
-       NSData *prefData = nil;
-       if([linkConfiguration count] > 0) {
-               prefData = [NSPropertyListSerialization dataWithPropertyList:linkConfiguration
-                                                                                                                         format:NSPropertyListXMLFormat_v1_0
-                                                                                                                        options:0
-                                                                                                                          error:nil];
-       }
-       CFPreferencesSetValue((CFStringRef)PREFERENCE_LINK_CONFIGURATION,
-                                                 (CFDataRef)prefData,
-                                                 (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       
-       CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       
-       //reload the new data
-       [tableViewLink reloadData];
+    if(!linkConfiguration) return;
+    int index = 0;
+    NSArray *keys = [linkConfiguration allKeys];
+    NSIndexSet *linkToRemove = [tableViewLink selectedRowIndexes];
+    if( [linkToRemove count] > 0) {
+       index = [linkToRemove firstIndex];
+       do {
+           [linkConfiguration removeObjectForKey:[keys objectAtIndex:index]];
+       } while ((index = [linkToRemove indexGreaterThanIndex:index]) != -1);
+    }
+
+    //write the new configuration
+    NSData *prefData = nil;
+    if([linkConfiguration count] > 0) {
+       prefData = [NSPropertyListSerialization dataWithPropertyList:linkConfiguration
+                                               format:NSPropertyListXMLFormat_v1_0
+                                               options:0
+                                               error:nil];
+    }
+    CFPreferencesSetValue((CFStringRef)PREFERENCE_LINK_CONFIGURATION,
+                         (CFDataRef)prefData,
+                         (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+    CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+    //reload the new data
+    [tableViewLink reloadData];
 }
 
 // -------------------------------------------------------------------------------
 //  removeExtra:
 // -------------------------------------------------------------------------------
 - (IBAction) enableLink:(id) sender {
-       [self writePreferenceFile];
+    [self writePreferenceFile];
 }
 
 // -------------------------------------------------------------------------------
 //  removeExtra:
 // -------------------------------------------------------------------------------
 - (IBAction) manageBackgrounderActivation:(id)sender {
-       [PListManager launchctlCommand:[(NSButton*)sender state] 
-                                               userDomain:YES 
-                                                       option:[NSArray arrayWithObjects:@"-S", @"Aqua", nil] 
-                                                plistName:[NSString stringWithFormat:@"%@.plist", BACKGROUNDER_P_FILE]];
-       //re ad the status to check taht all is gone well
-       [backgrounderActivationCheck setState:[PListManager launchdJobState:BACKGROUNDER_P_FILE]];
+    [PListManager launchctlCommand:[(NSButton*)sender state]
+                 userDomain:YES
+                 option:[NSArray arrayWithObjects:@"-S", @"Aqua", nil]
+                 plistName:[NSString stringWithFormat:@"%@.plist", BACKGROUNDER_P_FILE]];
+    //read the status to check that all is gone well
+    [backgrounderActivationCheck setState:[PListManager launchdJobState:BACKGROUNDER_P_FILE]];
 }
 
 // -------------------------------------------------------------------------------
 //  tableViewLinkPerformClick:
 // -------------------------------------------------------------------------------
 - (IBAction) tableViewLinkPerformClick:(id) sender {
-       NSLog(@"tableViewLinkPerformClick");
+    NSLog(@"tableViewLinkPerformClick");
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (void)tabView:(NSTabView *)tabView willSelectTabViewItem: (NSTabViewItem *)tabViewItem 
 {
-       //check to see if the cache param tab is the tab that will be selected
-       if([((NSString*)[tabViewItem identifier]) intValue] == TAB_LINK)
-       {
-               [tableViewLink reloadData];
-       }
+    //check to see if the cache param tab is the tab that will be selected
+    if([((NSString*)[tabViewItem identifier]) intValue] == TAB_LINK)
+    {
+       [tableViewLink reloadData];
+    }
 }
 // -------------------------------------------------------------------------------
 //  tableViewLinkPerformClick:
 // -------------------------------------------------------------------------------
 - (IBAction) enableDisableKrb5RenewCheck:(id) sender {
-       //NSLog(@"enableDisableKrb5RenewCheck");
-       CFPreferencesSetValue((CFStringRef)PREFERENCE_KRB5_CHECK_ENABLE,
-                                                 (CFNumberRef) [NSNumber numberWithInt:[(NSButton*)sender intValue]],
-                                                 (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-       CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
-               //notify the backgrounder
-       [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kPrefChangeNotification];
+    //NSLog(@"enableDisableKrb5RenewCheck");
+    CFPreferencesSetValue((CFStringRef)PREFERENCE_KRB5_CHECK_ENABLE,
+                         (CFNumberRef) [NSNumber numberWithInt:[(NSButton*)sender intValue]],
+                         (CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    CFPreferencesSynchronize((CFStringRef)kAfsCommanderID,  kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+    //notify the backgrounder
+    [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kPrefChangeNotification];
 }
 // -------------------------------------------------------------------------------
 //  tableViewLinkPerformClick:
 // -------------------------------------------------------------------------------
 - (IBAction) krb5RenewParamChange:(id) sender {
 }
+
+
+- (BOOL)isUnlocked {
+    return [authView authorizationState] == SFAuthorizationViewUnlockedState;
+}
+
+- (void)authorizationViewDidAuthorize:(SFAuthorizationView *)view {
+    // enable things
+    [startStopButton setEnabled:[self isUnlocked]];
+    [checkButtonAfsAtBootTime setEnabled:[self isUnlocked]];
+    [self setAfsStatus];
+    [installKRB5AuthAtLoginButton setEnabled:[self isUnlocked]];
+}
+
+- (void)authorizationViewDidDeauthorize:(SFAuthorizationView *)view {
+    // disable things
+    [startStopButton setEnabled:[self isUnlocked]];
+    [checkButtonAfsAtBootTime setEnabled:[self isUnlocked]];
+    [installKRB5AuthAtLoginButton setEnabled:[self isUnlocked]];
+}
 @end
 
 @implementation AFSCommanderPref (NSTableDataSource)
 - (void)tableView:(NSTableView *)table 
    setObjectValue:(id)data 
    forTableColumn:(NSTableColumn *)col 
-                         row:(int)row
+             row:(int)row
 {
-       NSString *identifier = (NSString*)[col identifier];
-       switch([table tag]){
-               case TABLE_TOKENS_LIST:
-                       break;
-                       
-               case TABLE_CELL_LIST:
-                       // we are editing checkbox for cellservdb table
-                       if([identifier intValue] == CELLSRVDB_TABLE_USR_DFLT_CHECK_COLUMN) {
-                               // set the user default cell
-                               DBCellElement *cellElement =  (DBCellElement*)[filteredCellDB objectAtIndex:row];
-                               [afsProperty setDefaultCellByName:[cellElement getCellName]];
-                               //[afsDefaultCellLabel setStringValue:[afsProperty getDefaultCellName]];
-                               [((NSTableView*)cellList) reloadData];
-                       } else if([identifier intValue] == CELLSRVDB_TABLE_DFLT_CHECK_COLUMN) {
-                               // set the cell for wich the user want to get token
-                               DBCellElement *cellElement =  (DBCellElement*)[filteredCellDB objectAtIndex:row];
-                               [cellElement setUserDefaultForToken:![cellElement userDefaultForToken]];
-                       }  
-                       break;
-       }
+    NSString *identifier = (NSString*)[col identifier];
+    switch([table tag]){
+    case TABLE_TOKENS_LIST:
+       break;
        
+    case TABLE_CELL_LIST:
+       // we are editing checkbox for cellservdb table
+       if([identifier intValue] == CELLSRVDB_TABLE_USR_DFLT_CHECK_COLUMN) {
+           // set the user default cell
+           DBCellElement *cellElement =  (DBCellElement*)[filteredCellDB objectAtIndex:row];
+           [afsProperty setDefaultCellByName:[cellElement getCellName]];
+           //[afsDefaultCellLabel setStringValue:[afsProperty getDefaultCellName]];
+           [((NSTableView*)cellList) reloadData];
+       } else if([identifier intValue] == CELLSRVDB_TABLE_DFLT_CHECK_COLUMN) {
+           // set the cell for wich the user want to get token
+           DBCellElement *cellElement =  (DBCellElement*)[filteredCellDB objectAtIndex:row];
+           [cellElement setUserDefaultForToken:![cellElement userDefaultForToken]];
+       }
+       break;
+    }
 }
 
 
 //  tableView:
 //             refresh delegate method for two AFSCommander table
 // -------------------------------------------------------------------------------
-- (id)         tableView:(NSTableView *) aTableView
-       objectValueForTableColumn:(NSTableColumn *) aTableColumn
-                                                 row:(int) rowIndex
+- (id) tableView:(NSTableView *) aTableView
+objectValueForTableColumn:(NSTableColumn *) aTableColumn
+            row:(int) rowIndex
 {  
+    id result = nil;
+    NSString *identifier = (NSString*)[aTableColumn identifier];
+    switch([aTableView tag]){
+    case TABLE_TOKENS_LIST:
+       //We are refreshing tokens table
+       result = [self getTableTokensListValue:[identifier intValue] row:rowIndex];
+       break;
        
-       id result = nil;
-       NSString *identifier = (NSString*)[aTableColumn identifier];
-       switch([aTableView tag]){
-               case TABLE_TOKENS_LIST:
-                       //We are refreshing tokens table
-                       result = [self getTableTokensListValue:[identifier intValue] row:rowIndex];
-                       break;
-                       
-               case TABLE_CELL_LIST:
-                       //We are refreshing cell db table
-                       result = [self getTableCelListValue:[identifier intValue] row:rowIndex];
-                       break;
-                       
-               case TABLE_LINK_LIST:
-                       result = [self getTableLinkValue:[identifier intValue] row:rowIndex];
-                       break;
-
-               
-       }
-       return result;  
+    case TABLE_CELL_LIST:
+       //We are refreshing cell db table
+       result = [self getTableCelListValue:[identifier intValue] row:rowIndex];
+       break;
+
+    case TABLE_LINK_LIST:
+       result = [self getTableLinkValue:[identifier intValue] row:rowIndex];
+       break;
+    }
+    return result;
 }
 
 
 // -------------------------------------------------------------------------------
 - (id)getTableTokensListValue:(int) colId row:(int)row
 {
-       id result = nil;
-       if(!tokenList) return nil;
-       switch(colId){
-               case 0:
-                       result = (NSString*)[tokenList objectAtIndex:row];
-                       break;
-       }
-       return result;
+    id result = nil;
+    if(!tokenList) return nil;
+    switch(colId){
+    case 0:
+       result = (NSString*)[tokenList objectAtIndex:row];
+       break;
+    }
+    return result;
 }
 
 
 // -------------------------------------------------------------------------------
 - (id)getTableCelListValue:(int) colId row:(int)row
 {
-       id result = nil;
-       //NSMutableArray *cellArray = [afsProperty getCellList];
-       DBCellElement *cellElement =  (DBCellElement*)[filteredCellDB objectAtIndex:row];
-       switch(colId){
-               case CELLSRVDB_TABLE_USR_DFLT_CHECK_COLUMN:
-                       result = [NSNumber numberWithInt:[cellElement userDefaultForCell]];
-                       break;
-                       
-               case CELLSRVDB_TABLE_DFLT_CHECK_COLUMN:
-                       result = [NSNumber numberWithInt:[cellElement userDefaultForToken]];
-                       break;
-               case CELLSRVDB_TABLE_NAME_COLUMN:
-                       result = [cellElement getCellName];
-                       break;
-                       
-               case CELLSRVDB_TABLE_DESCRIPTION_COLUMN:
-                       result = [cellElement getCellComment];
-                       break;
-       }
-       return result;
+    id result = nil;
+    //NSMutableArray *cellArray = [afsProperty getCellList];
+    DBCellElement *cellElement =  (DBCellElement*)[filteredCellDB objectAtIndex:row];
+    switch(colId){
+    case CELLSRVDB_TABLE_USR_DFLT_CHECK_COLUMN:
+       result = [NSNumber numberWithInt:[cellElement userDefaultForCell]];
+       break;
+
+    case CELLSRVDB_TABLE_DFLT_CHECK_COLUMN:
+       result = [NSNumber numberWithInt:[cellElement userDefaultForToken]];
+       break;
+    case CELLSRVDB_TABLE_NAME_COLUMN:
+       result = [cellElement getCellName];
+       break;
+
+    case CELLSRVDB_TABLE_DESCRIPTION_COLUMN:
+       result = [cellElement getCellComment];
+       break;
+    }
+    return result;
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (id)getTableLinkValue:(int) colId row:(int)row
 {
-       id result = nil;
-       NSArray *allKey = [linkConfiguration allKeys];
-       switch(colId){
-               case TABLE_COLUMN_LINK_NAME:
-                       result = [allKey objectAtIndex:row];
-                       break;
-                       
-               case TABLE_COLUMN_LINK_PATH:
-                       result = [linkConfiguration objectForKey:[allKey objectAtIndex:row]];
-                       break;
-       }
-       return result;
+    id result = nil;
+    NSArray *allKey = [linkConfiguration allKeys];
+    switch(colId){
+    case TABLE_COLUMN_LINK_NAME:
+       result = [allKey objectAtIndex:row];
+       break;
+
+    case TABLE_COLUMN_LINK_PATH:
+       result = [linkConfiguration objectForKey:[allKey objectAtIndex:row]];
+       break;
+    }
+    return result;
 }
 
 
 // -------------------------------------------------------------------------------
 - (int)numberOfRowsInTableView:(NSTableView *)aTableView
 {
-       int rowCount = 0;
-       //NSMutableArray *cellArray = nil;
-       switch([aTableView tag]){
-               case TABLE_TOKENS_LIST:
-                       if(tokenList)  rowCount = [tokenList count];
-                       break;
-                       
-               case TABLE_CELL_LIST:
-                       //cellArray = [afsProperty getCellList];
-                       if(filteredCellDB)  rowCount = [filteredCellDB count];
-                       break;
-                       
-               case TABLE_LINK_LIST:
-                       if(linkConfiguration)  rowCount = [linkConfiguration count];
-                       break;
-
-                       
-       }       
-       return rowCount;  
+    int rowCount = 0;
+    switch([aTableView tag]){
+    case TABLE_TOKENS_LIST:
+       if(tokenList)  rowCount = [tokenList count];
+       break;
+
+    case TABLE_CELL_LIST:
+       if(filteredCellDB)  rowCount = [filteredCellDB count];
+       break;
+
+    case TABLE_LINK_LIST:
+       if(linkConfiguration)  rowCount = [linkConfiguration count];
+       break;
+    }
+    return rowCount;
 }
 @end
 
 // -------------------------------------------------------------------------------
 - (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTable
 {
-       switch([aTable tag]){
-               case TABLE_TOKENS_LIST:
-                       
-                       break;
-                       
-               case TABLE_CELL_LIST:
-                       [self tableViewCellmanageButtonState:[aTable selectedRow]];
-                       break;
-                       
-               case TABLE_LINK_LIST:
-                       break;
-                       
-                       
-       }       
+    switch([aTable tag]){
+    case TABLE_TOKENS_LIST:
+       break;
        
-       return YES;
+    case TABLE_CELL_LIST:
+       [self tableViewCellmanageButtonState:[aTable selectedRow]];
+       break;
+
+    case TABLE_LINK_LIST:
+       break;
+
+
+    }
+
+    return YES;
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (BOOL)tableView:(NSTableView *)aTable shouldSelectRow:(int)aRow
 {
-       switch([aTable tag]){
-               case TABLE_TOKENS_LIST:
-                       
-                       break;
-                       
-               case TABLE_CELL_LIST:
-                       [self tableViewCellmanageButtonState:aRow];
-                       break;
-                       
-               case TABLE_LINK_LIST:
-                       break;
-                       
-                       
-       }
+    switch([aTable tag]){
+    case TABLE_TOKENS_LIST:
+       break;
+
+    case TABLE_CELL_LIST:
+       [self tableViewCellmanageButtonState:aRow];
+       break;
        
-       return YES;
+    case TABLE_LINK_LIST:
+       break;
+    }
+    return YES;
 }
 
 // -------------------------------------------------------------------------------
 //  tableView:
 // -------------------------------------------------------------------------------
 - (void)tableViewSelectionDidChange:(NSNotification *)aNotification {
-       NSTableView *aTable = [aNotification object];
-       switch([aTable tag]){
-               case TABLE_TOKENS_LIST:
-                       break;
-                       
-               case TABLE_CELL_LIST:
-                       break;
-                       
-               case TABLE_LINK_LIST:
-                       [self tableViewLinkmanageButtonState:[aTable selectedRowIndexes]];
-                       break;
-                       
-                       
-       }
+    NSTableView *aTable = [aNotification object];
+    switch([aTable tag]){
+    case TABLE_TOKENS_LIST:
+       break;
+
+    case TABLE_CELL_LIST:
+       break;
+
+    case TABLE_LINK_LIST:
+       [self tableViewLinkmanageButtonState:[aTable selectedRowIndexes]];
+       break;
+    }
 }
 // -------------------------------------------------------------------------------
 //  manageButtonState:
 // -------------------------------------------------------------------------------
 -(void) tableViewCellmanageButtonState:(int) rowSelected  {
-       [((NSControl*) cellIpButton) setEnabled:rowSelected >= 0];
-       [((NSControl*) removeCellButton) setEnabled:rowSelected >= 0];
+    [cellIpButton setEnabled:rowSelected >= 0];
+    [removeCellButton setEnabled:rowSelected >= 0];
 }
 
 // -------------------------------------------------------------------------------
 //  manageButtonState:
 // -------------------------------------------------------------------------------
 -(void) tableViewLinkmanageButtonState:(NSIndexSet *) rowsSelectedIndex {
-       [buttonRemoveLink setEnabled:[rowsSelectedIndex count]>0];
+    [buttonRemoveLink setEnabled:[rowsSelectedIndex count]>0];
 }
 @end
 
 - (void)didEndSheet:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
 {
     [sheet orderOut:self];
-       //Filter the cellServDb and allocate filtered array
-       [self searchCellTextEvent:nil];
-       [((NSTableView*)cellList) reloadData];
+    //Filter the cellServDb and allocate filtered array
+    [self searchCellTextEvent:nil];
+    [cellList reloadData];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (void)didEndCredentialSheet:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
 {
-       if([((TokenCredentialController*)credentialCommander) takenToken] == YES){
-               /*[AFSPropertyManager klog:[((TokenCredentialController*)credentialCommander) uName] 
-                                                       uPwd:[((TokenCredentialController*)credentialCommander) uPwd] ];*/
-               [afsProperty getTokens:true 
-                                                  usr:[((TokenCredentialController*)credentialCommander) uName] 
-                                                  pwd:[((TokenCredentialController*)credentialCommander) uPwd]];
-       }
+    if([((TokenCredentialController*)credentialCommander) takenToken] == YES){
+       /*[AFSPropertyManager klog:[((TokenCredentialController*)credentialCommander) uName]
+         uPwd:[((TokenCredentialController*)credentialCommander) uPwd] ];*/
+       [afsProperty getTokens:true
+                    usr:[((TokenCredentialController*)credentialCommander) uName]
+                    pwd:[((TokenCredentialController*)credentialCommander) uPwd]];
+    }
     [sheet orderOut:self];
-       [self refreshTokens:nil];
-       //Inform afs menuextra to updata afs status
-       [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kMExtraAFSStateChange];
-
+    [self refreshTokens:nil];
+    //Inform afs menuextra to updata afs status
+    [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAFSMenuExtraID object:kMExtraAFSStateChange];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (void)didEndInfoSheet:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
 {
-       [sheet orderOut:self];
+    [sheet orderOut:self];
 }
 
 // -------------------------------------------------------------------------------
 // -------------------------------------------------------------------------------
 - (void)didEndSymlinkSheet:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
 {
-       [lyncCreationSheet orderOut:self];
-       [self readPreferenceFile];
-       [tableViewLink reloadData];
-       
+    [lyncCreationSheet orderOut:self];
+    [self readPreferenceFile];
+    [tableViewLink reloadData];
 }
 @end
index e229c76..0ed4cd4 100644 (file)
@@ -29,7 +29,7 @@
        NSString *afsRootMountPoint;
        int statCacheEntry;
        int dCacheDim;
-       int     cacheDimension;
+       int cacheDimension;
        int daemonNumber;
        int nVolEntry;
        bool dynRoot;
index fb696da..e96fc74 100644 (file)
@@ -92,7 +92,6 @@
        if(cellList) {[cellList removeAllObjects];[cellList release];}
        if(cellName) {[cellName release];}
        if(futil) {
-               [futil endAutorization];
                [futil release];
                futil = nil; 
        }
        
        NSCharacterSet *returnCS = [NSCharacterSet characterSetWithCharactersInString:@"\n"];
        NSFileHandle *fileH = [NSFileHandle fileHandleForReadingAtPath:filePath];
-       if (!fileH) return nil;
+       if (!fileH) return 0;
        NSData *fileHData = [fileH readDataToEndOfFile];
        NSString *cacheInfoStrData = [[NSString alloc] initWithData:fileHData
                                                                                                           encoding:NSASCIIStringEncoding];
 // -------------------------------------------------------------------------------
 -(int) readOldAfsdOption:(NSString*)filePath
 {
-       if(!filePath) return nil;
+       if(!filePath) return 0;
        return [self readAFSDParamLineContent:[[NSString stringWithContentsOfFile:filePath 
                                                                                                                          encoding:NSUTF8StringEncoding 
                                                                                                                                 error:nil] stringByStandardizingPath]];
 //  readAFSDParamLineContent:
 // -------------------------------------------------------------------------------
 -(int) readAFSDParamLineContent:(NSString*) paramLine{
-       if (!paramLine) return nil;
+       if (!paramLine) return 0;
 
        NSString *tmpString = nil;
        NSCharacterSet *space = [NSCharacterSet characterSetWithCharactersInString:@" "];
 // -------------------------------------------------------------------------------
 -(int) readNewAfsdOption:(NSString*)filePath
 {
-       if(!filePath) return nil;
-       NSString *currentLines = nil;
-       NSString *paramValue = nil;
-       NSScanner *lineScanner = nil;
+       if(!filePath) return 0;
+       NSString *currentLines = 0;
+       NSString *paramValue = 0;
+       NSScanner *lineScanner = 0;
        
        //Get file content
        NSString *newAFSDConfContent = [NSString stringWithContentsOfFile:filePath 
                                                                                                                         encoding:NSUTF8StringEncoding 
                                                                                                                                error:nil];
-       if (!newAFSDConfContent) return nil;
+       if (!newAFSDConfContent) return 0;
        
        //get lines in array
        NSArray *confLines = [newAFSDConfContent componentsSeparatedByString:@"\n"];
 // -------------------------------------------------------------------------------
 -(void) shutdown
 {
-       @try {
-               const char *stopArgs[] = {"stop", 0L};
-               if([[AuthUtil shared] autorize] == noErr) {
-                       [[AuthUtil shared] execUnixCommand:AFS_DAEMON_STARTUPSCRIPT
-                                                                                 args:stopArgs
-                                                                               output:nil];
-               }
-
-       }
-       @catch (NSException * e) {
-               @throw e;
-       }
-       @finally {
-       
-       }
-       
-       
+  NSString *rootHelperApp = [[NSBundle bundleForClass:[self class]] pathForResource:@"afshlp" ofType:@""];
+    @try {
+       const char *stopArgs[] = {AFS_DAEMON_STARTUPSCRIPT, "stop", 0L};
+       [[AuthUtil shared] execUnixCommand:[rootHelperApp fileSystemRepresentation]
+                          args:stopArgs
+                          output:nil];
+    }
+    @catch (NSException * e) {
+       @throw e;
+    }
+    @finally {
+    }
 }
 
 
 // -------------------------------------------------------------------------------
 -(void) startup
 {
-       @try {
-               const char *startArgs[] = {"start", 0L};
-               if([[AuthUtil shared] autorize] == noErr) {
-                       [[AuthUtil shared] execUnixCommand:AFS_DAEMON_STARTUPSCRIPT
-                                                                                 args:startArgs
-                                                                               output:nil];
-               }
-
-       }
-       @catch (NSException * e) {
-               @throw e;
-       }
-       @finally {
-
-       }
-
-
+  NSString *rootHelperApp = [[NSBundle bundleForClass:[self class]] pathForResource:@"afshlp" ofType:@""];
+    @try {
+       const char *startArgs[] = {AFS_DAEMON_STARTUPSCRIPT, "start", 0L};
+       [[AuthUtil shared] execUnixCommand:[rootHelperApp fileSystemRepresentation]
+                          args:startArgs
+                          output:nil];
+    }
+    @catch (NSException * e) {
+       @throw e;
+    }
+    @finally {
+    }
 }
+
 // -------------------------------------------------------------------------------
 //  -(void) saveConfigurationFiles
 // -------------------------------------------------------------------------------
                                                         encoding:  NSUTF8StringEncoding 
                                                                error:&err];
                
-               // backup original file
-               if([futil startAutorization] != noErr){
-                       @throw [NSException exceptionWithName:@"saveConfigurationFiles:startAutorization" 
-                                                                                  reason:kUserNotAuth
-                                                                                userInfo:nil];
-               }
-
                if(makeBackup) [self backupConfigurationFiles];
 
                // install ThisCell
                [self writeAfsdOption:useAfsdConfVersion?AFSD_TMP_NEW_PREFERENCE_FILE:AFSD_TMP_OLD_PREFERENCE_FILE];
                
                // backup original file
-               if([futil startAutorization] != noErr){
-                       @throw [NSException exceptionWithName:@"AFSPropertyManager:saveCacheConfigurationFiles:startAutorization" 
-                                                                                  reason:kUserNotAuth
-                                                                                userInfo:nil];
-               }
-               
                if(makeBackup) {
                        //cacheinfo
                        [self backupFile:@"/etc/cacheinfo"];
 {      
 
        @try{
-               if([futil startAutorization] != noErr){
-                       @throw [NSException exceptionWithName:@"backupConfigurationFiles:startAutorization" 
-                                                                                  reason:kUserNotAuth
-                                                                                userInfo:nil];
-               }
                //This cell
                [self backupFile:@"/etc/ThisCell"];
        
                //TheseCell
                [self backupFile:@"/etc/TheseCells"];
                
-               //[futil endAutorization];
        } @catch (NSException *e) {
                @throw e;
        } @finally {
                
                //Check if the file at path exist
                NSFileManager *fileManager = [NSFileManager defaultManager];
-               
-               //check if th efile exist
                if(![fileManager fileExistsAtPath:[filePath stringByExpandingTildeInPath]]) return;
                
                // store the source path
index 80acbdf..b1190ba 100644 (file)
@@ -2,30 +2,46 @@
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
        <data>
                <int key="IBDocument.SystemTarget">1050</int>
-               <string key="IBDocument.SystemVersion">10C540</string>
-               <string key="IBDocument.InterfaceBuilderVersion">762</string>
-               <string key="IBDocument.AppKitVersion">1038.25</string>
-               <string key="IBDocument.HIToolboxVersion">458.00</string>
+               <string key="IBDocument.SystemVersion">11D50d</string>
+               <string key="IBDocument.InterfaceBuilderVersion">2182</string>
+               <string key="IBDocument.AppKitVersion">1138.32</string>
+               <string key="IBDocument.HIToolboxVersion">568.00</string>
                <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
                        <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                       <string key="NS.object.0">762</string>
+                       <string key="NS.object.0">2182</string>
                </object>
-               <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+               <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
-                       <integer value="101"/>
+                       <string>NSTabView</string>
+                       <string>NSStepper</string>
+                       <string>NSButton</string>
+                       <string>NSCustomObject</string>
+                       <string>NSTableView</string>
+                       <string>NSCustomView</string>
+                       <string>NSSearchField</string>
+                       <string>NSTextField</string>
+                       <string>NSNumberFormatter</string>
+                       <string>NSSearchFieldCell</string>
+                       <string>NSWindowTemplate</string>
+                       <string>NSTextFieldCell</string>
+                       <string>NSStepperCell</string>
+                       <string>NSButtonCell</string>
+                       <string>NSTableColumn</string>
+                       <string>NSBox</string>
+                       <string>NSView</string>
+                       <string>NSScrollView</string>
+                       <string>NSTabViewItem</string>
+                       <string>NSTextView</string>
+                       <string>NSScroller</string>
+                       <string>NSTableHeaderView</string>
                </object>
                <object class="NSArray" key="IBDocument.PluginDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                </object>
                <object class="NSMutableDictionary" key="IBDocument.Metadata">
-                       <bool key="EncodedWithXMLCoder">YES</bool>
-                       <object class="NSArray" key="dict.sortedKeys" id="0">
-                               <bool key="EncodedWithXMLCoder">YES</bool>
-                       </object>
-                       <object class="NSMutableArray" key="dict.values">
-                               <bool key="EncodedWithXMLCoder">YES</bool>
-                       </object>
+                       <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+                       <integer value="1" key="NS.object.0"/>
                </object>
                <object class="NSMutableArray" key="IBDocument.RootObjects" id="84888716">
                        <bool key="EncodedWithXMLCoder">YES</bool>
@@ -48,7 +64,7 @@
                                <object class="NSMutableString" key="NSViewClass">
                                        <characters key="NS.bytes">View</characters>
                                </object>
-                               <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
+                               <nil key="NSUserInterfaceItemIdentifier"/>
                                <object class="NSView" key="NSWindowView" id="645279396">
                                        <reference key="NSNextResponder"/>
                                        <int key="NSvFlags">274</int>
@@ -59,6 +75,8 @@
                                                        <int key="NSvFlags">256</int>
                                                        <string key="NSFrame">{{17, 1}, {304, 14}}</string>
                                                        <reference key="NSSuperview" ref="645279396"/>
+                                                       <reference key="NSWindow"/>
+                                                       <reference key="NSNextKeyView" ref="1047946385"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="947523856">
                                                                <int key="NSCellFlags">67239424</int>
                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                <object class="NSView" id="520583273">
                                                                        <reference key="NSNextResponder" ref="748501112"/>
-                                                                       <int key="NSvFlags">256</int>
+                                                                       <int key="NSvFlags">274</int>
                                                                        <object class="NSMutableArray" key="NSSubviews">
                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                <object class="NSButton" id="709840556">
                                                                                        <int key="NSvFlags">268</int>
                                                                                        <string key="NSFrame">{{13, 7}, {109, 28}}</string>
                                                                                        <reference key="NSSuperview" ref="520583273"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="713307252"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSButtonCell" key="NSCell" id="675447498">
                                                                                                <int key="NSCellFlags">67239424</int>
                                                                                        <int key="NSvFlags">265</int>
                                                                                        <string key="NSFrame">{{526, 9}, {21, 23}}</string>
                                                                                        <reference key="NSSuperview" ref="520583273"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="739317740"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSButtonCell" key="NSCell" id="1009755861">
                                                                                                <int key="NSCellFlags">-2080244224</int>
                                                                                        <int key="NSvFlags">268</int>
                                                                                        <string key="NSFrame">{{138, 13}, {117, 18}}</string>
                                                                                        <reference key="NSSuperview" ref="520583273"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="871603218"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSButtonCell" key="NSCell" id="98390178">
                                                                                                <int key="NSCellFlags">67239424</int>
                                                                        </object>
                                                                        <string key="NSFrame">{{1, 1}, {562, 43}}</string>
                                                                        <reference key="NSSuperview" ref="748501112"/>
+                                                                       <reference key="NSWindow"/>
+                                                                       <reference key="NSNextKeyView" ref="709840556"/>
                                                                </object>
                                                        </object>
                                                        <string key="NSFrame">{{17, 423}, {564, 45}}</string>
                                                        <reference key="NSSuperview" ref="645279396"/>
+                                                       <reference key="NSWindow"/>
+                                                       <reference key="NSNextKeyView" ref="520583273"/>
                                                        <string key="NSOffsets">{0, 0}</string>
                                                        <object class="NSTextFieldCell" key="NSTitleCell">
                                                                <int key="NSCellFlags">67239424</int>
                                                        <int key="NSvFlags">274</int>
                                                        <string key="NSFrame">{{13, 15}, {572, 401}}</string>
                                                        <reference key="NSSuperview" ref="645279396"/>
+                                                       <reference key="NSWindow"/>
+                                                       <reference key="NSNextKeyView" ref="1020318718"/>
                                                        <object class="NSMutableArray" key="NSTabViewItems">
                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                <object class="NSTabViewItem" id="269508902">
                                                                                                                                <int key="NSvFlags">256</int>
                                                                                                                                <string key="NSFrameSize">{516, 140}</string>
                                                                                                                                <reference key="NSSuperview" ref="457121079"/>
+                                                                                                                               <reference key="NSWindow"/>
+                                                                                                                               <reference key="NSNextKeyView" ref="884311606"/>
                                                                                                                                <int key="NSTag">1</int>
                                                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                                                <object class="NSTableHeaderView" key="NSHeaderView" id="1048519426">
                                                                                                                                        <int key="NSvFlags">256</int>
                                                                                                                                        <string key="NSFrameSize">{516, 17}</string>
                                                                                                                                        <reference key="NSSuperview" ref="214413149"/>
+                                                                                                                                       <reference key="NSWindow"/>
+                                                                                                                                       <reference key="NSNextKeyView" ref="457121079"/>
                                                                                                                                        <reference key="NSTableView" ref="313963250"/>
                                                                                                                                </object>
-                                                                                                                               <object class="_NSCornerView" key="NSCornerView" id="360324124">
-                                                                                                                                       <reference key="NSNextResponder" ref="440720679"/>
+                                                                                                                               <object class="_NSCornerView" key="NSCornerView">
+                                                                                                                                       <nil key="NSNextResponder"/>
                                                                                                                                        <int key="NSvFlags">-2147483392</int>
                                                                                                                                        <string key="NSFrame">{{-22, 0}, {12, 17}}</string>
-                                                                                                                                       <reference key="NSSuperview" ref="440720679"/>
                                                                                                                                </object>
                                                                                                                                <object class="NSMutableArray" key="NSTableColumns">
                                                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                        </object>
                                                                                                                                </object>
                                                                                                                                <double key="NSRowHeight">12</double>
-                                                                                                                               <int key="NSTvFlags">-692060160</int>
+                                                                                                                               <int key="NSTvFlags">-155189248</int>
                                                                                                                                <reference key="NSDelegate"/>
                                                                                                                                <reference key="NSDataSource"/>
                                                                                                                                <int key="NSGridStyleMask">2</int>
                                                                                                                                <int key="NSDraggingSourceMaskForNonLocal">0</int>
                                                                                                                                <bool key="NSAllowsTypeSelect">YES</bool>
                                                                                                                                <int key="NSTableViewDraggingDestinationStyle">0</int>
+                                                                                                                               <int key="NSTableViewGroupRowStyle">1</int>
                                                                                                                        </object>
                                                                                                                </object>
                                                                                                                <string key="NSFrame">{{1, 17}, {516, 140}}</string>
                                                                                                                <reference key="NSSuperview" ref="440720679"/>
+                                                                                                               <reference key="NSWindow"/>
                                                                                                                <reference key="NSNextKeyView" ref="313963250"/>
                                                                                                                <reference key="NSDocView" ref="313963250"/>
                                                                                                                <reference key="NSBGColor" ref="252569531"/>
                                                                                                                <int key="NSvFlags">-2147483392</int>
                                                                                                                <string key="NSFrame">{{494, 17}, {11, 80}}</string>
                                                                                                                <reference key="NSSuperview" ref="440720679"/>
+                                                                                                               <reference key="NSWindow"/>
+                                                                                                               <reference key="NSNextKeyView" ref="258996751"/>
                                                                                                                <int key="NSsFlags">256</int>
                                                                                                                <reference key="NSTarget" ref="440720679"/>
                                                                                                                <string key="NSAction">_doScroller:</string>
                                                                                                                <int key="NSvFlags">-2147483392</int>
                                                                                                                <string key="NSFrame">{{1, 97}, {505, 11}}</string>
                                                                                                                <reference key="NSSuperview" ref="440720679"/>
+                                                                                                               <reference key="NSWindow"/>
+                                                                                                               <reference key="NSNextKeyView" ref="893552286"/>
                                                                                                                <int key="NSsFlags">257</int>
                                                                                                                <reference key="NSTarget" ref="440720679"/>
                                                                                                                <string key="NSAction">_doScroller:</string>
                                                                                                                </object>
                                                                                                                <string key="NSFrame">{{1, 0}, {516, 17}}</string>
                                                                                                                <reference key="NSSuperview" ref="440720679"/>
+                                                                                                               <reference key="NSWindow"/>
                                                                                                                <reference key="NSNextKeyView" ref="1048519426"/>
                                                                                                                <reference key="NSDocView" ref="1048519426"/>
                                                                                                                <reference key="NSBGColor" ref="252569531"/>
                                                                                                                <int key="NScvFlags">4</int>
                                                                                                        </object>
-                                                                                                       <reference ref="360324124"/>
                                                                                                </object>
                                                                                                <string key="NSFrame">{{17, 199}, {518, 158}}</string>
                                                                                                <reference key="NSSuperview" ref="1020318718"/>
-                                                                                               <reference key="NSNextKeyView" ref="457121079"/>
-                                                                                               <int key="NSsFlags">562</int>
+                                                                                               <reference key="NSWindow"/>
+                                                                                               <reference key="NSNextKeyView" ref="214413149"/>
+                                                                                               <int key="NSsFlags">133682</int>
                                                                                                <reference key="NSVScroller" ref="884311606"/>
                                                                                                <reference key="NSHScroller" ref="258996751"/>
                                                                                                <reference key="NSContentView" ref="457121079"/>
                                                                                                <reference key="NSHeaderClipView" ref="214413149"/>
-                                                                                               <reference key="NSCornerView" ref="360324124"/>
                                                                                                <bytes key="NSScrollAmts">QSAAAEEgAABBYAAAQWAAAA</bytes>
                                                                                        </object>
                                                                                        <object class="NSButton" id="210387551">
                                                                                                <int key="NSvFlags">265</int>
                                                                                                <string key="NSFrame">{{329, 164}, {80, 28}}</string>
                                                                                                <reference key="NSSuperview" ref="1020318718"/>
+                                                                                               <reference key="NSWindow"/>
+                                                                                               <reference key="NSNextKeyView" ref="977607312"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSButtonCell" key="NSCell" id="327131725">
                                                                                                        <int key="NSCellFlags">67239424</int>
                                                                                                <int key="NSvFlags">265</int>
                                                                                                <string key="NSFrame">{{407, 164}, {133, 28}}</string>
                                                                                                <reference key="NSSuperview" ref="1020318718"/>
+                                                                                               <reference key="NSWindow"/>
+                                                                                               <reference key="NSNextKeyView" ref="802059200"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSButtonCell" key="NSCell" id="73578210">
                                                                                                        <int key="NSCellFlags">67239424</int>
                                                                                                <int key="NSvFlags">268</int>
                                                                                                <string key="NSFrame">{{14, 172}, {86, 18}}</string>
                                                                                                <reference key="NSSuperview" ref="1020318718"/>
+                                                                                               <reference key="NSWindow"/>
+                                                                                               <reference key="NSNextKeyView" ref="343070533"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSButtonCell" key="NSCell" id="428850916">
                                                                                                        <int key="NSCellFlags">67239424</int>
                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                        <object class="NSView" id="1000204505">
                                                                                                                <reference key="NSNextResponder" ref="184192603"/>
-                                                                                                               <int key="NSvFlags">256</int>
+                                                                                                               <int key="NSvFlags">274</int>
                                                                                                                <object class="NSMutableArray" key="NSSubviews">
                                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                        <object class="NSButton" id="478533800">
                                                                                                                                <int key="NSvFlags">268</int>
                                                                                                                                <string key="NSFrame">{{5, 32}, {75, 18}}</string>
                                                                                                                                <reference key="NSSuperview" ref="1000204505"/>
+                                                                                                                               <reference key="NSWindow"/>
+                                                                                                                               <reference key="NSNextKeyView" ref="541208829"/>
                                                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                                                <object class="NSButtonCell" key="NSCell" id="989004902">
                                                                                                                                        <int key="NSCellFlags">67239424</int>
                                                                                                                                <int key="NSvFlags">268</int>
                                                                                                                                <string key="NSFrame">{{5, 12}, {167, 18}}</string>
                                                                                                                                <reference key="NSSuperview" ref="1000204505"/>
+                                                                                                                               <reference key="NSWindow"/>
+                                                                                                                               <reference key="NSNextKeyView" ref="210387551"/>
                                                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                                                <object class="NSButtonCell" key="NSCell" id="95048095">
                                                                                                                                        <int key="NSCellFlags">67239424</int>
                                                                                                                                <int key="NSvFlags">268</int>
                                                                                                                                <string key="NSFrame">{{5, 52}, {170, 18}}</string>
                                                                                                                                <reference key="NSSuperview" ref="1000204505"/>
+                                                                                                                               <reference key="NSWindow"/>
+                                                                                                                               <reference key="NSNextKeyView" ref="478533800"/>
                                                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                                                <object class="NSButtonCell" key="NSCell" id="855912809">
                                                                                                                                        <int key="NSCellFlags">67239424</int>
                                                                                                                </object>
                                                                                                                <string key="NSFrame">{{1, 1}, {193, 78}}</string>
                                                                                                                <reference key="NSSuperview" ref="184192603"/>
+                                                                                                               <reference key="NSWindow"/>
+                                                                                                               <reference key="NSNextKeyView" ref="239701474"/>
                                                                                                        </object>
                                                                                                </object>
                                                                                                <string key="NSFrame">{{113, 97}, {195, 94}}</string>
                                                                                                <reference key="NSSuperview" ref="1020318718"/>
+                                                                                               <reference key="NSWindow"/>
+                                                                                               <reference key="NSNextKeyView" ref="1000204505"/>
                                                                                                <string key="NSOffsets">{0, 0}</string>
                                                                                                <object class="NSTextFieldCell" key="NSTitleCell">
                                                                                                        <int key="NSCellFlags">67239424</int>
                                                                                                <int key="NSvFlags">268</int>
                                                                                                <string key="NSFrame">{{14, 152}, {96, 18}}</string>
                                                                                                <reference key="NSSuperview" ref="1020318718"/>
+                                                                                               <reference key="NSWindow"/>
+                                                                                               <reference key="NSNextKeyView" ref="184192603"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSButtonCell" key="NSCell" id="237101992">
                                                                                                        <int key="NSCellFlags">67239424</int>
                                                                                                        <int key="NSPeriodicInterval">25</int>
                                                                                                </object>
                                                                                        </object>
+                                                                                       <object class="NSCustomView" id="802059200">
+                                                                                               <reference key="NSNextResponder" ref="1020318718"/>
+                                                                                               <int key="NSvFlags">268</int>
+                                                                                               <string key="NSFrame">{{3, 3}, {400, 40}}</string>
+                                                                                               <reference key="NSSuperview" ref="1020318718"/>
+                                                                                               <reference key="NSWindow"/>
+                                                                                               <reference key="NSNextKeyView"/>
+                                                                                               <string key="NSReuseIdentifierKey">_NS:9</string>
+                                                                                               <string key="NSClassName">SFAuthorizationView</string>
+                                                                                       </object>
                                                                                </object>
                                                                                <string key="NSFrame">{{10, 25}, {552, 363}}</string>
                                                                                <reference key="NSSuperview" ref="739317740"/>
+                                                                               <reference key="NSWindow"/>
+                                                                               <reference key="NSNextKeyView" ref="440720679"/>
                                                                        </object>
                                                                        <string key="NSLabel">Tokens</string>
                                                                        <reference key="NSColor" ref="568311573"/>
                                                                                                                                        <string>AXDescription</string>
                                                                                                                                        <string>NSAccessibilityEncodedAttributesValueType</string>
                                                                                                                                </object>
-                                                                                                                               <object class="NSMutableArray" key="dict.values">
+                                                                                                                               <object class="NSArray" key="dict.values">
                                                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                        <string>cancel</string>
                                                                                                                                        <integer value="1"/>
                                                                                                                                <reference key="NSBackgroundColor" ref="400556243"/>
                                                                                                                                <reference key="NSGridColor" ref="850792713"/>
                                                                                                                                <double key="NSRowHeight">15</double>
-                                                                                                                               <int key="NSTvFlags">1522532352</int>
+                                                                                                                               <int key="NSTvFlags">2059403264</int>
                                                                                                                                <reference key="NSDelegate"/>
                                                                                                                                <reference key="NSDataSource"/>
                                                                                                                                <int key="NSGridStyleMask">1</int>
                                                                                                                                <int key="NSDraggingSourceMaskForNonLocal">0</int>
                                                                                                                                <bool key="NSAllowsTypeSelect">YES</bool>
                                                                                                                                <int key="NSTableViewDraggingDestinationStyle">0</int>
+                                                                                                                               <int key="NSTableViewGroupRowStyle">1</int>
                                                                                                                        </object>
                                                                                                                </object>
                                                                                                                <string key="NSFrame">{{1, 17}, {516, 271}}</string>
                                                                                                <string key="NSFrame">{{15, 41}, {518, 289}}</string>
                                                                                                <reference key="NSSuperview" ref="1069727156"/>
                                                                                                <reference key="NSNextKeyView" ref="259172039"/>
-                                                                                               <int key="NSsFlags">562</int>
+                                                                                               <int key="NSsFlags">133682</int>
                                                                                                <reference key="NSVScroller" ref="177605134"/>
                                                                                                <reference key="NSHScroller" ref="172641834"/>
                                                                                                <reference key="NSContentView" ref="259172039"/>
                                                                                                <reference key="NSHeaderClipView" ref="281754774"/>
-                                                                                               <reference key="NSCornerView" ref="772760699"/>
                                                                                                <bytes key="NSScrollAmts">QSAAAEEgAABBiAAAQYgAAA</bytes>
                                                                                        </object>
                                                                                        <object class="NSTextField" id="747536303">
                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                        <object class="NSView" id="1006532054">
                                                                                                                <reference key="NSNextResponder" ref="1056952440"/>
-                                                                                                               <int key="NSvFlags">256</int>
+                                                                                                               <int key="NSvFlags">274</int>
                                                                                                                <object class="NSMutableArray" key="NSSubviews">
                                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                        <object class="NSTextField" id="748314809">
                                                                                                                                                                <string>numberStyle</string>
                                                                                                                                                                <string>positiveFormat</string>
                                                                                                                                                        </object>
-                                                                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                <integer value="1"/>
                                                                                                                                                                <integer value="1040"/>
                                                                                                                                                <nil key="NS.nil"/>
                                                                                                                                                <object class="NSAttributedString" key="NS.nan">
                                                                                                                                                        <string key="NSString">NaN</string>
-                                                                                                                                                       <object class="NSDictionary" key="NSAttributes" id="383448102">
+                                                                                                                                                       <object class="NSDictionary" key="NSAttributes" id="571560357">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
-                                                                                                                                                               <reference key="dict.sortedKeys" ref="0"/>
-                                                                                                                                                               <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                               <object class="NSArray" key="dict.sortedKeys" id="0">
                                                                                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                </object>
+                                                                                                                                                               <reference key="dict.values" ref="0"/>
                                                                                                                                                        </object>
                                                                                                                                                </object>
                                                                                                                                                <real value="1000" key="NS.min"/>
                                                                                                                                                                <string>minimumIntegerDigits</string>
                                                                                                                                                                <string>positiveFormat</string>
                                                                                                                                                        </object>
-                                                                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                <integer value="1"/>
                                                                                                                                                                <integer value="1040"/>
                                                                                                                                                <nil key="NS.nil"/>
                                                                                                                                                <object class="NSAttributedString" key="NS.nan">
                                                                                                                                                        <string key="NSString">NaN</string>
-                                                                                                                                                       <reference key="NSAttributes" ref="383448102"/>
+                                                                                                                                                       <reference key="NSAttributes" ref="571560357"/>
                                                                                                                                                </object>
                                                                                                                                                <real value="100" key="NS.min"/>
                                                                                                                                                <reference key="NS.max" ref="139642944"/>
                                                                                                                                                                <string>minimumIntegerDigits</string>
                                                                                                                                                                <string>positiveFormat</string>
                                                                                                                                                        </object>
-                                                                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                <integer value="1"/>
                                                                                                                                                                <integer value="1040"/>
                                                                                                                                                <nil key="NS.nil"/>
                                                                                                                                                <object class="NSAttributedString" key="NS.nan">
                                                                                                                                                        <string key="NSString">NaN</string>
-                                                                                                                                                       <reference key="NSAttributes" ref="383448102"/>
+                                                                                                                                                       <reference key="NSAttributes" ref="571560357"/>
                                                                                                                                                </object>
                                                                                                                                                <integer value="1" key="NS.min"/>
                                                                                                                                                <reference key="NS.max" ref="139642944"/>
                                                                                                                                                                <string>numberStyle</string>
                                                                                                                                                                <string>positiveFormat</string>
                                                                                                                                                        </object>
-                                                                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                <real value="0.0"/>
                                                                                                                                                                <real value="0.0"/>
                                                                                                                                                <nil key="NS.nil"/>
                                                                                                                                                <object class="NSAttributedString" key="NS.nan">
                                                                                                                                                        <string key="NSString">NaN</string>
-                                                                                                                                                       <reference key="NSAttributes" ref="383448102"/>
+                                                                                                                                                       <reference key="NSAttributes" ref="571560357"/>
                                                                                                                                                </object>
                                                                                                                                                <real value="10" key="NS.min"/>
                                                                                                                                                <reference key="NS.max" ref="139642944"/>
                                                                                                                                                                <string>numberStyle</string>
                                                                                                                                                                <string>positiveFormat</string>
                                                                                                                                                        </object>
-                                                                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                <integer value="1"/>
                                                                                                                                                                <integer value="1040"/>
                                                                                                                                                <nil key="NS.nil"/>
                                                                                                                                                <object class="NSAttributedString" key="NS.nan">
                                                                                                                                                        <string key="NSString">NaN</string>
-                                                                                                                                                       <reference key="NSAttributes" ref="383448102"/>
+                                                                                                                                                       <reference key="NSAttributes" ref="571560357"/>
                                                                                                                                                </object>
                                                                                                                                                <real value="10000" key="NS.min"/>
                                                                                                                                                <reference key="NS.max" ref="139642944"/>
                                                                                                                                <reference key="NSBackgroundColor" ref="400556243"/>
                                                                                                                                <reference key="NSGridColor" ref="850792713"/>
                                                                                                                                <double key="NSRowHeight">17</double>
-                                                                                                                               <int key="NSTvFlags">-557842432</int>
+                                                                                                                               <int key="NSTvFlags">-20971520</int>
                                                                                                                                <reference key="NSDelegate"/>
                                                                                                                                <reference key="NSDataSource"/>
                                                                                                                                <int key="NSGridStyleMask">2</int>
                                                                                                                                <int key="NSDraggingSourceMaskForNonLocal">0</int>
                                                                                                                                <bool key="NSAllowsTypeSelect">YES</bool>
                                                                                                                                <int key="NSTableViewDraggingDestinationStyle">0</int>
+                                                                                                                               <int key="NSTableViewGroupRowStyle">1</int>
                                                                                                                        </object>
                                                                                                                </object>
                                                                                                                <string key="NSFrame">{{1, 17}, {501, 283}}</string>
                                                                                                <string key="NSFrame">{{17, 41}, {518, 316}}</string>
                                                                                                <reference key="NSSuperview" ref="786994103"/>
                                                                                                <reference key="NSNextKeyView" ref="229139620"/>
-                                                                                               <int key="NSsFlags">50</int>
+                                                                                               <int key="NSsFlags">133170</int>
                                                                                                <reference key="NSVScroller" ref="497462431"/>
                                                                                                <reference key="NSHScroller" ref="145484441"/>
                                                                                                <reference key="NSContentView" ref="229139620"/>
                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                        <object class="NSView" id="660074200">
                                                                                                                <reference key="NSNextResponder" ref="731215349"/>
-                                                                                                               <int key="NSvFlags">256</int>
+                                                                                                               <int key="NSvFlags">274</int>
                                                                                                                <object class="NSMutableArray" key="NSSubviews">
                                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                        <object class="NSTextField" id="628152029">
                                                                                                                                                                <string>numberStyle</string>
                                                                                                                                                                <string>positiveInfinitySymbol</string>
                                                                                                                                                        </object>
-                                                                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                <boolean value="YES"/>
                                                                                                                                                                <integer value="1040"/>
                                                                                                                                                </object>
                                                                                                                                                <object class="NSAttributedString" key="NS.nan">
                                                                                                                                                        <string key="NSString">NaN</string>
-                                                                                                                                                       <reference key="NSAttributes" ref="383448102"/>
+                                                                                                                                                       <reference key="NSAttributes" ref="571560357"/>
                                                                                                                                                </object>
                                                                                                                                                <real value="60" key="NS.min"/>
                                                                                                                                                <reference key="NS.max" ref="139642944"/>
                                                                                                                                                                <string>numberStyle</string>
                                                                                                                                                                <string>positiveInfinitySymbol</string>
                                                                                                                                                        </object>
-                                                                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                <boolean value="YES"/>
                                                                                                                                                                <integer value="1040"/>
                                                                                                                                                </object>
                                                                                                                                                <object class="NSAttributedString" key="NS.nan">
                                                                                                                                                        <string key="NSString">NaN</string>
-                                                                                                                                                       <reference key="NSAttributes" ref="383448102"/>
+                                                                                                                                                       <reference key="NSAttributes" ref="571560357"/>
                                                                                                                                                </object>
                                                                                                                                                <real value="60" key="NS.min"/>
                                                                                                                                                <reference key="NS.max" ref="139642944"/>
                                                                                                                                                                <string>numberStyle</string>
                                                                                                                                                                <string>positiveInfinitySymbol</string>
                                                                                                                                                        </object>
-                                                                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                <boolean value="YES"/>
                                                                                                                                                                <integer value="1040"/>
                                                                                                                                                </object>
                                                                                                                                                <object class="NSAttributedString" key="NS.nan">
                                                                                                                                                        <string key="NSString">NaN</string>
-                                                                                                                                                       <reference key="NSAttributes" ref="383448102"/>
+                                                                                                                                                       <reference key="NSAttributes" ref="571560357"/>
                                                                                                                                                </object>
                                                                                                                                                <real value="0.0" key="NS.min"/>
                                                                                                                                                <real value="30" key="NS.max"/>
                                                                                                                                                                <string>numberStyle</string>
                                                                                                                                                                <string>positiveInfinitySymbol</string>
                                                                                                                                                        </object>
-                                                                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                <boolean value="YES"/>
                                                                                                                                                                <integer value="1040"/>
                                                                                                                                                </object>
                                                                                                                                                <object class="NSAttributedString" key="NS.nan">
                                                                                                                                                        <string key="NSString">NaN</string>
-                                                                                                                                                       <reference key="NSAttributes" ref="383448102"/>
+                                                                                                                                                       <reference key="NSAttributes" ref="571560357"/>
                                                                                                                                                </object>
                                                                                                                                                <real value="0.0" key="NS.min"/>
                                                                                                                                                <real value="24" key="NS.max"/>
                                                                                                                                                                <string>numberStyle</string>
                                                                                                                                                                <string>positiveInfinitySymbol</string>
                                                                                                                                                        </object>
-                                                                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                <boolean value="YES"/>
                                                                                                                                                                <integer value="1040"/>
                                                                                                                                                </object>
                                                                                                                                                <object class="NSAttributedString" key="NS.nan">
                                                                                                                                                        <string key="NSString">NaN</string>
-                                                                                                                                                       <reference key="NSAttributes" ref="383448102"/>
+                                                                                                                                                       <reference key="NSAttributes" ref="571560357"/>
                                                                                                                                                </object>
                                                                                                                                                <real value="0.0" key="NS.min"/>
                                                                                                                                                <real value="60" key="NS.max"/>
                                                                                                                                                                <string>numberStyle</string>
                                                                                                                                                                <string>positiveInfinitySymbol</string>
                                                                                                                                                        </object>
-                                                                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                                                <boolean value="YES"/>
                                                                                                                                                                <integer value="1040"/>
                                                                                                                                                </object>
                                                                                                                                                <object class="NSAttributedString" key="NS.nan">
                                                                                                                                                        <string key="NSString">NaN</string>
-                                                                                                                                                       <reference key="NSAttributes" ref="383448102"/>
+                                                                                                                                                       <reference key="NSAttributes" ref="571560357"/>
                                                                                                                                                </object>
                                                                                                                                                <real value="0.0" key="NS.min"/>
                                                                                                                                                <real value="60" key="NS.max"/>
                                                        <int key="NSvFlags">289</int>
                                                        <string key="NSFrame">{{323, 3}, {258, 11}}</string>
                                                        <reference key="NSSuperview" ref="645279396"/>
+                                                       <reference key="NSWindow"/>
+                                                       <reference key="NSNextKeyView"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="999146642">
                                                                <int key="NSCellFlags">68288064</int>
                                        </object>
                                        <string key="NSFrameSize">{595, 486}</string>
                                        <reference key="NSSuperview"/>
+                                       <reference key="NSWindow"/>
+                                       <reference key="NSNextKeyView" ref="748501112"/>
                                </object>
-                               <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
-                               <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
+                               <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
+                               <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
+                               <bool key="NSWindowIsRestorable">YES</bool>
                        </object>
                        <object class="NSWindowTemplate" id="52789773">
                                <int key="NSWindowStyleMask">9</int>
                                <object class="NSMutableString" key="NSViewClass">
                                        <characters key="NS.bytes">View</characters>
                                </object>
-                               <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
+                               <nil key="NSUserInterfaceItemIdentifier"/>
                                <object class="NSView" key="NSWindowView" id="1017822711">
                                        <nil key="NSNextResponder"/>
                                        <int key="NSvFlags">256</int>
                                                                                <object class="NSTextView" id="297493656">
                                                                                        <reference key="NSNextResponder" ref="853671207"/>
                                                                                        <int key="NSvFlags">2322</int>
-                                                                                       <string key="NSFrameSize">{662, 14}</string>
+                                                                                       <string key="NSFrameSize">{673, 14}</string>
                                                                                        <reference key="NSSuperview" ref="853671207"/>
                                                                                        <object class="NSTextContainer" key="NSTextContainer" id="512204159">
                                                                                                <object class="NSLayoutManager" key="NSLayoutManager">
                                                                                                        <nil key="NSDelegate"/>
                                                                                                </object>
                                                                                                <reference key="NSTextView" ref="297493656"/>
-                                                                                               <double key="NSWidth">662</double>
+                                                                                               <double key="NSWidth">673</double>
                                                                                                <int key="NSTCFlags">1</int>
                                                                                        </object>
                                                                                        <object class="NSTextViewSharedData" key="NSSharedData">
-                                                                                               <int key="NSFlags">2913</int>
+                                                                                               <int key="NSFlags">67111777</int>
                                                                                                <int key="NSTextCheckingTypes">0</int>
                                                                                                <nil key="NSMarkedAttributes"/>
                                                                                                <reference key="NSBackgroundColor" ref="400556243"/>
                                                                                                                <string>NSBackgroundColor</string>
                                                                                                                <string>NSColor</string>
                                                                                                        </object>
-                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                <object class="NSColor">
                                                                                                                        <int key="NSColorSpace">6</int>
                                                                                                                <string>NSColor</string>
                                                                                                                <string>NSUnderline</string>
                                                                                                        </object>
-                                                                                                       <object class="NSMutableArray" key="dict.values">
+                                                                                                       <object class="NSArray" key="dict.values">
                                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                <object class="NSColor">
                                                                                                                        <int key="NSColorSpace">1</int>
                                                                                                        </object>
                                                                                                </object>
                                                                                                <nil key="NSDefaultParagraphStyle"/>
+                                                                                               <nil key="NSTextFinder"/>
+                                                                                               <int key="NSPreferredTextFinderStyle">0</int>
                                                                                        </object>
                                                                                        <int key="NSTVFlags">6</int>
-                                                                                       <string key="NSMaxSize">{1337, 1e+07}</string>
+                                                                                       <string key="NSMaxSize">{1337, 10000000}</string>
                                                                                        <string key="NSMinize">{114, 0}</string>
                                                                                        <nil key="NSDelegate"/>
                                                                                </object>
                                                                        </object>
-                                                                       <string key="NSFrame">{{1, 1}, {662, 423}}</string>
+                                                                       <string key="NSFrame">{{1, 1}, {673, 423}}</string>
                                                                        <reference key="NSSuperview" ref="935020490"/>
                                                                        <reference key="NSNextKeyView" ref="297493656"/>
                                                                        <reference key="NSDocView" ref="297493656"/>
                                                                        <reference key="NSBGColor" ref="400556243"/>
                                                                        <object class="NSCursor" key="NSCursor">
-                                                                               <string key="NSHotSpot">{4, -5}</string>
-                                                                               <int key="NSCursorType">1</int>
+                                                                               <string key="NSHotSpot">{4, 5}</string>
+                                                                               <object class="NSImage" key="NSImage">
+                                                                                       <int key="NSImageFlags">79691776</int>
+                                                                                       <object class="NSArray" key="NSReps">
+                                                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                               <object class="NSArray">
+                                                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                       <integer value="5"/>
+                                                                                                       <object class="NSURL">
+                                                                                                               <nil key="NS.base"/>
+                                                                                                               <string key="NS.relative">file://localhost/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff</string>
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                       </object>
+                                                                                       <object class="NSColor" key="NSColor">
+                                                                                               <int key="NSColorSpace">3</int>
+                                                                                               <bytes key="NSWhite">MCAwAA</bytes>
+                                                                                       </object>
+                                                                               </object>
                                                                        </object>
                                                                        <int key="NScvFlags">4</int>
                                                                </object>
                                                        <string key="NSFrame">{{20, 40}, {675, 425}}</string>
                                                        <reference key="NSSuperview" ref="1017822711"/>
                                                        <reference key="NSNextKeyView" ref="853671207"/>
-                                                       <int key="NSsFlags">18</int>
+                                                       <int key="NSsFlags">133138</int>
                                                        <reference key="NSVScroller" ref="11642274"/>
                                                        <reference key="NSHScroller" ref="574894181"/>
                                                        <reference key="NSContentView" ref="853671207"/>
                                        </object>
                                        <string key="NSFrameSize">{715, 485}</string>
                                </object>
-                               <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
-                               <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
+                               <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
+                               <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
+                               <bool key="NSWindowIsRestorable">YES</bool>
                        </object>
                        <object class="NSCustomObject" id="176554930">
                                <string key="NSClassName">InfoController</string>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
-                                               <string key="label">infoPanel</string>
-                                               <reference key="source" ref="176554930"/>
-                                               <reference key="destination" ref="52789773"/>
-                                       </object>
-                                       <int key="connectionID">226</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">texEditInfo</string>
-                                               <reference key="source" ref="176554930"/>
-                                               <reference key="destination" ref="297493656"/>
-                                       </object>
-                                       <int key="connectionID">227</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">closePanel:</string>
-                                               <reference key="source" ref="176554930"/>
-                                               <reference key="destination" ref="729692979"/>
-                                       </object>
-                                       <int key="connectionID">228</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
                                                <string key="label">afsCommanderView</string>
                                                <reference key="source" ref="773588579"/>
                                                <reference key="destination" ref="645279396"/>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="739317740"/>
-                                               <reference key="destination" ref="773588579"/>
-                                       </object>
-                                       <int key="connectionID">669</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
                                                <string key="label">textSearchField</string>
                                                <reference key="source" ref="773588579"/>
                                                <reference key="destination" ref="530233415"/>
                                        <int key="connectionID">817</int>
                                </object>
                                <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="530233415"/>
-                                               <reference key="destination" ref="773588579"/>
-                                       </object>
-                                       <int key="connectionID">886</int>
-                               </object>
-                               <object class="IBConnectionRecord">
                                        <object class="IBActionConnection" key="connection">
                                                <string key="label">startStopAfs:</string>
                                                <reference key="source" ref="773588579"/>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
-                                               <string key="label">dataSource</string>
-                                               <reference key="source" ref="1029505942"/>
-                                               <reference key="destination" ref="773588579"/>
-                                       </object>
-                                       <int key="connectionID">2060</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="1029505942"/>
-                                               <reference key="destination" ref="773588579"/>
-                                       </object>
-                                       <int key="connectionID">2061</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
                                                <string key="label">buttonRemoveLink</string>
                                                <reference key="source" ref="773588579"/>
                                                <reference key="destination" ref="635503948"/>
                                        <int key="connectionID">2093</int>
                                </object>
                                <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">takeIntegerValueFrom:</string>
-                                               <reference key="source" ref="724013147"/>
-                                               <reference key="destination" ref="719182296"/>
-                                       </object>
-                                       <int key="connectionID">2104</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">takeIntegerValueFrom:</string>
-                                               <reference key="source" ref="791385502"/>
-                                               <reference key="destination" ref="338319881"/>
-                                       </object>
-                                       <int key="connectionID">2114</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">takeIntegerValueFrom:</string>
-                                               <reference key="source" ref="826525177"/>
-                                               <reference key="destination" ref="564887063"/>
-                                       </object>
-                                       <int key="connectionID">2120</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">takeIntegerValueFrom:</string>
-                                               <reference key="source" ref="338319881"/>
-                                               <reference key="destination" ref="791385502"/>
-                                       </object>
-                                       <int key="connectionID">2127</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">takeIntValueFrom:</string>
-                                               <reference key="source" ref="719182296"/>
-                                               <reference key="destination" ref="724013147"/>
-                                       </object>
-                                       <int key="connectionID">2128</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">takeIntValueFrom:</string>
-                                               <reference key="source" ref="564887063"/>
-                                               <reference key="destination" ref="826525177"/>
-                                       </object>
-                                       <int key="connectionID">2129</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">takeIntegerValueFrom:</string>
-                                               <reference key="source" ref="681255345"/>
-                                               <reference key="destination" ref="724827539"/>
-                                       </object>
-                                       <int key="connectionID">2140</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBActionConnection" key="connection">
-                                               <string key="label">takeIntValueFrom:</string>
-                                               <reference key="source" ref="724827539"/>
-                                               <reference key="destination" ref="681255345"/>
-                                       </object>
-                                       <int key="connectionID">2141</int>
-                               </object>
-                               <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
                                                <string key="label">nsTextFieldKrb5RenewTimeD</string>
                                                <reference key="source" ref="773588579"/>
                                        </object>
                                        <int key="connectionID">2149</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">authView</string>
+                                               <reference key="source" ref="773588579"/>
+                                               <reference key="destination" ref="802059200"/>
+                                       </object>
+                                       <int key="connectionID">2151</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="739317740"/>
+                                               <reference key="destination" ref="773588579"/>
+                                       </object>
+                                       <int key="connectionID">669</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="530233415"/>
+                                               <reference key="destination" ref="773588579"/>
+                                       </object>
+                                       <int key="connectionID">886</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">infoPanel</string>
+                                               <reference key="source" ref="176554930"/>
+                                               <reference key="destination" ref="52789773"/>
+                                       </object>
+                                       <int key="connectionID">226</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">texEditInfo</string>
+                                               <reference key="source" ref="176554930"/>
+                                               <reference key="destination" ref="297493656"/>
+                                       </object>
+                                       <int key="connectionID">227</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">closePanel:</string>
+                                               <reference key="source" ref="176554930"/>
+                                               <reference key="destination" ref="729692979"/>
+                                       </object>
+                                       <int key="connectionID">228</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">dataSource</string>
+                                               <reference key="source" ref="1029505942"/>
+                                               <reference key="destination" ref="773588579"/>
+                                       </object>
+                                       <int key="connectionID">2060</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="1029505942"/>
+                                               <reference key="destination" ref="773588579"/>
+                                       </object>
+                                       <int key="connectionID">2061</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">takeIntValueFrom:</string>
+                                               <reference key="source" ref="719182296"/>
+                                               <reference key="destination" ref="724013147"/>
+                                       </object>
+                                       <int key="connectionID">2128</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">takeIntegerValueFrom:</string>
+                                               <reference key="source" ref="724013147"/>
+                                               <reference key="destination" ref="719182296"/>
+                                       </object>
+                                       <int key="connectionID">2104</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">takeIntegerValueFrom:</string>
+                                               <reference key="source" ref="338319881"/>
+                                               <reference key="destination" ref="791385502"/>
+                                       </object>
+                                       <int key="connectionID">2127</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">takeIntegerValueFrom:</string>
+                                               <reference key="source" ref="791385502"/>
+                                               <reference key="destination" ref="338319881"/>
+                                       </object>
+                                       <int key="connectionID">2114</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">takeIntValueFrom:</string>
+                                               <reference key="source" ref="564887063"/>
+                                               <reference key="destination" ref="826525177"/>
+                                       </object>
+                                       <int key="connectionID">2129</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">takeIntegerValueFrom:</string>
+                                               <reference key="source" ref="826525177"/>
+                                               <reference key="destination" ref="564887063"/>
+                                       </object>
+                                       <int key="connectionID">2120</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">takeIntValueFrom:</string>
+                                               <reference key="source" ref="724827539"/>
+                                               <reference key="destination" ref="681255345"/>
+                                       </object>
+                                       <int key="connectionID">2141</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">takeIntegerValueFrom:</string>
+                                               <reference key="source" ref="681255345"/>
+&nbs