]> matita.cs.unibo.it Git - helm.git/blobdiff - matitaB/matita/matitaAuthentication.ml
Changed redirect behaviour of the daemon (incompatibility with browsers
[helm.git] / matitaB / matita / matitaAuthentication.ml
index ad6bec47d6915bad556bc737660a4e723ce7e49b..77aeed15f599c24f73d476b71e81aad45cc593d3 100644 (file)
@@ -104,9 +104,13 @@ let serialize () =
 ;;
 
 let deserialize () =
-  let utbl_ch = open_in (config_path () ^ "/usertable.dump") in
-  user_tbl := Marshal.from_channel utbl_ch;
-  close_in utbl_ch;
+  (try
+    let utbl_ch = open_in (config_path () ^ "/usertable.dump") in
+    user_tbl := Marshal.from_channel utbl_ch;
+    close_in utbl_ch;
+  with
+    | Sys_error _ -> 
+       user_tbl := []; serialize());
   (* old_sessions are now invalid *)
   session_tbl := [];
 ;;
@@ -120,3 +124,10 @@ let add_user uid pw =
     user_tbl := (uid,(pw,None))::!user_tbl;
     serialize ()
 ;;
+
+let reset () =
+  user_tbl := [];
+  session_tbl := [];
+  MatitaFilesystem.reset_lib ();
+  serialize ();
+;;