- neue Konfigurationsoption "OperCanUseMode" (Sektion "Global"):
ist sie aktiv, koennen IRC-Operatoren immer Channel-Modes setzen.
This commit is contained in:
parent
f673fb960a
commit
7e1b3b9157
|
@ -9,7 +9,7 @@
|
|||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*
|
||||
* $Id: conf.c,v 1.27 2002/05/30 16:52:21 alex Exp $
|
||||
* $Id: conf.c,v 1.28 2002/09/02 14:59:17 alex Exp $
|
||||
*
|
||||
* conf.h: Konfiguration des ngircd
|
||||
*/
|
||||
|
@ -100,6 +100,7 @@ Conf_Test( VOID )
|
|||
printf( " PingTimeout = %d\n", Conf_PingTimeout );
|
||||
printf( " PongTimeout = %d\n", Conf_PongTimeout );
|
||||
printf( " ConnectRetry = %d\n", Conf_ConnectRetry );
|
||||
printf( " OperCanUseMode = %s\n", Conf_OperCanMode == TRUE ? "yes" : "no" );
|
||||
puts( "" );
|
||||
|
||||
for( i = 0; i < Conf_Oper_Count; i++ )
|
||||
|
@ -167,6 +168,8 @@ Set_Defaults( VOID )
|
|||
Conf_Oper_Count = 0;
|
||||
Conf_Server_Count = 0;
|
||||
Conf_Channel_Count = 0;
|
||||
|
||||
Conf_OperCanMode = FALSE;
|
||||
} /* Set_Defaults */
|
||||
|
||||
|
||||
|
@ -371,6 +374,15 @@ Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
|
|||
if(( Conf_ConnectRetry ) < 5 ) Conf_ConnectRetry = 5;
|
||||
return;
|
||||
}
|
||||
if( strcasecmp( Var, "OperCanUseMode" ) == 0 )
|
||||
{
|
||||
/* Koennen IRC-Operatoren immer MODE benutzen? */
|
||||
if( strcasecmp( Arg, "yes" ) == 0 ) Conf_OperCanMode = TRUE;
|
||||
else if( strcasecmp( Arg, "true" ) == 0 ) Conf_OperCanMode = TRUE;
|
||||
else if( atoi( Arg ) != 0 ) Conf_OperCanMode = TRUE;
|
||||
else Conf_OperCanMode = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
Config_Error( LOG_ERR, "%s, line %d (section \"Global\"): Unknown variable \"%s\"!", NGIRCd_ConfFile, Line, Var );
|
||||
} /* Handle_GLOBAL */
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*
|
||||
* $Id: conf.h,v 1.17 2002/05/27 13:09:26 alex Exp $
|
||||
* $Id: conf.h,v 1.18 2002/09/02 14:59:18 alex Exp $
|
||||
*
|
||||
* conf.h: Konfiguration des ngircd (Header)
|
||||
*/
|
||||
|
@ -88,6 +88,8 @@ GLOBAL INT Conf_Server_Count;
|
|||
GLOBAL CONF_CHANNEL Conf_Channel[MAX_DEFCHANNELS];
|
||||
GLOBAL INT Conf_Channel_Count;
|
||||
|
||||
/* Koennen IRC OPs immer Modes setzen? */
|
||||
GLOBAL BOOLEAN Conf_OperCanMode;
|
||||
|
||||
GLOBAL VOID Conf_Init PARAMS((VOID ));
|
||||
GLOBAL INT Conf_Test PARAMS((VOID ));
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*
|
||||
* $Id: irc-mode.c,v 1.9 2002/08/26 23:47:58 alex Exp $
|
||||
* $Id: irc-mode.c,v 1.10 2002/09/02 14:59:18 alex Exp $
|
||||
*
|
||||
* irc-mode.c: IRC-Befehle zur Mode-Aenderung (MODE, AWAY, ...)
|
||||
*/
|
||||
|
@ -29,6 +29,8 @@
|
|||
#include "log.h"
|
||||
#include "parse.h"
|
||||
#include "messages.h"
|
||||
#include "resolve.h"
|
||||
#include "conf.h"
|
||||
|
||||
#include "exp.h"
|
||||
#include "irc-mode.h"
|
||||
|
@ -39,7 +41,7 @@ IRC_MODE( CLIENT *Client, REQUEST *Req )
|
|||
{
|
||||
CHAR *mode_ptr, the_modes[CLIENT_MODE_LEN], x[2];
|
||||
CLIENT *cl, *chan_cl, *prefix;
|
||||
BOOLEAN set, ok;
|
||||
BOOLEAN set, ok, modeok;
|
||||
CHANNEL *chan;
|
||||
|
||||
assert( Client != NULL );
|
||||
|
@ -171,7 +173,15 @@ IRC_MODE( CLIENT *Client, REQUEST *Req )
|
|||
if( chan )
|
||||
{
|
||||
/* Ist der User ein Channel Operator? */
|
||||
if( ! strchr( Channel_UserModes( chan, Client ), 'o' ))
|
||||
modeok = FALSE;
|
||||
if( strchr( Channel_UserModes( chan, Client ), 'o' )) modeok = TRUE;
|
||||
if( Conf_OperCanMode )
|
||||
{
|
||||
/* auch IRC-Operatoren duerfen MODE verwenden */
|
||||
if( Client_OperByMe( Client )) modeok = TRUE;
|
||||
}
|
||||
|
||||
if( ! modeok )
|
||||
{
|
||||
Log( LOG_DEBUG, "Can't change modes: \"%s\" is not operator on %s!", Client_ID( Client ), Channel_Name( chan ));
|
||||
ok = IRC_WriteStrClient( Client, ERR_CHANOPRIVSNEEDED_MSG, Client_ID( Client ), Channel_Name( chan ));
|
||||
|
|
Loading…
Reference in New Issue