]> matita.cs.unibo.it Git - helm.git/commitdiff
When the user db is not found, matitaweb now creates a new one.
authorWilmer Ricciotti <ricciott@cs.unibo.it>
Tue, 6 Sep 2011 12:28:13 +0000 (12:28 +0000)
committerWilmer Ricciotti <ricciott@cs.unibo.it>
Tue, 6 Sep 2011 12:28:13 +0000 (12:28 +0000)
matitaB/matita/matitaAuthentication.ml

index a183bc42033d8ed14ef487c86a79e68043ba978b..d51eb2e4fae4a4ff7c0d2b0bb9ea508f049a7b3c 100644 (file)
@@ -104,9 +104,12 @@ 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 := []);
   (* old_sessions are now invalid *)
   session_tbl := [];
 ;;