_flag_disable_registration

This commit is contained in:
psyc://psyced.org/~lynX 2011-07-26 12:22:56 +02:00
parent 0f3828597d
commit c71c6ada46
10 changed files with 34 additions and 12 deletions

View File

@ -1,6 +1,12 @@
<PSYC:TEXTDB> ## vim:syntax=mail
## Check utf-8: Praise Atatürk!
_failure_disabled_function_register
|Registrierung ist auf diesem Server deaktiviert.
_failure_disabled_function_register_URI
|Registrierung deaktiviert. Bitte registriere Dich auf [_page_register].
_error_necessary_nick_local
|Dieser Befehl akzeptiert nur lokale Spitznamen.

View File

@ -1,6 +1,12 @@
<PSYC:TEXTDB> ## vim:syntax=mail
## Check utf-8: Praise Atatürk!
_failure_disabled_function_register
|Registration disabled on this server.
_failure_disabled_function_register_URI
|Registration disabled here. You can register at [_page_register].
_failure_unavailable_state
|State module is not available as yet.

View File

@ -1,6 +1,12 @@
<PSYC:TEXTDB> ## vim:syntax=mail
## tradotto al 30% ... cerca /TODO/ per continuare
_failure_disabled_function_register
|Registrazione di nuovi utenti disabilitata su questo server.
_failure_disabled_function_register_URI
|Per la registrazione vada alla pagina [_page_register] per favore.
_failure_unavailable_alias
|niente alias per [_uniform_new]: [_nick_old] appartiene a [_uniform_old].

View File

@ -19,8 +19,10 @@ disco_info_root(vars) {
string featurelist;
featurelist = "<feature var='http://jabber.org/protocol/muc'/>"
#ifndef REGISTERED_USERS_ONLY
# ifndef _flag_disable_registration_XMPP
# ifndef _flag_disable_registration
# ifndef _flag_disable_registration_XMPP
"<feature var='jabber:iq:register'/>"
# endif
# endif
#endif
#ifndef VOLATILE

View File

@ -187,7 +187,7 @@ jabberMsg(XMLNode node) {
case "jabber:iq:register":
if (node["@type"] == "get"){
string packet;
#if defined(REGISTERED_USERS_ONLY) || defined(_flag_disable_registration_XMPP)
#if defined(REGISTERED_USERS_ONLY) || defined(_flag_disable_registration) || defined(_flag_disable_registration_XMPP)
// super dirty.. this should all be in textdb
packet = sprintf("<iq type='result' id='%s'>"
"<query xmlns='jabber:iq:register'/>"
@ -234,7 +234,7 @@ jabberMsg(XMLNode node) {
emit(packet);
// QUIT
} else {
#if defined(REGISTERED_USERS_ONLY) || defined(_flag_disable_registration_XMPP)
#if defined(REGISTERED_USERS_ONLY) || defined(_flag_disable_registration) || defined(_flag_disable_registration_XMPP)
// TODO: generate some error as above
#else
user -> vSet("password", t[Cdata]);

View File

@ -626,7 +626,7 @@ iq(XMLNode node) {
break;
}
break;
#if !defined(REGISTERED_USERS_ONLY) && !defined(_flag_disable_registration_XMPP)
#if !defined(REGISTERED_USERS_ONLY) && !defined(_flag_disable_registration) && !defined(_flag_disable_registration_XMPP)
case "jabber:iq:register":
switch(node["@type"]) {
case "get":

View File

@ -71,8 +71,10 @@ volatile mapping share = ([
"private" : "muc_hidden",
"persistent" : "muc_persistent",
"temporary" : "muc_temporary",
#ifndef _flag_disable_registration_XMPP
#ifndef _flag_disable_registration
# ifndef _flag_disable_registration_XMPP
"registration" : "jabber:iq:register",
# endif
#endif
"offlinestorage" : "msgoffline",
"version" : "jabber:iq:version",

View File

@ -778,15 +778,15 @@ case "HMAC-SHA1":
case "hmac-sha1":
ARETURN(try == hmac(TLS_HASH_SHA1, v("password"), salt))
# ifdef AUTH_HMAC_SECRET
# define REGISTER_DISABLED
# define _flag_disable_registration
case "hmac-sha1-shared":
if (try == hmac(TLS_HASH_SHA1, AUTH_HMAC_SECRET, salt + MYNICK)) {
if (IS_NEWBIE) {
vSet("password", "");
save();
}
ARETURN(1);
} else ARETURN(0);
ARETURN(1)
} else ARETURN(0)
# endif
# endif
#else

View File

@ -55,7 +55,7 @@ msg(source, mc, data, vars, showingLog, target) {
"version", // _tab
"time", "lasttime"
#endif
#if !defined(REGISTERED_USERS_ONLY) && !defined(_flag_disable_registration_XMPP)
#if !defined(REGISTERED_USERS_ONLY) && !defined(_flag_disable_registration) &&!defined(_flag_disable_registration_XMPP)
"registration",
#endif
#ifndef VOLATILE

View File

@ -3056,12 +3056,12 @@ set(key, value) {
w("_echo_set_default",
"Setting [_key_set] has been reset to its default state.",
([ "_key_set" : key ]) );
#ifdef REGISTER_DISABLED
#ifdef _flag_disable_registration
} else if (key == "password" && IS_NEWBIE) {
# ifdef REGISTER_URL
w("_echo_set_password", "Registration disabled here. You can register at: " + REGISTER_URL);
w("_failure_disabled_function_register_URI", 0, ([ "_page_register": REGISTER_URL ]));
# else
w("_echo_set_password", "Registration disabled.");
w("_failure_disabled_function_register");
# endif
#endif
} else {