line 212:
if ( ($config['publicevents'] == 1 && $user['U_Status'] = "Administrator")
of course should be $user['U_Status'] == "Administrator"
because of this error users get option "add event to calendar" even if $config['publicevents'] set to 1 or 2