Re: Alert prompts for BetterAuthorizationSample
Re: Alert prompts for BetterAuthorizationSample
- Subject: Re: Alert prompts for BetterAuthorizationSample
- From: Todd Heberlein <email@hidden>
- Date: Thu, 08 Oct 2009 20:21:27 -0700
On Oct 8, 2009, at 4:01 PM, Todd Heberlein wrote:
Of course, I can't expect my users to go into /etc/authorization to
change the entry themselves, and I'm not going to much around with
it from my code, so I guess I'll wait for Apple to fix this. I'm not
even sure which code is to blame (the BAS code or the Authorization
code).
I found a simple work around.
When the authorization code fails to retrieve the text for the prompt
in the password request panel that come up, it only displays the
prompt key, so I simply made the prompt "key" the entire sentence I
want to display.
For example, in my Common.c code I have
const BASCommandSpec kSampleCommandSet[] = {
{
kACManagerCopyToAuditControlCommand, // commandName
kACManagerCopyToAuditControlRightName, // rightName
"default", // rightDefaultRule
"To replace the system's audit_config file, you need to authenticae
yourself.",
NULL // userData
},
...
The "rightDescriptionKey" is that full sentence "To replace ..." And
then in the "SampleAuthorizationPrompts.strings" file (no, I didn't
change the names of the variable or file names from the example code)
I have the key and the value the same (i.e., the full sentence):
"To replace the system's audit_config file, you need to authenticae
yourself." = "To replace the system's audit_config file, you need to
authenticae yourself.";
Now when Snow Leopard doesn't do the right thing and only displays the
key (and not the value), it's OK because my key is also the value I
want to display. Now, this wouldn't work if I wanted to do more than
one language, but it will get me through the current day.
Todd
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden