call disconnect script only if the user was on connected state

This commit is contained in:
Nikos Mavrogiannopoulos
2014-12-02 08:34:20 +01:00
parent 6bfd5db245
commit 7abfb3e800

View File

@@ -257,8 +257,9 @@ void remove_proc(main_server_st * s, struct proc_st *proc, unsigned k)
kill(proc->pid, SIGTERM);
remove_from_script_list(s, proc);
if (proc->username[0] != 0)
if (proc->status == PS_AUTH_COMPLETED) {
user_disconnected(s, proc);
}
/* close any pending sessions */
if (s->config->session_control != 0 && proc->active_sid) {