/** load code **/
int mod_load(void)
{
    msu = memoserv_suser();
    ms_log = log_handle("memoserv");
    suser_add_cmd(msu, "SEND", ms_send, SEND_SUMMARY, SEND_HELP);
    forward_email = strdup(c_forward_email);
    return 0;
}
int mod_load(void)
{
  bsu = botserv_suser();  
  bs_log = log_handle("botserv");
  bs_group = find_group(AdminRole);	  
  suser_add_cmd(bsu, "DROP", bs_drop, BS_DROP_SUMMARY, BS_DROP_HELP);    
  return 0;
}
Beispiel #3
0
int mod_load(void)
{
  bsu = botserv_suser();  
  bs_log = log_handle("botserv");
  bs_group = find_group(AdminRole);	  
  suser_add_cmd(bsu, "CREATE", bs_create, BS_CREATE_SUMMARY, BS_CREATE_HELP);    
  return 0;
}
int mod_load(void)
{
  ns_log = log_handle("nickserv");
  nsu = nickserv_suser();
  suser_add_cmd(nsu, "DROP", ns_drop, DROP_SUMMARY, DROP_HELP);  
  suser_add_cmd_g(nsu, "SDROP", ns_sdrop, SDROP_SUMMARY, SDROP_HELP,
    find_group("Admin"));
  return 0;
}
Beispiel #5
0
int mod_load(void)
{
  cs_log = log_handle("chanserv");
  csu = chanserv_suser();

  suser_add_cmd(csu,
    "REGISTER", cs_register, REGISTER_SUMMARY, REGISTER_HELP);  

  return 0;
}
int mod_load(void)
{
  cs_log = log_handle("chanserv");
  csu = chanserv_suser();
  suser_add_cmd(csu, "SET", cs_set, SET_SUMMARY, SET_HELP);
  suser_add_cmd_g(csu, "SSET", cs_sset, SSET_SUMMARY, SSET_HELP,
    find_group("Admin"));
  /* we take care of the mlock, lets set the mlocker here */
  irc_SetChanMlocker(csu->u);
  return 0;
}
Beispiel #7
0
/** load code **/
int mod_load(void)
{

#ifndef SENDMAIL
  errlog("sendmail binary path was not found, this module will not work");
#else
  os_log = log_handle("operserv");  
  osu = operserv_suser();  
  suser_add_cmd(osu, "SENDPASS", (void*) os_sendpass, SENDPASS_SUMMARY, SENDPASS_HELP);    
#endif  
  return 0;
}
Beispiel #8
0
/* module initialization */
int mod_load(void)
{ 

  ns_log = log_handle("nickserv");
    
  /* get service user */    
  nsu = nickserv_suser();
  
  /* add command */
  suser_add_cmd(nsu, "AUTH", ns_auth, AUTH_SUMMARY, AUTH_HELP);  
  
  return 0;
}
int mod_load(void)
{

  ns_log = log_handle("nickserv");

  /* get service user */
  nsu = nickserv_suser();
          
  suser_add_cmd(nsu, "IDENTIFY", 
    ns_identify, IDENTIFY_SUMMARY, IDENTIFY_HELP);
  	
  return 0;
}
/** load code **/
int mod_load(void)
{

#ifndef SENDMAIL
  fprintf(stderr, "sendmail binary path was not found, you can't use this module");
  return -1;
#else
  os_log = log_handle("operserv");  
  osu = operserv_suser();  
  suser_add_cmd(osu, "SENDPASS", (void*) os_sendpass, SENDPASS_SUMMARY, SENDPASS_HELP);    
  return 0;  
#endif  

}
Beispiel #11
0
void * transfer(void * p){
	time_t		now;
	int  i	= 0,j=0;
	int cf_flag = 0;
	char 	* timestr;
	char 	msg[512];
	char 	* transfer_log_cache;
	char 	* line;
	ENTRY *ep;
	log_tab_start = (struct log_tab *)malloc(5*sizeof(struct log_tab));
	log_tab_temp = log_tab_start;
	for(j=0;j<5;j++){
		log_tab_temp->key = log_tab_key[j];
		strcpy(log_tab_temp->name,log_tab_key[j]);
		log_tab_temp++;
	}
	log_tab_temp = log_tab_start;
	/*for(j=0;j<5;j++){
		log_tab_all[j]->key = log_tab_key[j];
		strcpy(log_tab_all[j]->name,log_tab_key[j]);
	}*/
	hash_create(10,htab);
	for(j=0;j<5;j++){
		hash_add(log_tab_temp->key,log_tab_temp,htab);
		log_tab_temp++;
	}
	struct arg_set * args = (struct arg_set *)p;
	transfer_log_cache = args->log_p;
	sem = args->sem;
	line = transfer_log_cache;
	//time(&now);
	//timestr = ctime(&now);
	//timestr[strlen(timestr)-1] = '\0';
	while(1){
		if(cf_flag==1){
			return;
		}
		if(sem_trywait(sem)==0){ //pay attention to the lock of sem
			strcpy(msg,line);
			//printf("%s",msg);
			log_handle(msg);
			i++;
			if(i==CACHESIZE){
				line = transfer_log_cache;
			}else{
				line+=sizeof(msg);
			}
		}
	}
}
Beispiel #12
0
/*error log*/
void fvp_log_e(char *format, ...)
{
	if(fvp_log_level > LOG_E)
	{
		return;
	}

	va_list ap;
	va_start(ap, format);

	log_handle(format, ap);

	va_end(ap);

	return; 
}
Beispiel #13
0
/** load code **/
int mod_load(void)
{
  int r;
  /* initialize dbmem for uevents */
  dbm_uevents = dbmem_init("user_events", 128);
  r = sql_check_inst_upgrade(mod_info.name, DB_VERSION, NULL);
  
  if(r < 0)
    return -1;

  /* try to load existing exceptions */
  if(dbmem_load(dbm_uevents) < 0 )
    return -3;
    
  build_event_index();
  
  os_log = log_handle("operserv");
  osu = operserv_suser();  
  
  suser_add_cmd(osu, "UEVENT", os_uevent, 
    OS_UEVENT_SUMMARY, OS_UEVENT_HELP);

  /* Add help */
  suser_add_help(osu, "UEVENT EVENTS", OS_UEVENT_EVENT_LIST);
  suser_add_help(osu, "UEVENT ACTIONS",OS_UEVENT_ACTION_LIST);
  
  /* Add user events */
  irc_AddEvent(ET_NEW_USER, ev_uevents_new_user); /* new user */
  irc_AddEvent(ET_CHAN_JOIN, ev_uevents_chan_join);

  /* Add event actions */ 
  mod_add_event_action(e_expire, 
    (ActionHandler) ev_uevents_expire);
  mod_add_event_action(e_nick_identify, 
    (ActionHandler) ev_os_uevent_nick_identify);
  mod_add_event_action(e_nick_register,
    (ActionHandler) ev_os_uevent_nick_register);  
  return 0;
}
Beispiel #14
0
/* module load code */
int mod_load(void)
{
  int r;
  
  ns_log = log_handle("nickserv");
  
  r = sql_check_inst_upgrade(mod_info.name, DB_VERSION, NULL);
  
  if(r < 0)
    return -4;
  else if(r == 1) /* table was installed */
    create_core_groups();
  else
    {
      if(Root)
        stdlog(L_WARN, "Root is defined, please add a nick to the Root group and disable the setting");
    }
      
  nsu = nickserv_suser();
  
  suser_add_cmd(nsu, "GROUP", ns_group, NS_GROUP_SUMMARY, NS_GROUP_HELP);

  /* Add event actions */    
  mod_add_event_action(e_nick_identify, (ActionHandler) ev_ns_group_nick_identify);
  mod_add_event_action(e_nick_recognize, (ActionHandler) ev_ns_group_nick_identify);
  mod_add_event_action(e_expire, (ActionHandler) ev_ns_group_expire);

  /* Add subcommands help */ 
  suser_add_help(nsu, "GROUP ADD", NS_GROUP_ADD_HELP);
  suser_add_help(nsu, "GROUP CREATE", NS_GROUP_CREATE_HELP);
  suser_add_help(nsu, "GROUP DROP", NS_GROUP_DROP_HELP);
  suser_add_help(nsu, "GROUP DEL", NS_GROUP_DEL_HELP);
  suser_add_help(nsu, "GROUP INFO", NS_GROUP_INFO_HELP);
  suser_add_help(nsu, "GROUP LIST", NS_GROUP_LIST_HELP);
  suser_add_help(nsu, "GROUP SET", NS_GROUP_SET_HELP);
  suser_add_help(nsu, "GROUP SHOW", NS_GROUP_SHOW_HELP);  
  
  return 0;
}