* doc/guide.tex: Updated

* src/msgs/fr.msg: Updated (thanks to Sergei Golovan)

* src/mod_irc/mod_irc.erl: Added handler for disco items requests
(thanks to Sergei Golovan)

* src/mod_vcard.erl: Added option for JUD disabling (thanks to
Sergei Golovan)

* src/mod_configure2.erl: Fixed module stopping (thanks to Sergei
Golovan)
* src/mod_last.erl: Likewise
* src/mod_privacy.erl: Likewise
* src/mod_register.erl: Likewise
* src/mod_roster.erl: Likewise
* src/mod_vcard.erl: Likewise

* src/jd2ejd.erl: Added emergency catches (thanks to Sergei
Golovan)
* src/mod_last.erl: Likewise

* src/ejabberd_sm.erl: Removed needless call to
mod_disco:unregister_feature (thanks to Sergei Golovan)

* src/ejabberd_local.erl: Better support for mod_disco (thanks to
Sergei Golovan)
* src/mod_disco.erl: Likewise

* src/translate.erl: Suport for "default language" option (thanks
to Sergei Golovan)
* src/ejabberd_config.erl: Likewise
* src/ejabberd_c2s.erl: Likewise
* src/ejabberd.hrl: Added 'MYLANG' macros

* src/ejabberd.cfg.example: Updated (thanks to Sergei Golovan)

* doc/guide.tex: Updated (thanks to Sergei Golovan)

* src/win32/ejabberd.cfg: Updated (thanks to Sergei Golovan)

SVN Revision: 241
This commit is contained in:
Alexey Shchepin 2004-07-09 22:34:26 +00:00
parent b88da95b51
commit d2eab0d535
23 changed files with 576 additions and 417 deletions

View File

@ -1,3 +1,48 @@
2004-07-10 Alexey Shchepin <alexey@sevcom.net>
* doc/guide.tex: Updated
* src/msgs/fr.msg: Updated (thanks to Sergei Golovan)
* src/mod_irc/mod_irc.erl: Added handler for disco items requests
(thanks to Sergei Golovan)
* src/mod_vcard.erl: Added option for JUD disabling (thanks to
Sergei Golovan)
* src/mod_configure2.erl: Fixed module stopping (thanks to Sergei
Golovan)
* src/mod_last.erl: Likewise
* src/mod_privacy.erl: Likewise
* src/mod_register.erl: Likewise
* src/mod_roster.erl: Likewise
* src/mod_vcard.erl: Likewise
* src/jd2ejd.erl: Added emergency catches (thanks to Sergei
Golovan)
* src/mod_last.erl: Likewise
* src/ejabberd_sm.erl: Removed needless call to
mod_disco:unregister_feature (thanks to Sergei Golovan)
* src/ejabberd_local.erl: Better support for mod_disco (thanks to
Sergei Golovan)
* src/mod_disco.erl: Likewise
* src/translate.erl: Suport for "default language" option (thanks
to Sergei Golovan)
* src/ejabberd_config.erl: Likewise
* src/ejabberd_c2s.erl: Likewise
* src/ejabberd.hrl: Added 'MYLANG' macros
* src/ejabberd.cfg.example: Updated (thanks to Sergei Golovan)
* doc/guide.tex: Updated (thanks to Sergei Golovan)
2004-07-09 Alexey Shchepin <alexey@sevcom.net>
* src/win32/ejabberd.cfg: Updated (thanks to Sergei Golovan)
2004-07-07 Alexey Shchepin <alexey@sevcom.net>
* src/Makefile.win32: Updated (thanks to Sergei Golovan)

View File

