5 // Created by Claudio Bisegni on 10/05/07.
6 // Copyright (c) 2007 INFN - National Institute of Nuclear Physics. All rights reserved.
9 #import <PreferencePanes/PreferencePanes.h>
10 #import <SecurityInterface/SFAuthorizationView.h>
11 #import "AFSPropertyManager.h"
13 #import "ViewUtility.h"
14 #import "LynkCreationController.h"
16 // the way to load and unload the menuextra was inspired by MenuMeters developed by Alex Harper
17 // Routines to handle adding and remove menu extras in HIServices (from ASM source)
18 int CoreMenuExtraGetMenuExtra(CFStringRef identifier
, void *menuExtra
);
19 int CoreMenuExtraAddMenuExtra(CFURLRef path
, int position
, int whoCares
, int whoCares2
, int whoCares3
, int whoCares4
);
20 int CoreMenuExtraRemoveMenuExtra(void *menuExtra
, int whoCares
);
24 @interface AFSCommanderPref
: NSPreferencePane
<NSTableViewDataSource
, NSTableViewDelegate
>
26 //for check system version
30 IBOutlet SFAuthorizationView
*authView
;
31 IBOutlet NSView
*afsCommanderView
;
32 IBOutlet NSSearchField
*textSearchField
;
33 IBOutlet NSTextField
*afsDefaultCellLabel
;
34 IBOutlet NSButton
*tokensButton
;
35 IBOutlet NSButton
*unlogButton
;
36 IBOutlet NSButton
*aklogCredentialAtLoginTime
;
37 IBOutlet NSButton
*installKRB5AuthAtLoginButton
;
38 IBOutlet NSButton
*useAklogCheck
;
39 IBOutlet NSTextField
*afsVersionLabel
;
40 IBOutlet NSButton
*checkButtonAfsAtBootTime
;
41 IBOutlet NSTextField
*textFieldDevInfoLabel
;
42 IBOutlet NSTextField
*statCacheEntry
;
43 IBOutlet NSTextField
*dCacheDim
;
44 IBOutlet NSTextField
*cacheDimension
;
45 IBOutlet NSTextField
*daemonNumber
;
46 IBOutlet NSTextField
*afsRootMountPoint
;
47 IBOutlet NSTextField
*nVolEntry
;
48 IBOutlet NSTextField
*nsTextFieldKrb5RenewTimeD
;
49 IBOutlet NSTextField
*nsTextFieldKrb5RenewTimeH
;
50 IBOutlet NSTextField
*nsTextFieldKrb5RenewTimeM
;
51 IBOutlet NSTextField
*nsTextFieldKrb5RenewTimeS
;
52 IBOutlet NSStepper
*nsStepperKrb5RenewTimeD
;
53 IBOutlet NSStepper
*nsStepperKrb5RenewTimeH
;
54 IBOutlet NSStepper
*nsStepperKrb5RenewTimeM
;
55 IBOutlet NSStepper
*nsStepperKrb5RenewTimeS
;
56 IBOutlet NSTextField
*nsTextFieldKrb5SecToExpireDateForRenew
;
57 IBOutlet NSTextField
*nsTextFieldKrb5RenewCheckIntervall
;
58 IBOutlet NSButton
*nsButtonEnableDisableKrb5RenewCheck
;
59 IBOutlet NSButton
*dynRoot
;
60 IBOutlet NSButton
*afsDB
;
61 IBOutlet NSButton
*verbose
;
62 IBOutlet NSButton
*backgrounderActivationCheck
;
63 IBOutlet NSBox
*groupsBox
;
65 //id installationPathTextField;
66 IBOutlet NSButton
*startStopButton
;
67 IBOutlet NSTableView
*cellList
;
68 //id cellNameTextEdit;
69 IBOutlet NSControl
*cellIpButton
;
70 IBOutlet NSControl
*addCellButton
;
71 IBOutlet NSControl
*removeCellButton
;
72 //id refreshConfigurationButton;
73 IBOutlet NSControl
*saveConfigurationButton
;
75 IBOutlet NSTableView
*tokensTable
;
76 IBOutlet NSControl
*afsMenucheckBox
;
79 id ipConfigurationSheet
;
80 id ipConfControllerCommander
;
84 id credentialCommander
;
93 IBOutlet LynkCreationController
*lynkCreationController
;
96 IBOutlet NSButton
*checkEnableLink
;
97 IBOutlet NSButton
*buttonAddLink
;
98 IBOutlet NSButton
*buttonRemoveLink
;
99 IBOutlet NSTableView
*tableViewLink
;
100 NSMutableDictionary
*linkConfiguration
;
102 AFSPropertyManager
*afsProperty
; //AFS Property managment class
103 NSMutableArray
*filteredCellDB
; //Filtered CellServDB
105 NSTimer
*timerForCheckTokensList
;
110 - (void) mainViewDidLoad
;
111 - (void) willUnselect
;
113 - (id
) initWithBundle
:(NSBundle
*)bundle
;
117 - (IBAction
) refreshConfiguration
:(id
) sender
;
118 - (void) fillCacheParamView
;
119 - (void) updateCacheParamFromView
;
120 - (IBAction
) showCellIP
:(id
) sender
;
121 - (IBAction
) addRemoveCell
:(id
) sender
;
122 - (IBAction
) addLink
:(id
) sender
;
123 - (IBAction
) removeLink
:(id
) sender
;
124 - (IBAction
) enableLink
:(id
) sender
;
125 - (IBAction
) saveConfiguration
:(id
) sender
;
126 - (IBAction
) saveCacheManagerParam
:(id
) sender
;
127 - (IBAction
) startStopAfs
:(id
) sender
;
128 - (IBAction
) info
:(id
) sender
;
129 - (IBAction
) tableDoubleAction
:(id
) sender
;
130 - (IBAction
) getNewToken
:(id
) sender
;
131 - (IBAction
) unlog
:(id
) sender
;
132 - (IBAction
) afsMenuActivationEvent
:(id
) sender
;
133 - (IBAction
) aklogSwitchEvent
:(id
) sender
;
134 - (IBAction
) credentialAtLoginTimeEvent
:(id
) sender
;
135 - (IBAction
) afsStartupSwitchEvent
:(id
) sender
;
136 - (IBAction
) krb5KredentialAtLoginTimeEvent
:(id
) sender
;
137 - (IBAction
) searchCellTextEvent
:(id
) sender
;
138 - (IBAction
) manageBackgrounderActivation
:(id
)sender
;
139 - (IBAction
) tableViewLinkPerformClick
:(id
) sender
;
140 - (IBAction
) enableDisableKrb5RenewCheck
:(id
) sender
;
141 - (IBAction
) krb5RenewParamChange
:(id
) sender
;
142 - (void) credentialAtLoginTimeEventCreationLaunchAgentDir
:(NSWindow
*)alert returnCode
:(int)returnCode contextInfo
:(void *)contextInfo
;
143 - (void) clearCellServDBFiltering
;
144 - (void) filterCellServDB
:(NSString
*)textToFilter
;
145 - (DBCellElement
*) getCurrentCellInDB
;
146 - (DBCellElement
*) getCellByIDX
:(int) idx
;
147 - (void) modifyCell
:(DBCellElement
*) cellElement
;
148 - (void) modifyCellByIDX
:(int) idx
;
149 - (void) showMessage
:(NSString
*) message
;
150 - (void) setAfsStatus
;
151 - (void) refreshTokens
:(NSTimer
*)theTimer
;
152 - (void) writePreferenceFile
;
153 - (void) readPreferenceFile
;
154 - (void) refreshGui
:(NSNotification
*)notification
;
155 - (void) refreshTokensNotify
:(NSNotification
*)notification
;
156 - (void) afsVolumeMountChange
:(NSNotification
*)notification
;
157 - (void)tabView
:(NSTabView
*)tabView willSelectTabViewItem
: (NSTabViewItem
*)tabViewItem
;
160 @interface
AFSCommanderPref (TableDelegate
)
161 - (void) tableViewCellmanageButtonState
:(int) rowSelected
;
162 - (void) tableViewLinkmanageButtonState
:(NSIndexSet
*) rowsSelectedIndex
;
165 @interface
AFSCommanderPref (NSTableDataSource
)
166 - (id
) getTableTokensListValue
:(int) colId row
:(int)row
;
167 - (id
) getTableCelListValue
:(int) colId row
:(int)row
;
168 - (id
) getTableLinkValue
:(int) colId row
:(int)row
;