Warning: Reason support is experimental. We are looking for beta-tester and contributors.

Module User_data

module User_data : sig..end

Author(s): Piero Furiesi, Jaap Boender, Vincent Balat, Boris Yakobowski


val valid_username : string -> bool
val valid_emailaddr : string -> bool
val generate_password : unit -> bytes

User creation

type user_creation = {
  non_admin_can_create: bool;  mail_from: string;  mail_addr: string;  mail_subject: string;  new_user_groups: User_sql.Types.user list;}

Options for the creation of a new user

val can_create_user : options:user_creation -> bool Lwt.t
val can_create_group : unit -> bool Lwt.t
val can_admin_users : unit -> bool Lwt.t
val create_group : 
  name:string -> descr:string -> User_sql.Types.userid Lwt.t

Change user information

val can_view_users : unit -> bool Lwt.t
val can_view_groups : unit -> bool Lwt.t
val can_view_roles : unit -> bool Lwt.t
val can_change_user_data_by_userid : User_sql.Types.userid -> bool Lwt.t
val can_change_user_data_by_user : User_sql.Types.user -> bool Lwt.t
val change_user_data : 
  userid:User_sql.Types.userid ->
  pwd:string * string -> fullname:string -> email:string -> unit Lwt.t

Edition of groups

val add_remove_user_from_group : 
  group:string ->
  user:string ->
  (user:User_sql.Types.user -> group:User_sql.Types.user -> unit Lwt.t) ->
  unit Lwt.t
val add_user_from_group : group:string -> user:string -> unit -> unit Lwt.t
val remove_user_from_group : 
  group:string -> user:string -> unit -> unit Lwt.t

Login and logout

val logout : unit -> unit Lwt.t
val th_login : Throttle.t
val th_ip : Throttle.t
val login : name:Throttle.key -> pwd:string -> unit Lwt.t

Login error tracking

val login_error_eref : exn list Eliom_reference.eref
val get_login_error : unit -> exn list Lwt.t
val add_login_error : exn -> unit Lwt.t