@ -56,56 +56,49 @@
<A HREF="#htoc12">3.1&nbsp;&nbsp;Initial Configuration</A>
<UL><LI>
<A HREF="#htoc13">3.1.1&nbsp;&nbsp;Host Name</A>
<LI><A HREF="#htoc14">3.1.2&nbsp;&nbsp;Access Rules</A>
<LI><A HREF="#htoc15">3.1.3&nbsp;&nbsp;Shapers Configuration</A>
<LI><A HREF="#htoc16">3.1.4&nbsp;&nbsp;Listened Sockets</A>
<LI><A HREF="#htoc17">3.1.5&nbsp;&nbsp;Modules</A>
<LI><A HREF="#htoc14">3.1.2&nbsp;&nbsp;Default Language</A>
<LI><A HREF="#htoc15">3.1.3&nbsp;&nbsp;Access Rules</A>
<LI><A HREF="#htoc16">3.1.4&nbsp;&nbsp;Shapers Configuration</A>
<LI><A HREF="#htoc17">3.1.5&nbsp;&nbsp;Listened Sockets</A>
<LI><A HREF="#htoc18">3.1.6&nbsp;&nbsp;Modules</A>
</UL>
<LI><A HREF="#htoc18">3.2&nbsp;&nbsp;Online Configuration and Monitoring</A>
<LI><A HREF="#htoc19">3.2&nbsp;&nbsp;Online Configuration and Monitoring</A>
</UL>
<LI><A HREF="#htoc20">4&nbsp;&nbsp;Distribution</A>
<UL><LI>
<A HREF="#htoc19">3.2.1&nbsp;&nbsp;Node <TT>config</TT>: Global Configuration</A>
<LI><A HREF="#htoc20">3.2.2&nbsp;&nbsp;Node <TT>online users</TT>: List of Online Users</A>
<LI><A HREF="#htoc21">3.2.3&nbsp;&nbsp;Node <TT>all users</TT>: List of Registered Users</A>
<LI><A HREF="#htoc22">3.2.4&nbsp;&nbsp;Node <TT>outgoing s2s</TT>: List of Outgoing S2S connections</A>
<LI><A HREF="#htoc23">3.2.5&nbsp;&nbsp;Node <TT>running nodes</TT>: List of Running <TT>ejabberd</TT> Nodes</A>
<LI><A HREF="#htoc24">3.2.6&nbsp;&nbsp;Node <TT>stopped nodes</TT>: List of Stopped Nodes</A>
</UL>
</UL>
<LI><A HREF="#htoc25">4&nbsp;&nbsp;Distribution</A>
<A HREF="#htoc21">4.1&nbsp;&nbsp;How it works</A>
<UL><LI>
<A HREF="#htoc26">4.1&nbsp;&nbsp;How it works</A>
<A HREF="#htoc22">4.1.1&nbsp;&nbsp;Router</A>
<LI><A HREF="#htoc23">4.1.2&nbsp;&nbsp;Local Router</A>
<LI><A HREF="#htoc24">4.1.3&nbsp;&nbsp;Session Manager</A>
<LI><A HREF="#htoc25">4.1.4&nbsp;&nbsp;S2S Manager</A>
</UL>
</UL>
<LI><A HREF="#htoc26">A&nbsp;&nbsp;Built-in Modules</A>
<UL><LI>
<A HREF="#htoc27">4.1.1&nbsp;&nbsp;Router</A>
<LI><A HREF="#htoc28">4.1.2&nbsp;&nbsp;Local Router</A>
<LI><A HREF="#htoc29">4.1.3&nbsp;&nbsp;Session Manager</A>
<LI><A HREF="#htoc30">4.1.4&nbsp;&nbsp;S2S Manager</A>
</UL>
</UL>
<LI><A HREF="#htoc31">A&nbsp;&nbsp;Built-in Modules</A>
<A HREF="#htoc27">A.1&nbsp;&nbsp;Common Options</A>
<UL><LI>
<A HREF="#htoc32">A.1&nbsp;&nbsp;Common Options</A>
<UL><LI>
<A HREF="#htoc33">A.1.1&nbsp;&nbsp;Option <TT>iqdisc</TT></A>
<LI><A HREF="#htoc34">A.1.2&nbsp;&nbsp;Option <TT>host</TT></A>
<A HREF="#htoc28">A.1.1&nbsp;&nbsp;Option <TT>iqdisc</TT></A>
<LI><A HREF="#htoc29">A.1.2&nbsp;&nbsp;Option <TT>host</TT></A>
</UL>
<LI><A HREF="#htoc35">A.2&nbsp;&nbsp;<TT>mod_configure</TT></A>
<LI><A HREF="#htoc36">A.3&nbsp;&nbsp;<TT>mod_disco</TT></A>
<LI><A HREF="#htoc37">A.4&nbsp;&nbsp;<TT>mod_echo</TT></A>
<LI><A HREF="#htoc38">A.5&nbsp;&nbsp;<TT>mod_irc</TT></A>
<LI><A HREF="#htoc39">A.6&nbsp;&nbsp;<TT>mod_last</TT></A>
<LI><A HREF="#htoc40">A.7&nbsp;&nbsp;<TT>mod_muc</TT></A>
<LI><A HREF="#htoc41">A.8&nbsp;&nbsp;<TT>mod_offline</TT></A>
<LI><A HREF="#htoc42">A.9&nbsp;&nbsp;<TT>mod_privacy</TT></A>
<LI><A HREF="#htoc43">A.10&nbsp;&nbsp;<TT>mod_private</TT></A>
<LI><A HREF="#htoc44">A.11&nbsp;&nbsp;<TT>mod_pubsub</TT></A>
<LI><A HREF="#htoc45">A.12&nbsp;&nbsp;<TT>mod_register</TT></A>
<LI><A HREF="#htoc46">A.13&nbsp;&nbsp;<TT>mod_roster</TT></A>
<LI><A HREF="#htoc47">A.14&nbsp;&nbsp;<TT>mod_stats</TT></A>
<LI><A HREF="#htoc48">A.15&nbsp;&nbsp;<TT>mod_time</TT></A>
<LI><A HREF="#htoc49">A.16&nbsp;&nbsp;<TT>mod_vcard</TT></A>
<LI><A HREF="#htoc50">A.17&nbsp;&nbsp;<TT>mod_version</TT></A>
<LI><A HREF="#htoc30">A.2&nbsp;&nbsp;<TT>mod_configure</TT></A>
<LI><A HREF="#htoc31">A.3&nbsp;&nbsp;<TT>mod_disco</TT></A>
<LI><A HREF="#htoc32">A.4&nbsp;&nbsp;<TT>mod_echo</TT></A>
<LI><A HREF="#htoc33">A.5&nbsp;&nbsp;<TT>mod_irc</TT></A>
<LI><A HREF="#htoc34">A.6&nbsp;&nbsp;<TT>mod_last</TT></A>
<LI><A HREF="#htoc35">A.7&nbsp;&nbsp;<TT>mod_muc</TT></A>
<LI><A HREF="#htoc36">A.8&nbsp;&nbsp;<TT>mod_offline</TT></A>
<LI><A HREF="#htoc37">A.9&nbsp;&nbsp;<TT>mod_privacy</TT></A>
<LI><A HREF="#htoc38">A.10&nbsp;&nbsp;<TT>mod_private</TT></A>
<LI><A HREF="#htoc39">A.11&nbsp;&nbsp;<TT>mod_pubsub</TT></A>
<LI><A HREF="#htoc40">A.12&nbsp;&nbsp;<TT>mod_register</TT></A>
<LI><A HREF="#htoc41">A.13&nbsp;&nbsp;<TT>mod_roster</TT></A>
<LI><A HREF="#htoc42">A.14&nbsp;&nbsp;<TT>mod_stats</TT></A>
<LI><A HREF="#htoc43">A.15&nbsp;&nbsp;<TT>mod_time</TT></A>
<LI><A HREF="#htoc44">A.16&nbsp;&nbsp;<TT>mod_vcard</TT></A>
<LI><A HREF="#htoc45">A.17&nbsp;&nbsp;<TT>mod_version</TT></A>
</UL>
<LI><A HREF="#htoc51">B&nbsp;&nbsp;I18n/L10n</A>
<LI><A HREF="#htoc46">B&nbsp;&nbsp;I18n/L10n</A>
</UL>
<!--TOC section Introduction-->
@ -131,6 +124,7 @@ Works on most of popular platforms: *nix (tested on Linux, FreeBSD and
<LI>Built-in IRC transport
<LI>Built-in <A HREF="http://www.jabber.org/jeps/jep-0060.html">Publish-Subscribe</A> service
<LI>Built-in Jabber Users Directory service based on users vCards
<LI>Built-in web-based administration interface
<LI>Built-in <A HREF="http://www.jabber.org/jeps/jep-0025.html">HTTP Polling</A> service
<LI>SSL support
<LI>Support for LDAP authentification
@ -328,13 +322,25 @@ adding new ones.<BR>
<A NAME="sec:confighostname"></A>
Option <TT>hostname</TT> defines name of Jabber domain that <TT>ejabberd</TT>
serves. E.&nbsp;g. to use <TT>jabber.org</TT> domain add following line in config:
serves. E.&nbsp;g. to use <TT>jabber.org</TT> domain add the following line in the config:
<PRE>
{host, "jabber.org"}.
</PRE>
<!--TOC subsubsection Default Language-->
<H4><A NAME="htoc14">3.1.2</A>&nbsp;&nbsp;Default Language</H4><!--SEC END -->
<A NAME="sec:configlanguage"></A>
Option <TT>language</TT> defines default language of <TT>ejabberd</TT> messages, sent
to users. Default value is <TT>"en"</TT>. In order to take effect there must be a
translation file <TT>&lt;language&gt;.msg</TT> in <TT>ejabberd</TT> <TT>msgs</TT> directory.
E.&nbsp;g. to use Russian as default language add the following line in the config:
<PRE>
{language, "ru"}.
</PRE>
<!--TOC subsubsection Access Rules-->
<H4><A NAME="htoc14">3.1.2</A>&nbsp;&nbsp;Access Rules</H4><!--SEC END -->
<H4><A NAME="htoc15">3.1.3</A>&nbsp;&nbsp;Access Rules</H4><!--SEC END -->
<A NAME="sec:configaccess"></A>
Access control in <TT>ejabberd</TT> is performed via Access Control Lists (ACL). The
@ -420,7 +426,7 @@ Following access rules pre-defined:
</DL>
<!--TOC subsubsection Shapers Configuration-->
<H4><A NAME="htoc15">3.1.3</A>&nbsp;&nbsp;Shapers Configuration</H4><!--SEC END -->
<H4><A NAME="htoc16">3.1.4</A>&nbsp;&nbsp;Shapers Configuration</H4><!--SEC END -->
<A NAME="sec:configshaper"></A>
With shapers is possible to bound connection traffic. The declarations of
@ -439,7 +445,7 @@ E.&nbsp;g. to define shaper with name ``<TT>normal</TT>'' and maximum allowed ra
</PRE>
<!--TOC subsubsection Listened Sockets-->
<H4><A NAME="htoc16">3.1.4</A>&nbsp;&nbsp;Listened Sockets</H4><!--SEC END -->
<H4><A NAME="htoc17">3.1.5</A>&nbsp;&nbsp;Listened Sockets</H4><!--SEC END -->
<A NAME="sec:configlistened"></A>
Option <TT>listen</TT> defines list of listened sockets and what services
@ -499,19 +505,23 @@ For example, the following configuration defines that:
C2S connections are listened on port 5222 and 5223 (SSL) and denied for
user ``<TT>bad</TT>''
<LI>S2S connections are listened on port 5269
<LI>HTTP connections are listened on port 5280 and administration interface
and HTTP Polling support are enabled
<LI>All users except admins have traffic limit 1000&nbsp;B/s
<LI>AIM service <TT>aim.example.org</TT> is connected to port 5233 with
<LI>AIM transport <TT>aim.example.org</TT> is connected to port 5233 with
password ``<TT>aimsecret</TT>''
<LI>JIT services <TT>icq.example.org</TT> and <TT>sms.example.org</TT> are
<LI>JIT transports <TT>icq.example.org</TT> and <TT>sms.example.org</TT> are
connected to port 5234 with password ``<TT>jitsecret</TT>''
<LI>MSN service <TT>msn.example.org</TT> is connected to port 5235 with
<LI>MSN transport <TT>msn.example.org</TT> is connected to port 5235 with
password ``<TT>msnsecret</TT>''
<LI>Yahoo! service <TT>yahoo.example.org</TT> is connected to port 5236 with
<LI>Yahoo! transport <TT>yahoo.example.org</TT> is connected to port 5236 with
password ``<TT>yahoosecret</TT>''
<LI>ILE service <TT>ile.example.org</TT> is connected to port 5237 with
<LI>Gadu-Gadu transport <TT>gg.example.org</TT> is connected to port 5237 with
password ``<TT>ggsecret</TT>''
<LI>ILE service <TT>ile.example.org</TT> is connected to port 5238 with
password ``<TT>ilesecret</TT>''
</UL>
<PRE>
<PRE>
{acl, blocked, {user, "bad"}}.
{access, c2s, [{deny, blocked},
{allow, all}]}.
@ -523,6 +533,7 @@ C2S connections are listened on port 5222 and 5223 (SSL) and denied for
{5223, ejabberd_c2s, [{access, c2s},
ssl, {certfile, "/path/to/ssl.pem"}]},
{5269, ejabberd_s2s_in, []},
{5280, ejabberd_http, [http_poll, web_admin]},
{5233, ejabberd_service, [{host, "aim.example.org",
[{password, "aimsecret"}]}]},
{5234, ejabberd_service, [{hosts, ["icq.example.org", "sms.example.org"],
@ -571,7 +582,7 @@ transports log and do XDB by themselves:
</PRE>
<!--TOC subsubsection Modules-->
<H4><A NAME="htoc17">3.1.5</A>&nbsp;&nbsp;Modules</H4><!--SEC END -->
<H4><A NAME="htoc18">3.1.6</A>&nbsp;&nbsp;Modules</H4><!--SEC END -->
<A NAME="sec:configmodules"></A>
Option <TT>modules</TT> defines the list of modules that will be loaded after
@ -602,146 +613,54 @@ Example:
</PRE>
<!--TOC subsection Online Configuration and Monitoring-->
<H3><A NAME="htoc18">3.2</A>&nbsp;&nbsp;Online Configuration and Monitoring</H3><!--SEC END -->
<H3><A NAME="htoc19">3.2</A>&nbsp;&nbsp;Online Configuration and Monitoring</H3><!--SEC END -->
<A NAME="sec:onlineconfig"></A>
To perform online reconfiguration of <TT>ejabberd</TT> you will need to have
<TT>mod_configure</TT> loaded (see section&nbsp;<A HREF="#sec:modconfigure">A.2</A>). It is also highly
recommended to load <TT>mod_disco</TT> as well (see section&nbsp;<A HREF="#sec:moddisco">A.3</A>),
because <TT>mod_configure</TT> is highly integrated with it. Additionally it is
recommended to use a disco- and xdata-capable client such as
<A HREF="http://tkabber.jabber.ru/">Tkabber</A>
(which was developed synchronously with <TT>ejabberd</TT>, its CVS version
supports most of <TT>ejabberd</TT> features).<BR>
<BR>
On disco query <TT>ejabberd</TT> returns following items (see figure&nbsp;<A HREF="#fig:disco">1</A>):
<UL><LI>
Identity of server.
<LI>List of features, including defined namespaces.
<LI>List of JIDs from route table.
<LI>List of disco-nodes described in following subsections.
</UL>
To perform online reconfiguration of <TT>ejabberd</TT> you need to enable
<TT>ejabberd_http</TT> listener with option <TT>web_admin</TT> (see
section&nbsp;<A HREF="#sec:configlistened">3.1.5</A>). After that you can open URL
<CODE>http://server:port/admin/</CODE> with you favorite web-browser and enter
username and password of <TT>ejabberd</TT> administrator. E.&nbsp;g. with such config:
<PRE>
...
{host, "example.org"}.
...
{listen,
[...
{5280, ejabberd_http, [web_admin]},
...
]
}.
</PRE>you should enter URL <CODE>http://example.org:5280/admin/</CODE>. After
authentification you should see something like in figure&nbsp;<A HREF="#fig:webadmmain">1</A>.
<BLOCKQUOTE><DIV ALIGN=center><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
<IMG SRC="disco.png">
<IMG SRC="webadmmain.png">
<BR>
<DIV ALIGN=center>Figure 1: Tkabber Discovery window</DIV><BR>
<DIV ALIGN=center>Figure 1: Web-administration top page</DIV><BR>
<A NAME="fig:disco"></A>
<A NAME="fig:webadmmain"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE>
<!--TOC subsubsection Node <TT>config</TT>: Global Configuration-->
<H4><A NAME="htoc19">3.2.1</A>&nbsp;&nbsp;Node <TT>config</TT>: Global Configuration</H4><!--SEC END -->
Under this node the following nodes exist:<BR>
<BR>
<!--TOC paragraph Node <TT>config/hostname</TT>-->
<H5>Node <TT>config/hostname</TT></H5><!--SEC END -->
Via <TT>ejabberd:config</TT> queries to this node possible to change host name of
this <TT>ejabberd</TT> server. (See figure&nbsp;<A HREF="#fig:hostname">2</A>) (Currently this works
correctly only after a restart)
<BLOCKQUOTE><DIV ALIGN=center><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
<IMG SRC="confhostname.png">
<BR>
<DIV ALIGN=center>Figure 2: Editing of hostname</DIV><BR>
<A NAME="fig:hostname"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE>
<!--TOC paragraph Node <TT>config/acls</TT>-->
<H5>Node <TT>config/acls</TT></H5><!--SEC END -->
Via <TT>ejabberd:config</TT> queries to this node it is possible to edit ACLs list.
(See figure&nbsp;<A HREF="#fig:acls">3</A>)
<BLOCKQUOTE><DIV ALIGN=center><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
<IMG SRC="confacls.png">
<BR>
<DIV ALIGN=center>Figure 3: Editing of ACLs</DIV><BR>
<A NAME="fig:acls"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE>
<!--TOC paragraph Node <TT>config/access</TT>-->
<H5>Node <TT>config/access</TT></H5><!--SEC END -->
Via <TT>ejabberd:config</TT> queries to this node it is possible to edit access
rules.<BR>
<BR>
<!--TOC paragraph Node <TT>config/remusers</TT>-->
<H5>Node <TT>config/remusers</TT></H5><!--SEC END -->
Via <TT>ejabberd:config</TT> queries to this node it is possible to remove users. If
removed user is online, then he will be disconnected. Also user-related data
(e.g. his roster) is removed (but appropriate module must be loaded).<BR>
<BR>
<!--TOC subsubsection Node <TT>online users</TT>: List of Online Users-->
<H4><A NAME="htoc20">3.2.2</A>&nbsp;&nbsp;Node <TT>online users</TT>: List of Online Users</H4><!--SEC END -->
<!--TOC subsubsection Node <TT>all users</TT>: List of Registered Users-->
<H4><A NAME="htoc21">3.2.3</A>&nbsp;&nbsp;Node <TT>all users</TT>: List of Registered Users</H4><!--SEC END -->
<BLOCKQUOTE><DIV ALIGN=center><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
<IMG SRC="discoallusers.png">
<BR>
<DIV ALIGN=center>Figure 4: Discovery all users</DIV><BR>
<A NAME="fig:discoallusers"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE>
<!--TOC subsubsection Node <TT>outgoing s2s</TT>: List of Outgoing S2S connections-->
<H4><A NAME="htoc22">3.2.4</A>&nbsp;&nbsp;Node <TT>outgoing s2s</TT>: List of Outgoing S2S connections</H4><!--SEC END -->
<!--TOC subsubsection Node <TT>running nodes</TT>: List of Running <TT>ejabberd</TT> Nodes-->
<H4><A NAME="htoc23">3.2.5</A>&nbsp;&nbsp;Node <TT>running nodes</TT>: List of Running <TT>ejabberd</TT> Nodes</H4><!--SEC END -->
<BLOCKQUOTE><DIV ALIGN=center><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
<IMG SRC="discorunnodes.png">
<BR>
<DIV ALIGN=center>Figure 5: Discovery running nodes</DIV><BR>
<A NAME="fig:discorunnodes"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE>
<!--TOC subsubsection Node <TT>stopped nodes</TT>: List of Stopped Nodes-->
<H4><A NAME="htoc24">3.2.6</A>&nbsp;&nbsp;Node <TT>stopped nodes</TT>: List of Stopped Nodes</H4><!--SEC END -->
TBD<BR>
Here you can edit access restrictions, manage users, create backup files,
manage DB, enable/disable listened ports, and view statistics.<BR>
<BR>
<!--TOC section Distribution-->
<H2><A NAME="htoc25">4</A>&nbsp;&nbsp;Distribution</H2><!--SEC END -->
<H2><A NAME="htoc20">4</A>&nbsp;&nbsp;Distribution</H2><!--SEC END -->
<A NAME="sec:distribution"></A>
<!--TOC subsection How it works-->
<H3><A NAME="htoc26">4.1</A>&nbsp;&nbsp;How it works</H3><!--SEC END -->
<H3><A NAME="htoc21">4.1</A>&nbsp;&nbsp;How it works</H3><!--SEC END -->
<A NAME="sec:howitworks"></A>
A Jabber domain is served by one or more <TT>ejabberd</TT> nodes. These nodes can
be run on different machines that are connected via a network. They all must
have the ability to connect to port 4369 of all another nodes, and must have
the same magic cookie (see Erlang/OTP documentation, in other words the file
<TT>~ejabberd/.erlang.cookie</TT> must be the same on all nodes). This is
be runned on different machines that are connected via a network. They all
must have the ability to connect to port 4369 of all another nodes, and must
have the same magic cookie (see Erlang/OTP documentation, in other words the
file <TT>~ejabberd/.erlang.cookie</TT> must be the same on all nodes). This is
needed because all nodes exchange information about connected users, S2S
connections, registered services, etc...<BR>
<BR>
@ -754,7 +673,7 @@ router;
</UL>
<!--TOC subsubsection Router-->
<H4><A NAME="htoc27">4.1.1</A>&nbsp;&nbsp;Router</H4><!--SEC END -->
<H4><A NAME="htoc22">4.1.1</A>&nbsp;&nbsp;Router</H4><!--SEC END -->
This module is the main router of Jabber packets on each node. It routes
them based on their destinations domains. It has two tables: local and global
@ -766,7 +685,7 @@ manager.<BR>
<BR>
<!--TOC subsubsection Local Router-->
<H4><A NAME="htoc28">4.1.2</A>&nbsp;&nbsp;Local Router</H4><!--SEC END -->
<H4><A NAME="htoc23">4.1.2</A>&nbsp;&nbsp;Local Router</H4><!--SEC END -->
This module routes packets which have a destination domain equal to this server
name. If destination JID has a non-empty user part, then it routed to the
@ -774,7 +693,7 @@ session manager, else it is processed depending on it's content.<BR>
<BR>
<!--TOC subsubsection Session Manager-->
<H4><A NAME="htoc29">4.1.3</A>&nbsp;&nbsp;Session Manager</H4><!--SEC END -->
<H4><A NAME="htoc24">4.1.3</A>&nbsp;&nbsp;Session Manager</H4><!--SEC END -->
This module routes packets to local users. It searches for what user resource
packet must be sended via presence table. If this resource is connected to
@ -783,7 +702,7 @@ the packet is sent to session manager on that node.<BR>
<BR>
<!--TOC subsubsection S2S Manager-->
<H4><A NAME="htoc30">4.1.4</A>&nbsp;&nbsp;S2S Manager</H4><!--SEC END -->
<H4><A NAME="htoc25">4.1.4</A>&nbsp;&nbsp;S2S Manager</H4><!--SEC END -->
This module routes packets to other Jabber servers. First, it checks if an
open S2S connection from the domain of the packet source to the domain of
@ -794,12 +713,12 @@ does not exist, then it is opened and registered.<BR>
<BR>
<!--TOC section Built-in Modules-->
<H2><A NAME="htoc31">A</A>&nbsp;&nbsp;Built-in Modules</H2><!--SEC END -->
<H2><A NAME="htoc26">A</A>&nbsp;&nbsp;Built-in Modules</H2><!--SEC END -->
<A NAME="sec:modules"></A>
<!--TOC subsection Common Options-->
<H3><A NAME="htoc32">A.1</A>&nbsp;&nbsp;Common Options</H3><!--SEC END -->
<H3><A NAME="htoc27">A.1</A>&nbsp;&nbsp;Common Options</H3><!--SEC END -->
<A NAME="sec:modcommonopts"></A>
The following options are used by many modules, so they are described in
@ -807,7 +726,7 @@ separate section.<BR>
<BR>
<!--TOC subsubsection Option <TT>iqdisc</TT>-->
<H4><A NAME="htoc33">A.1.1</A>&nbsp;&nbsp;Option <TT>iqdisc</TT></H4><!--SEC END -->
<H4><A NAME="htoc28">A.1.1</A>&nbsp;&nbsp;Option <TT>iqdisc</TT></H4><!--SEC END -->
<A NAME="sec:modiqdiscoption"></A>
Many modules define handlers for processing IQ queries of different namespaces
@ -840,7 +759,7 @@ Example:
</PRE>
<!--TOC subsubsection Option <TT>host</TT>-->
<H4><A NAME="htoc34">A.1.2</A>&nbsp;&nbsp;Option <TT>host</TT></H4><!--SEC END -->
<H4><A NAME="htoc29">A.1.2</A>&nbsp;&nbsp;Option <TT>host</TT></H4><!--SEC END -->
<A NAME="sec:modhostoption"></A>
This option explicitly defines hostname for the module which acts as a service.<BR>
@ -856,7 +775,7 @@ Example:
</PRE>
<!--TOC subsection <TT>mod_configure</TT>-->
<H3><A NAME="htoc35">A.2</A>&nbsp;&nbsp;<TT>mod_configure</TT></H3><!--SEC END -->
<H3><A NAME="htoc30">A.2</A>&nbsp;&nbsp;<TT>mod_configure</TT></H3><!--SEC END -->
<A NAME="sec:modconfigure"></A>
Options:
@ -866,7 +785,7 @@ discipline (see&nbsp;<A HREF="#sec:modiqdiscoption">A.1.1</A>).
</DL>
<!--TOC subsection <TT>mod_disco</TT>-->
<H3><A NAME="htoc36">A.3</A>&nbsp;&nbsp;<TT>mod_disco</TT></H3><!--SEC END -->
<H3><A NAME="htoc31">A.3</A>&nbsp;&nbsp;<TT>mod_disco</TT></H3><!--SEC END -->
<A NAME="sec:moddisco"></A>
This module adds support for <A HREF="http://www.jabber.org/jeps/jep-0030.html">JEP-0030</A> (Service Discovery).<BR>
@ -891,7 +810,7 @@ Example:
</PRE>
<!--TOC subsection <TT>mod_echo</TT>-->
<H3><A NAME="htoc37">A.4</A>&nbsp;&nbsp;<TT>mod_echo</TT></H3><!--SEC END -->
<H3><A NAME="htoc32">A.4</A>&nbsp;&nbsp;<TT>mod_echo</TT></H3><!--SEC END -->
<A NAME="sec:modecho"></A>
This module acts as a service and simply returns to sender any Jabber packet. Module may be
@ -905,7 +824,7 @@ then prefix <TT>echo.</TT> is added to main <TT>ejabberd</TT> hostname.
</DL>
<!--TOC subsection <TT>mod_irc</TT>-->
<H3><A NAME="htoc38">A.5</A>&nbsp;&nbsp;<TT>mod_irc</TT></H3><!--SEC END -->
<H3><A NAME="htoc33">A.5</A>&nbsp;&nbsp;<TT>mod_irc</TT></H3><!--SEC END -->
<A NAME="sec:modirc"></A>
This module implements IRC transport.<BR>
@ -918,7 +837,7 @@ then prefix <TT>irc.</TT> is added to main <TT>ejabberd</TT> hostname.
</DL>
<!--TOC subsection <TT>mod_last</TT>-->
<H3><A NAME="htoc39">A.6</A>&nbsp;&nbsp;<TT>mod_last</TT></H3><!--SEC END -->
<H3><A NAME="htoc34">A.6</A>&nbsp;&nbsp;<TT>mod_last</TT></H3><!--SEC END -->
<A NAME="sec:modlast"></A>
This module adds support for <A HREF="http://www.jabber.org/jeps/jep-0012.html">JEP-0012</A> (Last Activity)<BR>
@ -930,7 +849,7 @@ discipline (see&nbsp;<A HREF="#sec:modiqdiscoption">A.1.1</A>).
</DL>
<!--TOC subsection <TT>mod_muc</TT>-->
<H3><A NAME="htoc40">A.7</A>&nbsp;&nbsp;<TT>mod_muc</TT></H3><!--SEC END -->
<H3><A NAME="htoc35">A.7</A>&nbsp;&nbsp;<TT>mod_muc</TT></H3><!--SEC END -->
<A NAME="sec:modmuc"></A>
This module implements <A HREF="http://www.jabber.org/jeps/jep-0045.html">JEP-0045</A> (Multi-User Chat) service.<BR>
@ -965,14 +884,14 @@ Example:
</PRE>
<!--TOC subsection <TT>mod_offline</TT>-->
<H3><A NAME="htoc41">A.8</A>&nbsp;&nbsp;<TT>mod_offline</TT></H3><!--SEC END -->
<H3><A NAME="htoc36">A.8</A>&nbsp;&nbsp;<TT>mod_offline</TT></H3><!--SEC END -->
<A NAME="sec:modoffline"></A>
This module implements offline message storage.<BR>
<BR>
<!--TOC subsection <TT>mod_privacy</TT>-->
<H3><A NAME="htoc42">A.9</A>&nbsp;&nbsp;<TT>mod_privacy</TT></H3><!--SEC END -->
<H3><A NAME="htoc37">A.9</A>&nbsp;&nbsp;<TT>mod_privacy</TT></H3><!--SEC END -->
<A NAME="sec:modprivacy"></A>
This module implements Privacy Rules as defined in XMPP IM
@ -985,7 +904,7 @@ discipline (see&nbsp;<A HREF="#sec:modiqdiscoption">A.1.1</A>).
</DL>
<!--TOC subsection <TT>mod_private</TT>-->
<H3><A NAME="htoc43">A.10</A>&nbsp;&nbsp;<TT>mod_private</TT></H3><!--SEC END -->
<H3><A NAME="htoc38">A.10</A>&nbsp;&nbsp;<TT>mod_private</TT></H3><!--SEC END -->
<A NAME="sec:modprivate"></A>
This module adds support of <A HREF="http://www.jabber.org/jeps/jep-0049.html">JEP-0049</A> (Private XML Storage).<BR>
@ -997,7 +916,7 @@ discipline (see&nbsp;<A HREF="#sec:modiqdiscoption">A.1.1</A>).
</DL>
<!--TOC subsection <TT>mod_pubsub</TT>-->
<H3><A NAME="htoc44">A.11</A>&nbsp;&nbsp;<TT>mod_pubsub</TT></H3><!--SEC END -->
<H3><A NAME="htoc39">A.11</A>&nbsp;&nbsp;<TT>mod_pubsub</TT></H3><!--SEC END -->
<A NAME="sec:modpubsub"></A>
This module implements <A HREF="http://www.jabber.org/jeps/jep-0060.html">JEP-0060</A> (Publish-Subscribe Service).<BR>
@ -1022,7 +941,7 @@ Example:
</PRE>
<!--TOC subsection <TT>mod_register</TT>-->
<H3><A NAME="htoc45">A.12</A>&nbsp;&nbsp;<TT>mod_register</TT></H3><!--SEC END -->
<H3><A NAME="htoc40">A.12</A>&nbsp;&nbsp;<TT>mod_register</TT></H3><!--SEC END -->
<A NAME="sec:modregister"></A>
This module adds support for <A HREF="http://www.jabber.org/jeps/jep-0077.html">JEP-0077</A> (In-Band Registration).
@ -1054,7 +973,7 @@ Example:
</PRE>
<!--TOC subsection <TT>mod_roster</TT>-->
<H3><A NAME="htoc46">A.13</A>&nbsp;&nbsp;<TT>mod_roster</TT></H3><!--SEC END -->
<H3><A NAME="htoc41">A.13</A>&nbsp;&nbsp;<TT>mod_roster</TT></H3><!--SEC END -->
<A NAME="sec:modroster"></A>
This module implements roster management.<BR>
@ -1066,7 +985,7 @@ discipline (see&nbsp;<A HREF="#sec:modiqdiscoption">A.1.1</A>).
</DL>
<!--TOC subsection <TT>mod_stats</TT>-->
<H3><A NAME="htoc47">A.14</A>&nbsp;&nbsp;<TT>mod_stats</TT></H3><!--SEC END -->
<H3><A NAME="htoc42">A.14</A>&nbsp;&nbsp;<TT>mod_stats</TT></H3><!--SEC END -->
<A NAME="sec:modstats"></A>
This module adds support for <A HREF="http://www.jabber.org/jeps/jep-0039.html">JEP-0039</A> (Statistics Gathering).<BR>
@ -1080,7 +999,7 @@ TBD about access.<BR>
<BR>
<!--TOC subsection <TT>mod_time</TT>-->
<H3><A NAME="htoc48">A.15</A>&nbsp;&nbsp;<TT>mod_time</TT></H3><!--SEC END -->
<H3><A NAME="htoc43">A.15</A>&nbsp;&nbsp;<TT>mod_time</TT></H3><!--SEC END -->
<A NAME="sec:modtime"></A>
This module answers UTC time on <TT>jabber:iq:time</TT> queries.<BR>
@ -1092,7 +1011,7 @@ discipline (see&nbsp;<A HREF="#sec:modiqdiscoption">A.1.1</A>).
</DL>
<!--TOC subsection <TT>mod_vcard</TT>-->
<H3><A NAME="htoc49">A.16</A>&nbsp;&nbsp;<TT>mod_vcard</TT></H3><!--SEC END -->
<H3><A NAME="htoc44">A.16</A>&nbsp;&nbsp;<TT>mod_vcard</TT></H3><!--SEC END -->
<A NAME="sec:modvcard"></A>
This module implements simple Jabber User Directory (based on user vCards)
@ -1105,10 +1024,22 @@ Options:
then prefix <TT>vjud.</TT> is added to main <TT>ejabberd</TT> hostname.
<DT><B><TT>iqdisc</TT></B><DD> <TT>vcard-temp</TT> IQ queries processing
discipline (see&nbsp;<A HREF="#sec:modiqdiscoption">A.1.1</A>).
<DT><B><TT>search</TT></B><DD> Specifies wheather search is enabled (value is <TT>true</TT>, default) or
disabled (value is <TT>false</TT>) by the service. If <TT>search</TT> is set to <TT>false</TT>,
option <TT>host</TT> is ignored and service does not appear in Jabber Discovery items.
</DL>
Example:
<PRE>
{modules,
[
...
{mod_vcard, [{search, false}]}
...
]}.
</PRE>
<!--TOC subsection <TT>mod_version</TT>-->
<H3><A NAME="htoc50">A.17</A>&nbsp;&nbsp;<TT>mod_version</TT></H3><!--SEC END -->
<H3><A NAME="htoc45">A.17</A>&nbsp;&nbsp;<TT>mod_version</TT></H3><!--SEC END -->
<A NAME="sec:modversion"></A>
This module answers <TT>ejabberd</TT> version on <TT>jabber:iq:version</TT> queries.<BR>
@ -1120,12 +1051,11 @@ discipline (see&nbsp;<A HREF="#sec:modiqdiscoption">A.1.1</A>).
</DL>
<!--TOC section I18n/L10n-->
<H2><A NAME="htoc51">B</A>&nbsp;&nbsp;I18n/L10n</H2><!--SEC END -->
<H2><A NAME="htoc46">B</A>&nbsp;&nbsp;I18n/L10n</H2><!--SEC END -->
<A NAME="sec:i18nl10n"></A>
All built-in modules support <TT>xml:lang</TT> attribute inside IQ queries.
E.&nbsp;g. on figure&nbsp;<A HREF="#fig:discorus">6</A> (compare it with figure&nbsp;<A HREF="#fig:disco">1</A>)
showed reply on following query:
E.&nbsp;g. on figure&nbsp;<A HREF="#fig:discorus">2</A> showed the reply on the following query:
<PRE>
&lt;iq id='5'
to='e.localhost'
@ -1140,10 +1070,23 @@ showed reply on following query:
<BR>
<DIV ALIGN=center>Figure 6: Discovery result when <TT>xml:lang='ru'</TT></DIV><BR>
<DIV ALIGN=center>Figure 2: Discovery result when <TT>xml:lang='ru'</TT></DIV><BR>
<A NAME="fig:discorus"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE>
Also web-interface supports <CODE>Accept-Language</CODE> HTTP header (see
figure&nbsp;<A HREF="#fig:webadmmainru">3</A>, compare it with figure&nbsp;<A HREF="#fig:webadmmain">1</A>)
<BLOCKQUOTE><DIV ALIGN=center><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
<IMG SRC="webadmmainru.png">
<BR>
<DIV ALIGN=center>Figure 3: Web-administration top page with HTTP header
``<CODE>Accept-Language: ru</CODE>''</DIV><BR>
<A NAME="fig:webadmmainru"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE>
<!--HTMLFOOT-->
<!--ENDHTML-->
<!--FOOTER-->

View File

@ -111,6 +111,7 @@ The main features of \ejabberd{} are:
\item Built-in IRC transport
\item Built-in \tjepref{0060}{Publish-Subscribe} service
\item Built-in Jabber Users Directory service based on users vCards
\item Built-in web-based administration interface
\item Built-in \tjepref{0025}{HTTP Polling} service
\item SSL support
\item Support for LDAP authentification
@ -311,13 +312,24 @@ adding new ones.
\label{sec:confighostname}
Option \option{hostname} defines name of \Jabber{} domain that \ejabberd{}
serves. E.\,g.\ to use \jid{jabber.org} domain add following line in config:
serves. E.\,g.\ to use \jid{jabber.org} domain add the following line in the config:
\begin{verbatim}
{host, "jabber.org"}.
\end{verbatim}
%This option is mandatory.
\subsubsection{Default Language}
\label{sec:configlanguage}
Option \option{language} defines default language of \ejabberd{} messages, sent
to users. Default value is \term{"en"}. In order to take effect there must be a
translation file \term{<language>.msg} in \ejabberd{} \term{msgs} directory.
E.\,g.\ to use Russian as default language add the following line in the config:
\begin{verbatim}
{language, "ru"}.
\end{verbatim}
\subsubsection{Access Rules}
\label{sec:configaccess}
@ -505,18 +517,20 @@ For example, the following configuration defines that:
\item HTTP connections are listened on port 5280 and administration interface
and HTTP Polling support are enabled
\item All users except admins have traffic limit 1000\,B/s
\item AIM service \jid{aim.example.org} is connected to port 5233 with
\item AIM transport \jid{aim.example.org} is connected to port 5233 with
password ``\term{aimsecret}''
\item JIT services \jid{icq.example.org} and \jid{sms.example.org} are
\item JIT transports \jid{icq.example.org} and \jid{sms.example.org} are
connected to port 5234 with password ``\term{jitsecret}''
\item MSN service \jid{msn.example.org} is connected to port 5235 with
\item MSN transport \jid{msn.example.org} is connected to port 5235 with
password ``\term{msnsecret}''
\item Yahoo! service \jid{yahoo.example.org} is connected to port 5236 with
\item Yahoo! transport \jid{yahoo.example.org} is connected to port 5236 with
password ``\term{yahoosecret}''
\item ILE service \jid{ile.example.org} is connected to port 5237 with
\item Gadu-Gadu transport \jid{gg.example.org} is connected to port 5237 with
password ``\term{ggsecret}''
\item ILE service \jid{ile.example.org} is connected to port 5238 with
password ``\term{ilesecret}''
\end{itemize}
\begin{verbatim}
\begin{verbatim}
{acl, blocked, {user, "bad"}}.
{access, c2s, [{deny, blocked},
{allow, all}]}.
@ -612,102 +626,34 @@ Example:
\subsection{Online Configuration and Monitoring}
\label{sec:onlineconfig}
To perform online reconfiguration of \ejabberd{} you will need to have
\modconfigure{} loaded (see section~\ref{sec:modconfigure}). It is also highly
recommended to load \moddisco{} as well (see section~\ref{sec:moddisco}),
because \modconfigure{} is highly integrated with it. Additionally it is
recommended to use a disco- and xdata-capable client such as
\footahref{http://tkabber.jabber.ru/}{Tkabber}
(which was developed synchronously with \ejabberd{}, its CVS version
supports most of \ejabberd{} features).
On disco query \ejabberd{} returns following items (see figure~\ref{fig:disco}):
\begin{itemize}
\item Identity of server.
\item List of features, including defined namespaces.
\item List of JIDs from route table.
\item List of disco-nodes described in following subsections.
\end{itemize}
To perform online reconfiguration of \ejabberd{} you need to enable
\term{ejabberd\_http} listener with option \term{web\_admin} (see
section~\ref{sec:configlistened}). After that you can open URL
\verb|http://server:port/admin/| with you favorite web-browser and enter
username and password of \ejabberd{} administrator. E.\,g. with such config:
\begin{verbatim}
...
{host, "example.org"}.
...
{listen,
[...
{5280, ejabberd_http, [web_admin]},
...
]
}.
\end{verbatim}
you should enter URL \verb|http://example.org:5280/admin/|. After
authentification you should see something like in figure~\ref{fig:webadmmain}.
\begin{figure}[htbp]
\centering
\insimg{disco.png}
\caption{Tkabber Discovery window}
\label{fig:disco}
\end{figure}
\subsubsection{Node \node{config}: Global Configuration}
Under this node the following nodes exist:
\paragraph{Node \node{config/hostname}}
Via \ns{ejabberd:config} queries to this node possible to change host name of
this \ejabberd{} server. (See figure~\ref{fig:hostname}) (Currently this works
correctly only after a restart)
\begin{figure}[htbp]
\centering
\insimg{confhostname.png}
\caption{Editing of hostname}
\label{fig:hostname}
\end{figure}
\paragraph{Node \node{config/acls}}
Via \ns{ejabberd:config} queries to this node it is possible to edit ACLs list.
(See figure~\ref{fig:acls})
\begin{figure}[htbp]
\centering
\insimg{confacls.png}
\caption{Editing of ACLs}
\label{fig:acls}
\insimg{webadmmain.png}
\caption{Web-administration top page}
\label{fig:webadmmain}
\end{figure}
Here you can edit access restrictions, manage users, create backup files,
manage DB, enable/disable listened ports, and view statistics.
\paragraph{Node \node{config/access}}
Via \ns{ejabberd:config} queries to this node it is possible to edit access
rules.
\paragraph{Node \node{config/remusers}}
Via \ns{ejabberd:config} queries to this node it is possible to remove users. If
removed user is online, then he will be disconnected. Also user-related data
(e.g. his roster) is removed (but appropriate module must be loaded).
\subsubsection{Node \node{online users}: List of Online Users}
\subsubsection{Node \node{all users}: List of Registered Users}
\begin{figure}[htbp]
\centering
\insimg{discoallusers.png}
\caption{Discovery all users}
\label{fig:discoallusers}
\end{figure}
\subsubsection{Node \node{outgoing s2s}: List of Outgoing S2S connections}
\subsubsection{Node \node{running nodes}: List of Running \ejabberd{} Nodes}
\begin{figure}[htbp]
\centering
\insimg{discorunnodes.png}
\caption{Discovery running nodes}
\label{fig:discorunnodes}
\end{figure}
\subsubsection{Node \node{stopped nodes}: List of Stopped Nodes}
TBD
\section{Distribution}
\label{sec:distribution}
@ -717,10 +663,10 @@ TBD
\label{sec:howitworks}
A \Jabber{} domain is served by one or more \ejabberd{} nodes. These nodes can
be run on different machines that are connected via a network. They all must
have the ability to connect to port 4369 of all another nodes, and must have
the same magic cookie (see Erlang/OTP documentation, in other words the file
\term{\~{}ejabberd/.erlang.cookie} must be the same on all nodes). This is
be runned on different machines that are connected via a network. They all
must have the ability to connect to port 4369 of all another nodes, and must
have the same magic cookie (see Erlang/OTP documentation, in other words the
file \term{\~{}ejabberd/.erlang.cookie} must be the same on all nodes). This is
needed because all nodes exchange information about connected users, S2S
connections, registered services, etc\ldots
@ -1061,8 +1007,21 @@ Options:
\begin{description}
\hostitem{vjud}
\iqdiscitem{\ns{vcard-temp}}
\titem{search} Specifies wheather search is enabled (value is \term{true}, default) or
disabled (value is \term{false}) by the service. If \term{search} is set to \term{false},
option \term{host} is ignored and service does not appear in Jabber Discovery items.
\end{description}
Example:
\begin{verbatim}
{modules,
[
...
{mod_vcard, [{search, false}]}
...
]}.
\end{verbatim}
\subsection{\modversion{}}
\label{sec:modversion}
@ -1079,8 +1038,7 @@ Options:
\label{sec:i18nl10n}
All built-in modules support \texttt{xml:lang} attribute inside IQ queries.
E.\,g.\ on figure~\ref{fig:discorus} (compare it with figure~\ref{fig:disco})
showed reply on following query:
E.\,g.\ on figure~\ref{fig:discorus} showed the reply on the following query:
\begin{verbatim}
<iq id='5'
to='e.localhost'
@ -1097,5 +1055,16 @@ showed reply on following query:
\label{fig:discorus}
\end{figure}
Also web-interface supports \verb|Accept-Language| HTTP header (see
figure~\ref{fig:webadmmainru}, compare it with figure~\ref{fig:webadmmain})
\begin{figure}[htbp]
\centering
\insimg{webadmmainru.png}
\caption{Web-administration top page with HTTP header
``\verb|Accept-Language: ru|''}
\label{fig:webadmmainru}
\end{figure}
\end{document}

BIN
doc/webadmmain.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
doc/webadmmainru.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -86,6 +86,9 @@
{host, "localhost"}.
% Default language for server messages
{language, "en"}.
% Listened ports:
{listen,
[{5222, ejabberd_c2s, [{access, c2s}, {shaper, c2s_shaper}]},

View File

@ -31,6 +31,7 @@
-define(MYNAME, ejabberd_config:get_global_option(host)).
-define(S2STIMEOUT, 600000).
%-define(S2STIMEOUT, 6000).
-define(MYLANG, ejabberd_config:get_global_option(language)).
-define(MSGS_DIR, "msgs").
-define(CONFIG_PATH, "ejabberd.cfg").

View File

@ -70,7 +70,7 @@
"<?xml version='1.0'?>"
"<stream:stream xmlns='jabber:client' "
"xmlns:stream='http://etherx.jabber.org/streams' "
"id='~s' from='~s'~s>"
"id='~s' from='~s'~s~s>"
).
-define(STREAM_TRAILER, "</stream:stream>").
@ -131,6 +131,12 @@ init([{SockMod, Socket}, Opts]) ->
%%----------------------------------------------------------------------
wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
DefaultLang = case ?MYLANG of
undefined ->
" xml:lang='en'";
DL ->
" xml:lang='" ++ DL ++ "'"
end,
case xml:get_attr_s("xmlns:stream", Attrs) of
?NS_STREAM ->
Lang = xml:get_attr_s("xml:lang", Attrs),
@ -139,7 +145,8 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
Header = io_lib:format(?STREAM_HEADER,
[StateData#state.streamid,
?MYNAME,
" version='1.0'"]),
" version='1.0'",
DefaultLang]),
send_text(StateData, Header),
case StateData#state.authentificated of
false ->
@ -181,14 +188,14 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
_ ->
Header = io_lib:format(
?STREAM_HEADER,
[StateData#state.streamid, ?MYNAME, ""]),
[StateData#state.streamid, ?MYNAME, "", DefaultLang]),
send_text(StateData, Header),
{next_state, wait_for_auth, StateData#state{lang = Lang}}
end;
_ ->
Header = io_lib:format(
?STREAM_HEADER,
[StateData#state.streamid, ?MYNAME, ""]),
[StateData#state.streamid, ?MYNAME, "", ""]),
send_text(StateData,
Header ++ ?INVALID_NS_ERR ++ ?STREAM_TRAILER),
{stop, normal, StateData}
@ -196,7 +203,7 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
wait_for_stream({xmlstreamerror, _}, StateData) ->
Header = io_lib:format(?STREAM_HEADER,
["none", ?MYNAME, " version='1.0'"]),
["none", ?MYNAME, " version='1.0'", ""]),
send_text(StateData,
Header ++ ?INVALID_XML_ERR ++ ?STREAM_TRAILER),
{stop, normal, StateData};

View File

@ -78,6 +78,8 @@ add_option(Opt, Val, State) ->
Table = case Opt of
host ->
config;
language ->
config;
_ ->
local_config
end,

View File

@ -14,7 +14,8 @@
-export([register_iq_handler/3,
register_iq_handler/4,
unregister_iq_handler/1
unregister_iq_handler/1,
refresh_iq_handlers/0
]).
-include("ejabberd.hrl").
@ -47,11 +48,11 @@ loop(State) ->
loop(State);
{register_iq_handler, XMLNS, Module, Function} ->
ets:insert(State#state.iqtable, {XMLNS, Module, Function}),
mod_disco:register_feature(XMLNS),
catch mod_disco:register_feature(XMLNS),
loop(State);
{register_iq_handler, XMLNS, Module, Function, Opts} ->
ets:insert(State#state.iqtable, {XMLNS, Module, Function, Opts}),
mod_disco:register_feature(XMLNS),
catch mod_disco:register_feature(XMLNS),
loop(State);
{unregister_iq_handler, XMLNS} ->
case ets:lookup(State#state.iqtable, XMLNS) of
@ -61,7 +62,20 @@ loop(State) ->
ok
end,
ets:delete(State#state.iqtable, XMLNS),
mod_disco:unregister_feature(XMLNS),
catch mod_disco:unregister_feature(XMLNS),
loop(State);
refresh_iq_handlers ->
lists:map(
fun(T) ->
case T of
{XMLNS, _Module, _Function, _Opts} ->
catch mod_disco:register_feature(XMLNS);
{XMLNS, _Module, _Function} ->
catch mod_disco:register_feature(XMLNS);
_ ->
ok
end
end, ets:tab2list(State#state.iqtable)),
loop(State);
_ ->
loop(State)
@ -142,6 +156,8 @@ register_iq_handler(XMLNS, Module, Fun, Opts) ->
unregister_iq_handler(XMLNS) ->
ejabberd_local ! {unregister_iq_handler, XMLNS}.
refresh_iq_handlers() ->
ejabberd_local ! refresh_iq_handlers.
announce_online(From, To, Packet) ->
case acl:match_rule(announce, From) of

View File

@ -80,7 +80,6 @@ loop() ->
ok
end,
ets:delete(sm_iqtable, XMLNS),
mod_disco:unregister_feature(XMLNS),
loop();
_ ->
loop()

View File

@ -105,38 +105,39 @@ xdb_data({xmlstreamelement, El}, StateData) ->
ejabberd_auth:set_password(StateData#state.user, Password),
StateData;
?NS_ROSTER ->
%mod_roster:process_iq(From,
% {"", ?MYNAME, ""},
% #iq{type = set, xmlns = ?NS_ROSTER, sub_el = El}),
mod_roster:set_items(StateData#state.user, El),
%catch mod_roster:process_iq(
% From,
% {"", ?MYNAME, ""},
% #iq{type = set, xmlns = ?NS_ROSTER, sub_el = El}),
catch mod_roster:set_items(StateData#state.user, El),
StateData;
?NS_VCARD ->
mod_vcard:process_sm_iq(
From,
jlib:make_jid("", ?MYNAME, ""),
#iq{type = set, xmlns = ?NS_VCARD, sub_el = El}),
catch mod_vcard:process_sm_iq(
From,
jlib:make_jid("", ?MYNAME, ""),
#iq{type = set, xmlns = ?NS_VCARD, sub_el = El}),
StateData;
"jabber:x:offline" ->
process_offline(From, El),
StateData;
%?NS_REGISTER ->
% mod_register:process_iq(
% {"", "", ""}, {"", ?MYNAME, ""},
% #iq{type =set, xmlns = ?NS_REGISTER, xub_el = El}),
% catch mod_register:process_iq(
% {"", "", ""}, {"", ?MYNAME, ""},
% #iq{type =set, xmlns = ?NS_REGISTER, xub_el = El}),
% User = xml:get_path_s(El, [{elem, "username"}, cdata]),
% io:format("user ~s~n", [User]),
% StateData;
XMLNS ->
case xml:get_attr_s("j_private_flag", Attrs) of
"1" ->
mod_private:process_local_iq(
From,
jlib:make_jid("", ?MYNAME, ""),
#iq{type = set, xmlns = ?NS_PRIVATE,
sub_el = {xmlelement, "query", [],
[jlib:remove_attr(
"j_private_flag",
jlib:remove_attr("xdbns", El))]}}),
catch mod_private:process_local_iq(
From,
jlib:make_jid("", ?MYNAME, ""),
#iq{type = set, xmlns = ?NS_PRIVATE,
sub_el = {xmlelement, "query", [],
[jlib:remove_attr(
"j_private_flag",
jlib:remove_attr("xdbns", El))]}}),
StateData;
_ ->
io:format("jd2ejd: Unknown namespace \"~s\"~n",
@ -232,7 +233,7 @@ process_offline(To, {xmlelement, _, _, Els}) ->
error ->
ok;
_ ->
mod_offline:store_packet(From, To, El)
catch mod_offline:store_packet(From, To, El)
end
end, Els).

View File

@ -28,8 +28,7 @@ start(Opts) ->
ok.
stop() ->
gen_iq_handler:remove_iq_handler(ejabberd_local, ?NS_IQDATA),
gen_iq_handler:remove_iq_handler(ejabberd_sm, ?NS_IQDATA).
gen_iq_handler:remove_iq_handler(ejabberd_local, ?NS_ECONFIGURE).
process_local_iq(From, _To, #iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) ->

View File

@ -33,6 +33,8 @@
{"node", SNode}], []}]}).
start(Opts) ->
ejabberd_local:refresh_iq_handlers(),
IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
gen_iq_handler:add_iq_handler(ejabberd_local, ?NS_DISCO_ITEMS,
?MODULE, process_local_iq_items, IQDisc),
@ -42,9 +44,12 @@ start(Opts) ->
?MODULE, process_sm_iq_items, IQDisc),
gen_iq_handler:add_iq_handler(ejabberd_sm, ?NS_DISCO_INFO,
?MODULE, process_sm_iq_info, IQDisc),
catch ets:new(disco_features, [named_table, ordered_set, public]),
register_feature("iq"),
register_feature("presence"),
register_feature("presence-invisible"),
catch ets:new(disco_extra_domains, [named_table, ordered_set, public]),
ExtraDomains = gen_mod:get_opt(extra_domains, Opts, []),
lists:foreach(fun register_extra_domain/1, ExtraDomains),
@ -54,7 +59,10 @@ stop() ->
gen_iq_handler:remove_iq_handler(ejabberd_local, ?NS_DISCO_ITEMS),
gen_iq_handler:remove_iq_handler(ejabberd_local, ?NS_DISCO_INFO),
gen_iq_handler:remove_iq_handler(ejabberd_sm, ?NS_DISCO_ITEMS),
gen_iq_handler:remove_iq_handler(ejabberd_sm, ?NS_DISCO_INFO).
gen_iq_handler:remove_iq_handler(ejabberd_sm, ?NS_DISCO_INFO),
catch ets:delete(disco_features),
catch ets:delete(disco_extra_domains),
ok.
register_feature(Feature) ->

View File

@ -73,6 +73,14 @@ do_route(Host, From, To, Packet) ->
ejabberd_router:route(To,
From,
jlib:iq_to_xml(Res));
#iq{type = get, xmlns = ?NS_DISCO_ITEMS = XMLNS} = IQ ->
Res = IQ#iq{type = result,
sub_el = [{xmlelement, "query",
[{"xmlns", XMLNS}],
[]}]},
ejabberd_router:route(To,
From,
jlib:iq_to_xml(Res));
#iq{xmlns = ?NS_REGISTER} = IQ ->
process_register(From, To, IQ);
#iq{type = get, xmlns = ?NS_VCARD = XMLNS,

View File

@ -36,7 +36,8 @@ start(Opts) ->
?MODULE, process_sm_iq, IQDisc).
stop() ->
gen_iq_handler:remove_iq_handler(ejabberd_local, ?NS_LAST).
gen_iq_handler:remove_iq_handler(ejabberd_local, ?NS_LAST),
gen_iq_handler:remove_iq_handler(ejabberd_sm, ?NS_LAST).
process_local_iq(_From, _To, #iq{type = Type, sub_el = SubEl} = IQ) ->
case Type of
@ -66,11 +67,13 @@ process_sm_iq(From, To, #iq{type = Type, sub_el = SubEl} = IQ) ->
{'EXIT', _Reason} ->
get_last(IQ, SubEl, User);
List ->
case mod_privacy:check_packet(
User, List,
{From, To,
{xmlelement, "presence", [], []}},
out) of
case catch mod_privacy:check_packet(
User, List,
{From, To,
{xmlelement, "presence", [], []}},
out) of
{'EXIT', _Reason} ->
get_last(IQ, SubEl, User);
allow ->
get_last(IQ, SubEl, User);
deny ->

View File

@ -12,7 +12,7 @@
-behaviour(gen_mod).
-export([start/1,
-export([start/1, stop/0,
process_iq/3,
process_iq_set/3,
process_iq_get/4,
@ -49,6 +49,8 @@ start(Opts) ->
gen_iq_handler:add_iq_handler(ejabberd_sm, ?NS_PRIVACY,
?MODULE, process_iq, IQDisc).
stop() ->
gen_iq_handler:remove_iq_handler(ejabberd_local, ?NS_PRIVACY).
process_iq(From, _To, IQ) ->
#iq{type = Type, sub_el = SubEl} = IQ,

View File

@ -12,7 +12,7 @@
-behaviour(gen_mod).
-export([start/1, init/0, process_iq/3]).
-export([start/1, stop/0, process_iq/3]).
-include("ejabberd.hrl").
-include("jlib.hrl").
@ -25,8 +25,9 @@ start(Opts) ->
?MODULE, process_iq, IQDisc),
ok.
init() ->
ok.
stop() ->
gen_iq_handler:remove_iq_handler(ejabberd_local, ?NS_REGISTER),
gen_iq_handler:remove_iq_handler(ejabberd_sm, ?NS_REGISTER).
process_iq(From, _To, #iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) ->
case Type of

View File

@ -12,7 +12,7 @@
-behaviour(gen_mod).
-export([start/1,
-export([start/1, stop/0,
process_iq/3,
process_local_iq/3,
get_subscription_lists/1,
@ -44,6 +44,10 @@ start(Opts) ->
gen_iq_handler:add_iq_handler(ejabberd_sm, ?NS_ROSTER,
?MODULE, process_iq, IQDisc).
stop() ->
gen_iq_handler:remove_iq_handler(ejabberd_sm, ?NS_ROSTER).
-define(PSI_ROSTER_WORKAROUND, true).
-ifdef(PSI_ROSTER_WORKAROUND).

View File

@ -12,7 +12,7 @@
-behaviour(gen_mod).
-export([start/1, init/1,
-export([start/1, init/2, stop/0,
process_local_iq/3,
process_sm_iq/3,
reindex_vcards/0,
@ -64,14 +64,20 @@ start(Opts) ->
gen_iq_handler:add_iq_handler(ejabberd_sm, ?NS_VCARD,
?MODULE, process_sm_iq, IQDisc),
Host = gen_mod:get_opt(host, Opts, "vjud." ++ ?MYNAME),
spawn(?MODULE, init, [Host]).
Search = gen_mod:get_opt(search, Opts, true),
register(ejabberd_mod_vcard, spawn(?MODULE, init, [Host, Search])).
init(Host) ->
ejabberd_router:register_route(Host),
loop().
init(Host, Search) ->
case Search of
true ->
ejabberd_router:register_route(Host),
loop(Host);
_ ->
loop(Host)
end.
loop() ->
loop(Host) ->
receive
{route, From, To, Packet} ->
case catch do_route(From, To, Packet) of
@ -80,11 +86,19 @@ loop() ->
_ ->
ok
end,
loop();
loop(Host);
stop ->
catch ejabberd_router:unregister_route(Host),
ok;
_ ->
loop()
loop(Host)
end.
stop() ->
gen_iq_handler:remove_iq_handler(ejabberd_local, ?NS_VCARD),
gen_iq_handler:remove_iq_handler(ejabberd_sm, ?NS_VCARD),
ejabberd_mod_vcard ! stop,
ok.
process_local_iq(_From, _To, #iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) ->
case Type of

View File

@ -3,22 +3,39 @@
% mod_configure.erl
{"DB Tables Configuration", "Configuration des tables de BD"}.
{"Choose storage type of tables", "Choisissez un type de stockage pour les tables"}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"", ""}.
{"RAM copy", ""}.
{"RAM and disc copy", ""}.
{"Disc only copy", ""}.
{"Remote copy", ""}.
{"Stop Modules at ", ""}.
{"Choose modules to stop", ""}.
{"Start Modules at ", ""}.
{"Enter list of {Module, [Options]}", ""}.
{"List of modules to start", ""}.
{"Backup to File at ", ""}.
{"Enter path to backup file", ""}.
{"Path to File", ""}.
{"Restore Backup from File at ", ""}.
{"Dump Backup to Text File at ", ""}.
{"Enter path to text file", ""}.
{"Import User from File at ", ""}.
{"Enter path to jabberd1.4 spool file", ""}.
{"Import Users from Dir at ", ""}.
{"Enter path to jabberd1.4 spool dir", ""}.
{"Path to Dir", ""}.
{"Hostname Configuration", ""}.
{"Choose host name", ""}.
{"Host name", ""}.
{"Access Control List Configuration", ""}.
{"Access control lists", ""}.
{"Access Configuration", ""}.
{"Access rules", ""}.
{"Remove Users", ""}.
{"Choose users to remove", ""}.
{"Administration of ", ""}.
{"Action on user", ""}.
{"Edit Properties", ""}.
{"Remove User", ""}.
% mod_disco.erl
{"Configuration", "Configuration"}.
@ -30,24 +47,33 @@
{"Running Nodes", "Noeuds actifs"}.
{"Stopped Nodes", "Noeuds arrêtés"}.
{"Host Name", "Nom du serveur"}.
{"ACLs", "ACLs"}.
{"Access Control Lists", ""}.
{"Access Rules", "Règles d'accès"}.
{"Remove Users", "Supprimer des utilisateurs"}.
{"DB", "BD"}.
{"Modules", "Modules"}.
{"Start Modules", "Modules de démarrage"}.
{"Stop Modules", "Modules d'arrêt"}.
{"Backup Management", ""}.
{"Import users from jabberd1.4 spool files", ""}.
{"Backup", ""}.
{"Restore", ""}.
{"Dump to Text File", ""}.
{"Import File", ""}.
{"Import Directory", ""}.
% mod_register.erl
{"Choose a username and password to register with this server", ""}.
% mod_vcard.erl
{"You need a x:data capable client to search",
{"Erlang Jabber Server\nCopyright (c) 2002-2004 Alexey Shchepin", ""}.
{"ejabberd vCard module\nCopyright (c) 2003-2004 Alexey Shchepin", ""}.
{"You need an x:data capable client to search",
"Vous avez besoin d'un client supportant x:data pour faire une recherche"}.
{"Users Search", "Rechercher des utilisateurs"}.
{"Search users in ", "Rechercher des utilisateurs "}.
{"Fill in fields to search for any matching Jabber User",
"Remplissez les champs pour rechercher n'importe quel utilisateur Jabber correspondant"}.
{"Users Search Results", "Résultat de la recherche des utilisateurs"}.
{"Results of search in ", "Résultat de la recherche des utilisateurs "}.
{"User", "Utilisateur"}.
{"Full Name", "Nom complet"}.
@ -62,9 +88,25 @@
{"Organization Name", "Nom de l'organisation"}.
{"Organization Unit", "Unité de l'organisation"}.
% mod_pubsub/mod_pubsub.erl
{"ejabberd pub/sub module\nCopyright (c) 2003-2004 Alexey Shchepin", ""}.
% mod_muc/mod_muc.erl
{"You need an x:data capable client to register nickname", ""}.
{"Nickname Registration at ", ""}.
{"Enter nickname you want to register", ""}.
{"ejabberd MUC module\nCopyright (c) 2003-2004 Alexey Shchepin", ""}.
{"Only service administrators are allowed to send service messages", ""}.
{"Room creation is not allowed by service policy", ""}.
{"Conference room does not exist", ""}.
{"Access denied by service policy", ""}.
{"You must fill in field \"nick\" in the form", ""}.
{"Specified nickname is already registered", ""}.
% mod_muc/mod_muc_room.erl
{" has set the subject to: ", ""}.
{"You need an x:data capable client to configure room", ""}.
{"Configuration for ", ""}.
{"Room title", "Titre du salon"}.
{"Allow users to change subject?", "Autoriser les utilisateurs à changer le sujet ?"}.
{"Allow users to query other users?",
@ -82,9 +124,49 @@
{"Allow users to send invites?",
"Autoriser des utilisateurs à envoyer des invitations ?"}.
{"Make room password protected?", "Créer un salon protégé par mot de passe ?"}.
{"Password", ""}.
{"Make room anonymous?", "Créer un salon anonyme ?"}.
{"Enable logging?", "Activer la journalisation ?"}.
{"Only moderators and participants are allowed to change subject in this room", ""}.
{"Only moderators are allowed to change subject in this room", ""}.
{"Visitors are not allowed to send messages to all occupants", ""}.
{"Only occupants are allowed to send messages to the conference", ""}.
{"It is not allowed to send normal messages to the conference", ""}.
{"It is not allowed to send private messages to the conference", ""}.
{"Improper message type", ""}.
{"Nickname is already in use by another occupant", ""}.
{"Nickname is registered by another person", ""}.
{"It is not allowed to send private messages of type \"groupchat\"", ""}.
{"Recipient is not in the conference room", ""}.
{"Only occupants are allowed to send queries to the conference", ""}.
{"Queries to the conference members are not allowed in this room", ""}.
{"You have been banned from this room", ""}.
{"Membership required to enter this room", ""}.
{"Password required to enter this room", ""}.
{"Incorrect password", ""}.
{"Administrator privileges required", ""}.
{"Moderator privileges required", ""}.
{"JID ~s is invalid", ""}.
{"Nickname ~s does not exist in the room", ""}.
{"Invalid affiliation: ~s", ""}.
{"Invalid role: ~s", ""}.
{"Owner privileges required", ""}.
{"private, ", ""}.
% mod_irc/mod_irc.erl
{"ejabberd IRC module\nCopyright (c) 2003-2004 Alexey Shchepin", ""}.
{"You need an x:data capable client to configure mod_irc settings", ""}.
{"Registration in mod_irc for ", ""}.
{"Enter username and encodings you wish to use for connecting to IRC servers", ""}.
{"IRC Username", ""}.
{"If you want to specify different encodings for IRC servers, fill this list with values in format '{\"irc server\", \"encoding\"}'. By default this service use \"~s\" encoding.", ""}.
{"Example: [{\"irc.lucky.net\", \"koi8-r\"}, {\"vendetta.fef.net\", \"iso8859-1\"}].", ""}.
{"Encodings", ""}.
% web/ejabberd_web_admin.erl
{"Users", ""}.
{"Nodes", ""}.
{"Statistics", ""}.
% Local Variables:
% mode: erlang

View File

@ -60,8 +60,14 @@ load_file(Lang, File) ->
case file:consult(File) of
{ok, Terms} ->
lists:foreach(fun({Orig, Trans}) ->
ets:insert(translations,
{{Lang, Orig}, Trans})
Trans1 = case Trans of
"" ->
Orig;
_ ->
Trans
end,
ets:insert(translations,
{{Lang, Orig}, Trans1})
end, Terms);
{error, Reason} ->
exit(file:format_error(Reason))
@ -72,6 +78,47 @@ translate(Lang, Msg) ->
[{_, Trans}] ->
Trans;
_ ->
Msg
ShortLang = string:substr(Lang, 1, 2),
case ShortLang of
"en" ->
Msg;
Lang ->
translate(Msg);
_ ->
case ets:lookup(translations, {ShortLang, Msg}) of
[{_, Trans}] ->
Trans;
_ ->
translate(Msg)
end
end
end.
translate(Msg) ->
case ?MYLANG of
undefined ->
Msg;
"en" ->
Msg;
Lang ->
case ets:lookup(translations, {Lang, Msg}) of
[{_, Trans}] ->
Trans;
_ ->
ShortLang = string:substr(Lang, 1, 2),
case ShortLang of
"en" ->
Msg;
Lang ->
Msg;
_ ->
case ets:lookup(translations, {ShortLang, Msg}) of
[{_, Trans}] ->
Trans;
_ ->
Msg
end
end
end
end.

View File

@ -64,6 +64,9 @@
% Admins of this server are also admins of MUC service:
{access, muc_admin, [{allow, admin}]}.
% All users are allowed to use MUC service:
{access, muc, [{allow, all}]}.
% This rule allows access only for local users:
{access, local, [{allow, local}]}.
@ -84,44 +87,46 @@
% Listened ports:
{listen, [{5222, ejabberd_c2s, [{access, c2s},
{shaper, c2s_shaper}]},
% {5223, ejabberd_c2s, [{access, c2s},
% {ssl, [{certfile, "./cert.pem"}]}]},
{5269, ejabberd_s2s_in, [{shaper, s2s_shaper}]}%,
% {5555, ejabberd_service, [{host, "icq.localhost", [{password, "someSecret"}]}]},
% {8888, ejabberd_service, [%{access, local},
% {hosts,
% ["conference.e.localhost",
% "muc.e.localhost"],
% [{password, "secret"}]}]}
]}.
{listen,
[{5222, ejabberd_c2s, [{access, c2s}, {shaper, c2s_shaper}]},
% {5223, ejabberd_c2s, [{access, c2s}, ssl, {certfile, "./ssl.pem"}]},
{5269, ejabberd_s2s_in, [{shaper, s2s_shaper}]},
% {5555, ejabberd_service, [{access, all},
% {host, "icq.localhost", [{password, "secret"}]}]},
{5280, ejabberd_http, [http_poll, web_admin]}
]}.
% If SRV lookup fails, then port 5269 is used to communicate with remote server
{outgoing_s2s_port, 5269}.
% Used modules:
{modules, [
{mod_register, []},
{mod_roster, []},
{mod_privacy, []},
{mod_configure, []},
{mod_disco, []},
{mod_stats, []},
{mod_vcard, []},
{mod_offline, []},
{mod_echo, [{host, "echo.localhost"}]},
{mod_private, []},
{mod_irc, []},
{mod_muc, []},
{mod_pubsub, []},
{mod_time, []},
{mod_last, []},
{mod_version, []}
]}.
{modules,
[
{mod_register, []},
{mod_roster, []},
{mod_privacy, []},
{mod_configure, []},
{mod_disco, []},
{mod_stats, []},
{mod_vcard, []},
{mod_offline, []},
{mod_private, []},
{mod_irc, []},
{mod_muc, []},
% Default options for mod_muc:
% host: "conference." ++ ?MYNAME
% access: all
% access_create: all
% access_admin: none (only room creator has owner privileges)
{mod_muc, [{access, muc},
{access_create, muc},
{access_admin, muc_admin}]},
{mod_pubsub, []},
{mod_time, []},
{mod_last, []},
{mod_version, []}
]}.
% Local Variables: