25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

* src/jlib.hrl: Added jaber:iq:auth:error namespace and

appropriate errors
* src/ejabberd_c2s.erl: Use auth:error in appropriate places

* src/jlib.hrl: Changed stream error and stanza error namespace
names due to last XMPP Core changes

SVN Revision: 97
This commit is contained in:
Alexey Shchepin 2003-04-08 19:32:01 +00:00
parent 76fdfe18b4
commit 71d4115a08
3 changed files with 29 additions and 5 deletions

View File

@ -1,3 +1,12 @@
2003-04-07 Alexey Shchepin <alexey@sevcom.net>
* src/jlib.hrl: Added jaber:iq:auth:error namespace and
appropriate errors
* src/ejabberd_c2s.erl: Use auth:error in appropriate places
* src/jlib.hrl: Changed stream error and stanza error namespace
names due to last XMPP Core changes
2003-03-28 Alexey Shchepin <alexey@sevcom.net> 2003-03-28 Alexey Shchepin <alexey@sevcom.net>
* src/mod_muc/mod_muc_room.erl: Added support for grant/revoke * src/mod_muc/mod_muc_room.erl: Added support for grant/revoke

View File

@ -178,7 +178,7 @@ wait_for_auth({xmlstreamelement, El}, StateData) ->
send_element(StateData#state.socket, Res), send_element(StateData#state.socket, Res),
{next_state, wait_for_auth, StateData}; {next_state, wait_for_auth, StateData};
{auth, ID, set, {U, P, D, ""}} -> {auth, ID, set, {U, P, D, ""}} ->
Err = jlib:make_error_reply(El, "406", "Not Acceptable"), Err = jlib:make_error_reply(El, ?ERR_AUTH_NO_RESOURCE_PROVIDED),
send_element(StateData#state.socket, Err), send_element(StateData#state.socket, Err),
{next_state, wait_for_auth, StateData}; {next_state, wait_for_auth, StateData};
{auth, ID, set, {U, P, D, R}} -> {auth, ID, set, {U, P, D, R}} ->
@ -316,7 +316,7 @@ wait_for_resource_auth({xmlstreamelement, El}, StateData) ->
send_element(StateData#state.socket, Res), send_element(StateData#state.socket, Res),
{next_state, wait_for_resource_auth, StateData}; {next_state, wait_for_resource_auth, StateData};
{auth, ID, set, {U, _, _, ""}} -> {auth, ID, set, {U, _, _, ""}} ->
Err = jlib:make_error_reply(El, "406", "Not Acceptable"), Err = jlib:make_error_reply(El, ?ERR_AUTH_NO_RESOURCE_PROVIDED),
send_element(StateData#state.socket, Err), send_element(StateData#state.socket, Err),
{next_state, wait_for_resource_auth, StateData}; {next_state, wait_for_resource_auth, StateData};
{auth, ID, set, {U, _, _, R}} -> {auth, ID, set, {U, _, _, R}} ->

View File

@ -9,6 +9,7 @@
-define(NS_DISCO_INFO, "http://jabber.org/protocol/disco#info"). -define(NS_DISCO_INFO, "http://jabber.org/protocol/disco#info").
-define(NS_VCARD, "vcard-temp"). -define(NS_VCARD, "vcard-temp").
-define(NS_AUTH, "jabber:iq:auth"). -define(NS_AUTH, "jabber:iq:auth").
-define(NS_AUTH_ERROR, "jabber:iq:auth:error").
-define(NS_REGISTER, "jabber:iq:register"). -define(NS_REGISTER, "jabber:iq:register").
-define(NS_SEARCH, "jabber:iq:search"). -define(NS_SEARCH, "jabber:iq:search").
-define(NS_ROSTER, "jabber:iq:roster"). -define(NS_ROSTER, "jabber:iq:roster").
@ -27,9 +28,8 @@
-define(NS_STREAM, "http://etherx.jabber.org/streams"). -define(NS_STREAM, "http://etherx.jabber.org/streams").
% TODO: replace "xmppcore-rfc-number" with real RFC number -define(NS_STANZAS, "urn:ietf:params:xml:ns:xmpp-stanzas").
-define(NS_STANZAS, "urn:ietf:rfc:xmppcore-rfc-number:stanzas"). -define(NS_STREAMS, "urn:ietf:params:xml:ns:xmpp-streams").
-define(NS_STREAMS, "urn:ietf:rfc:xmppcore-rfc-number:streams").
-define(NS_SASL_MECHANISMS, "http://www.iana.org/assignments/sasl-mechanisms"). -define(NS_SASL_MECHANISMS, "http://www.iana.org/assignments/sasl-mechanisms").
@ -68,6 +68,21 @@
%-define(ERR_, %-define(ERR_,
% ?STANZA_ERROR("", "", "")). % ?STANZA_ERROR("", "", "")).
% Application-specific stanza errors
-define(AUTH_STANZA_ERROR(Condition),
{xmlelement, "error",
[{"code", "406"}, {"class", "app"}],
[{xmlelement, "auth-condition",
[{"xmlns", ?NS_AUTH_ERROR}],
[{xmlelement, Condition, [], []}]}]}).
-define(ERR_AUTH_NO_RESOURCE_PROVIDED,
?AUTH_STANZA_ERROR("no-resource-provided")).
-define(ERR_AUTH_BAD_RESOURCE_FORMAT,
?AUTH_STANZA_ERROR("bad-resource-format")).
-define(ERR_AUTH_RESOURCE_CONFLICT,
?AUTH_STANZA_ERROR("resource-conflict")).
-define(STREAM_ERROR(Class, Condition), -define(STREAM_ERROR(Class, Condition),
{xmlelement, "stream:error", {xmlelement, "stream:error",