anchor.diff:      {noreply, State}.
   
   %% update_table_user update table user
  -%% TODO : More than 1 group 
   update_table_user(Raw) ->
  -    Query = exmpp_xml:get_element(Raw, "query"),
  -    Items = exmpp_xml:get_elements(Query, "item"),
  +    Query = exmpp_xml:get_element(Raw, query),
  +    Items = exmpp_xml:get_elements(Query, item),
       lager:debug("Item ~p~n", [Items]),
       lists:foreach(fun(Item) ->
                             User = exmpp_xml:get_attribute(Item, binary:list_to_bin("jid"), "not_found"),
  -                          case exmpp_xml:has_element(Item, "group") of
  -                              true -> Groupe = exmpp_xml:get_element(Item, "group"),
  -                                      Groupe_Name = exmpp_xml:get_cdata(Groupe),
  -                                      add_user(User, Groupe_Name),
  -                                      lager:debug("Groupe_Name ~p~n", [Groupe_Name]),
  -                                      lager:debug("User ~p~n", [User]);
  -                              false -> add_user(User),
  -                                       lager:debug("User ~p~n", [User])
  +                          Nick = exmpp_xml:get_attribute(Item, binary:list_to_bin("name"), ""),
  +                          case exmpp_xml:has_element(Item, group) of
  +                              true -> Groups = exmpp_xml:get_elements(Item, group),
  +                                      lists:foreach(fun(Group) -> 
  +                                                            Group_Name = exmpp_xml:get_cdata(Group),
  +                                                            User1 = binary_to_list(User),
  +                                                            epasswd:create_user(User1, Nick),
  +                                                            Group_Name1 = binary_to_list(Group_Name),
  +                                                            epasswd:create_group([Group_Name1]),
  +                                                            %%TODO do not set a random number for id ingroup
  +                                                            Rand = random:uniform(1000),
  +                                                            Rand2 = integer_to_list(Rand),
  +                                                            Rand3 = string:concat("id", Rand2),
  +                                                            epasswd:create_ingroup(Rand3, User1, Group_Name1),
  +                                                            lager:debug("Groupe_Name ~p~n", [Group_Name]),
  +                                                            lager:debug("User ~p~n", [User])
  +                                                    end, Groups);
  +                              false -> 
  +                                  User1 = binary_to_list(User),
  +                                  epasswd:create_user(User1, Nick),
  +                                  lager:debug("User ~p~n", [User])
                             end
                     end, Items).
   
   iq_roster(Session) ->
       Roster_Iq = exmpp_client_roster:get_roster(),
  -    exmpp_session:send_packet(Session, Roster_Iq).
  -
  -%%add_user Add user in mnesia table
  -add_user(User) ->
  -    F = fun() ->
  -                mnesia:write(#occi_user{id=User})
  -        end,
  -    mnesia:transaction(F).
  -
  -add_user(User, Groupe_Name) ->
  -    F = fun() ->
  -                mnesia:write(#occi_user{id=User, groups=Groupe_Name})
  -        end,
  -    mnesia:transaction(F). 
  -%% %%test ajout a regarder
  -read_user(JID) ->
  -    F = fun() ->
  -                mnesia:read(occi_user, JID)
  -        end,
  -    mnesia:transaction(F).
  +    exmpp_session:send_packet(Session, Roster_Iq).
positive.code:                 host=exmpp_jid:domain(Jid), 
                  userinfo=exmpp_jid:node(Jid)},
      occi_config:set(name, Name),
      TState = session(Props),
      State = element(2, TState),
      Session = State#state.session,
      epasswd:start(Session),
      {ok, State}.
  
  %%--------------------------------------------------------------------
  %% @private
  
negative.code:     case exmpp_xml:get_attribute(Raw, binary:list_to_bin("type"), "not_found") of
          <<"result">> -> update_table_user(Raw);
          <<"get">> -> lager:debug("Get");
          <<"set">> -> lager:debug("Modification roster")
      end,
      lager:debug("### ROSTER IQ from ~p: ~p~n", [From, Raw]).
  
  