Re: Fast User Switching in Panther...
Re: Fast User Switching in Panther...
- Subject: Re: Fast User Switching in Panther...
- From: Alec Carlson <email@hidden>
- Date: Tue, 05 Aug 2003 10:52:59 -0500
OK, here's a scenario:
1. The Mac is powered off
2. UserA powers the Mac up and logs into Panther
3. As part of the OS startup process, a background server application is
launched. It will be run in a process owned by UserA.
4. UserB comes over and fast switches the Mac to his account. UserB starts
using the Mac.
5. Sometime in the future, the background application running in UserA's
context gets a timed event which causes it to want to look up something from
the users Preference file. It executes the following:
userPrefs = [[NSUserDefaults standardUserDefaults]
persistentDomainForName:@2com.company.prefs2]
The intent is to get the user defaults of the user currently using the Mac -
the person interacting with the GUI since his preferences are the important
ones. That would be UserB. However, since the background app is running in
UserA9s context, this call returns UserA9s preferences, not UserB9s. Since
UserA has 3left the building2, his prefs don9t really matter...
Now, I could use the NSUserDefaults 3- (id) initWithUser2 method but that
begs the question of how does the background app figure out that UserB is
now in control of the Mac and not UserA ? In addition, It9s possible that
the background app running in UserA9s context does not have read access to
UserB9s preference files - that would be another problem (but I can get
around that one...)
Any suggestions for resolving this ?
What I9d like to see:
1. An API for determining who the last login or fast-switch user is.
2. Or an API to get the owner name of the 3Window Manager2 process (I9m
assuming there is only one Window Manager running at a time)
3. and callback registration to allow notifications of user switching
Comments welcome...
Alec
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.