Re: Non Privileged shutdown (was Privileged shutdown)
Re: Non Privileged shutdown (was Privileged shutdown)
- Subject: Re: Non Privileged shutdown (was Privileged shutdown)
- From: Bernard Azancot <email@hidden>
- Date: Wed, 28 Jul 2004 07:02:28 +0200
Le 24 Jul 2004 15:46:42 +0200 Axel Luttgens <email@hidden>
m'a ripondu
Bernard Azancot wrote:
This shutdown dialog snippet is OK when the user is the
administrator, but not with another user.
When I replace the administrator password by the other user one,
nothing happens (the shudown does not occur).
--
if button returned of result is "OK" then
do shell script "/sbin/shutdown -h now" password "xxxx" with
administrator privileges
end if
--
Any suggestion ?
... you could first have a look at System Events' dictionary,
especially its 'shut down' command.
This one should be executable by any user (as if the corresponding
item in the Apple menu was selected), and even without the "with
administrator privileges" part.
Would be nicer, if it works, than messing with sudoers or possibly
by-passing some system calls.
Thanks for your detailed answer, Axel.
I do not need a priviledged shutdowm command. I just thought that a 'do
shell script' was necessary to Shut the Mac down under MacOSX.
I have seen the 'shut down' command in the 'System Events' dictionary.
I know there is a way to call a 'System Events' command in a script but
I do do not remember the right syntax.
Something else:
Is there a hint to launch a script when you shutdown the Mac ( by the
Applemenu, without administrator privileges) ?
It was so simple under MacOS9... Godferdam !! (private joke for Axel).
Thanks again.
Regards.
Bernard
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.