- let uid,st,hist = List.assoc sid !session_tbl in
- let salt,pw,_ = List.assoc uid !user_tbl in
- user_tbl := (uid,(salt,pw,None))::List.remove_assoc uid !user_tbl;
+ let uid,st,hist,cp = List.assoc sid !session_tbl in
+ (if cp then
+ let salt,pw,_ = List.assoc uid !user_tbl in
+ user_tbl := (uid,(salt,pw,None))::List.remove_assoc uid !user_tbl
+ else
+ let salt,pw,_ = List.assoc uid !luser_tbl in
+ luser_tbl := (uid,(salt,pw,None))::List.remove_assoc uid !luser_tbl);