Two things I'm thinking of:

$=execute( should not be used. $rc=execute( would be a better choice, especially with KiXtart 4.02 and previous vesions. Ref: http://www.scriptlogic.com/Support/Forums/display_message.asp?mid=2525

Also, you reference $user in a couple places. Is this a dynavar defined elsewhere in your script?

-Brian