mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
* src/ejabberd_c2s.erl: Processing of jabber:iq:register totally
moved to mod_register.erl (thanks to Sergei Golovan) * src/mod_register.erl: Likewise * src/win32/ejabberd.nsi: Added two pictures in installer (thanks to Maxim Ryazanov) * src/win32/ejabberd_header.bmp: Likewise * src/win32/ejabberd_intro.bmp: Likewise * src/web/ejabberd_web_admin.erl: Fixed spelling of word "authentication" * src/ejabberd_c2s.erl: Likewise SVN Revision: 375
This commit is contained in:
parent
3202705ad6
commit
a9e3b76bed
29
ChangeLog
29
ChangeLog
@ -1,3 +1,18 @@
|
||||
2005-07-15 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
* src/ejabberd_c2s.erl: Processing of jabber:iq:register totally
|
||||
moved to mod_register.erl (thanks to Sergei Golovan)
|
||||
* src/mod_register.erl: Likewise
|
||||
|
||||
* src/win32/ejabberd.nsi: Added two pictures in installer (thanks
|
||||
to Maxim Ryazanov)
|
||||
* src/win32/ejabberd_header.bmp: Likewise
|
||||
* src/win32/ejabberd_intro.bmp: Likewise
|
||||
|
||||
* src/web/ejabberd_web_admin.erl: Fixed spelling of word
|
||||
"authentication"
|
||||
* src/ejabberd_c2s.erl: Likewise
|
||||
|
||||
2005-07-13 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
* src/mod_register.erl: Bugfix
|
||||
@ -745,10 +760,10 @@
|
||||
2004-07-30 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
* examples/extauth/check_pass_null.pl: A reference "null"
|
||||
implementation of external authentification script (thanks to Leif
|
||||
implementation of external authentication script (thanks to Leif
|
||||
Johansson)
|
||||
|
||||
* src/extauth.erl: Support for external authentification
|
||||
* src/extauth.erl: Support for external authentication
|
||||
(thanks to Leif Johansson)
|
||||
* src/ejabberd_auth.erl: Likewise
|
||||
|
||||
@ -1382,7 +1397,7 @@
|
||||
|
||||
* src/ejabberd.cfg.example: Updated
|
||||
|
||||
* src/ejabberd_auth.erl: Support for LDAP authentification
|
||||
* src/ejabberd_auth.erl: Support for LDAP authentication
|
||||
* src/cyrsasl_digest.erl: Likewise
|
||||
* src/mod_register.erl: Likewise
|
||||
* src/ejabberd_c2s.erl: Likewise
|
||||
@ -1436,7 +1451,7 @@
|
||||
|
||||
2003-11-07 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
* src/cyrsasl.erl: Updated SASL authentification
|
||||
* src/cyrsasl.erl: Updated SASL authentication
|
||||
* src/ejabberd_c2s.erl: Likewise
|
||||
|
||||
* src/ejabberd_sm.erl: Better resource handling
|
||||
@ -1470,7 +1485,7 @@
|
||||
|
||||
2003-10-30 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
* src/ejabberd_c2s.erl: More strong check for authentificated JID
|
||||
* src/ejabberd_c2s.erl: More strong check for authenticated JID
|
||||
|
||||
* src/mod_roster.erl: Bugfix
|
||||
|
||||
@ -1628,7 +1643,7 @@
|
||||
|
||||
2003-10-09 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
* src/ejabberd_c2s.erl: Added authentification logging
|
||||
* src/ejabberd_c2s.erl: Added authentication logging
|
||||
|
||||
* src/ejabberd_listener.erl: Added logging of accepted connections
|
||||
|
||||
@ -1715,7 +1730,7 @@
|
||||
* src/ejabberd_s2s_out.erl: Likewise
|
||||
|
||||
* src/ejabberd_c2s.erl: Added sending of empty <stream:features/>
|
||||
element after opening of authentificated stream
|
||||
element after opening of authenticated stream
|
||||
|
||||
2003-09-02 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
tls_required = false,
|
||||
tls_enabled = false,
|
||||
tls_options = [],
|
||||
authentificated = false,
|
||||
authenticated = false,
|
||||
jid,
|
||||
user = "", server = ?MYNAME, resource = "",
|
||||
pres_t = ?SETS:new(),
|
||||
@ -178,7 +178,7 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
|
||||
" version='1.0'",
|
||||
DefaultLang]),
|
||||
send_text(StateData, Header),
|
||||
case StateData#state.authentificated of
|
||||
case StateData#state.authenticated of
|
||||
false ->
|
||||
SASLState =
|
||||
cyrsasl:server_new(
|
||||
@ -223,10 +223,11 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
|
||||
TLSFeature ++
|
||||
[{xmlelement, "mechanisms",
|
||||
[{"xmlns", ?NS_SASL}],
|
||||
Mechs},
|
||||
{xmlelement, "register",
|
||||
[{"xmlns", ?NS_FEATURE_IQREGISTER}],
|
||||
[]}]}),
|
||||
Mechs}] ++
|
||||
ejabberd_hooks:run_fold(
|
||||
c2s_stream_features,
|
||||
Server,
|
||||
[], [])}),
|
||||
{next_state, wait_for_feature_request,
|
||||
StateData#state{server = Server,
|
||||
sasl_state = SASLState,
|
||||
@ -411,21 +412,8 @@ wait_for_auth({xmlstreamelement, El}, StateData) ->
|
||||
end
|
||||
end;
|
||||
_ ->
|
||||
case jlib:iq_query_info(El) of
|
||||
#iq{xmlns = ?NS_REGISTER} = IQ ->
|
||||
ResIQ = mod_register:process_iq(
|
||||
{"", "", ""},
|
||||
jlib:make_jid("", StateData#state.server, ""),
|
||||
IQ),
|
||||
Res1 = jlib:replace_from_to({"", StateData#state.server, ""},
|
||||
{"", "", ""},
|
||||
jlib:iq_to_xml(ResIQ)),
|
||||
Res = jlib:remove_attr("to", Res1),
|
||||
send_element(StateData, Res),
|
||||
{next_state, wait_for_auth, StateData};
|
||||
_ ->
|
||||
process_unauthenticated_stanza(StateData, El),
|
||||
{next_state, wait_for_auth, StateData}
|
||||
end
|
||||
end;
|
||||
|
||||
wait_for_auth({xmlstreamend, _Name}, StateData) ->
|
||||
@ -463,7 +451,7 @@ wait_for_feature_request({xmlstreamelement, El}, StateData) ->
|
||||
[StateData#state.socket, U]),
|
||||
{next_state, wait_for_stream,
|
||||
StateData#state{streamid = new_id(),
|
||||
authentificated = true,
|
||||
authenticated = true,
|
||||
user = U
|
||||
}};
|
||||
{continue, ServerOut, NewSASLState} ->
|
||||
@ -506,22 +494,9 @@ wait_for_feature_request({xmlstreamelement, El}, StateData) ->
|
||||
?STREAM_TRAILER),
|
||||
{stop, normal, StateData};
|
||||
true ->
|
||||
case jlib:iq_query_info(El) of
|
||||
#iq{xmlns = ?NS_REGISTER} = IQ ->
|
||||
ResIQ = mod_register:process_iq(
|
||||
{"", "", ""},
|
||||
jlib:make_jid("", StateData#state.server, ""),
|
||||
IQ),
|
||||
Res1 = jlib:replace_from_to({"", StateData#state.server, ""},
|
||||
{"", "", ""},
|
||||
jlib:iq_to_xml(ResIQ)),
|
||||
Res = jlib:remove_attr("to", Res1),
|
||||
send_element(StateData, Res),
|
||||
{next_state, wait_for_feature_request, StateData};
|
||||
_ ->
|
||||
process_unauthenticated_stanza(StateData, El),
|
||||
{next_state, wait_for_feature_request, StateData}
|
||||
end
|
||||
end
|
||||
end;
|
||||
|
||||
wait_for_feature_request({xmlstreamend, _Name}, StateData) ->
|
||||
@ -553,7 +528,7 @@ wait_for_sasl_response({xmlstreamelement, El}, StateData) ->
|
||||
[StateData#state.socket, U]),
|
||||
{next_state, wait_for_stream,
|
||||
StateData#state{streamid = new_id(),
|
||||
authentificated = true,
|
||||
authenticated = true,
|
||||
user = U
|
||||
}};
|
||||
{continue, ServerOut, NewSASLState} ->
|
||||
@ -572,21 +547,8 @@ wait_for_sasl_response({xmlstreamelement, El}, StateData) ->
|
||||
{next_state, wait_for_feature_request, StateData}
|
||||
end;
|
||||
_ ->
|
||||
case jlib:iq_query_info(El) of
|
||||
#iq{xmlns = ?NS_REGISTER} = IQ ->
|
||||
ResIQ = mod_register:process_iq(
|
||||
{"", "", ""},
|
||||
jlib:make_jid("", StateData#state.server, ""),
|
||||
IQ),
|
||||
Res1 = jlib:replace_from_to({"", StateData#state.server, ""},
|
||||
{"", "", ""},
|
||||
jlib:iq_to_xml(ResIQ)),
|
||||
Res = jlib:remove_attr("to", Res1),
|
||||
send_element(StateData, Res),
|
||||
{next_state, wait_for_feature_request, StateData};
|
||||
_ ->
|
||||
process_unauthenticated_stanza(StateData, El),
|
||||
{next_state, wait_for_feature_request, StateData}
|
||||
end
|
||||
end;
|
||||
|
||||
wait_for_sasl_response({xmlstreamend, _Name}, StateData) ->
|
||||
@ -863,7 +825,7 @@ handle_info({send_text, Text}, StateName, StateData) ->
|
||||
handle_info(replaced, _StateName, StateData) ->
|
||||
% TODO
|
||||
%send_text(StateData#state.sender, Text),
|
||||
{stop, normal, StateData#state{authentificated = replaced}};
|
||||
{stop, normal, StateData#state{authenticated = replaced}};
|
||||
handle_info({route, From, To, Packet}, StateName, StateData) ->
|
||||
{xmlelement, Name, Attrs, Els} = Packet,
|
||||
{Pass, NewAttrs, NewState} =
|
||||
@ -1005,7 +967,7 @@ handle_info({route, From, To, Packet}, StateName, StateData) ->
|
||||
terminate(_Reason, StateName, StateData) ->
|
||||
case StateName of
|
||||
session_established ->
|
||||
case StateData#state.authentificated of
|
||||
case StateData#state.authenticated of
|
||||
replaced ->
|
||||
?INFO_MSG("(~w) Replaced session for ~s",
|
||||
[StateData#state.socket,
|
||||
@ -1568,3 +1530,30 @@ get_statustag(Presence) ->
|
||||
case xml:get_path_s(Presence, [{elem, "status"}, cdata]) of
|
||||
ShowTag -> ShowTag
|
||||
end.
|
||||
|
||||
process_unauthenticated_stanza(StateData, El) ->
|
||||
case jlib:iq_query_info(El) of
|
||||
#iq{} = IQ ->
|
||||
Res = ejabberd_hooks:run_fold(c2s_unauthenticated_iq,
|
||||
StateData#state.server,
|
||||
empty,
|
||||
[StateData#state.server, IQ]),
|
||||
case Res of
|
||||
empty ->
|
||||
% The only reasonable IQ's here are auth and register IQ's
|
||||
% They contain secrets, so don't include subelements to response
|
||||
ResIQ = IQ#iq{type = error,
|
||||
sub_el = [?ERR_FEATURE_NOT_IMPLEMENTED]},
|
||||
Res1 = jlib:replace_from_to(
|
||||
jlib:make_jid("", StateData#state.server, ""),
|
||||
jlib:make_jid("", "", ""),
|
||||
jlib:iq_to_xml(ResIQ)),
|
||||
send_element(StateData, jlib:remove_attr("to", Res1));
|
||||
_ ->
|
||||
send_element(StateData, Res)
|
||||
end;
|
||||
_ ->
|
||||
% Drop any stanza, which isn't IQ stanza
|
||||
ok
|
||||
end.
|
||||
|
||||
|
@ -14,6 +14,8 @@
|
||||
|
||||
-export([start/2,
|
||||
stop/1,
|
||||
stream_feature_register/1,
|
||||
unauthenticated_iq_register/3,
|
||||
process_iq/3]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
@ -25,12 +27,37 @@ start(Host, Opts) ->
|
||||
?MODULE, process_iq, IQDisc),
|
||||
gen_iq_handler:add_iq_handler(ejabberd_sm, Host, ?NS_REGISTER,
|
||||
?MODULE, process_iq, IQDisc),
|
||||
ejabberd_hooks:add(c2s_stream_features, Host,
|
||||
?MODULE, stream_feature_register, 50),
|
||||
ejabberd_hooks:add(c2s_unauthenticated_iq, Host,
|
||||
?MODULE, unauthenticated_iq_register, 50),
|
||||
ok.
|
||||
|
||||
stop(Host) ->
|
||||
ejabberd_hooks:delete(c2s_stream_features, Host,
|
||||
?MODULE, stream_feature_register, 50),
|
||||
ejabberd_hooks:delete(c2s_unauthenticated_iq, Host,
|
||||
?MODULE, unauthenticated_iq_register, 50),
|
||||
gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?NS_REGISTER),
|
||||
gen_iq_handler:remove_iq_handler(ejabberd_sm, Host, ?NS_REGISTER).
|
||||
|
||||
|
||||
stream_feature_register(Acc) ->
|
||||
[{xmlelement, "register",
|
||||
[{"xmlns", ?NS_FEATURE_IQREGISTER}], []} | Acc].
|
||||
|
||||
unauthenticated_iq_register(_Acc, Server, #iq{xmlns = ?NS_REGISTER} = IQ) ->
|
||||
ResIQ = process_iq(jlib:make_jid("", "", ""),
|
||||
jlib:make_jid("", Server, ""),
|
||||
IQ),
|
||||
Res1 = jlib:replace_from_to(jlib:make_jid("", Server, ""),
|
||||
jlib:make_jid("", "", ""),
|
||||
jlib:iq_to_xml(ResIQ)),
|
||||
jlib:remove_attr("to", Res1);
|
||||
|
||||
unauthenticated_iq_register(Acc, _Server, _IQ) ->
|
||||
Acc.
|
||||
|
||||
process_iq(From, To,
|
||||
#iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) ->
|
||||
case Type of
|
||||
|
@ -1332,7 +1332,7 @@ get_stats(global, Lang) ->
|
||||
[?XE("tbody",
|
||||
[?XE("tr", [?XCT("td", "Registered users"),
|
||||
?XC("td", integer_to_list(RegisteredUsers))]),
|
||||
?XE("tr", [?XCT("td", "Authentificated users"),
|
||||
?XE("tr", [?XCT("td", "Authenticated users"),
|
||||
?XC("td", integer_to_list(AuthUsers))]),
|
||||
?XE("tr", [?XCT("td", "Online users"),
|
||||
?XC("td", integer_to_list(OnlineUsers))]),
|
||||
@ -1985,7 +1985,7 @@ get_node(global, Node, ["stats"], Query, Lang) ->
|
||||
?XE("tr", [?XCT("td", "CPU Time"),
|
||||
?XAC("td", [{"class", "alignright"}],
|
||||
CPUTimeS)]),
|
||||
?XE("tr", [?XCT("td", "Authentificated users"),
|
||||
?XE("tr", [?XCT("td", "Authenticated users"),
|
||||
?XAC("td", [{"class", "alignright"}],
|
||||
integer_to_list(Users))]),
|
||||
?XE("tr", [?XCT("td", "Transactions commited"),
|
||||
|
@ -19,6 +19,10 @@
|
||||
|
||||
!define MUI_ICON "ejabberd.ico"
|
||||
!define MUI_UNICON "ejabberd.ico"
|
||||
!define MUI_HEADERIMAGE
|
||||
!define MUI_HEADERIMAGE_BITMAP "ejabberd_header.bmp"
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "ejabberd_intro.bmp"
|
||||
|
||||
|
||||
;--------------------------------
|
||||
;Configuration
|
||||
@ -28,6 +32,10 @@
|
||||
;--------------------------------
|
||||
;Reserve Files
|
||||
|
||||
ReserveFile "ejabberd.ico"
|
||||
ReserveFile "ejabberd.ico"
|
||||
ReserveFile "ejabberd_header.bmp"
|
||||
ReserveFile "ejabberd_intro.bmp"
|
||||
!ifdef HACKED_INSTALLOPTIONS
|
||||
ReserveFile "CheckUserH.ini"
|
||||
ReserveFile "CheckReqs1H.ini"
|
||||
@ -111,12 +119,12 @@ FunctionEnd
|
||||
!define MUI_ABORTWARNING
|
||||
|
||||
;--------------------------------
|
||||
;Pages
|
||||
;Installer/Uninstaller pages
|
||||
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
|
||||
Page custom CheckUser LeaveCheckUser
|
||||
Page custom CheckService LeaveCheckService
|
||||
!insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
|
||||
Page custom CheckReqs LeaveCheckReqs
|
||||
Page custom CheckReqs1 LeaveCheckReqs1
|
||||
;!insertmacro MUI_PAGE_COMPONENTS
|
||||
|
BIN
src/win32/ejabberd_header.bmp
Normal file
BIN
src/win32/ejabberd_header.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
BIN
src/win32/ejabberd_intro.bmp
Normal file
BIN
src/win32/ejabberd_intro.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
Loading…
Reference in New Issue
Block a user