From d2eab0d5350cd2fc09987d43f39b7f00dde406d6 Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Fri, 9 Jul 2004 22:34:26 +0000 Subject: * 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 --- ChangeLog | 45 +++++++ doc/guide.html | 343 ++++++++++++++++++++--------------------------- doc/guide.tex | 177 ++++++++++-------------- doc/webadmmain.png | Bin 0 -> 23928 bytes doc/webadmmainru.png | Bin 0 -> 24539 bytes src/ejabberd.cfg.example | 3 + src/ejabberd.hrl | 1 + src/ejabberd_c2s.erl | 17 ++- src/ejabberd_config.erl | 2 + src/ejabberd_local.erl | 24 +++- src/ejabberd_sm.erl | 1 - src/jd2ejd.erl | 41 +++--- src/mod_configure2.erl | 3 +- src/mod_disco.erl | 10 +- src/mod_irc/mod_irc.erl | 8 ++ src/mod_last.erl | 15 ++- src/mod_privacy.erl | 4 +- src/mod_register.erl | 7 +- src/mod_roster.erl | 6 +- src/mod_vcard.erl | 30 +++-- src/msgs/fr.msg | 128 ++++++++++++++---- src/translate.erl | 53 +++++++- src/win32/ejabberd.cfg | 69 +++++----- 23 files changed, 573 insertions(+), 414 deletions(-) create mode 100644 doc/webadmmain.png create mode 100644 doc/webadmmainru.png diff --git a/ChangeLog b/ChangeLog index 12d55cb63..e2b6d19dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,48 @@ +2004-07-10 Alexey Shchepin + + * 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 + + * src/win32/ejabberd.cfg: Updated (thanks to Sergei Golovan) + 2004-07-07 Alexey Shchepin * src/Makefile.win32: Updated (thanks to Sergei Golovan) diff --git a/doc/guide.html b/doc/guide.html index c896d836a..19038a75a 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -56,56 +56,49 @@ 3.1  Initial Configuration -
  • 3.2  Online Configuration and Monitoring - +
  • 3.2  Online Configuration and Monitoring -
  • 4  Distribution +
  • 4  Distribution -
  • A  Built-in Modules +
  • A  Built-in Modules -
  • B  I18n/L10n +
  • B  I18n/L10n @@ -131,6 +124,7 @@ Works on most of popular platforms: *nix (tested on Linux, FreeBSD and
  • Built-in IRC transport
  • Built-in Publish-Subscribe service
  • Built-in Jabber Users Directory service based on users vCards +
  • Built-in web-based administration interface
  • Built-in HTTP Polling service
  • SSL support
  • Support for LDAP authentification @@ -328,13 +322,25 @@ adding new ones.
    Option hostname defines name of Jabber domain that ejabberd -serves. E. g. to use jabber.org domain add following line in config: +serves. E. g. to use jabber.org domain add the following line in the config:
       {host, "jabber.org"}.
     
    + + +

    3.1.2  Default Language

    + + +Option language defines default language of ejabberd messages, sent +to users. Default value is "en". In order to take effect there must be a +translation file <language>.msg in ejabberd msgs directory. +E. g. to use Russian as default language add the following line in the config: +
    +  {language, "ru"}.
    +
    -

    3.1.2  Access Rules

    +

    3.1.3  Access Rules

    Access control in ejabberd is performed via Access Control Lists (ACL). The @@ -420,7 +426,7 @@ Following access rules pre-defined: -

    3.1.3  Shapers Configuration

    +

    3.1.4  Shapers Configuration

    With shapers is possible to bound connection traffic. The declarations of @@ -439,7 +445,7 @@ E. g. to define shaper with name ``normal'' and maximum allowed ra -

    3.1.4  Listened Sockets

    +

    3.1.5  Listened Sockets

    Option listen 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 ``bad''
  • S2S connections are listened on port 5269 +
  • HTTP connections are listened on port 5280 and administration interface + and HTTP Polling support are enabled
  • All users except admins have traffic limit 1000 B/s -
  • AIM service aim.example.org is connected to port 5233 with +
  • AIM transport aim.example.org is connected to port 5233 with password ``aimsecret'' -
  • JIT services icq.example.org and sms.example.org are +
  • JIT transports icq.example.org and sms.example.org are connected to port 5234 with password ``jitsecret'' -
  • MSN service msn.example.org is connected to port 5235 with +
  • MSN transport msn.example.org is connected to port 5235 with password ``msnsecret'' -
  • Yahoo! service yahoo.example.org is connected to port 5236 with +
  • Yahoo! transport yahoo.example.org is connected to port 5236 with password ``yahoosecret'' -
  • ILE service ile.example.org is connected to port 5237 with +
  • Gadu-Gadu transport gg.example.org is connected to port 5237 with + password ``ggsecret'' +
  • ILE service ile.example.org is connected to port 5238 with password ``ilesecret'' -
    +
       {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:
     
    -

    3.1.5  Modules

    +

    3.1.6  Modules

    Option modules defines the list of modules that will be loaded after @@ -602,146 +613,54 @@ Example:
    -

    3.2  Online Configuration and Monitoring

    +

    3.2  Online Configuration and Monitoring

    -To perform online reconfiguration of ejabberd you will need to have -mod_configure loaded (see section A.2). It is also highly -recommended to load mod_disco as well (see section A.3), -because mod_configure is highly integrated with it. Additionally it is -recommended to use a disco- and xdata-capable client such as -Tkabber -(which was developed synchronously with ejabberd, its CVS version -supports most of ejabberd features).
    -
    -On disco query ejabberd returns following items (see figure 1): -
    • -Identity of server. -
    • List of features, including defined namespaces. -
    • List of JIDs from route table. -
    • List of disco-nodes described in following subsections. -
    -

    - - - - -
    -
    Figure 1: Tkabber Discovery window

    - - -

    - - -

    3.2.1  Node config: Global Configuration

    - -Under this node the following nodes exist:
    -
    - - -
    Node config/hostname
    - -Via ejabberd:config queries to this node possible to change host name of -this ejabberd server. (See figure 2) (Currently this works -correctly only after a restart) -

    - - - - -
    -
    Figure 2: Editing of hostname

    - - -

    - - -
    Node config/acls
    - -Via ejabberd:config queries to this node it is possible to edit ACLs list. -(See figure 3) -

    - - - - -
    -
    Figure 3: Editing of ACLs

    - - -

    - - -
    Node config/access
    - -Via ejabberd:config queries to this node it is possible to edit access -rules.
    -
    - - -
    Node config/remusers
    - -Via 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).
    -
    - - -

    3.2.2  Node online users: List of Online Users

    - - - -

    3.2.3  Node all users: List of Registered Users

    - -

    - - - - -
    -
    Figure 4: Discovery all users

    - - -

    - - -

    3.2.4  Node outgoing s2s: List of Outgoing S2S connections

    - - - -

    3.2.5  Node running nodes: List of Running ejabberd Nodes

    - +To perform online reconfiguration of ejabberd you need to enable +ejabberd_http listener with option web_admin (see +section 3.1.5). After that you can open URL +http://server:port/admin/ with you favorite web-browser and enter +username and password of ejabberd administrator. E. g. with such config: +
    +  ...
    +  {host, "example.org"}.
    +  ...
    +  {listen,
    +   [...
    +    {5280, ejabberd_http, [web_admin]},
    +    ...
    +   ]
    +  }.
    +
    you should enter URL http://example.org:5280/admin/. After +authentification you should see something like in figure 1.

    - +
    -
    Figure 5: Discovery running nodes

    +
    Figure 1: Web-administration top page

    - +

    - - -

    3.2.6  Node stopped nodes: List of Stopped Nodes

    - -TBD
    +Here you can edit access restrictions, manage users, create backup files, +manage DB, enable/disable listened ports, and view statistics.

    -

    4  Distribution

    +

    4  Distribution

    -

    4.1  How it works

    +

    4.1  How it works

    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 -~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 ~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...

    @@ -754,7 +673,7 @@ router; -

    4.1.1  Router

    +

    4.1.1  Router

    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.

    -

    4.1.2  Local Router

    +

    4.1.2  Local Router

    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.

    -

    4.1.3  Session Manager

    +

    4.1.3  Session Manager

    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.

    -

    4.1.4  S2S Manager

    +

    4.1.4  S2S Manager

    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.

    -

    A  Built-in Modules

    +

    A  Built-in Modules

    -

    A.1  Common Options

    +

    A.1  Common Options

    The following options are used by many modules, so they are described in @@ -807,7 +726,7 @@ separate section.

    -

    A.1.1  Option iqdisc

    +

    A.1.1  Option iqdisc

    Many modules define handlers for processing IQ queries of different namespaces @@ -840,7 +759,7 @@ Example: -

    A.1.2  Option host

    +

    A.1.2  Option host

    This option explicitly defines hostname for the module which acts as a service.
    @@ -856,7 +775,7 @@ Example: -

    A.2  mod_configure

    +

    A.2  mod_configure

    Options: @@ -866,7 +785,7 @@ discipline (see A.1.1). -

    A.3  mod_disco

    +

    A.3  mod_disco

    This module adds support for JEP-0030 (Service Discovery).
    @@ -891,7 +810,7 @@ Example: -

    A.4  mod_echo

    +

    A.4  mod_echo

    This module acts as a service and simply returns to sender any Jabber packet. Module may be @@ -905,7 +824,7 @@ then prefix echo. is added to main ejabberd hostname. -

    A.5  mod_irc

    +

    A.5  mod_irc

    This module implements IRC transport.
    @@ -918,7 +837,7 @@ then prefix irc. is added to main ejabberd hostname. -

    A.6  mod_last

    +

    A.6  mod_last

    This module adds support for JEP-0012 (Last Activity)
    @@ -930,7 +849,7 @@ discipline (see A.1.1). -

    A.7  mod_muc

    +

    A.7  mod_muc

    This module implements JEP-0045 (Multi-User Chat) service.
    @@ -965,14 +884,14 @@ Example: -

    A.8  mod_offline

    +

    A.8  mod_offline

    This module implements offline message storage.

    -

    A.9  mod_privacy

    +

    A.9  mod_privacy

    This module implements Privacy Rules as defined in XMPP IM @@ -985,7 +904,7 @@ discipline (see A.1.1). -

    A.10  mod_private

    +

    A.10  mod_private

    This module adds support of JEP-0049 (Private XML Storage).
    @@ -997,7 +916,7 @@ discipline (see A.1.1). -

    A.11  mod_pubsub

    +

    A.11  mod_pubsub

    This module implements JEP-0060 (Publish-Subscribe Service).
    @@ -1022,7 +941,7 @@ Example: -

    A.12  mod_register

    +

    A.12  mod_register

    This module adds support for JEP-0077 (In-Band Registration). @@ -1054,7 +973,7 @@ Example: -

    A.13  mod_roster

    +

    A.13  mod_roster

    This module implements roster management.
    @@ -1066,7 +985,7 @@ discipline (see A.1.1). -

    A.14  mod_stats

    +

    A.14  mod_stats

    This module adds support for JEP-0039 (Statistics Gathering).
    @@ -1080,7 +999,7 @@ TBD about access.

    -

    A.15  mod_time

    +

    A.15  mod_time

    This module answers UTC time on jabber:iq:time queries.
    @@ -1092,7 +1011,7 @@ discipline (see A.1.1). -

    A.16  mod_vcard

    +

    A.16  mod_vcard

    This module implements simple Jabber User Directory (based on user vCards) @@ -1105,10 +1024,22 @@ Options: then prefix vjud. is added to main ejabberd hostname.
    iqdisc
    vcard-temp IQ queries processing discipline (see A.1.1). +
    search
    Specifies wheather search is enabled (value is true, default) or +disabled (value is false) by the service. If search is set to false, +option host is ignored and service does not appear in Jabber Discovery items. +Example: +
    +  {modules,
    +   [
    +    ...
    +    {mod_vcard, [{search, false}]}
    +    ...
    +   ]}.
    +
    -

    A.17  mod_version

    +

    A.17  mod_version

    This module answers ejabberd version on jabber:iq:version queries.
    @@ -1120,12 +1051,11 @@ discipline (see A.1.1). -

    B  I18n/L10n

    +

    B  I18n/L10n

    All built-in modules support xml:lang attribute inside IQ queries. -E. g. on figure 6 (compare it with figure 1) -showed reply on following query: +E. g. on figure 2 showed the reply on the following query:
       <iq id='5'
           to='e.localhost'
    @@ -1140,10 +1070,23 @@ showed reply on following query:
      
     
      
    -
    Figure 6: Discovery result when xml:lang='ru'

    +
    Figure 2: Discovery result when xml:lang='ru'


    +Also web-interface supports Accept-Language HTTP header (see +figure 3, compare it with figure 1) +

    + + + + +
    +
    Figure 3: Web-administration top page with HTTP header + ``Accept-Language: ru''

    + + +

    diff --git a/doc/guide.tex b/doc/guide.tex index c763710a7..1752a8606 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -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{.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,103 +626,35 @@ 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} -\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} -\end{figure} - - -\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} - +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{discorunnodes.png} - \caption{Discovery running nodes} - \label{fig:discorunnodes} + \insimg{webadmmain.png} + \caption{Web-administration top page} + \label{fig:webadmmain} \end{figure} - -\subsubsection{Node \node{stopped nodes}: List of Stopped Nodes} - - - +Here you can edit access restrictions, manage users, create backup files, +manage DB, enable/disable listened ports, and view statistics. - -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} " "" + "id='~s' from='~s'~s~s>" ). -define(STREAM_TRAILER, ""). @@ -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}; diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl index 6b93c4954..2642e2ad0 100644 --- a/src/ejabberd_config.erl +++ b/src/ejabberd_config.erl @@ -78,6 +78,8 @@ add_option(Opt, Val, State) -> Table = case Opt of host -> config; + language -> + config; _ -> local_config end, diff --git a/src/ejabberd_local.erl b/src/ejabberd_local.erl index cf46e73fc..5c91e280a 100644 --- a/src/ejabberd_local.erl +++ b/src/ejabberd_local.erl @@ -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 diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index ef495d544..d2c278545 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -80,7 +80,6 @@ loop() -> ok end, ets:delete(sm_iqtable, XMLNS), - mod_disco:unregister_feature(XMLNS), loop(); _ -> loop() diff --git a/src/jd2ejd.erl b/src/jd2ejd.erl index 8bcbb30fe..1fff78149 100644 --- a/src/jd2ejd.erl +++ b/src/jd2ejd.erl @@ -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). diff --git a/src/mod_configure2.erl b/src/mod_configure2.erl index 78366400f..58eb387a4 100644 --- a/src/mod_configure2.erl +++ b/src/mod_configure2.erl @@ -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) -> diff --git a/src/mod_disco.erl b/src/mod_disco.erl index e4063f13a..af992df0b 100644 --- a/src/mod_disco.erl +++ b/src/mod_disco.erl @@ -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) -> diff --git a/src/mod_irc/mod_irc.erl b/src/mod_irc/mod_irc.erl index a7afd5f06..9cfe26d6a 100644 --- a/src/mod_irc/mod_irc.erl +++ b/src/mod_irc/mod_irc.erl @@ -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, diff --git a/src/mod_last.erl b/src/mod_last.erl index ecda02719..bcff1ed8b 100644 --- a/src/mod_last.erl +++ b/src/mod_last.erl @@ -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 -> diff --git a/src/mod_privacy.erl b/src/mod_privacy.erl index 8ddb12b69..734b1e863 100644 --- a/src/mod_privacy.erl +++ b/src/mod_privacy.erl @@ -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, diff --git a/src/mod_register.erl b/src/mod_register.erl index 0727c354e..a07c14e11 100644 --- a/src/mod_register.erl +++ b/src/mod_register.erl @@ -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 diff --git a/src/mod_roster.erl b/src/mod_roster.erl index 0e02c619d..884f0dd7c 100644 --- a/src/mod_roster.erl +++ b/src/mod_roster.erl @@ -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). diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index 5f6bf4f5e..2dbc987c9 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -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 diff --git a/src/msgs/fr.msg b/src/msgs/fr.msg index 980d2ac29..3e3843769 100644 --- a/src/msgs/fr.msg +++ b/src/msgs/fr.msg @@ -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_room.erl +% 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 diff --git a/src/translate.erl b/src/translate.erl index ebdd96472..664cbed49 100644 --- a/src/translate.erl +++ b/src/translate.erl @@ -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. diff --git a/src/win32/ejabberd.cfg b/src/win32/ejabberd.cfg index 2aa6788bd..1e2b2081b 100644 --- a/src/win32/ejabberd.cfg +++ b/src/win32/ejabberd.cfg @@ -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: -- cgit v1.2.3