This module enables user authentication via the Mnesia DBMS. The following config directive is described:
Syntax: AuthMnesiaDB toggle
Default: AuthMnesiaDB Off
Module: mod_auth_mnesia(3)
Context: <Directory>
AuthMnesiaDB toggles the use of Mnesia for
authentication. On or Off is valid toggle
values.
mod_auth(3) is the basic EWSAPI
module for user authentication in the server. This module serves
as an alternative or complement to mod_auth(3) making it
possible to manage authentication data in real-time using the
Mnesia DBMS, that is Mnesia makes it possible to manage
authentication data directly from CGI scripts in a running
server. Two tables have to be created in the Mnesia database,
before the functions below can be used:
%% Declare the mod_auth_mnesia(3) tables.
-record(user,{user_name,password}).
-record(group,{group_name,user_name}).
%% Create the mod_auth_mnesia(3) tables.
create_tables() ->
mnesia:create_table(user,[{attributes,record_info(fields,user)},
{disc_copies,Nodes}]),
mnesia:create_table(group,[{attributes,record_info(fields,group)},
{disc_copies,Nodes},{type,bag}]).
Refer to mnesia(3) for further information about the
Mnesia DBMS. When Mnesia has been prepared, as described above,
the following functions can be used:
change_password(UserName,OldPassword,NewPassword,Port,Dir) -> Ret
UserName = OldPassword = NewPassword = Dir = string()Port = integer()Ret = ok | {error,Reason}Reason = string() | aborted_reason()change_password/5 updates the password for a
specific UserName. Port, Dir and
aborted_reason() is as defined in store_user/5.
list_group_members(GroupName,Port,Dir) -> Ret
GroupName = Dir = string()Port = integer()Ret = {ok,[UserName]} | {error,Reason}UserName = string()Reason = string() | aborted_reason()list_group_members/3 lists all users in a group
GroupName allowed to access information from a specific
Port and directory (Dir). aborted_reason()
is as defined in store_user/5.
Port = integer()Dir = string()Ret = {ok,[GroupName]} | {error,Reason}UserName = string()Reason = string() | aborted_reason()list_groups/2 lists all groups allowed to access
information from a specific Port and directory
(Dir). aborted_reason() is as defined in
store_user/5.
Port = integer()Dir = string()Ret = {ok,[UserName]} | {error,Reason}UserName = string()Reason = string() | aborted_reason()list_users/2 lists all users allowed to access
information from a specific Port and directory
(Dir). aborted_reason() is as defined in
store_user/5.
store_group_member(GroupName,UserName,Port,Dir,AccessPassword) -> Ret
GroupName = UserName = Dir = AccessPassword = string()Port = integer()Ret = ok | {error,Reason}Reason = string() | aborted_reason()store_group_member/5 stores a new group member in
Mnesia as follows; A new group member UserName is
added to the the group GroupName. Port,
Dir, AccessPassword and aborted_reason()
are as defined in store_user/5.
store_user(UserName,Password,Port,Dir,AccessPassword) -> Ret
UserName = Password = Dir = AccessPassword = string()Port = integer()Ret = ok | {error,Reason}Reason = string() | aborted_reason()store_user/5 stores a new user in Mnesia. A new user
(with UserName and Password) is allowed to
access information from a server on a Port and a from
a specific directory (Dir) and its
sub-directories. Dir is a regular expression as
defined in one of the <Directory> config
directives in the server config
file. aborted_reason() is of the same type as a
Reason returned by an aborted
mnesia:transaction/1 (See
mnesia(3)). AccessPassword isn't used in this
version of the server.
remove_group_member(GroupName,UserName,Port,Dir,AccessPassword) -> Ret
GroupName = UserName = Dir = AccessPassword = string()Port = integer()Ret = ok | {error,Reason}Reason = string() | aborted_reason()remove_group_member/5 removes a user in a group from
Mnesia. Port, Dir, AccessPassword and
aborted_reason() is as defined in store_user/5.
remove_group(GroupName,Port,Dir,AccessPassword) -> Ret
GroupName = Dir = AccessPassword = string()Port = integer()Ret = ok | {error,Reason}Reason = string() | aborted_reason()remove_group/4 removes a group from Mnesia. Port,
Dir, AccessPassword and aborted_reason()
is as defined in store_user/5.
remove_user(UserName,Port,Dir,AccessPassword) -> Ret
UserName = Dir = AccessPassword = string()Port = integer()Ret = ok | {error,Reason}Reason = string() | aborted_reason()remove_user/4 removes a user from Mnesia. Port,
Dir, AccessPassword and aborted_reason()
is as defined in store_user/5.
Uses the following EWSAPI interaction data, if available:
{real_name,{Path,AfterPath}}
Exports the following EWSAPI interaction data, if possible:
{remote_user,User}
Uses the following exported EWSAPI functions: