]> granicus.if.org Git - ejabberd/commitdiff
* src/mod_register.erl: When a registration is blocked due to IP
authorBadlop <badlop@process-one.net>
Thu, 24 Jul 2008 17:49:37 +0000 (17:49 +0000)
committerBadlop <badlop@process-one.net>
Thu, 24 Jul 2008 17:49:37 +0000 (17:49 +0000)
limitation, return description in error stanza (EJAB-692)

SVN Revision: 1487

ChangeLog
src/mod_register.erl

index 2909ae88d2ff6f33baa617ec4ca83852c7956183..8b4b8b9edc208796b83ff4a94506e41168eeb9e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-2008-07-23  Christophe Romain  <christophe.romain@process-one.net>
+2008-07-24  Badlop  <badlop@process-one.net>
+
+       * src/mod_register.erl: When a registration is blocked due to IP
+       limitation, return description in error stanza (EJAB-692)
+       
+2008-07-24  Christophe Romain  <christophe.romain@process-one.net>
 
        * src/mod_pubsub/mod_pubsub.erl: Allow owner to subscribe/get its own
        node (EJAB-705)
index a936ea5e1a522df302063d09f7ee1c9857a4fc66..89afb8bc49fa7fb9f6a9cc299f807d93383e4eb7 100644 (file)
@@ -167,7 +167,7 @@ process_iq(From, To,
                            IQ#iq{type = result, sub_el = [SubEl]};
                        _ ->
                            case try_register(User, Server, Password,
-                                             Source) of
+                                             Source, Lang) of
                                ok ->
                                    IQ#iq{type = result, sub_el = [SubEl]};
                                {error, Error} ->
@@ -195,7 +195,7 @@ process_iq(From, To,
     end.
 
 
-try_register(User, Server, Password, Source) ->
+try_register(User, Server, Password, Source, Lang) ->
     case jlib:is_nodename(User) of
        false ->
            {error, ?ERR_BAD_REQUEST};
@@ -229,7 +229,9 @@ try_register(User, Server, Password, Source) ->
                                    end
                            end;
                        false ->
-                           {error, ?ERR_RESOURCE_CONSTRAINT}
+                           ErrText = "Users are not allowed to register "
+                               "accounts so fast",
+                           {error, ?ERRT_RESOURCE_CONSTRAINT(Lang, ErrText)}
                    end
            end
     end.