From c71c6ada4616abddc67cdcba0ce0849ee075d76c Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Tue, 26 Jul 2011 12:22:56 +0200 Subject: [PATCH] _flag_disable_registration --- world/default/de/plain.textdb | 6 ++++++ world/default/en/plain.textdb | 6 ++++++ world/default/it/plain.textdb | 6 ++++++ world/net/jabber/disco.c | 4 +++- world/net/jabber/server.c | 4 ++-- world/net/jabber/user.c | 2 +- world/net/library/share.c | 4 +++- world/net/person.c | 6 +++--- world/net/root.c | 2 +- world/net/usercmd.i | 6 +++--- 10 files changed, 34 insertions(+), 12 deletions(-) diff --git a/world/default/de/plain.textdb b/world/default/de/plain.textdb index 7eeae62..3d2405e 100644 --- a/world/default/de/plain.textdb +++ b/world/default/de/plain.textdb @@ -1,6 +1,12 @@ ## 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. diff --git a/world/default/en/plain.textdb b/world/default/en/plain.textdb index f76e02c..552f0bc 100644 --- a/world/default/en/plain.textdb +++ b/world/default/en/plain.textdb @@ -1,6 +1,12 @@ ## 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. diff --git a/world/default/it/plain.textdb b/world/default/it/plain.textdb index 1e83d9b..ce34307 100644 --- a/world/default/it/plain.textdb +++ b/world/default/it/plain.textdb @@ -1,6 +1,12 @@ ## 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]. diff --git a/world/net/jabber/disco.c b/world/net/jabber/disco.c index 9e5665c..757e42f 100644 --- a/world/net/jabber/disco.c +++ b/world/net/jabber/disco.c @@ -19,8 +19,10 @@ disco_info_root(vars) { string featurelist; featurelist = "" #ifndef REGISTERED_USERS_ONLY -# ifndef _flag_disable_registration_XMPP +# ifndef _flag_disable_registration +# ifndef _flag_disable_registration_XMPP "" +# endif # endif #endif #ifndef VOLATILE diff --git a/world/net/jabber/server.c b/world/net/jabber/server.c index 038b7aa..db1d43c 100644 --- a/world/net/jabber/server.c +++ b/world/net/jabber/server.c @@ -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("" "" @@ -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]); diff --git a/world/net/jabber/user.c b/world/net/jabber/user.c index 48a401d..2d70d71 100644 --- a/world/net/jabber/user.c +++ b/world/net/jabber/user.c @@ -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": diff --git a/world/net/library/share.c b/world/net/library/share.c index da6ac02..41ee64e 100644 --- a/world/net/library/share.c +++ b/world/net/library/share.c @@ -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", diff --git a/world/net/person.c b/world/net/person.c index 72233a0..a2ce76c 100644 --- a/world/net/person.c +++ b/world/net/person.c @@ -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 diff --git a/world/net/root.c b/world/net/root.c index 8308c72..585c0e0 100644 --- a/world/net/root.c +++ b/world/net/root.c @@ -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 diff --git a/world/net/usercmd.i b/world/net/usercmd.i index 0362233..1057027 100644 --- a/world/net/usercmd.i +++ b/world/net/usercmd.i @@ -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 {