- Config->ConfValue("type","name",j,TypeName,&Config->config_f);
-
- if (!strcmp(TypeName,OperType))
- {
- /* found this oper's opertype */
- Config->ConfValue("type","host",j,HostName,&Config->config_f);
- if (*HostName)
- ChangeDisplayedHost(user,HostName);
- if (!isnick(TypeName))
- {
- WriteServ(user->fd,"491 %s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick);
- WriteOpers("*** CONFIGURATION ERROR! Oper type invalid for OperType '%s'",OperType);
- log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.",user->nick,user->ident,user->host);
- return;
- }
-
- /* correct oper credentials */
- WriteOpers("*** %s (%s@%s) is now an IRC operator of type %s",user->nick,user->ident,user->host,OperType);
- WriteServ(user->fd,"381 %s :You are now an IRC operator of type %s",user->nick,OperType);
-
- if (!strchr(user->modes,'o'))
- {
- strcat(user->modes,"o");
- WriteServ(user->fd,"MODE %s :+o",user->nick);
- FOREACH_MOD(I_OnOper,OnOper(user,OperType));
- log(DEFAULT,"OPER: %s!%s@%s opered as type: %s",user->nick,user->ident,user->host,OperType);
- AddOper(user);
- FOREACH_MOD(I_OnPostOper,OnPostOper(user,OperType));
- }
-
- strlcpy(user->oper,TypeName,NICKMAX-1);
- return;
- }
+ user->WriteServ("491 %s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick);
+ ServerInstance->WriteOpers("*** CONFIGURATION ERROR! Oper type invalid for OperType '%s'",OperType);
+ log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.",user->nick,user->ident,user->host);
+ return;