mirror of
https://github.com/ChronosX88/psyced.git
synced 2024-11-09 12:01:00 +00:00
_flag_disable_unauthenticated_users
This commit is contained in:
parent
c71c6ada46
commit
25734947cb
@ -138,8 +138,13 @@
|
||||
# define NO_NEWBIES
|
||||
#endif
|
||||
|
||||
#ifdef REGISTERED_USERS_ONLY
|
||||
# echo Please fix your #define REGISTERED_USERS_ONLY
|
||||
# define _flag_disable_unauthenticated_users
|
||||
#endif
|
||||
|
||||
#ifdef RELAY
|
||||
# define NO_NEWBIES // same as REGISTERED_USERS_ONLY ?
|
||||
# define NO_NEWBIES // same as _flag_disable_unauthenticated_users ?
|
||||
// anyway, chance for some ifdef optimizations TODO
|
||||
# define IRCGATE_NICK "PSYC.EU"
|
||||
# undef DEFAULT_USER_OBJECT
|
||||
|
@ -18,7 +18,7 @@
|
||||
disco_info_root(vars) {
|
||||
string featurelist;
|
||||
featurelist = "<feature var='http://jabber.org/protocol/muc'/>"
|
||||
#ifndef REGISTERED_USERS_ONLY
|
||||
#ifndef _flag_disable_unauthenticated_users
|
||||
# ifndef _flag_disable_registration
|
||||
# ifndef _flag_disable_registration_XMPP
|
||||
"<feature var='jabber:iq:register'/>"
|
||||
|
@ -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) || defined(_flag_disable_registration_XMPP)
|
||||
#if defined(_flag_disable_unauthenticated_users) || 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) || defined(_flag_disable_registration_XMPP)
|
||||
#if defined(_flag_disable_unauthenticated_users) || defined(_flag_disable_registration) || defined(_flag_disable_registration_XMPP)
|
||||
// TODO: generate some error as above
|
||||
#else
|
||||
user -> vSet("password", t[Cdata]);
|
||||
@ -358,7 +358,7 @@ jabberMsg(XMLNode node) {
|
||||
# endif
|
||||
break;
|
||||
#endif
|
||||
#ifndef REGISTERED_USERS_ONLY
|
||||
#ifndef _flag_disable_unauthenticated_users
|
||||
case "ANONYMOUS":
|
||||
unless(node[Cdata]) {
|
||||
SASL_ERROR("incorrect-encoding")
|
||||
@ -481,7 +481,7 @@ open_stream(XMLNode node) {
|
||||
"<mechanism>DIGEST-MD5</mechanism>"
|
||||
#endif
|
||||
"<mechanism>PLAIN</mechanism>";
|
||||
#ifndef REGISTERED_USERS_ONLY
|
||||
#ifndef _flag_disable_unauthenticated_users
|
||||
// sasl anonymous
|
||||
"<mechanism>ANONYMOUS</mechanism>";
|
||||
#endif
|
||||
@ -494,7 +494,7 @@ open_stream(XMLNode node) {
|
||||
#endif
|
||||
features += "</mechanisms>";
|
||||
features += "<auth xmlns='http://jabber.org/features/iq-auth'/>";
|
||||
#ifndef REGISTERED_USERS_ONLY
|
||||
#ifndef _flag_disable_unauthenticated_users
|
||||
features += "<register xmlns='http://jabber.org/features/iq-register'/>";
|
||||
#endif
|
||||
}
|
||||
|
@ -626,7 +626,7 @@ iq(XMLNode node) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#if !defined(REGISTERED_USERS_ONLY) && !defined(_flag_disable_registration) && !defined(_flag_disable_registration_XMPP)
|
||||
#if !defined(_flag_disable_unauthenticated_users) && !defined(_flag_disable_registration) && !defined(_flag_disable_registration_XMPP)
|
||||
case "jabber:iq:register":
|
||||
switch(node["@type"]) {
|
||||
case "get":
|
||||
|
@ -756,7 +756,7 @@ checkPassword(try, method, salt, args, cb, varargs cbargs) {
|
||||
#endif
|
||||
// why here?
|
||||
//while (remove_call_out(#'quit) != -1);
|
||||
#ifndef REGISTERED_USERS_ONLY
|
||||
#ifndef _flag_disable_unauthenticated_users
|
||||
# ifdef AUTH_HMAC_SECRET
|
||||
if (IS_NEWBIE && method != "hmac-sha1-shared") ARETURN(1)
|
||||
# else
|
||||
|
@ -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) &&!defined(_flag_disable_registration_XMPP)
|
||||
#if !defined(_flag_disable_unauthenticated_users) && !defined(_flag_disable_registration) &&!defined(_flag_disable_registration_XMPP)
|
||||
"registration",
|
||||
#endif
|
||||
#ifndef VOLATILE
|
||||
|
@ -81,7 +81,7 @@ hello(ni, elm, try, method, salt) {
|
||||
ni, try, elm);
|
||||
}
|
||||
|
||||
#ifdef REGISTERED_USERS_ONLY // TODO: rename into a _flag
|
||||
#ifdef _flag_disable_unauthenticated_users
|
||||
ohYeah(whatever) {
|
||||
input_to(#'ohYeah, input_to_settings);
|
||||
// input ignore warning? inverting mc's is really a good idea!
|
||||
@ -120,7 +120,7 @@ authChecked(int result, ni, try, elm) {
|
||||
// return;
|
||||
// }
|
||||
}
|
||||
#ifdef REGISTERED_USERS_ONLY
|
||||
#ifdef _flag_disable_unauthenticated_users
|
||||
else {
|
||||
if (user -> isNewbie()) {
|
||||
#ifdef PSYC_SYNCHRONIZE
|
||||
@ -157,7 +157,7 @@ authChecked(int result, ni, try, elm) {
|
||||
return promptForPassword(user);
|
||||
#endif
|
||||
}
|
||||
#ifndef REGISTERED_USERS_ONLY
|
||||
#ifndef _flag_disable_unauthenticated_users
|
||||
// added user->isNewbie() check for ircers
|
||||
if (user->online() && user->isNewbie()
|
||||
#ifdef _flag_log_hosts
|
||||
|
Loading…
Reference in New Issue
Block a user