anchor.diff:      Rec = mnesia:transaction(F),
       Rec.
   
  -%%====================================================================
  -%% Behaviour functions
  -%%====================================================================
   
   %%====================================================================
   %% Internal functions
  
positive.code: 	 list_users/0,
  	 insert_purge_phone/7,
  	 purge_class_phone/2,
  	 expired_phones/0,
  	 delete_record/1,
  	 delete_user/1,
  
negative.code:     mnesia:transaction(F).
  
  %%--------------------------------------------------------------------
  %% Function: set_user_password(User, Password)
  %%           User     = string()
  %%           Password = term()
  %% Descrip.: Set password for User.
  %% Returns : term(), result of Mnesia transaction
  %%--------------------------------------------------------------------
  set_user_password(User, Password) ->
      F = fun() ->
  		case mnesia:read({user, User}) of
  		    [] ->
  			mnesia:abort(no_such_user);
  		    L when is_list(L) ->
  			Update = fun(Obj) ->
  					 mnesia:write(Obj#user{password = Password})
  				 end,
  			lists:foreach(Update, L);
  		    _ ->
  			mnesia:abort(illegal)
  		end
  	end,
      mnesia:transaction(F).
  
  %%--------------------------------------------------------------------
  %% Function: set_user_flags(User, Flags)
  %%           User  = string()
  %%           Flags = list() of atom()
  %% Descrip.: Set flags for User.
  %% Returns : term(), result of Mnesia transaction
  %%--------------------------------------------------------------------
  set_user_flags(User, Flags) when is_list(User), is_list(Flags) ->
      F = fun() ->
  		case mnesia:read({user, User}) of
  		    [] ->
  			mnesia:abort(no_such_user);
  		    A when is_list(A) ->
  			Update = fun(Obj) ->
  					 mnesia:write(Obj#user{flags = Flags})
  				 end,
  			lists:foreach(Update, A);
  		    _ ->
  			mnesia:abort(illegal)
  		end
  	end,
      mnesia:transaction(F).
  
  %%--------------------------------------------------------------------
  %% Function: set_user_numbers(User, Numbers)
  %%           User    = string()
  %%           Numbers = list() of string()
  %% Descrip.: Set numbers for User.
  %% Returns : term(), result of Mnesia transaction
  %%--------------------------------------------------------------------
  set_user_numbers(User, Numbers) when is_list(User), is_list(Numbers) ->
      F = fun() ->
  		A = mnesia:read({numbers, User}),
  		Delete = fun(Obj) ->
  