I have wrote my applescript and its running great, this script is running at the loginhook… so when users type in their credentials the script runs and displays two buttons “OK” and “Decline”
when the user select Ok, it continue to login but when the user select Decline it should force the user to log out by killing the loginwindow process.
The OK buttun works fine… but Decline button is what am trying to fix here!.. any idea?.. here is the script:
right now Decline button log the user in and then it will ask the user to log out “which is not what i want”
#!/bin/bash
/usr/bin/osascript <<EOF
tell application “SystemUIServer”
activate
display dialog “welcome to blah blah… etc” buttons {“Decline”,“OK”}
default button “OK”
if button returned of result is “Decline” then
tell application “System Events”
log out
end tell
end if
end tell
EOF